Curl_altsvc_init:
  325|  3.74k|{
  326|  3.74k|  struct altsvcinfo *asi = curlx_calloc(1, sizeof(struct altsvcinfo));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  327|  3.74k|  if(!asi)
  ------------------
  |  Branch (327:6): [True: 0, False: 3.74k]
  ------------------
  328|      0|    return NULL;
  329|  3.74k|  Curl_llist_init(&asi->list, NULL);
  330|       |
  331|       |  /* set default behavior */
  332|  3.74k|  asi->flags = CURLALTSVC_H1
  ------------------
  |  | 1045|  3.74k|#define CURLALTSVC_H1           (1L << 3)
  ------------------
  333|  3.74k|#ifdef USE_HTTP2
  334|  3.74k|    | CURLALTSVC_H2
  ------------------
  |  | 1046|  3.74k|#define CURLALTSVC_H2           (1L << 4)
  ------------------
  335|  3.74k|#endif
  336|       |#ifdef USE_HTTP3
  337|       |    | CURLALTSVC_H3
  338|       |#endif
  339|  3.74k|    ;
  340|  3.74k|  return asi;
  341|  3.74k|}
Curl_altsvc_load:
  347|  3.74k|{
  348|  3.74k|  DEBUGASSERT(asi);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (348:3): [True: 0, False: 3.74k]
  |  Branch (348:3): [True: 3.74k, False: 0]
  ------------------
  349|  3.74k|  return altsvc_load(asi, file);
  350|  3.74k|}
Curl_altsvc_cleanup:
  375|  7.48k|{
  376|  7.48k|  if(*asi) {
  ------------------
  |  Branch (376:6): [True: 3.74k, False: 3.74k]
  ------------------
  377|  3.74k|    struct Curl_llist_node *e;
  378|  3.74k|    struct Curl_llist_node *n;
  379|  3.74k|    struct altsvcinfo *altsvc = *asi;
  380|  3.74k|    for(e = Curl_llist_head(&altsvc->list); e; e = n) {
  ------------------
  |  Branch (380:45): [True: 0, False: 3.74k]
  ------------------
  381|      0|      struct altsvc *as = Curl_node_elem(e);
  382|      0|      n = Curl_node_next(e);
  383|      0|      altsvc_free(as);
  ------------------
  |  |   87|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  384|      0|    }
  385|  3.74k|    curlx_free(altsvc->filename);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  386|  3.74k|    curlx_free(altsvc);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  387|       |    *asi = NULL; /* clear the pointer */
  388|  3.74k|  }
  389|  7.48k|}
Curl_altsvc_save:
  396|  7.48k|{
  397|  7.48k|  CURLcode result = CURLE_OK;
  398|  7.48k|  FILE *out;
  399|  7.48k|  char *tempstore = NULL;
  400|       |
  401|  7.48k|  if(!asi)
  ------------------
  |  Branch (401:6): [True: 3.74k, False: 3.74k]
  ------------------
  402|       |    /* no cache activated */
  403|  3.74k|    return CURLE_OK;
  404|       |
  405|       |  /* if not new name is given, use the one we stored from the load */
  406|  3.74k|  if(!file && asi->filename)
  ------------------
  |  Branch (406:6): [True: 0, False: 3.74k]
  |  Branch (406:15): [True: 0, False: 0]
  ------------------
  407|      0|    file = asi->filename;
  408|       |
  409|  3.74k|  if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1044|  3.74k|#define CURLALTSVC_READONLYFILE (1L << 2)
  ------------------
  |  Branch (409:6): [True: 0, False: 3.74k]
  |  Branch (409:48): [True: 0, False: 3.74k]
  |  Branch (409:57): [True: 0, False: 3.74k]
  ------------------
  410|       |    /* marked as read-only, no file or zero length filename */
  411|      0|    return CURLE_OK;
  412|       |
  413|  3.74k|  result = Curl_fopen(data, file, &out, &tempstore);
  414|  3.74k|  if(!result) {
  ------------------
  |  Branch (414:6): [True: 3.74k, False: 0]
  ------------------
  415|  3.74k|    struct Curl_llist_node *e;
  416|  3.74k|    struct Curl_llist_node *n;
  417|  3.74k|    fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n"
  418|  3.74k|          "# This file was generated by libcurl! Edit at your own risk.\n",
  419|  3.74k|          out);
  420|  3.74k|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (420:42): [True: 0, False: 3.74k]
  ------------------
  421|      0|      struct altsvc *as = Curl_node_elem(e);
  422|      0|      n = Curl_node_next(e);
  423|      0|      result = altsvc_out(as, out);
  424|      0|      if(result)
  ------------------
  |  Branch (424:10): [True: 0, False: 0]
  ------------------
  425|      0|        break;
  426|      0|    }
  427|  3.74k|    curlx_fclose(out);
  ------------------
  |  |   81|  3.74k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  428|  3.74k|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   72|      0|#define curlx_rename            rename
  ------------------
  |  Branch (428:8): [True: 3.74k, False: 0]
  |  Branch (428:19): [True: 0, False: 3.74k]
  |  Branch (428:32): [True: 0, False: 0]
  ------------------
  429|      0|      result = CURLE_WRITE_ERROR;
  430|       |
  431|  3.74k|    if(result && tempstore)
  ------------------
  |  Branch (431:8): [True: 0, False: 3.74k]
  |  Branch (431:18): [True: 0, False: 0]
  ------------------
  432|      0|      unlink(tempstore);
  433|  3.74k|  }
  434|  3.74k|  curlx_free(tempstore);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  435|  3.74k|  return result;
  436|  3.74k|}
altsvc.c:altsvc_load:
  238|  3.74k|{
  239|  3.74k|  CURLcode result = CURLE_OK;
  240|  3.74k|  FILE *fp;
  241|       |
  242|       |  /* we need a private copy of the filename so that the altsvc cache file
  243|       |     name survives an easy handle reset */
  244|  3.74k|  curlx_free(asi->filename);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  245|  3.74k|  asi->filename = curlx_strdup(file);
  ------------------
  |  | 1422|  3.74k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  246|  3.74k|  if(!asi->filename)
  ------------------
  |  Branch (246:6): [True: 0, False: 3.74k]
  ------------------
  247|      0|    return CURLE_OUT_OF_MEMORY;
  248|       |
  249|  3.74k|  fp = curlx_fopen(file, FOPEN_READTEXT);
  ------------------
  |  |   76|  3.74k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  250|  3.74k|  if(fp) {
  ------------------
  |  Branch (250:6): [True: 3.74k, False: 0]
  ------------------
  251|  3.74k|    curlx_struct_stat stat;
  ------------------
  |  |   65|  3.74k|#define curlx_struct_stat       struct stat
  ------------------
  252|  3.74k|    if((curlx_fstat(fileno(fp), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   64|  3.74k|#define curlx_fstat             fstat
  ------------------
  |  Branch (252:8): [True: 0, False: 3.74k]
  |  Branch (252:50): [True: 3.74k, False: 0]
  ------------------
  253|  3.74k|      bool eof = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  254|  3.74k|      struct dynbuf buf;
  255|  3.74k|      curlx_dyn_init(&buf, MAX_ALTSVC_LINE);
  ------------------
  |  |   41|  3.74k|#define MAX_ALTSVC_LINE    4095
  ------------------
  256|  3.74k|      do {
  257|  3.74k|        result = Curl_get_line(&buf, fp, &eof);
  258|  3.74k|        if(!result) {
  ------------------
  |  Branch (258:12): [True: 3.74k, False: 0]
  ------------------
  259|  3.74k|          const char *lineptr = curlx_dyn_ptr(&buf);
  260|  3.74k|          curlx_str_passblanks(&lineptr);
  261|  3.74k|          if(curlx_str_single(&lineptr, '#'))
  ------------------
  |  Branch (261:14): [True: 3.74k, False: 0]
  ------------------
  262|  3.74k|            altsvc_add(asi, lineptr);
  263|  3.74k|        }
  264|  3.74k|      } while(!result && !eof);
  ------------------
  |  Branch (264:15): [True: 3.74k, False: 0]
  |  Branch (264:26): [True: 0, False: 3.74k]
  ------------------
  265|  3.74k|      curlx_dyn_free(&buf); /* free the line buffer */
  266|  3.74k|    }
  267|  3.74k|    curlx_fclose(fp);
  ------------------
  |  |   81|  3.74k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  268|  3.74k|  }
  269|  3.74k|  return result;
  270|  3.74k|}
altsvc.c:altsvc_add:
  169|  3.74k|{
  170|       |  /* Example line:
  171|       |     h2 example.com 443 h3 shiny.example.com 8443 "20191231 10:00:00" 1
  172|       |   */
  173|  3.74k|  struct Curl_str srchost;
  174|  3.74k|  struct Curl_str dsthost;
  175|  3.74k|  struct Curl_str srcalpn;
  176|  3.74k|  struct Curl_str dstalpn;
  177|  3.74k|  struct Curl_str date;
  178|  3.74k|  curl_off_t srcport;
  179|  3.74k|  curl_off_t dstport;
  180|  3.74k|  curl_off_t persist;
  181|  3.74k|  curl_off_t prio;
  182|       |
  183|  3.74k|  if(curlx_str_word(&line, &srcalpn, MAX_ALTSVC_ALPNLEN) ||
  ------------------
  |  |   44|  3.74k|#define MAX_ALTSVC_ALPNLEN 10
  ------------------
  |  Branch (183:6): [True: 0, False: 3.74k]
  ------------------
  184|  3.74k|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (184:6): [True: 3.74k, False: 0]
  ------------------
  185|      0|     curlx_str_word(&line, &srchost, MAX_ALTSVC_HOSTLEN) ||
  ------------------
  |  |   43|      0|#define MAX_ALTSVC_HOSTLEN 2048
  ------------------
  |  Branch (185:6): [True: 0, False: 0]
  ------------------
  186|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (186:6): [True: 0, False: 0]
  ------------------
  187|      0|     curlx_str_number(&line, &srcport, 65535) ||
  ------------------
  |  Branch (187:6): [True: 0, False: 0]
  ------------------
  188|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (188:6): [True: 0, False: 0]
  ------------------
  189|      0|     curlx_str_word(&line, &dstalpn, MAX_ALTSVC_ALPNLEN) ||
  ------------------
  |  |   44|      0|#define MAX_ALTSVC_ALPNLEN 10
  ------------------
  |  Branch (189:6): [True: 0, False: 0]
  ------------------
  190|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (190:6): [True: 0, False: 0]
  ------------------
  191|      0|     curlx_str_word(&line, &dsthost, MAX_ALTSVC_HOSTLEN) ||
  ------------------
  |  |   43|      0|#define MAX_ALTSVC_HOSTLEN 2048
  ------------------
  |  Branch (191:6): [True: 0, False: 0]
  ------------------
  192|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (192:6): [True: 0, False: 0]
  ------------------
  193|      0|     curlx_str_number(&line, &dstport, 65535) ||
  ------------------
  |  Branch (193:6): [True: 0, False: 0]
  ------------------
  194|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (194:6): [True: 0, False: 0]
  ------------------
  195|      0|     curlx_str_quotedword(&line, &date, MAX_ALTSVC_DATELEN) ||
  ------------------
  |  |   42|      0|#define MAX_ALTSVC_DATELEN 17
  ------------------
  |  Branch (195:6): [True: 0, False: 0]
  ------------------
  196|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (196:6): [True: 0, False: 0]
  ------------------
  197|      0|     curlx_str_number(&line, &persist, 1) ||
  ------------------
  |  Branch (197:6): [True: 0, False: 0]
  ------------------
  198|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (198:6): [True: 0, False: 0]
  ------------------
  199|      0|     curlx_str_number(&line, &prio, 0) ||
  ------------------
  |  Branch (199:6): [True: 0, False: 0]
  ------------------
  200|      0|     curlx_str_newline(&line))
  ------------------
  |  Branch (200:6): [True: 0, False: 0]
  ------------------
  201|  3.74k|    ;
  202|      0|  else {
  203|      0|    char dbuf[MAX_ALTSVC_DATELEN + 1];
  204|      0|    time_t expires = 0;
  205|      0|    time_t now = time(NULL);
  ------------------
  |  |   63|      0|#define time(x) altsvc_debugtime(x)
  ------------------
  206|       |
  207|       |    /* The date parser works on a null-terminated string. The maximum length
  208|       |       is upheld by curlx_str_quotedword(). */
  209|      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)
  ------------------
  210|      0|    dbuf[curlx_strlen(&date)] = 0;
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  211|      0|    Curl_getdate_capped(dbuf, &expires);
  212|       |
  213|      0|    if(now < expires) {
  ------------------
  |  Branch (213:8): [True: 0, False: 0]
  ------------------
  214|      0|      struct altsvc *as = altsvc_create(&srchost, &dsthost, &srcalpn, &dstalpn,
  215|      0|                                        (size_t)srcport, (size_t)dstport);
  216|      0|      if(as) {
  ------------------
  |  Branch (216:10): [True: 0, False: 0]
  ------------------
  217|      0|        as->expires = expires;
  218|      0|        as->persist = persist ? 1 : 0;
  ------------------
  |  Branch (218:23): [True: 0, False: 0]
  ------------------
  219|      0|        altsvc_append(asi, as);
  220|      0|      }
  221|      0|      else
  222|      0|        return CURLE_OUT_OF_MEMORY;
  223|      0|    }
  224|      0|  }
  225|       |
  226|  3.74k|  return CURLE_OK;
  227|  3.74k|}

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

Curl_bufq_init2:
  220|  3.04k|{
  221|       |  bufq_init(q, NULL, chunk_size, max_chunks, opts);
  222|  3.04k|}
Curl_bufq_free:
  236|  3.04k|{
  237|  3.04k|  chunk_list_free(&q->head);
  238|  3.04k|  chunk_list_free(&q->spare);
  239|       |  q->tail = NULL;
  240|  3.04k|  q->chunk_count = 0;
  241|  3.04k|}
Curl_bufq_is_empty:
  267|  5.95k|{
  268|  5.95k|  return !q->head || chunk_is_empty(q->head);
  ------------------
  |  Branch (268:10): [True: 5.95k, False: 0]
  |  Branch (268:22): [True: 0, False: 0]
  ------------------
  269|  5.95k|}
bufq.c:chunk_list_free:
  137|  6.08k|{
  138|  6.08k|  struct buf_chunk *chunk;
  139|  6.08k|  while(*anchor) {
  ------------------
  |  Branch (139:9): [True: 0, False: 6.08k]
  ------------------
  140|      0|    chunk = *anchor;
  141|      0|    *anchor = chunk->next;
  142|      0|    curlx_free(chunk);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  143|      0|  }
  144|  6.08k|}
bufq.c:bufq_init:
  208|  3.04k|{
  209|  3.04k|  DEBUGASSERT(chunk_size > 0);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 3.04k]
  |  Branch (209:3): [True: 3.04k, False: 0]
  ------------------
  210|  3.04k|  DEBUGASSERT(max_chunks > 0);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (210:3): [True: 0, False: 3.04k]
  |  Branch (210:3): [True: 3.04k, False: 0]
  ------------------
  211|  3.04k|  memset(q, 0, sizeof(*q));
  212|  3.04k|  q->chunk_size = chunk_size;
  213|  3.04k|  q->max_chunks = max_chunks;
  214|  3.04k|  q->pool = pool;
  215|  3.04k|  q->opts = opts;
  216|  3.04k|}

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

Curl_cf_ip_happy_insert_after:
 1026|  3.04k|{
 1027|  3.04k|  struct Curl_cfilter *cf;
 1028|  3.04k|  CURLcode result;
 1029|       |
 1030|       |  /* Need to be first */
 1031|  3.04k|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1031:3): [True: 0, False: 3.04k]
  |  Branch (1031:3): [True: 3.04k, False: 0]
  ------------------
 1032|  3.04k|  result = cf_ip_happy_create(&cf, data, origin, peer, transport_peer,
 1033|  3.04k|                              cf_at->conn, tunnel_peer, tunnel_transport);
 1034|  3.04k|  if(result)
  ------------------
  |  Branch (1034:6): [True: 0, False: 3.04k]
  ------------------
 1035|      0|    return result;
 1036|       |
 1037|  3.04k|  Curl_conn_cf_insert_after(cf_at, cf);
 1038|  3.04k|  return CURLE_OK;
 1039|  3.04k|}
cf-ip-happy.c:cf_ip_happy_destroy:
  954|  3.04k|{
  955|  3.04k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  956|       |
  957|  3.04k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  958|  3.04k|  if(ctx) {
  ------------------
  |  Branch (958:6): [True: 3.04k, False: 0]
  ------------------
  959|  3.04k|    cf_ip_happy_ctx_clear(ctx, data);
  960|  3.04k|    cf_ip_happy_ctx_destroy(ctx, data);
  961|  3.04k|  }
  962|  3.04k|}
cf-ip-happy.c:cf_ip_happy_ctx_clear:
  789|  9.12k|{
  790|  9.12k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (790:3): [True: 0, False: 9.12k]
  |  Branch (790:3): [True: 9.12k, False: 0]
  ------------------
  791|  9.12k|  if(ctx)
  ------------------
  |  Branch (791:6): [True: 9.12k, False: 0]
  ------------------
  792|  9.12k|    cf_ip_ballers_clear(data, &ctx->ballers);
  793|  9.12k|}
cf-ip-happy.c:cf_ip_ballers_clear:
  322|  9.12k|{
  323|  9.12k|  while(bs->running) {
  ------------------
  |  Branch (323:9): [True: 0, False: 9.12k]
  ------------------
  324|      0|    struct cf_ip_attempt *a = bs->running;
  325|      0|    bs->running = a->next;
  326|      0|    cf_ip_attempt_free(a, data);
  327|      0|  }
  328|  9.12k|  bs->running_tail = &bs->running;
  329|  9.12k|  cf_ip_attempt_free(bs->winner, data);
  330|       |  bs->winner = NULL;
  331|  9.12k|  Curl_peer_unlink(&bs->origin);
  332|  9.12k|  Curl_peer_unlink(&bs->peer);
  333|  9.12k|  Curl_peer_unlink(&bs->tunnel_peer);
  334|  9.12k|}
cf-ip-happy.c:cf_ip_attempt_free:
  181|  9.12k|{
  182|  9.12k|  if(a) {
  ------------------
  |  Branch (182:6): [True: 3.04k, False: 6.08k]
  ------------------
  183|  3.04k|    if(a->cf)
  ------------------
  |  Branch (183:8): [True: 0, False: 3.04k]
  ------------------
  184|      0|      Curl_conn_cf_discard_chain(&a->cf, data);
  185|  3.04k|    Curl_peer_unlink(&a->origin);
  186|  3.04k|    Curl_peer_unlink(&a->peer);
  187|  3.04k|    Curl_peer_unlink(&a->tunnel_peer);
  188|  3.04k|    curlx_free(a);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  189|  3.04k|  }
  190|  9.12k|}
cf-ip-happy.c:cf_ip_happy_ctx_destroy:
  797|  3.04k|{
  798|  3.04k|  if(ctx) {
  ------------------
  |  Branch (798:6): [True: 3.04k, False: 0]
  ------------------
  799|  3.04k|    cf_ip_happy_ctx_clear(ctx, data);
  800|  3.04k|    curlx_free(ctx);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  801|  3.04k|  }
  802|  3.04k|}
cf-ip-happy.c:cf_ip_happy_connect:
  840|  3.04k|{
  841|  3.04k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  842|  3.04k|  CURLcode result = CURLE_OK;
  843|       |
  844|       |  /* -Werror=null-dereference finds false positives suddenly. */
  845|  3.04k|  if(!data)
  ------------------
  |  Branch (845:6): [True: 0, False: 3.04k]
  ------------------
  846|      0|    return CURLE_FAILED_INIT;
  847|       |
  848|  3.04k|  if(cf->connected) {
  ------------------
  |  Branch (848:6): [True: 0, False: 3.04k]
  ------------------
  849|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  850|      0|    return CURLE_OK;
  851|      0|  }
  852|       |
  853|  3.04k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (853:3): [True: 0, False: 3.04k]
  |  Branch (853:3): [True: 3.04k, False: 0]
  ------------------
  854|  3.04k|  *done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  855|       |
  856|  3.04k|  if(!ctx->dns_resolved) {
  ------------------
  |  Branch (856:6): [True: 3.04k, False: 0]
  ------------------
  857|  3.04k|    result = Curl_conn_dns_addr_result(cf->conn, cf->sockindex,
  858|  3.04k|                                       ctx->ballers.peer);
  859|  3.04k|    if(!result)
  ------------------
  |  Branch (859:8): [True: 3.04k, False: 0]
  ------------------
  860|  3.04k|      ctx->dns_resolved = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  861|      0|    else if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (861:13): [True: 0, False: 0]
  ------------------
  862|      0|      result = CURLE_OK;
  863|      0|    }
  864|      0|    else /* real error */
  865|      0|      goto out;
  866|  3.04k|  }
  867|       |
  868|  3.04k|  switch(ctx->state) {
  ------------------
  |  Branch (868:10): [True: 3.04k, False: 0]
  ------------------
  869|  3.04k|  case SCFST_INIT:
  ------------------
  |  Branch (869:3): [True: 3.04k, False: 0]
  ------------------
  870|  3.04k|    DEBUGASSERT(CURL_SOCKET_BAD == Curl_conn_cf_get_socket(cf, data));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (870:5): [True: 0, False: 3.04k]
  |  Branch (870:5): [True: 3.04k, False: 0]
  ------------------
  871|  3.04k|    DEBUGASSERT(!cf->connected);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (871:5): [True: 0, False: 3.04k]
  |  Branch (871:5): [True: 3.04k, False: 0]
  ------------------
  872|  3.04k|    result = cf_ip_happy_init(cf, data);
  873|  3.04k|    if(result)
  ------------------
  |  Branch (873:8): [True: 0, False: 3.04k]
  ------------------
  874|      0|      goto out;
  875|  3.04k|    ctx->state = SCFST_WAITING;
  876|  3.04k|    FALLTHROUGH();
  ------------------
  |  |  767|  3.04k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  877|  3.04k|  case SCFST_WAITING:
  ------------------
  |  Branch (877:3): [True: 0, False: 3.04k]
  ------------------
  878|  3.04k|    result = is_connected(cf, data, done);
  879|  3.04k|    if(!result && *done) {
  ------------------
  |  Branch (879:8): [True: 3.04k, False: 0]
  |  Branch (879:19): [True: 3.04k, False: 0]
  ------------------
  880|  3.04k|      DEBUGASSERT(ctx->ballers.winner);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (880:7): [True: 0, False: 3.04k]
  |  Branch (880:7): [True: 3.04k, False: 0]
  ------------------
  881|  3.04k|      DEBUGASSERT(ctx->ballers.winner->cf);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (881:7): [True: 0, False: 3.04k]
  |  Branch (881:7): [True: 3.04k, False: 0]
  ------------------
  882|  3.04k|      DEBUGASSERT(ctx->ballers.winner->cf->connected);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (882:7): [True: 0, False: 3.04k]
  |  Branch (882:7): [True: 3.04k, False: 0]
  ------------------
  883|       |      /* we have a winner. Install and activate it.
  884|       |       * close/free all others. */
  885|  3.04k|      ctx->state = SCFST_DONE;
  886|  3.04k|      cf->connected = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  887|  3.04k|      cf->next = ctx->ballers.winner->cf;
  888|  3.04k|      ctx->ballers.winner->cf = NULL;
  889|       |
  890|  3.04k|      if(cf->conn->scheme->protocol & PROTO_FAMILY_SSH)
  ------------------
  |  |   87|  3.04k|#define PROTO_FAMILY_SSH  (CURLPROTO_SCP | CURLPROTO_SFTP)
  |  |  ------------------
  |  |  |  | 1092|  3.04k|#define CURLPROTO_SCP     (1L << 4)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_SSH  (CURLPROTO_SCP | CURLPROTO_SFTP)
  |  |  ------------------
  |  |  |  | 1093|  3.04k|#define CURLPROTO_SFTP    (1L << 5)
  |  |  ------------------
  ------------------
  |  Branch (890:10): [True: 0, False: 3.04k]
  ------------------
  891|      0|        Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */
  892|  3.04k|#ifdef CURLVERBOSE
  893|  3.04k|      if(Curl_trc_cf_is_verbose(cf, data)) {
  ------------------
  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  ------------------
  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  894|      0|        struct ip_quadruple ipquad;
  895|      0|        bool is_ipv6;
  896|      0|        if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) {
  ------------------
  |  Branch (896:12): [True: 0, False: 0]
  ------------------
  897|      0|          CURL_TRC_CF(data, cf, "Connected to %s (%s) port %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]
  |  |  ------------------
  ------------------
  898|      0|                      ctx->ballers.peer->hostname,
  899|      0|                      ipquad.remote_ip, ipquad.remote_port);
  900|      0|        }
  901|      0|      }
  902|  3.04k|#endif
  903|  3.04k|      cf_ip_happy_ctx_clear(ctx, data);
  904|  3.04k|      Curl_expire_clear(data, EXPIRE_HAPPY_EYEBALLS);
  905|       |      /* whatever errors were reported by ballers, clear our errorbuf */
  906|  3.04k|      Curl_reset_fail(data);
  907|  3.04k|      data->info.numconnects++; /* to track the # of connections made */
  908|  3.04k|    }
  909|  3.04k|    break;
  910|  3.04k|  case SCFST_DONE:
  ------------------
  |  Branch (910:3): [True: 0, False: 3.04k]
  ------------------
  911|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  912|      0|    break;
  913|  3.04k|  }
  914|  3.04k|out:
  915|  3.04k|  return result;
  916|  3.04k|}
cf-ip-happy.c:cf_ip_happy_init:
  759|  3.04k|{
  760|  3.04k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  761|       |
  762|  3.04k|  if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (762:6): [True: 0, False: 3.04k]
  ------------------
  763|       |    /* a precaution, no need to continue if time already is up */
  764|      0|    failf(data, "Connection time-out");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  765|      0|    return CURLE_OPERATION_TIMEDOUT;
  766|      0|  }
  767|       |
  768|  3.04k|  if(ctx->ballers.transport_peer == TRNSPRT_UNIX) {
  ------------------
  |  |  240|  3.04k|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (768:6): [True: 0, False: 3.04k]
  ------------------
  769|      0|#ifdef USE_UNIX_SOCKETS
  770|      0|    cf_ai_iter_init(&ctx->ballers.addr_iter, cf, ctx->ballers.peer, AF_UNIX);
  771|       |#else
  772|       |    return CURLE_UNSUPPORTED_PROTOCOL;
  773|       |#endif
  774|      0|  }
  775|  3.04k|  else { /* TCP/UDP/QUIC */
  776|  3.04k|#ifdef USE_IPV6
  777|  3.04k|    cf_ai_iter_init(&ctx->ballers.ipv6_iter, cf, ctx->ballers.peer, AF_INET6);
  778|  3.04k|#endif
  779|  3.04k|    cf_ai_iter_init(&ctx->ballers.addr_iter, cf, ctx->ballers.peer, AF_INET);
  780|  3.04k|  }
  781|       |
  782|  3.04k|  CURL_TRC_CF(data, cf, "init ip ballers for transport %u",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  783|  3.04k|              ctx->ballers.transport_peer);
  784|  3.04k|  return CURLE_OK;
  785|  3.04k|}
cf-ip-happy.c:cf_ai_iter_init:
  130|  6.08k|{
  131|  6.08k|  iter->cf = cf;
  132|  6.08k|  iter->peer = peer; /* not linked, ctx->ballers owns and has same lifetime */
  133|  6.08k|  iter->ai_family = ai_family;
  134|  6.08k|  iter->n = 0;
  135|  6.08k|}
cf-ip-happy.c:is_connected:
  699|  3.04k|{
  700|  3.04k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  701|  3.04k|  struct connectdata *conn = cf->conn;
  702|  3.04k|  CURLcode result;
  703|       |
  704|  3.04k|  result = cf_ip_ballers_run(&ctx->ballers, cf, data,
  705|  3.04k|                             (bool)ctx->dns_resolved, connected);
  706|       |
  707|  3.04k|  if(!result)
  ------------------
  |  Branch (707:6): [True: 3.04k, False: 0]
  ------------------
  708|  3.04k|    return CURLE_OK;
  709|      0|  else {
  710|      0|    struct Curl_peer *peer = NULL, *proxy_peer = NULL;
  711|      0|    char viamsg[160];
  712|       |
  713|      0|    peer = Curl_conn_get_first_peer(conn, cf->sockindex);
  714|      0|    if(!conn->origin || !peer)
  ------------------
  |  Branch (714:8): [True: 0, False: 0]
  |  Branch (714:25): [True: 0, False: 0]
  ------------------
  715|      0|      return CURLE_FAILED_INIT;
  716|       |
  717|      0|#ifndef CURL_DISABLE_PROXY
  718|      0|    if(conn->socks_proxy.peer)
  ------------------
  |  Branch (718:8): [True: 0, False: 0]
  ------------------
  719|      0|      proxy_peer = conn->socks_proxy.peer;
  720|      0|    else if(conn->http_proxy.peer)
  ------------------
  |  Branch (720:13): [True: 0, False: 0]
  ------------------
  721|      0|      proxy_peer = conn->http_proxy.peer;
  722|      0|#endif
  723|       |
  724|      0|    viamsg[0] = 0;
  725|      0|    if(!Curl_peer_equal(peer, conn->origin) &&
  ------------------
  |  Branch (725:8): [True: 0, False: 0]
  ------------------
  726|      0|       !Curl_peer_equal(peer, proxy_peer)) {
  ------------------
  |  Branch (726:8): [True: 0, False: 0]
  ------------------
  727|      0|#ifdef USE_UNIX_SOCKETS
  728|      0|      if(peer->unix_socket)
  ------------------
  |  Branch (728:10): [True: 0, False: 0]
  ------------------
  729|      0|        curl_msnprintf(viamsg, sizeof(viamsg), " over unix://%s",
  730|      0|                       peer->hostname);
  731|      0|      else
  732|      0|#endif
  733|      0|      curl_msnprintf(viamsg, sizeof(viamsg), " via %s:%u",
  734|      0|                     peer->hostname, peer->port);
  735|      0|    }
  736|       |
  737|      0|    failf(data, "Failed to connect to %s:%u%s %s%s%safter "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  738|      0|          "%" FMT_TIMEDIFF_T " ms: %s",
  739|      0|          conn->origin->hostname, conn->origin->port, viamsg,
  740|      0|          proxy_peer ? "over proxy " : "",
  ------------------
  |  Branch (740:11): [True: 0, False: 0]
  ------------------
  741|      0|          proxy_peer ? proxy_peer->hostname : "",
  ------------------
  |  Branch (741:11): [True: 0, False: 0]
  ------------------
  742|      0|          proxy_peer ? " " : "",
  ------------------
  |  Branch (742:11): [True: 0, False: 0]
  ------------------
  743|      0|          Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE),
  744|      0|          curl_easy_strerror(result));
  745|       |
  746|      0|#ifdef SOCKETIMEDOUT
  747|      0|    if(SOCKETIMEDOUT == data->state.os_errno)
  ------------------
  |  | 1081|      0|#define SOCKETIMEDOUT     ETIMEDOUT
  ------------------
  |  Branch (747:8): [True: 0, False: 0]
  ------------------
  748|      0|      result = CURLE_OPERATION_TIMEDOUT;
  749|      0|#endif
  750|       |
  751|      0|    return result;
  752|      0|  }
  753|  3.04k|}
cf-ip-happy.c:cf_ip_ballers_run:
  401|  3.04k|{
  402|  3.04k|  CURLcode result = CURLE_OK;
  403|  3.04k|  struct cf_ip_attempt *a = NULL, **panchor;
  404|  3.04k|  bool do_more;
  405|  3.04k|  timediff_t next_expire_ms;
  406|  3.04k|  uint32_t inconclusive, ongoing;
  407|  3.04k|  const struct curltime *pnow = NULL;
  408|  3.04k|  VERBOSE(int i);
  ------------------
  |  | 1563|  3.04k|#define VERBOSE(x) x
  ------------------
  409|       |
  410|  3.04k|  if(bs->winner)
  ------------------
  |  Branch (410:6): [True: 0, False: 3.04k]
  ------------------
  411|      0|    return CURLE_OK;
  412|       |
  413|  6.08k|evaluate:
  414|  6.08k|  if(Curl_timeleft_now_ms(data, Curl_pgrs_now(data)) < 0) {
  ------------------
  |  Branch (414:6): [True: 0, False: 6.08k]
  ------------------
  415|      0|    failf(data, "Connection timeout after %" FMT_OFF_T " ms",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  416|      0|          Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE));
  417|      0|    return CURLE_OPERATION_TIMEDOUT;
  418|      0|  }
  419|       |
  420|  6.08k|  ongoing = inconclusive = 0;
  421|       |
  422|       |  /* check if a running baller connects now */
  423|  6.08k|  VERBOSE(i = -1);
  ------------------
  |  | 1563|  6.08k|#define VERBOSE(x) x
  ------------------
  424|  6.08k|  for(panchor = &bs->running; *panchor;) {
  ------------------
  |  Branch (424:31): [True: 3.04k, False: 3.04k]
  ------------------
  425|  3.04k|    VERBOSE(++i);
  ------------------
  |  | 1563|  3.04k|#define VERBOSE(x) x
  ------------------
  426|  3.04k|    a = *panchor;
  427|  3.04k|    a->result = cf_ip_attempt_connect(a, data, connected);
  428|  3.04k|    if(!a->result) {
  ------------------
  |  Branch (428:8): [True: 3.04k, False: 0]
  ------------------
  429|  3.04k|      if(*connected) {
  ------------------
  |  Branch (429:10): [True: 3.04k, False: 0]
  ------------------
  430|       |        /* connected, declare the winner, remove from running,
  431|       |         * clear remaining running list. */
  432|  3.04k|        CURL_TRC_CF(data, cf, "connect attempt #%d successful", i);
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  433|  3.04k|        bs->winner = a;
  434|  3.04k|        *panchor = a->next;
  435|  3.04k|        a->next = NULL;
  436|  3.04k|        while(bs->running) {
  ------------------
  |  Branch (436:15): [True: 0, False: 3.04k]
  ------------------
  437|      0|          a = bs->running;
  438|      0|          bs->running = a->next;
  439|      0|          cf_ip_attempt_free(a, data);
  440|      0|        }
  441|  3.04k|        bs->running_tail = &bs->running;
  442|  3.04k|        return CURLE_OK;
  443|  3.04k|      }
  444|       |      /* still running */
  445|      0|      ++ongoing;
  446|      0|      panchor = &(*panchor)->next;
  447|      0|    }
  448|      0|    else if(a->inconclusive) { /* failed, but inconclusive */
  ------------------
  |  Branch (448:13): [True: 0, False: 0]
  ------------------
  449|      0|      ++inconclusive;
  450|      0|      panchor = &(*panchor)->next;
  451|      0|    }
  452|      0|    else {
  453|       |      /* hard failure, discard right away */
  454|      0|      *panchor = a->next;
  455|      0|      if(!a->next)
  ------------------
  |  Branch (455:10): [True: 0, False: 0]
  ------------------
  456|      0|        bs->running_tail = panchor;
  457|      0|      a->next = NULL;
  458|      0|      bs->last_dead_result = a->result;
  459|      0|      bs->had_dead = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  460|      0|      cf_ip_attempt_free(a, data);
  461|      0|    }
  462|  3.04k|  }
  463|  3.04k|  if(bs->running)
  ------------------
  |  Branch (463:6): [True: 0, False: 3.04k]
  ------------------
  464|      0|    CURL_TRC_CF(data, cf, "checked connect attempts: "
  ------------------
  |  |  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.04k|                "%u ongoing, %u inconclusive", ongoing, inconclusive);
  466|       |
  467|       |  /* no attempt connected yet, start another one? */
  468|  3.04k|  pnow = Curl_pgrs_now(data);
  469|  3.04k|  if(!ongoing) {
  ------------------
  |  Branch (469:6): [True: 3.04k, False: 0]
  ------------------
  470|  3.04k|    do_more = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  471|  3.04k|  }
  472|      0|  else {
  473|      0|    bool more_possible = cf_ai_iter_has_more(&bs->addr_iter, data);
  474|      0|#ifdef USE_IPV6
  475|      0|    if(!more_possible)
  ------------------
  |  Branch (475:8): [True: 0, False: 0]
  ------------------
  476|      0|      more_possible = cf_ai_iter_has_more(&bs->ipv6_iter, data);
  477|      0|#endif
  478|      0|    do_more = more_possible &&
  ------------------
  |  Branch (478:15): [True: 0, False: 0]
  ------------------
  479|      0|      (curlx_ptimediff_ms(pnow, &bs->last_attempt_started) >=
  ------------------
  |  Branch (479:7): [True: 0, False: 0]
  ------------------
  480|      0|       bs->attempt_delay_ms);
  481|      0|    if(do_more)
  ------------------
  |  Branch (481:8): [True: 0, False: 0]
  ------------------
  482|      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]
  |  |  ------------------
  ------------------
  483|      0|                  "start next attempt");
  484|      0|  }
  485|       |
  486|  3.04k|  if(do_more) {
  ------------------
  |  Branch (486:6): [True: 3.04k, False: 0]
  ------------------
  487|       |    /* start the next attempt if there is another ip address to try.
  488|       |     * Alternate between address families when possible. */
  489|  3.04k|    const struct Curl_addrinfo *ai = NULL;
  490|  3.04k|    int ai_family = 0;
  491|  3.04k|    CURL_TRC_CF(data, cf, "want to do more");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  492|  3.04k|#ifdef USE_IPV6
  493|  3.04k|    if((bs->last_attempt_ai_family == AF_INET) ||
  ------------------
  |  Branch (493:8): [True: 3.04k, False: 0]
  ------------------
  494|  3.04k|       !cf_ai_iter_has_more(&bs->addr_iter, data)) {
  ------------------
  |  Branch (494:8): [True: 0, False: 0]
  ------------------
  495|  3.04k|      ai = cf_ai_iter_next(&bs->ipv6_iter, data);
  496|  3.04k|      ai_family = bs->ipv6_iter.ai_family;
  497|  3.04k|      CURL_TRC_CF(data, cf, "check for next AAAA address: %s",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  498|  3.04k|                  ai ? "found" : "none");
  499|  3.04k|    }
  500|  3.04k|#endif
  501|  3.04k|    if(!ai) {
  ------------------
  |  Branch (501:8): [True: 3.04k, False: 0]
  ------------------
  502|  3.04k|      ai = cf_ai_iter_next(&bs->addr_iter, data);
  503|  3.04k|      ai_family = bs->addr_iter.ai_family;
  504|  3.04k|      CURL_TRC_CF(data, cf, "check for next A address: %s",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  505|  3.04k|                  ai ? "found" : "none");
  506|  3.04k|    }
  507|       |    /* We are (re-)starting attempts. We are not interested in
  508|       |     * keeping old failure information. The new attempt will either
  509|       |     * succeed or persist new failure. */
  510|  3.04k|    Curl_reset_fail(data);
  511|       |
  512|  3.04k|    if(ai) {  /* try another address */
  ------------------
  |  Branch (512:8): [True: 3.04k, False: 0]
  ------------------
  513|  3.04k|      struct Curl_sockaddr_ex addr;
  514|       |
  515|       |      /* Discard oldest to make room for new attempt */
  516|  3.04k|      if(bs->max_concurrent)
  ------------------
  |  Branch (516:10): [True: 3.04k, False: 0]
  ------------------
  517|  3.04k|        cf_ip_ballers_prune(bs, cf, data, bs->max_concurrent - 1);
  518|       |
  519|  3.04k|      result = Curl_socket_addr_from_ai(&addr, ai, bs->transport_peer);
  520|  3.04k|      if(result)
  ------------------
  |  Branch (520:10): [True: 0, False: 3.04k]
  ------------------
  521|      0|        goto out;
  522|       |
  523|  3.04k|      result = cf_ip_attempt_new(&a, data, cf, bs->origin, bs->peer,
  524|  3.04k|                                 bs->transport_peer, &addr, ai_family,
  525|  3.04k|                                 bs->tunnel_peer, bs->tunnel_transport,
  526|  3.04k|                                 bs->cf_create);
  527|  3.04k|      CURL_TRC_CF(data, cf, "starting %s attempt for ipv%s -> %d",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  528|  3.04k|                  bs->running ? "next" : "first",
  529|  3.04k|                  (ai_family == AF_INET) ? "4" : "6", (int)result);
  530|  3.04k|      if(result)
  ------------------
  |  Branch (530:10): [True: 0, False: 3.04k]
  ------------------
  531|      0|        goto out;
  532|  3.04k|      DEBUGASSERT(a);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (532:7): [True: 0, False: 3.04k]
  |  Branch (532:7): [True: 3.04k, False: 0]
  ------------------
  533|       |
  534|       |      /* append to running list */
  535|  3.04k|      *bs->running_tail = a;
  536|  3.04k|      a->next = NULL;
  537|  3.04k|      bs->running_tail = &a->next;
  538|  3.04k|      bs->last_attempt_started = *pnow;
  539|  3.04k|      bs->last_attempt_ai_family = ai_family;
  540|       |      /* and run everything again */
  541|  3.04k|      goto evaluate;
  542|  3.04k|    }
  543|      0|    else if(inconclusive) {
  ------------------
  |  Branch (543:13): [True: 0, False: 0]
  ------------------
  544|       |      /* tried all addresses, no success but some where inconclusive.
  545|       |       * Let's restart the inconclusive ones. */
  546|      0|      timediff_t since_ms =
  547|      0|        curlx_ptimediff_ms(pnow, &bs->last_attempt_started);
  548|      0|      timediff_t delay_ms = bs->attempt_delay_ms - since_ms;
  549|      0|      if(delay_ms <= 0) {
  ------------------
  |  Branch (549:10): [True: 0, False: 0]
  ------------------
  550|      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]
  |  |  ------------------
  ------------------
  551|      0|        VERBOSE(i = -1);
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
  552|      0|        for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (552:30): [True: 0, False: 0]
  ------------------
  553|      0|          VERBOSE(++i);
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
  554|      0|          if(!a->inconclusive)
  ------------------
  |  Branch (554:14): [True: 0, False: 0]
  ------------------
  555|      0|            continue;
  556|      0|          result = cf_ip_attempt_restart(a, cf, data);
  557|      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]
  |  |  ------------------
  ------------------
  558|      0|          if(result) /* serious failure */
  ------------------
  |  Branch (558:14): [True: 0, False: 0]
  ------------------
  559|      0|            goto out;
  560|      0|          bs->last_attempt_started = *pnow;
  561|      0|          goto evaluate;
  562|      0|        }
  563|      0|        DEBUGASSERT(0); /* should not come here */
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (563:9): [Folded, False: 0]
  |  Branch (563:9): [Folded, False: 0]
  ------------------
  564|      0|      }
  565|      0|      else {
  566|       |        /* let's wait some more before restarting */
  567|      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]
  |  |  ------------------
  ------------------
  568|      0|                    "in %" FMT_TIMEDIFF_T "ms", delay_ms);
  569|      0|        Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, delay_ms, pnow);
  570|      0|      }
  571|       |      /* attempt timeout for restart has not expired yet */
  572|      0|      goto out;
  573|      0|    }
  574|      0|    else if(!ongoing && dns_resolved) {
  ------------------
  |  Branch (574:13): [True: 0, False: 0]
  |  Branch (574:25): [True: 0, False: 0]
  ------------------
  575|       |      /* no more addresses, no inconclusive attempts */
  576|      0|      CURL_TRC_CF(data, cf, "no more attempts to try");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  577|      0|      DEBUGASSERT(!bs->running);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (577:7): [True: 0, False: 0]
  |  Branch (577:7): [True: 0, False: 0]
  ------------------
  578|      0|      result = bs->had_dead ? bs->last_dead_result : CURLE_COULDNT_CONNECT;
  ------------------
  |  Branch (578:16): [True: 0, False: 0]
  ------------------
  579|      0|    }
  580|  3.04k|  }
  581|       |
  582|      0|out:
  583|      0|  if(!result) {
  ------------------
  |  Branch (583:6): [True: 0, False: 0]
  ------------------
  584|      0|    bool more_possible;
  585|       |
  586|       |    /* when do we need to be called again? */
  587|      0|    pnow = Curl_pgrs_now(data);
  588|      0|    next_expire_ms = Curl_timeleft_now_ms(data, pnow);
  589|      0|    if(next_expire_ms < 0) {
  ------------------
  |  Branch (589:8): [True: 0, False: 0]
  ------------------
  590|      0|      failf(data, "Connection timeout after %" FMT_OFF_T " ms",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  591|      0|            Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE));
  592|      0|      return CURLE_OPERATION_TIMEDOUT;
  593|      0|    }
  594|       |
  595|      0|    more_possible = cf_ai_iter_has_more(&bs->addr_iter, data);
  596|      0|#ifdef USE_IPV6
  597|      0|    if(!more_possible)
  ------------------
  |  Branch (597:8): [True: 0, False: 0]
  ------------------
  598|      0|      more_possible = cf_ai_iter_has_more(&bs->ipv6_iter, data);
  599|      0|#endif
  600|      0|    if(more_possible) {
  ------------------
  |  Branch (600:8): [True: 0, False: 0]
  ------------------
  601|      0|      timediff_t expire_ms, elapsed_ms;
  602|       |
  603|      0|      elapsed_ms = curlx_ptimediff_ms(pnow, &bs->last_attempt_started);
  604|      0|      expire_ms = CURLMAX(bs->attempt_delay_ms - elapsed_ms, 0);
  ------------------
  |  | 1239|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1239:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  605|      0|      next_expire_ms = CURLMIN(next_expire_ms, expire_ms);
  ------------------
  |  | 1240|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1240:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  606|      0|      if(next_expire_ms <= 0) {
  ------------------
  |  Branch (606:10): [True: 0, False: 0]
  ------------------
  607|      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]
  |  |  ------------------
  ------------------
  608|      0|        goto evaluate;
  609|      0|      }
  610|      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]
  |  |  ------------------
  ------------------
  611|      0|                  "ms", next_expire_ms);
  612|      0|      Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, next_expire_ms, pnow);
  613|      0|    }
  614|      0|  }
  615|      0|  return result;
  616|      0|}
cf-ip-happy.c:cf_ip_attempt_connect:
  247|  3.04k|{
  248|  3.04k|  *connected = (bool)a->connected;
  249|  3.04k|  if(!a->result && !*connected) {
  ------------------
  |  Branch (249:6): [True: 3.04k, False: 0]
  |  Branch (249:20): [True: 3.04k, False: 0]
  ------------------
  250|       |    /* evaluate again */
  251|  3.04k|    a->result = Curl_conn_cf_connect(a->cf, data, connected);
  252|       |
  253|  3.04k|    if(!a->result) {
  ------------------
  |  Branch (253:8): [True: 3.04k, False: 0]
  ------------------
  254|  3.04k|      if(*connected) {
  ------------------
  |  Branch (254:10): [True: 3.04k, False: 0]
  ------------------
  255|  3.04k|        a->connected = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  256|  3.04k|      }
  257|  3.04k|    }
  258|      0|    else {
  259|      0|      if(a->result == CURLE_WEIRD_SERVER_REPLY)
  ------------------
  |  Branch (259:10): [True: 0, False: 0]
  ------------------
  260|      0|        a->inconclusive = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  261|      0|      if(a->cf)
  ------------------
  |  Branch (261:10): [True: 0, False: 0]
  ------------------
  262|      0|        Curl_conn_cf_discard_chain(&a->cf, data);
  263|      0|    }
  264|  3.04k|  }
  265|  3.04k|  return a->result;
  266|  3.04k|}
cf-ip-happy.c:cf_ai_iter_next:
  139|  6.08k|{
  140|  6.08k|  const struct Curl_addrinfo *addr;
  141|       |
  142|  6.08k|  if(!iter->cf)
  ------------------
  |  Branch (142:6): [True: 0, False: 6.08k]
  ------------------
  143|      0|    return NULL;
  144|       |
  145|  6.08k|  addr = Curl_conn_dns_get_ai(data, iter->peer, iter->cf->sockindex,
  146|  6.08k|                              iter->ai_family, iter->n);
  147|  6.08k|  if(addr)
  ------------------
  |  Branch (147:6): [True: 3.04k, False: 3.04k]
  ------------------
  148|  3.04k|    iter->n++;
  149|  6.08k|  return addr;
  150|  6.08k|}
cf-ip-happy.c:cf_ip_ballers_prune:
  369|  3.04k|{
  370|  3.04k|  struct cf_ip_attempt *a = NULL, **panchor;
  371|  3.04k|  uint32_t ongoing = 0;
  372|       |
  373|  3.04k|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (373:24): [True: 0, False: 3.04k]
  ------------------
  374|      0|    if(!a->result && !a->connected)
  ------------------
  |  Branch (374:8): [True: 0, False: 0]
  |  Branch (374:22): [True: 0, False: 0]
  ------------------
  375|      0|      ++ongoing;
  376|      0|  }
  377|       |
  378|  3.04k|  panchor = &bs->running;
  379|  3.04k|  while(*panchor && (ongoing > max_concurrent)) {
  ------------------
  |  Branch (379:9): [True: 0, False: 3.04k]
  |  Branch (379:21): [True: 0, False: 0]
  ------------------
  380|      0|    a = *panchor;
  381|      0|    if(!a->result && !a->connected) {
  ------------------
  |  Branch (381:8): [True: 0, False: 0]
  |  Branch (381:22): [True: 0, False: 0]
  ------------------
  382|      0|      *panchor = a->next;
  383|      0|      if(!a->next)
  ------------------
  |  Branch (383:10): [True: 0, False: 0]
  ------------------
  384|      0|        bs->running_tail = panchor;
  385|      0|      a->next = NULL;
  386|      0|      cf_ip_attempt_free(a, data);
  387|      0|      --ongoing;
  388|      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]
  |  |  ------------------
  ------------------
  389|      0|    }
  390|      0|    else {
  391|      0|      panchor = &a->next;
  392|      0|    }
  393|      0|  }
  394|  3.04k|}
cf-ip-happy.c:cf_ip_attempt_new:
  203|  3.04k|{
  204|  3.04k|  struct Curl_cfilter *wcf;
  205|  3.04k|  struct cf_ip_attempt *a;
  206|  3.04k|  CURLcode result = CURLE_OK;
  207|       |
  208|  3.04k|  *pa = NULL;
  209|  3.04k|  a = curlx_calloc(1, sizeof(*a));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  210|  3.04k|  if(!a)
  ------------------
  |  Branch (210:6): [True: 0, False: 3.04k]
  ------------------
  211|      0|    return CURLE_OUT_OF_MEMORY;
  212|       |
  213|  3.04k|  Curl_peer_link(&a->origin, origin);
  214|  3.04k|  Curl_peer_link(&a->peer, peer);
  215|  3.04k|  a->transport_peer = transport_peer;
  216|  3.04k|  Curl_peer_link(&a->tunnel_peer, tunnel_peer);
  217|  3.04k|  a->tunnel_transport = tunnel_transport;
  218|  3.04k|  a->addr = *addr;
  219|  3.04k|  a->ai_family = ai_family;
  220|  3.04k|  a->result = CURLE_OK;
  221|  3.04k|  a->cf_create = cf_create;
  222|  3.04k|  *pa = a;
  223|       |
  224|  3.04k|  result = a->cf_create(&a->cf, data, a->origin, a->peer, a->transport_peer,
  225|  3.04k|                        cf->conn, &a->addr, a->tunnel_peer,
  226|  3.04k|                        a->tunnel_transport);
  227|  3.04k|  if(result)
  ------------------
  |  Branch (227:6): [True: 0, False: 3.04k]
  ------------------
  228|      0|    goto out;
  229|       |
  230|       |  /* the new filter might have sub-filters */
  231|  6.08k|  for(wcf = a->cf; wcf; wcf = wcf->next) {
  ------------------
  |  Branch (231:20): [True: 3.04k, False: 3.04k]
  ------------------
  232|  3.04k|    wcf->conn = cf->conn;
  233|  3.04k|    wcf->sockindex = cf->sockindex;
  234|  3.04k|  }
  235|       |
  236|  3.04k|out:
  237|  3.04k|  if(result) {
  ------------------
  |  Branch (237:6): [True: 0, False: 3.04k]
  ------------------
  238|      0|    cf_ip_attempt_free(a, data);
  239|       |    *pa = NULL;
  240|      0|  }
  241|  3.04k|  return result;
  242|  3.04k|}
cf-ip-happy.c:cf_ip_happy_query:
  932|  6.08k|{
  933|  6.08k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  934|       |
  935|  6.08k|  if(!cf->connected) {
  ------------------
  |  Branch (935:6): [True: 3.04k, False: 3.04k]
  ------------------
  936|  3.04k|    switch(query) {
  937|      0|    case CF_QUERY_CONNECT_REPLY_MS: {
  ------------------
  |  |  168|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (937:5): [True: 0, False: 3.04k]
  ------------------
  938|      0|      *pres1 = cf_ip_ballers_min_reply_ms(&ctx->ballers, data);
  939|      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]
  |  |  ------------------
  ------------------
  940|      0|      return CURLE_OK;
  941|      0|    }
  942|  3.04k|    default:
  ------------------
  |  Branch (942:5): [True: 3.04k, False: 0]
  ------------------
  943|  3.04k|      break;
  944|  3.04k|    }
  945|  3.04k|  }
  946|       |
  947|  6.08k|  return cf->next ?
  ------------------
  |  Branch (947:10): [True: 3.04k, False: 3.04k]
  ------------------
  948|  3.04k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  949|  6.08k|    CURLE_UNKNOWN_OPTION;
  950|  6.08k|}
cf-ip-happy.c:cf_ip_happy_create:
  989|  3.04k|{
  990|  3.04k|  struct cf_ip_happy_ctx *ctx = NULL;
  991|  3.04k|  CURLcode result;
  992|       |
  993|  3.04k|  (void)data;
  994|  3.04k|  (void)conn;
  995|  3.04k|  *pcf = NULL;
  996|  3.04k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  997|  3.04k|  if(!ctx) {
  ------------------
  |  Branch (997:6): [True: 0, False: 3.04k]
  ------------------
  998|      0|    result = CURLE_OUT_OF_MEMORY;
  999|      0|    goto out;
 1000|      0|  }
 1001|  3.04k|  result = cf_ip_ballers_init(&ctx->ballers, data,
 1002|  3.04k|                              origin, peer, transport_peer,
 1003|  3.04k|                              tunnel_peer, tunnel_transport,
 1004|  3.04k|                              data->set.happy_eyeballs_timeout,
 1005|  3.04k|                              IP_HE_MAX_CONCURRENT_ATTEMPTS);
  ------------------
  |  |  755|  3.04k|#define IP_HE_MAX_CONCURRENT_ATTEMPTS     6
  ------------------
 1006|  3.04k|  if(result)
  ------------------
  |  Branch (1006:6): [True: 0, False: 3.04k]
  ------------------
 1007|      0|    goto out;
 1008|       |
 1009|  3.04k|  result = Curl_cf_create(pcf, &Curl_cft_ip_happy, ctx);
 1010|       |
 1011|  3.04k|out:
 1012|  3.04k|  if(result) {
  ------------------
  |  Branch (1012:6): [True: 0, False: 3.04k]
  ------------------
 1013|       |    curlx_safefree(*pcf);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1014|      0|    cf_ip_happy_ctx_destroy(ctx, data);
 1015|      0|  }
 1016|  3.04k|  return result;
 1017|  3.04k|}
cf-ip-happy.c:cf_ip_ballers_init:
  345|  3.04k|{
  346|  3.04k|  memset(bs, 0, sizeof(*bs));
  347|  3.04k|  bs->running_tail = &bs->running;
  348|  3.04k|  bs->cf_create = get_cf_create(transport_peer, !!tunnel_peer);
  349|  3.04k|  if(!bs->cf_create) {
  ------------------
  |  Branch (349:6): [True: 0, False: 3.04k]
  ------------------
  350|      0|    failf(data, "unsupported transport type %u%s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  351|      0|          transport_peer, tunnel_peer ? " to proxy" : "");
  ------------------
  |  Branch (351:27): [True: 0, False: 0]
  ------------------
  352|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
  353|      0|  }
  354|  3.04k|  Curl_peer_link(&bs->origin, origin);
  355|  3.04k|  Curl_peer_link(&bs->peer, peer);
  356|  3.04k|  bs->transport_peer = transport_peer;
  357|  3.04k|  Curl_peer_link(&bs->tunnel_peer, tunnel_peer);
  358|  3.04k|  bs->tunnel_transport = tunnel_transport;
  359|  3.04k|  bs->attempt_delay_ms = attempt_delay_ms;
  360|  3.04k|  bs->max_concurrent = max_concurrent;
  361|       |  bs->last_attempt_ai_family = AF_INET; /* so AF_INET6 is next */
  362|  3.04k|  return CURLE_OK;
  363|  3.04k|}
cf-ip-happy.c:get_cf_create:
   93|  3.04k|{
   94|  3.04k|  size_t i;
   95|  3.04k|  for(i = 0; i < CURL_ARRAYSIZE(transport_providers); ++i) {
  ------------------
  |  | 1251|  3.04k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (95:14): [True: 3.04k, False: 0]
  ------------------
   96|  3.04k|    if((transport == transport_providers[i].transport) &&
  ------------------
  |  Branch (96:8): [True: 3.04k, False: 0]
  ------------------
   97|  3.04k|       (tunnel == transport_providers[i].tunnel))
  ------------------
  |  Branch (97:8): [True: 3.04k, False: 0]
  ------------------
   98|  3.04k|      return transport_providers[i].cf_create;
   99|  3.04k|  }
  100|      0|  return NULL;
  101|  3.04k|}

Curl_cf_setup_add:
  451|  3.04k|{
  452|  3.04k|  struct Curl_cfilter *cf;
  453|  3.04k|  CURLcode result = CURLE_OK;
  454|       |
  455|  3.04k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (455:3): [True: 0, False: 3.04k]
  |  Branch (455:3): [True: 3.04k, False: 0]
  ------------------
  456|  3.04k|  result = cf_setup_create(&cf, data, transport, ssl_mode);
  457|  3.04k|  if(result)
  ------------------
  |  Branch (457:6): [True: 0, False: 3.04k]
  ------------------
  458|      0|    goto out;
  459|  3.04k|  Curl_conn_cf_add(data, conn, sockindex, cf);
  460|  3.04k|out:
  461|  3.04k|  return result;
  462|  3.04k|}
cf-setup.c:cf_setup_destroy:
  390|  3.04k|{
  391|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
  392|       |
  393|  3.04k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  394|       |  curlx_safefree(ctx);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  395|  3.04k|}
cf-setup.c:cf_setup_connect:
  364|  3.04k|{
  365|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
  366|  3.04k|  CURLcode result;
  367|       |
  368|       |  /* In some situations, a server/proxy may close the connection and
  369|       |   * we need to connect again (HTTP/1.x proxy auth, for example).
  370|       |   * We used to close the filters and reuse them for another attempt,
  371|       |   * however that complicates filter code and it is simpler to tear them
  372|       |   * all down and start over. */
  373|  3.04k|retry:
  374|  3.04k|  result = cf_setup_connect_steps(cf, data, done);
  375|       |
  376|  3.04k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (376:6): [True: 0, False: 3.04k]
  ------------------
  377|      0|    ++ctx->retry_count;
  378|      0|    if(ctx->retry_count > 5) /* arbitrary limit, better just timeout? */
  ------------------
  |  Branch (378:8): [True: 0, False: 0]
  ------------------
  379|      0|      return CURLE_COULDNT_CONNECT;
  380|       |
  381|      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]
  |  |  ------------------
  ------------------
  382|      0|    Curl_conn_cf_discard_chain(&cf->next, data);
  383|      0|    ctx->state = CF_SETUP_INIT;
  384|      0|    goto retry;
  385|      0|  }
  386|  3.04k|  return result;
  387|  3.04k|}
cf-setup.c:cf_setup_connect_steps:
  302|  3.04k|{
  303|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
  304|  3.04k|  CURLcode result = CURLE_OK;
  305|       |
  306|  3.04k|  if(cf->connected) {
  ------------------
  |  Branch (306:6): [True: 0, False: 3.04k]
  ------------------
  307|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  308|      0|    return CURLE_OK;
  309|      0|  }
  310|       |
  311|       |  /* connect current sub-chain */
  312|  6.08k|connect_sub_chain:
  313|  6.08k|  VERBOSE(Curl_conn_trc_filters(data, cf->sockindex, "cf_setup_connect"));
  ------------------
  |  | 1563|  6.08k|#define VERBOSE(x) x
  ------------------
  314|       |
  315|  6.08k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (315:6): [True: 3.04k, False: 3.04k]
  |  Branch (315:18): [True: 3.04k, False: 0]
  ------------------
  316|  3.04k|    result = Curl_conn_cf_connect(cf->next, data, done);
  317|  3.04k|    if(result || !*done)
  ------------------
  |  Branch (317:8): [True: 0, False: 3.04k]
  |  Branch (317:18): [True: 0, False: 3.04k]
  ------------------
  318|      0|      return result;
  319|  3.04k|  }
  320|       |
  321|  6.08k|  result = cf_setup_add_ip_happy(cf, data);
  322|  6.08k|  if(result)
  ------------------
  |  Branch (322:6): [True: 0, False: 6.08k]
  ------------------
  323|      0|    return result;
  324|  6.08k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (324:6): [True: 0, False: 6.08k]
  |  Branch (324:19): [True: 3.04k, False: 3.04k]
  ------------------
  325|  3.04k|    goto connect_sub_chain;
  326|       |
  327|  3.04k|#ifndef CURL_DISABLE_PROXY
  328|  3.04k|  result = cf_setup_add_socks(cf, data);
  329|  3.04k|  if(result)
  ------------------
  |  Branch (329:6): [True: 0, False: 3.04k]
  ------------------
  330|      0|    return result;
  331|  3.04k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (331:6): [True: 0, False: 3.04k]
  |  Branch (331:19): [True: 0, False: 3.04k]
  ------------------
  332|      0|    goto connect_sub_chain;
  333|       |
  334|  3.04k|#ifndef CURL_DISABLE_HTTP
  335|  3.04k|  result = cf_setup_add_http_proxy(cf, data);
  336|  3.04k|  if(result)
  ------------------
  |  Branch (336:6): [True: 0, False: 3.04k]
  ------------------
  337|      0|    return result;
  338|  3.04k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (338:6): [True: 0, False: 3.04k]
  |  Branch (338:19): [True: 0, False: 3.04k]
  ------------------
  339|      0|    goto connect_sub_chain;
  340|  3.04k|#endif /* !CURL_DISABLE_HTTP */
  341|       |
  342|  3.04k|  result = cf_setup_add_haproxy(cf, data);
  343|  3.04k|  if(result)
  ------------------
  |  Branch (343:6): [True: 0, False: 3.04k]
  ------------------
  344|      0|    return result;
  345|  3.04k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (345:6): [True: 0, False: 3.04k]
  |  Branch (345:19): [True: 0, False: 3.04k]
  ------------------
  346|      0|    goto connect_sub_chain;
  347|  3.04k|#endif /* !CURL_DISABLE_PROXY */
  348|       |
  349|  3.04k|  result = cf_setup_add_origin_filters(cf, data);
  350|  3.04k|  if(result)
  ------------------
  |  Branch (350:6): [True: 0, False: 3.04k]
  ------------------
  351|      0|    return result;
  352|  3.04k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (352:6): [True: 0, False: 3.04k]
  |  Branch (352:19): [True: 0, False: 3.04k]
  ------------------
  353|      0|    goto connect_sub_chain;
  354|       |
  355|  3.04k|  ctx->state = CF_SETUP_DONE;
  356|  3.04k|  cf->connected = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  357|       |  *done = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  358|  3.04k|  return CURLE_OK;
  359|  3.04k|}
cf-setup.c:cf_setup_add_ip_happy:
  175|  6.08k|{
  176|  6.08k|  struct cf_setup_ctx *ctx = cf->ctx;
  177|  6.08k|  CURLcode result = CURLE_OK;
  178|       |
  179|  6.08k|  if(ctx->state < CF_SETUP_CNNCT_EYEBALLS) {
  ------------------
  |  Branch (179:6): [True: 3.04k, False: 3.04k]
  ------------------
  180|       |    /* What is the first hop we directly connect to and what transport
  181|       |     * do we use for it? Only on the first hop we can do Happy Eyeballs.
  182|       |     * first_origin and first_peer differ on --connect-to. */
  183|  3.04k|    struct Curl_peer *first_origin =
  184|  3.04k|      conn_get_first_origin(cf->conn, cf->sockindex);
  185|  3.04k|    struct Curl_peer *first_peer =
  186|  3.04k|      Curl_conn_get_first_peer(cf->conn, cf->sockindex);
  187|  3.04k|    struct Curl_peer *tunnel_peer = NULL;
  188|  3.04k|    uint8_t first_transport = ctx->transport;
  189|       |
  190|  3.04k|    if(!first_peer)
  ------------------
  |  Branch (190:8): [True: 0, False: 3.04k]
  ------------------
  191|      0|      return CURLE_FAILED_INIT;
  192|       |
  193|  3.04k|#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
  194|  3.04k|    if(cf->conn->http_proxy.peer && !cf->conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (194:8): [True: 0, False: 3.04k]
  |  Branch (194:37): [True: 0, False: 0]
  ------------------
  195|      0|      first_transport =
  196|      0|        Curl_http_proxy_transport(cf->conn->http_proxy.proxytype);
  197|      0|      tunnel_peer = Curl_conn_get_destination(cf->conn, cf->sockindex);
  198|      0|      if((first_transport == TRNSPRT_QUIC) && cf->conn->socks_proxy.peer) {
  ------------------
  |  |  239|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (198:10): [True: 0, False: 0]
  |  Branch (198:47): [True: 0, False: 0]
  ------------------
  199|      0|        failf(data, "HTTP/3 proxy not possible via SOCKS");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  200|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
  201|      0|      }
  202|      0|    }
  203|  3.04k|#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */
  204|       |
  205|  3.04k|    result = Curl_cf_ip_happy_insert_after(cf, data, first_origin, first_peer,
  206|  3.04k|                                           first_transport,
  207|  3.04k|                                           tunnel_peer, ctx->transport);
  208|  3.04k|    if(result) {
  ------------------
  |  Branch (208:8): [True: 0, False: 3.04k]
  ------------------
  209|      0|      CURL_TRC_CF(data, cf, "adding happy eyeballs 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]
  |  |  ------------------
  ------------------
  210|      0|      return result;
  211|      0|    }
  212|       |
  213|  3.04k|    if(tunnel_peer && (first_transport == TRNSPRT_QUIC)) {
  ------------------
  |  |  239|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (213:8): [True: 0, False: 3.04k]
  |  Branch (213:23): [True: 0, False: 0]
  ------------------
  214|      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]
  |  |  ------------------
  ------------------
  215|      0|                  first_peer->hostname, first_peer->port);
  216|      0|      ctx->state = CF_SETUP_CNNCT_HTTP_PROXY;
  217|      0|    }
  218|  3.04k|    else {
  219|  3.04k|      CURL_TRC_CF(data, cf, "happy eyeballing to %s %s:%u",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  220|  3.04k|                  tunnel_peer ? "proxy" : "origin",
  221|  3.04k|                  first_peer->hostname, first_peer->port);
  222|  3.04k|      ctx->state = CF_SETUP_CNNCT_EYEBALLS;
  223|  3.04k|    }
  224|  3.04k|  }
  225|  6.08k|  return result;
  226|  6.08k|}
cf-setup.c:conn_get_first_origin:
  163|  3.04k|{
  164|  3.04k|#ifndef CURL_DISABLE_PROXY
  165|  3.04k|  if(conn->socks_proxy.peer)
  ------------------
  |  Branch (165:6): [True: 0, False: 3.04k]
  ------------------
  166|      0|    return conn->socks_proxy.peer;
  167|  3.04k|  if(conn->http_proxy.peer)
  ------------------
  |  Branch (167:6): [True: 0, False: 3.04k]
  ------------------
  168|      0|    return conn->http_proxy.peer;
  169|  3.04k|#endif
  170|  3.04k|  return (sockindex == SECONDARYSOCKET) ? conn->origin2 : conn->origin;
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (170:10): [True: 0, False: 3.04k]
  ------------------
  171|  3.04k|}
cf-setup.c:cf_setup_add_socks:
   86|  3.04k|{
   87|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
   88|  3.04k|  CURLcode result = CURLE_OK;
   89|  3.04k|  if(ctx->state < CF_SETUP_CNNCT_SOCKS && cf->conn->socks_proxy.peer) {
  ------------------
  |  Branch (89:6): [True: 3.04k, False: 0]
  |  Branch (89:43): [True: 0, False: 3.04k]
  ------------------
   90|       |    /* Add a SOCKS proxy to go through `first_peer` to `second_peer`*/
   91|      0|    struct Curl_peer *second_peer;
   92|       |
   93|      0|    if(cf->conn->http_proxy.peer)
  ------------------
  |  Branch (93:8): [True: 0, False: 0]
  ------------------
   94|      0|      second_peer = cf->conn->http_proxy.peer;
   95|      0|    else
   96|      0|      second_peer = Curl_conn_get_destination(cf->conn, cf->sockindex);
   97|      0|    if(!second_peer)
  ------------------
  |  Branch (97:8): [True: 0, False: 0]
  ------------------
   98|      0|      return CURLE_FAILED_INIT;
   99|       |
  100|      0|    result = Curl_cf_socks_proxy_insert_after(
  101|      0|      cf, data, second_peer, cf->conn->ip_version,
  102|      0|      cf->conn->socks_proxy.proxytype,
  103|      0|      cf->conn->socks_proxy.creds);
  104|      0|    if(result) {
  ------------------
  |  Branch (104:8): [True: 0, False: 0]
  ------------------
  105|      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]
  |  |  ------------------
  ------------------
  106|      0|      return result;
  107|      0|    }
  108|       |
  109|      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]
  |  |  ------------------
  ------------------
  110|      0|                second_peer->hostname, second_peer->port);
  111|      0|    ctx->state = CF_SETUP_CNNCT_SOCKS;
  112|      0|  }
  113|  3.04k|  return result;
  114|  3.04k|}
cf-setup.c:cf_setup_add_http_proxy:
  119|  3.04k|{
  120|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
  121|  3.04k|  CURLcode result = CURLE_OK;
  122|       |
  123|  3.04k|  if(ctx->state < CF_SETUP_CNNCT_HTTP_PROXY &&
  ------------------
  |  Branch (123:6): [True: 3.04k, False: 0]
  ------------------
  124|  3.04k|     cf->conn->http_proxy.peer && !cf->conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (124:6): [True: 0, False: 3.04k]
  |  Branch (124:35): [True: 0, False: 0]
  ------------------
  125|      0|    struct Curl_peer *peer = cf->conn->http_proxy.peer;
  126|      0|    struct Curl_peer *tunnel_peer =
  127|      0|      Curl_conn_get_destination(cf->conn, cf->sockindex);
  128|       |
  129|      0|#ifdef USE_SSL
  130|      0|    if(CURL_PROXY_IS_HTTPS(cf->conn->http_proxy.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]
  |  |  ------------------
  ------------------
  131|      0|       !Curl_conn_is_ssl(cf->conn, cf->sockindex)) {
  ------------------
  |  Branch (131:8): [True: 0, False: 0]
  ------------------
  132|      0|      result = Curl_cf_ssl_proxy_insert_after(
  133|      0|        cf, data, cf->conn->http_proxy.peer);
  134|      0|      if(result) {
  ------------------
  |  Branch (134:10): [True: 0, False: 0]
  ------------------
  135|      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]
  |  |  ------------------
  ------------------
  136|      0|                    (int)result);
  137|      0|        return result;
  138|      0|      }
  139|      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]
  |  |  ------------------
  ------------------
  140|      0|    }
  141|      0|#endif /* USE_SSL */
  142|       |
  143|      0|    result = Curl_cf_http_proxy_insert_after(
  144|      0|      cf, data, peer, tunnel_peer,
  145|      0|      ctx->transport, cf->conn->http_proxy.proxytype);
  146|      0|    if(result) {
  ------------------
  |  Branch (146:8): [True: 0, False: 0]
  ------------------
  147|      0|      CURL_TRC_CF(data, cf, "adding HTTP proxy tunnel 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]
  |  |  ------------------
  ------------------
  148|      0|                  (int)result);
  149|      0|      return result;
  150|      0|    }
  151|      0|    CURL_TRC_CF(data, cf, "added HTTP proxy tunnel 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]
  |  |  ------------------
  ------------------
  152|      0|    ctx->state = CF_SETUP_CNNCT_HTTP_PROXY;
  153|      0|  }
  154|  3.04k|  return result;
  155|  3.04k|}
cf-setup.c:cf_setup_add_haproxy:
   61|  3.04k|{
   62|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
   63|  3.04k|  CURLcode result = CURLE_OK;
   64|       |
   65|  3.04k|  if(ctx->state < CF_SETUP_CNNCT_HAPROXY) {
  ------------------
  |  Branch (65:6): [True: 3.04k, False: 0]
  ------------------
   66|  3.04k|    if(data->set.haproxyprotocol) {
  ------------------
  |  Branch (66:8): [True: 0, False: 3.04k]
  ------------------
   67|      0|      if(ctx->transport == TRNSPRT_QUIC) {
  ------------------
  |  |  239|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (67:10): [True: 0, False: 0]
  ------------------
   68|      0|        failf(data, "haproxy protocol does not support QUIC");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
   69|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
   70|      0|      }
   71|      0|      result = Curl_cf_haproxy_insert_after(cf, data);
   72|      0|      if(result) {
  ------------------
  |  Branch (72:10): [True: 0, False: 0]
  ------------------
   73|      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]
  |  |  ------------------
  ------------------
   74|      0|                    (int)result);
   75|      0|        return result;
   76|      0|      }
   77|      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]
  |  |  ------------------
  ------------------
   78|      0|    }
   79|  3.04k|    ctx->state = CF_SETUP_CNNCT_HAPROXY;
   80|  3.04k|  }
   81|  3.04k|  return result;
   82|  3.04k|}
cf-setup.c:cf_setup_add_origin_filters:
  230|  3.04k|{
  231|  3.04k|  struct cf_setup_ctx *ctx = cf->ctx;
  232|  3.04k|  CURLcode result = CURLE_OK;
  233|       |
  234|  3.04k|  (void)data; /* not used in all builds */
  235|  3.04k|  if(ctx->state < CF_SETUP_CNNCT_SSL) {
  ------------------
  |  Branch (235:6): [True: 3.04k, False: 0]
  ------------------
  236|       |#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) && \
  237|       |    !defined(CURL_DISABLE_PROXY)
  238|       |
  239|       |    /* Wanting QUIC with an HTTP tunneling filter, we now need to add
  240|       |     * the QUIC filter on top. Without tunneling, this has already
  241|       |     * happened in the Happy Eyeball filter. */
  242|       |    if(ctx->transport == TRNSPRT_QUIC &&
  243|       |       cf->conn->http_proxy.peer && !cf->conn->bits.origin_is_proxy) {
  244|       |      struct Curl_peer *origin = Curl_conn_get_origin(cf->conn, cf->sockindex);
  245|       |      struct Curl_peer *peer =
  246|       |        Curl_conn_get_destination(cf->conn, cf->sockindex);
  247|       |
  248|       |      result = Curl_cf_capsule_insert_after(cf, data);
  249|       |      if(result) {
  250|       |        CURL_TRC_CF(data, cf, "adding capsule filter failed -> %d",
  251|       |                    (int)result);
  252|       |        return result;
  253|       |      }
  254|       |      result = Curl_cf_quic_insert_after(cf, data, origin, peer);
  255|       |      if(result) {
  256|       |        CURL_TRC_CF(data, cf, "adding QUIC filter failed -> %d", (int)result);
  257|       |        return result;
  258|       |      }
  259|       |      CURL_TRC_CF(data, cf, "added QUIC filter for origin");
  260|       |    }
  261|       |    else
  262|       |#endif /* !CURL_DISABLE_HTTP && USE_HTTP3 && CURL_DISABLE_PROXY */
  263|  3.04k|#ifdef USE_SSL
  264|  3.04k|    if((ctx->ssl_mode == CURL_CF_SSL_ENABLE ||
  ------------------
  |  |  366|  6.08k|#define CURL_CF_SSL_ENABLE   1
  ------------------
  |  Branch (264:9): [True: 0, False: 3.04k]
  ------------------
  265|  3.04k|        (ctx->ssl_mode != CURL_CF_SSL_DISABLE &&
  ------------------
  |  |  365|  6.08k|#define CURL_CF_SSL_DISABLE  0
  ------------------
  |  Branch (265:10): [True: 3.04k, False: 0]
  ------------------
  266|  3.04k|         cf->conn->scheme->flags & PROTOPT_SSL)) && /* we want SSL */
  ------------------
  |  |  204|  3.04k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (266:10): [True: 0, False: 3.04k]
  ------------------
  267|      0|       !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { /* it is missing */
  ------------------
  |  Branch (267:8): [True: 0, False: 0]
  ------------------
  268|       |
  269|      0|#ifndef CURL_DISABLE_PROXY
  270|      0|      if(cf->conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (270:10): [True: 0, False: 0]
  ------------------
  271|      0|        result = Curl_cf_ssl_proxy_insert_after(cf, data, cf->conn->origin);
  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 same peers as FIRSTSOCKET. See #22225
  281|       |         * Meaning: cf->sockindex does not matter here. */
  282|      0|        result = Curl_cf_ssl_insert_after(cf, data,
  283|      0|          Curl_conn_get_origin(cf->conn, FIRSTSOCKET),
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  284|      0|          Curl_conn_get_destination(cf->conn, FIRSTSOCKET));
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  285|      0|      }
  286|      0|      if(result) {
  ------------------
  |  Branch (286:10): [True: 0, False: 0]
  ------------------
  287|      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]
  |  |  ------------------
  ------------------
  288|      0|                    (int)result);
  289|      0|        return result;
  290|      0|      }
  291|      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]
  |  |  ------------------
  ------------------
  292|      0|    }
  293|  3.04k|#endif /* USE_SSL */
  294|  3.04k|    ctx->state = CF_SETUP_CNNCT_SSL;
  295|  3.04k|  }
  296|  3.04k|  return result;
  297|  3.04k|}
cf-setup.c:cf_setup_create:
  418|  3.04k|{
  419|  3.04k|  struct Curl_cfilter *cf = NULL;
  420|  3.04k|  struct cf_setup_ctx *ctx;
  421|  3.04k|  CURLcode result = CURLE_OK;
  422|       |
  423|  3.04k|  (void)data;
  424|  3.04k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  425|  3.04k|  if(!ctx) {
  ------------------
  |  Branch (425:6): [True: 0, False: 3.04k]
  ------------------
  426|      0|    result = CURLE_OUT_OF_MEMORY;
  427|      0|    goto out;
  428|      0|  }
  429|  3.04k|  ctx->state = CF_SETUP_INIT;
  430|  3.04k|  ctx->ssl_mode = ssl_mode;
  431|  3.04k|  ctx->transport = transport;
  432|       |
  433|  3.04k|  result = Curl_cf_create(&cf, &Curl_cft_setup, ctx);
  434|  3.04k|  if(result)
  ------------------
  |  Branch (434:6): [True: 0, False: 3.04k]
  ------------------
  435|      0|    goto out;
  436|  3.04k|  ctx = NULL;
  437|       |
  438|  3.04k|out:
  439|  3.04k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (439:10): [True: 0, False: 3.04k]
  ------------------
  440|  3.04k|  if(ctx) {
  ------------------
  |  Branch (440:6): [True: 0, False: 3.04k]
  ------------------
  441|      0|    curlx_free(ctx);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  442|      0|  }
  443|  3.04k|  return result;
  444|  3.04k|}

sockaddr2string:
   98|  9.12k|{
   99|  9.12k|  CURLcode result;
  100|  9.12k|  struct sockaddr_in *si = NULL;
  101|  9.12k|#ifdef USE_IPV6
  102|  9.12k|  struct sockaddr_in6 *si6 = NULL;
  103|  9.12k|#endif
  104|  9.12k|#ifdef USE_UNIX_SOCKETS
  105|  9.12k|  struct sockaddr_un *su = NULL;
  106|       |#else
  107|       |  (void)salen;
  108|       |#endif
  109|       |
  110|  9.12k|  switch(sa->sa_family) {
  111|  3.04k|  case AF_INET:
  ------------------
  |  Branch (111:3): [True: 3.04k, False: 6.08k]
  ------------------
  112|  3.04k|    si = (struct sockaddr_in *)(void *)sa;
  113|  3.04k|    result = curlx_inet_ntop(sa->sa_family, &si->sin_addr, addr,
  114|  3.04k|                             MAX_IPADR_LEN);
  ------------------
  |  |   41|  3.04k|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  115|  3.04k|    if(!result) {
  ------------------
  |  Branch (115:8): [True: 3.04k, False: 0]
  ------------------
  116|  3.04k|      *port = ntohs(si->sin_port);
  117|  3.04k|      return result;
  118|  3.04k|    }
  119|      0|    break;
  120|      0|#ifdef USE_IPV6
  121|      0|  case AF_INET6:
  ------------------
  |  Branch (121:3): [True: 0, False: 9.12k]
  ------------------
  122|      0|    si6 = (struct sockaddr_in6 *)(void *)sa;
  123|      0|    result = curlx_inet_ntop(sa->sa_family, &si6->sin6_addr, addr,
  124|      0|                             MAX_IPADR_LEN);
  ------------------
  |  |   41|      0|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  125|      0|    if(!result) {
  ------------------
  |  Branch (125:8): [True: 0, False: 0]
  ------------------
  126|      0|      *port = ntohs(si6->sin6_port);
  127|      0|      return result;
  128|      0|    }
  129|      0|    break;
  130|      0|#endif
  131|      0|#ifdef USE_UNIX_SOCKETS
  132|  6.08k|  case AF_UNIX:
  ------------------
  |  Branch (132:3): [True: 6.08k, False: 3.04k]
  ------------------
  133|  6.08k|    if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) {
  ------------------
  |  Branch (133:8): [True: 0, False: 6.08k]
  ------------------
  134|      0|      su = (struct sockaddr_un *)sa;
  135|      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")
  ------------------
  136|      0|    }
  137|  6.08k|    else
  138|  6.08k|      addr[0] = 0; /* socket with no name */
  139|  6.08k|    *port = 0;
  140|  6.08k|    return CURLE_OK;
  141|      0|#endif
  142|      0|  default:
  ------------------
  |  Branch (142:3): [True: 0, False: 9.12k]
  ------------------
  143|      0|    result = CURLE_UNSUPPORTED_PROTOCOL;
  144|      0|    break;
  145|  9.12k|  }
  146|       |
  147|      0|  addr[0] = '\0';
  148|      0|  *port = 0;
  149|      0|  return result;
  150|  9.12k|}
Curl_socket_addr_from_ai:
  347|  3.04k|{
  348|       |  /*
  349|       |   * The Curl_sockaddr_ex structure is libcurl's external API
  350|       |   * curl_sockaddr structure with enough space available to directly hold
  351|       |   * any protocol-specific address structures. The variable declared here
  352|       |   * will be used to pass / receive data to/from the fopensocket callback
  353|       |   * if this has been set, before that, it is initialized from parameters.
  354|       |   */
  355|  3.04k|  addr->family = ai->ai_family;
  356|  3.04k|  addr->socktype = Curl_socktype_for_transport(transport);
  357|  3.04k|  addr->protocol = Curl_protocol_for_transport(transport);
  358|  3.04k|  addr->addrlen = (unsigned int)ai->ai_addrlen;
  359|       |
  360|  3.04k|  DEBUGASSERT(addr->addrlen <= sizeof(addr->curl_sa_addrbuf));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (360:3): [True: 0, False: 3.04k]
  |  Branch (360:3): [True: 3.04k, False: 0]
  ------------------
  361|  3.04k|  if(addr->addrlen > sizeof(addr->curl_sa_addrbuf))
  ------------------
  |  |   36|  3.04k|#define curl_sa_addrbuf addr.buf
  ------------------
  |  Branch (361:6): [True: 0, False: 3.04k]
  ------------------
  362|      0|    return CURLE_TOO_LARGE;
  363|       |
  364|  3.04k|  memcpy(&addr->curl_sa_addrbuf, ai->ai_addr, addr->addrlen);
  ------------------
  |  |   36|  3.04k|#define curl_sa_addrbuf addr.buf
  ------------------
  365|  3.04k|  return CURLE_OK;
  366|  3.04k|}
Curl_cf_tcp_create:
 1870|  3.04k|{
 1871|  3.04k|  struct cf_socket_ctx *ctx = NULL;
 1872|  3.04k|  struct Curl_cfilter *cf = NULL;
 1873|  3.04k|  CURLcode result;
 1874|       |
 1875|  3.04k|  (void)data;
 1876|  3.04k|  (void)origin;
 1877|  3.04k|  (void)conn;
 1878|  3.04k|  (void)tunnel_peer;
 1879|  3.04k|  (void)tunnel_transport;
 1880|  3.04k|  DEBUGASSERT(transport_peer == TRNSPRT_TCP);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1880:3): [True: 0, False: 3.04k]
  |  Branch (1880:3): [True: 3.04k, False: 0]
  ------------------
 1881|  3.04k|  if(!addr) {
  ------------------
  |  Branch (1881:6): [True: 0, False: 3.04k]
  ------------------
 1882|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
 1883|      0|    goto out;
 1884|      0|  }
 1885|       |
 1886|  3.04k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1887|  3.04k|  if(!ctx) {
  ------------------
  |  Branch (1887:6): [True: 0, False: 3.04k]
  ------------------
 1888|      0|    result = CURLE_OUT_OF_MEMORY;
 1889|      0|    goto out;
 1890|      0|  }
 1891|       |
 1892|  3.04k|  result = cf_socket_ctx_init(ctx, peer, addr, transport_peer);
 1893|  3.04k|  if(result)
  ------------------
  |  Branch (1893:6): [True: 0, False: 3.04k]
  ------------------
 1894|      0|    goto out;
 1895|       |
 1896|  3.04k|  result = Curl_cf_create(&cf, &Curl_cft_tcp, ctx);
 1897|       |
 1898|  3.04k|out:
 1899|  3.04k|  *pcf = (!result) ? cf : NULL;
  ------------------
  |  Branch (1899:10): [True: 3.04k, False: 0]
  ------------------
 1900|  3.04k|  if(result) {
  ------------------
  |  Branch (1900:6): [True: 0, False: 3.04k]
  ------------------
 1901|      0|    curlx_safefree(cf);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1902|      0|    cf_socket_ctx_free(ctx);
 1903|      0|  }
 1904|       |
 1905|  3.04k|  return result;
 1906|  3.04k|}
cf-socket.c:socket_open:
  423|  3.04k|{
  424|  3.04k|  char errbuf[STRERROR_LEN];
  425|       |
  426|  3.04k|#ifdef SOCK_CLOEXEC
  427|  3.04k|  addr->socktype |= SOCK_CLOEXEC;
  428|  3.04k|#endif
  429|       |
  430|  3.04k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (430:3): [True: 0, False: 3.04k]
  |  Branch (430:3): [True: 3.04k, False: 0]
  ------------------
  431|  3.04k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (431:3): [True: 0, False: 3.04k]
  |  Branch (431:3): [True: 3.04k, False: 0]
  ------------------
  432|  3.04k|  if(data->set.fopensocket) {
  ------------------
  |  Branch (432:6): [True: 3.04k, False: 0]
  ------------------
  433|       |    /*
  434|       |     * If the opensocket callback is set, all the destination address
  435|       |     * information is passed to the callback. Depending on this information the
  436|       |     * callback may opt to abort the connection, this is indicated returning
  437|       |     * CURL_SOCKET_BAD; otherwise it will return a not-connected socket. When
  438|       |     * the callback returns a valid socket the destination address information
  439|       |     * might have been changed and this 'new' address will actually be used
  440|       |     * here to connect.
  441|       |     */
  442|  3.04k|    struct Curl_mapi_guard guard;
  443|  3.04k|    CURL_CBAPI_START(&guard, data, easy_fopensocket);
  ------------------
  |  |  201|  3.04k|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
  444|  3.04k|    *sockfd = data->set.fopensocket(data->set.opensocket_client,
  445|  3.04k|                                    CURLSOCKTYPE_IPCXN,
  446|  3.04k|                                    (struct curl_sockaddr *)addr);
  447|  3.04k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  3.04k|  Curl_cbapi_leave(g)
  ------------------
  448|  3.04k|  }
  449|      0|  else {
  450|       |    /* opensocket callback not set, so create the socket now */
  451|      0|#ifdef DEBUGBUILD
  452|      0|    if((addr->family == AF_INET6) && getenv("CURL_DBG_SOCK_FAIL_IPV6")) {
  ------------------
  |  Branch (452:8): [True: 0, False: 0]
  |  Branch (452:38): [True: 0, False: 0]
  ------------------
  453|      0|      failf(data, "CURL_DBG_SOCK_FAIL_IPV6: failed to open socket");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  454|      0|      return CURLE_COULDNT_CONNECT;
  455|      0|    }
  456|      0|#endif
  457|      0|    *sockfd = CURL_SOCKET(addr->family, addr->socktype, addr->protocol);
  ------------------
  |  | 1381|      0|  curl_dbg_socket((int)(domain), type, protocol, __LINE__, __FILE__)
  ------------------
  458|      0|    if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
                  if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
                  if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  | 1079|      0|#define SOCKENOMEM        ENOMEM
  ------------------
  |  Branch (458:8): [True: 0, False: 0]
  |  Branch (458:40): [True: 0, False: 0]
  ------------------
  459|      0|      return CURLE_OUT_OF_MEMORY;
  460|      0|  }
  461|       |
  462|  3.04k|  if(*sockfd == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (462:6): [True: 0, False: 3.04k]
  ------------------
  463|       |    /* no socket, no connection */
  464|      0|    failf(data, "failed to open socket: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  465|      0|          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  466|      0|    return CURLE_COULDNT_CONNECT;
  467|      0|  }
  468|       |
  469|       |#ifdef USE_SO_NOSIGPIPE
  470|       |  if(Curl_sock_nosigpipe(*sockfd) < 0) {
  471|       |    failf(data, "setsockopt enable SO_NOSIGPIPE: %s",
  472|       |          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  473|       |    sclose(*sockfd);
  474|       |    *sockfd = CURL_SOCKET_BAD;
  475|       |    return CURLE_COULDNT_CONNECT;
  476|       |  }
  477|       |#endif /* USE_SO_NOSIGPIPE */
  478|       |
  479|       |#if defined(HAVE_FCNTL) && !defined(SOCK_CLOEXEC)
  480|       |  if(fcntl(*sockfd, F_SETFD, FD_CLOEXEC) < 0) {
  481|       |    failf(data, "fcntl set CLOEXEC: %s",
  482|       |          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  483|       |    sclose(*sockfd);
  484|       |    *sockfd = CURL_SOCKET_BAD;
  485|       |    return CURLE_COULDNT_CONNECT;
  486|       |  }
  487|       |#endif
  488|       |
  489|  3.04k|#if defined(USE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
  490|  3.04k|  if(addr->family == AF_INET6) {
  ------------------
  |  Branch (490:6): [True: 0, False: 3.04k]
  ------------------
  491|      0|    struct sockaddr_in6 * const sa6 = (void *)&addr->curl_sa_addr;
  ------------------
  |  |   35|      0|#define curl_sa_addr    addr.sa
  ------------------
  492|      0|    sa6->sin6_scope_id = get_scope_id(data, sa6);
  493|      0|  }
  494|  3.04k|#endif
  495|  3.04k|  return CURLE_OK;
  496|  3.04k|}
cf-socket.c:socket_close:
  529|  3.04k|{
  530|  3.04k|  if(sock == CURL_SOCKET_BAD)
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (530:6): [True: 0, False: 3.04k]
  ------------------
  531|      0|    return 0;
  532|       |
  533|  3.04k|  if(use_callback && conn && conn->fclosesocket) {
  ------------------
  |  Branch (533:6): [True: 3.04k, False: 0]
  |  Branch (533:22): [True: 3.04k, False: 0]
  |  Branch (533:30): [True: 0, False: 3.04k]
  ------------------
  534|      0|    struct Curl_mapi_guard guard;
  535|      0|    int rc;
  536|      0|    Curl_multi_will_close(data, sock);
  537|      0|    CURL_CBAPI_START(&guard, data, easy_closesocket);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
  538|      0|    rc = conn->fclosesocket(conn->closesocket_client, sock);
  539|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  540|      0|    return rc;
  541|      0|  }
  542|       |
  543|  3.04k|  if(conn)
  ------------------
  |  Branch (543:6): [True: 3.04k, False: 0]
  ------------------
  544|       |    /* tell the multi-socket code about this */
  545|  3.04k|    Curl_multi_will_close(data, sock);
  546|       |
  547|  3.04k|  sclose(sock);
  ------------------
  |  | 1373|  3.04k|#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
  ------------------
  548|       |
  549|  3.04k|  return 0;
  550|  3.04k|}
cf-socket.c:cf_socket_destroy:
 1068|  3.04k|{
 1069|  3.04k|  struct cf_socket_ctx *ctx = cf->ctx;
 1070|       |
 1071|  3.04k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((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.04k|   (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.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 1072|  3.04k|  if(ctx) {
  ------------------
  |  Branch (1072:6): [True: 3.04k, False: 0]
  ------------------
 1073|  3.04k|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1073:8): [True: 3.04k, False: 0]
  ------------------
 1074|  3.04k|      CURL_TRC_CF(data, cf, "cf_socket_close, fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((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.04k|   (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.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 1075|  3.04k|      if(ctx->sock == cf->conn->sock[cf->sockindex])
  ------------------
  |  Branch (1075:10): [True: 3.04k, False: 0]
  ------------------
 1076|  3.04k|        cf->conn->sock[cf->sockindex] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1077|  3.04k|      socket_close(data, cf->conn, !ctx->accepted, ctx->sock);
 1078|  3.04k|    }
 1079|  3.04k|    cf_socket_ctx_free(ctx);
 1080|  3.04k|  }
 1081|  3.04k|}
cf-socket.c:cf_tcp_connect:
 1411|  3.04k|{
 1412|  3.04k|  struct cf_socket_ctx *ctx = cf->ctx;
 1413|  3.04k|  CURLcode result = CURLE_COULDNT_CONNECT;
 1414|  3.04k|  int rc = 0;
 1415|       |
 1416|  3.04k|  if(cf->connected) {
  ------------------
  |  Branch (1416:6): [True: 0, False: 3.04k]
  ------------------
 1417|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1418|      0|    return CURLE_OK;
 1419|      0|  }
 1420|       |
 1421|  3.04k|  *done = FALSE; /* a negative world view is best */
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1422|  3.04k|  if(ctx->sock == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1422:6): [True: 3.04k, False: 0]
  ------------------
 1423|  3.04k|    int sockerr;
 1424|       |
 1425|  3.04k|    result = cf_socket_open(cf, data);
 1426|  3.04k|    if(result)
  ------------------
  |  Branch (1426:8): [True: 0, False: 3.04k]
  ------------------
 1427|      0|      goto out;
 1428|       |
 1429|  3.04k|    if(cf->connected) {
  ------------------
  |  Branch (1429:8): [True: 3.04k, False: 0]
  ------------------
 1430|  3.04k|      *done = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1431|  3.04k|      return CURLE_OK;
 1432|  3.04k|    }
 1433|       |
 1434|       |    /* Connect TCP socket */
 1435|      0|    rc = do_connect(cf, data, (bool)cf->conn->bits.tcp_fastopen);
 1436|      0|    sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1437|      0|    set_local_ip(cf, data);
 1438|      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]
  |  |  ------------------
  ------------------
 1439|      0|                ctx->ip.local_ip, ctx->ip.local_port);
 1440|      0|    if(rc == -1) {
  ------------------
  |  Branch (1440:8): [True: 0, False: 0]
  ------------------
 1441|      0|      ctx->sockerr = sockerr;
 1442|      0|      result = socket_connect_result(data, ctx->ip.remote_ip, sockerr);
 1443|      0|      goto out;
 1444|      0|    }
 1445|      0|  }
 1446|       |
 1447|       |#ifdef mpeix
 1448|       |  /* Call this function once now, and ignore the results. We do this to
 1449|       |     "clear" the error state on the socket so that we can later read it
 1450|       |     reliably. This is reported necessary on the MPE/iX operating
 1451|       |     system. */
 1452|       |  (void)verifyconnect(ctx->sock, NULL);
 1453|       |#endif
 1454|       |  /* check socket for connect */
 1455|      0|  rc = SOCKET_WRITABLE(ctx->sock, 0);
  ------------------
  |  |   79|      0|  Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, x, z)
  |  |  ------------------
  |  |  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  |  |                 Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, x, z)
  |  |  ------------------
  |  |  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  ------------------
 1456|       |
 1457|      0|  if(rc == 0) { /* no connection yet */
  ------------------
  |  Branch (1457:6): [True: 0, False: 0]
  ------------------
 1458|      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]
  |  |  ------------------
  ------------------
 1459|      0|    return CURLE_OK;
 1460|      0|  }
 1461|      0|  else if(rc == CURL_CSELECT_OUT || cf->conn->bits.tcp_fastopen) {
  ------------------
  |  |  291|      0|#define CURL_CSELECT_OUT  0x02
  ------------------
  |  Branch (1461:11): [True: 0, False: 0]
  |  Branch (1461:37): [True: 0, False: 0]
  ------------------
 1462|      0|    if(verifyconnect(ctx->sock, &ctx->sockerr)) {
  ------------------
  |  Branch (1462:8): [True: 0, False: 0]
  ------------------
 1463|       |      /* we are connected with TCP, awesome! */
 1464|      0|      ctx->connected_at = *Curl_pgrs_now(data);
 1465|      0|      set_local_ip(cf, data);
 1466|      0|      *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1467|      0|      cf->connected = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1468|      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]
  |  |  ------------------
  ------------------
 1469|      0|      return CURLE_OK;
 1470|      0|    }
 1471|      0|  }
 1472|      0|  else if(rc & CURL_CSELECT_ERR) {
  ------------------
  |  |  292|      0|#define CURL_CSELECT_ERR  0x04
  ------------------
  |  Branch (1472:11): [True: 0, False: 0]
  ------------------
 1473|      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]
  |  |  ------------------
  ------------------
 1474|      0|    (void)verifyconnect(ctx->sock, &ctx->sockerr);
 1475|      0|    result = CURLE_COULDNT_CONNECT;
 1476|      0|  }
 1477|       |
 1478|      0|out:
 1479|      0|  if(result) {
  ------------------
  |  Branch (1479:6): [True: 0, False: 0]
  ------------------
 1480|      0|    VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
 1481|      0|    set_local_ip(cf, data);
 1482|      0|    if(ctx->sockerr) {
  ------------------
  |  Branch (1482:8): [True: 0, False: 0]
  ------------------
 1483|      0|      data->state.os_errno = ctx->sockerr;
 1484|      0|      SET_SOCKERRNO(ctx->sockerr);
  ------------------
  |  | 1042|      0|#define SET_SOCKERRNO(x)  (errno = (x))
  ------------------
 1485|      0|      VERBOSE(curlx_strerror(ctx->sockerr, buffer, sizeof(buffer)));
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
 1486|      0|    }
 1487|      0|    else {
 1488|      0|      VERBOSE(curlx_strcopy(buffer, sizeof(buffer), STRCONST("peer closed")));
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
 1489|      0|    }
 1490|      0|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1490:8): [True: 0, False: 0]
  ------------------
 1491|      0|      socket_close(data, cf->conn, TRUE, ctx->sock);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1492|      0|      ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1493|      0|    }
 1494|      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]
  |  |  ------------------
  ------------------
 1495|      0|          ctx->ip.remote_ip, ctx->ip.remote_port,
 1496|      0|          ctx->ip.local_ip, ctx->ip.local_port,
 1497|      0|          curlx_strerror(ctx->sockerr, buffer, sizeof(buffer)));
 1498|       |    *done = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1499|      0|  }
 1500|      0|  return result;
 1501|      0|}
cf-socket.c:cf_socket_open:
 1195|  3.04k|{
 1196|  3.04k|  struct cf_socket_ctx *ctx = cf->ctx;
 1197|  3.04k|  int error = 0;
 1198|  3.04k|  bool isconnected = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1199|  3.04k|  CURLcode result = CURLE_COULDNT_CONNECT;
 1200|  3.04k|  bool is_tcp;
 1201|       |
 1202|  3.04k|  DEBUGASSERT(ctx->sock == CURL_SOCKET_BAD);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1202:3): [True: 0, False: 3.04k]
  |  Branch (1202:3): [True: 3.04k, False: 0]
  ------------------
 1203|  3.04k|  ctx->started_at = *Curl_pgrs_now(data);
 1204|  3.04k|#ifdef CURL_USE_SOCK_NONBLOCK
 1205|       |  /* Do not tuck SOCK_NONBLOCK into socktype when opensocket callback is set
 1206|       |   * because we would not know how socktype is about to be used in the
 1207|       |   * callback, SOCK_NONBLOCK might get factored out before calling socket().
 1208|       |   */
 1209|  3.04k|  if(!data->set.fopensocket)
  ------------------
  |  Branch (1209:6): [True: 0, False: 3.04k]
  ------------------
 1210|      0|    ctx->addr.socktype |= SOCK_NONBLOCK;
 1211|  3.04k|#endif
 1212|  3.04k|  result = socket_open(data, &ctx->addr, &ctx->sock);
 1213|  3.04k|#ifdef CURL_USE_SOCK_NONBLOCK
 1214|       |  /* Restore the socktype after the socket is created. */
 1215|  3.04k|  if(!data->set.fopensocket)
  ------------------
  |  Branch (1215:6): [True: 0, False: 3.04k]
  ------------------
 1216|      0|    ctx->addr.socktype &= ~SOCK_NONBLOCK;
 1217|  3.04k|#endif
 1218|  3.04k|  if(result)
  ------------------
  |  Branch (1218:6): [True: 0, False: 3.04k]
  ------------------
 1219|      0|    goto out;
 1220|       |
 1221|  3.04k|  result = set_remote_ip(cf, data);
 1222|  3.04k|  if(result)
  ------------------
  |  Branch (1222:6): [True: 0, False: 3.04k]
  ------------------
 1223|      0|    goto out;
 1224|       |
 1225|  3.04k|#ifdef USE_IPV6
 1226|  3.04k|  if(ctx->addr.family == AF_INET6) {
  ------------------
  |  Branch (1226:6): [True: 0, False: 3.04k]
  ------------------
 1227|       |#ifdef USE_WINSOCK
 1228|       |    /* Turn on support for IPv4-mapped IPv6 addresses.
 1229|       |     * Linux kernel, NetBSD, FreeBSD, Darwin, lwIP: default is off;
 1230|       |     * Windows Vista and later: default is on;
 1231|       |     * DragonFly BSD: acts like off, and dummy setting;
 1232|       |     * OpenBSD and earlier Windows: unsupported.
 1233|       |     * Linux: controlled by /proc/sys/net/ipv6/bindv6only.
 1234|       |     */
 1235|       |    int on = 0;
 1236|       |    (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_V6ONLY,
 1237|       |                     (void *)&on, sizeof(on));
 1238|       |#endif
 1239|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 1240|      0|    {
 1241|      0|      struct sockaddr_in6 *sa6 = (void *)&ctx->addr.curl_sa_addr;
  ------------------
  |  |   35|      0|#define curl_sa_addr    addr.sa
  ------------------
 1242|      0|      if(sa6->sin6_scope_id)
  ------------------
  |  Branch (1242:10): [True: 0, False: 0]
  ------------------
 1243|      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]
  |  |  ------------------
  ------------------
 1244|      0|              ctx->ip.remote_ip, ctx->ip.remote_port,
 1245|      0|              (unsigned long)sa6->sin6_scope_id);
 1246|      0|      else
 1247|      0|#endif
 1248|      0|        infof(data, "  Trying [%s]:%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]
  |  |  ------------------
  ------------------
 1249|      0|              ctx->ip.remote_ip, ctx->ip.remote_port);
 1250|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 1251|      0|    }
 1252|      0|#endif
 1253|      0|  }
 1254|  3.04k|  else
 1255|  3.04k|#endif
 1256|  3.04k|    infof(data, "  Trying %s:%d...", ctx->ip.remote_ip, ctx->ip.remote_port);
  ------------------
  |  |  143|  3.04k|  do {                               \
  |  |  144|  3.04k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.04k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.04k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  3.04k|    ((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.04k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 1257|       |
 1258|  3.04k|#ifdef USE_IPV6
 1259|  3.04k|  is_tcp = (ctx->addr.family == AF_INET ||
  ------------------
  |  Branch (1259:13): [True: 3.04k, False: 0]
  ------------------
 1260|      0|            ctx->addr.family == AF_INET6) &&
  ------------------
  |  Branch (1260:13): [True: 0, False: 0]
  ------------------
 1261|  3.04k|    cf_socktype(ctx->addr.socktype) == SOCK_STREAM;
  ------------------
  |  Branch (1261:5): [True: 3.04k, False: 0]
  ------------------
 1262|       |#else
 1263|       |  is_tcp = (ctx->addr.family == AF_INET) &&
 1264|       |    cf_socktype(ctx->addr.socktype) == SOCK_STREAM;
 1265|       |#endif
 1266|  3.04k|  if(is_tcp) {
  ------------------
  |  Branch (1266:6): [True: 3.04k, False: 0]
  ------------------
 1267|  3.04k|    if(data->set.tcp_nodelay)
  ------------------
  |  Branch (1267:8): [True: 3.04k, False: 0]
  ------------------
 1268|  3.04k|      tcpnodelay(cf, data, ctx->sock);
 1269|       |
 1270|  3.04k|    if(data->set.tcp_keepalive)
  ------------------
  |  Branch (1270:8): [True: 0, False: 3.04k]
  ------------------
 1271|      0|      tcpkeepalive(cf, data, ctx->sock);
 1272|       |
 1273|  3.04k|    tcplocalhost(cf, ctx->sock);
 1274|  3.04k|  }
 1275|       |
 1276|  3.04k|  if(data->set.fsockopt) {
  ------------------
  |  Branch (1276:6): [True: 3.04k, False: 0]
  ------------------
 1277|       |    /* activate callback for setting socket options */
 1278|  3.04k|    struct Curl_mapi_guard guard;
 1279|  3.04k|    CURL_CBAPI_START(&guard, data, easy_fsockopt);
  ------------------
  |  |  201|  3.04k|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
 1280|  3.04k|    error = data->set.fsockopt(data->set.sockopt_client,
 1281|  3.04k|                               ctx->sock,
 1282|  3.04k|                               CURLSOCKTYPE_IPCXN);
 1283|  3.04k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  3.04k|  Curl_cbapi_leave(g)
  ------------------
 1284|       |
 1285|  3.04k|    if(error == CURL_SOCKOPT_ALREADY_CONNECTED)
  ------------------
  |  |  423|  3.04k|#define CURL_SOCKOPT_ALREADY_CONNECTED 2
  ------------------
  |  Branch (1285:8): [True: 3.04k, False: 0]
  ------------------
 1286|  3.04k|      isconnected = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1287|      0|    else if(error) {
  ------------------
  |  Branch (1287:13): [True: 0, False: 0]
  ------------------
 1288|      0|      result = CURLE_ABORTED_BY_CALLBACK;
 1289|      0|      goto out;
 1290|      0|    }
 1291|  3.04k|  }
 1292|       |
 1293|  3.04k|#ifndef CURL_DISABLE_BINDLOCAL
 1294|       |  /* possibly bind the local end to an IP, interface or port */
 1295|  3.04k|  if(ctx->addr.family == AF_INET
  ------------------
  |  Branch (1295:6): [True: 3.04k, False: 0]
  ------------------
 1296|      0|#ifdef USE_IPV6
 1297|      0|     || ctx->addr.family == AF_INET6
  ------------------
  |  Branch (1297:9): [True: 0, False: 0]
  ------------------
 1298|  3.04k|#endif
 1299|  3.04k|    ) {
 1300|  3.04k|    result = bindlocal(data, cf->conn, ctx->sock, ctx->addr.family,
 1301|  3.04k|                       Curl_ipv6_scope(&ctx->addr.curl_sa_addr),
  ------------------
  |  |   35|  3.04k|#define curl_sa_addr    addr.sa
  ------------------
 1302|  3.04k|                       ctx->transport);
 1303|  3.04k|    if(result) {
  ------------------
  |  Branch (1303:8): [True: 0, False: 3.04k]
  ------------------
 1304|      0|      if(result == CURLE_UNSUPPORTED_PROTOCOL) {
  ------------------
  |  Branch (1304:10): [True: 0, False: 0]
  ------------------
 1305|       |        /* The address family is not supported on this interface.
 1306|       |           We can continue trying addresses */
 1307|      0|        result = CURLE_COULDNT_CONNECT;
 1308|      0|      }
 1309|      0|      goto out;
 1310|      0|    }
 1311|  3.04k|  }
 1312|  3.04k|#endif
 1313|       |
 1314|       |#ifndef CURL_USE_SOCK_NONBLOCK
 1315|       |  /* Set socket non-blocking, must be a non-blocking socket for
 1316|       |   * a non-blocking connect. */
 1317|       |  error = curlx_nonblock(ctx->sock, TRUE);
 1318|       |  if(error < 0) {
 1319|       |    result = CURLE_UNSUPPORTED_PROTOCOL;
 1320|       |    ctx->sockerr = SOCKERRNO;
 1321|       |    goto out;
 1322|       |  }
 1323|       |#else
 1324|  3.04k|  if(data->set.fopensocket) {
  ------------------
  |  Branch (1324:6): [True: 3.04k, False: 0]
  ------------------
 1325|       |    /* Set socket non-blocking, must be a non-blocking socket for
 1326|       |     * a non-blocking connect. */
 1327|  3.04k|    error = curlx_nonblock(ctx->sock, TRUE);
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1328|  3.04k|    if(error < 0) {
  ------------------
  |  Branch (1328:8): [True: 0, False: 3.04k]
  ------------------
 1329|      0|      result = CURLE_UNSUPPORTED_PROTOCOL;
 1330|      0|      ctx->sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1331|      0|      goto out;
 1332|      0|    }
 1333|  3.04k|  }
 1334|  3.04k|#endif
 1335|  3.04k|  ctx->sock_connected = (cf_socktype(ctx->addr.socktype) != SOCK_DGRAM);
 1336|  3.04k|out:
 1337|  3.04k|  if(result) {
  ------------------
  |  Branch (1337:6): [True: 0, False: 3.04k]
  ------------------
 1338|      0|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1338:8): [True: 0, False: 0]
  ------------------
 1339|      0|      socket_close(data, cf->conn, TRUE, ctx->sock);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1340|      0|      ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1341|      0|    }
 1342|      0|  }
 1343|  3.04k|  else if(isconnected) {
  ------------------
  |  Branch (1343:11): [True: 3.04k, False: 0]
  ------------------
 1344|  3.04k|    set_local_ip(cf, data);
 1345|  3.04k|    ctx->connected_at = *Curl_pgrs_now(data);
 1346|  3.04k|    cf->connected = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1347|  3.04k|  }
 1348|  3.04k|  CURL_TRC_CF(data, cf, "cf_socket_open() -> %d, fd=%" FMT_SOCKET_T,
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 1349|  3.04k|              (int)result, ctx->sock);
 1350|  3.04k|  return result;
 1351|  3.04k|}
cf-socket.c:set_remote_ip:
 1118|  3.04k|{
 1119|  3.04k|  struct cf_socket_ctx *ctx = cf->ctx;
 1120|  3.04k|  CURLcode result;
 1121|       |
 1122|       |  /* store remote address and port used in this connection attempt */
 1123|  3.04k|  ctx->ip.transport = ctx->transport;
 1124|  3.04k|  result = sockaddr2string(&ctx->addr.curl_sa_addr,
  ------------------
  |  |   35|  3.04k|#define curl_sa_addr    addr.sa
  ------------------
 1125|  3.04k|                           (curl_socklen_t)ctx->addr.addrlen,
 1126|  3.04k|                           ctx->ip.remote_ip, &ctx->ip.remote_port);
 1127|  3.04k|  if(result) {
  ------------------
  |  Branch (1127:6): [True: 0, False: 3.04k]
  ------------------
 1128|      0|    ctx->sockerr = SOCKEAFNOSUPPORT;
  ------------------
  |  | 1070|      0|#define SOCKEAFNOSUPPORT  EAFNOSUPPORT
  ------------------
 1129|       |    /* malformed address or bug in inet_ntop, try next address */
 1130|      0|    failf(data, "curl_sa_addr inet_ntop() failed with %d", (int)result);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1131|      0|    return CURLE_FAILED_INIT;
 1132|      0|  }
 1133|  3.04k|  return CURLE_OK;
 1134|  3.04k|}
cf-socket.c:cf_socktype:
 1139|  6.08k|{
 1140|  6.08k|#ifdef SOCK_CLOEXEC
 1141|  6.08k|  x &= ~SOCK_CLOEXEC;
 1142|  6.08k|#endif
 1143|  6.08k|#ifdef CURL_USE_SOCK_NONBLOCK
 1144|       |  x &= ~SOCK_NONBLOCK;
 1145|  6.08k|#endif
 1146|  6.08k|  return x;
 1147|  6.08k|}
cf-socket.c:tcpnodelay:
  155|  3.04k|{
  156|  3.04k|#if defined(TCP_NODELAY) && defined(CURL_TCP_NODELAY_SUPPORTED)
  157|  3.04k|  curl_socklen_t onoff = (curl_socklen_t)1;
  158|  3.04k|  int level = IPPROTO_TCP;
  159|  3.04k|  VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1563|  3.04k|#define VERBOSE(x) x
  ------------------
  160|       |
  161|  3.04k|  if(setsockopt(sockfd, level, TCP_NODELAY, (void *)&onoff, sizeof(onoff)) < 0)
  ------------------
  |  Branch (161:6): [True: 3.04k, False: 0]
  ------------------
  162|  3.04k|    CURL_TRC_CF(data, cf, "Could not set TCP_NODELAY: %s",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  163|  3.04k|                curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
  164|       |#else
  165|       |  (void)cf;
  166|       |  (void)data;
  167|       |  (void)sockfd;
  168|       |#endif
  169|  3.04k|}
cf-socket.c:bindlocal:
  647|  3.04k|{
  648|  3.04k|  struct Curl_sockaddr_storage sa;
  649|  3.04k|  struct sockaddr *sock = (struct sockaddr *)&sa;  /* bind to this address */
  650|  3.04k|  curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */
  651|  3.04k|  struct sockaddr_in *si4 = (struct sockaddr_in *)&sa;
  652|  3.04k|#ifdef USE_IPV6
  653|  3.04k|  struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa;
  654|  3.04k|#endif
  655|       |
  656|  3.04k|  struct Curl_dns_entry *h = NULL;
  657|  3.04k|  unsigned short port = data->set.localport; /* use this port number, 0 for
  658|       |                                                "random" */
  659|       |  /* how many port numbers to try to bind to, increasing one at a time */
  660|  3.04k|  int portnum = data->set.localportrange;
  661|  3.04k|  const char *dev = CURL_EASY_STR(data, STRING_DEVICE);
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  662|  3.04k|  const char *iface_input = CURL_EASY_STR(data, STRING_INTERFACE);
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  663|  3.04k|  const char *host_input = CURL_EASY_STR(data, STRING_BINDHOST);
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  664|  3.04k|  const char *iface = iface_input ? iface_input : dev;
  ------------------
  |  Branch (664:23): [True: 0, False: 3.04k]
  ------------------
  665|  3.04k|  const char *host = host_input ? host_input : dev;
  ------------------
  |  Branch (665:22): [True: 0, False: 3.04k]
  ------------------
  666|  3.04k|  int sockerr;
  667|  3.04k|#ifdef IP_BIND_ADDRESS_NO_PORT
  668|  3.04k|  int on = 1;
  669|  3.04k|#endif
  670|       |#ifndef USE_IPV6
  671|       |  (void)scope;
  672|       |#endif
  673|       |
  674|       |  /*************************************************************
  675|       |   * Select device to bind socket to
  676|       |   *************************************************************/
  677|  3.04k|  if(!iface && !host && !port)
  ------------------
  |  Branch (677:6): [True: 3.04k, False: 0]
  |  Branch (677:16): [True: 3.04k, False: 0]
  |  Branch (677:25): [True: 3.04k, False: 0]
  ------------------
  678|       |    /* no local kind of binding was requested */
  679|  3.04k|    return CURLE_OK;
  680|      0|  else if(iface && (strlen(iface) >= 255))
  ------------------
  |  Branch (680:11): [True: 0, False: 0]
  |  Branch (680:20): [True: 0, False: 0]
  ------------------
  681|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  682|       |
  683|      0|  memset(&sa, 0, sizeof(struct Curl_sockaddr_storage));
  684|       |
  685|      0|  if(iface || host) {
  ------------------
  |  Branch (685:6): [True: 0, False: 0]
  |  Branch (685:15): [True: 0, False: 0]
  ------------------
  686|      0|    char myhost[256] = "";
  687|      0|    int done = 0; /* -1 for error, 1 for address found */
  688|      0|    if2ip_result_t if2ip_result = IF2IP_NOT_FOUND;
  689|       |
  690|      0|#ifdef SO_BINDTODEVICE
  691|       |    /*
  692|       |     * This binds the local socket to a particular interface. This will
  693|       |     * force even requests to other local interfaces to go out the external
  694|       |     * interface. Only bind to the interface when specified as interface,
  695|       |     * not as a hostname or ip address.
  696|       |     *
  697|       |     * The interface might be a VRF, eg: vrf-blue, which means it cannot be
  698|       |     * converted to an IP address and would fail Curl_if2ip. Try to
  699|       |     * use it straight away.
  700|       |     */
  701|      0|    if(iface &&
  ------------------
  |  Branch (701:8): [True: 0, False: 0]
  ------------------
  702|      0|       setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
  ------------------
  |  Branch (702:8): [True: 0, False: 0]
  ------------------
  703|      0|                  iface, (curl_socklen_t)strlen(iface) + 1) == 0 &&
  704|       |       /* This is often "errno 1, error: Operation not permitted" if you are
  705|       |        * not running as root or another suitable privileged user. If it
  706|       |        * succeeds it means the parameter was a valid interface and not an IP
  707|       |        * address. Return immediately.
  708|       |        */
  709|      0|       !host_input) {
  ------------------
  |  Branch (709:8): [True: 0, False: 0]
  ------------------
  710|      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]
  |  |  ------------------
  ------------------
  711|      0|      return CURLE_OK;
  712|      0|    }
  713|      0|#endif
  714|      0|    if(!host_input) {
  ------------------
  |  Branch (714:8): [True: 0, False: 0]
  ------------------
  715|       |      /* Discover IP from input device, then bind to it */
  716|      0|      if2ip_result = Curl_if2ip(af,
  717|      0|#ifdef USE_IPV6
  718|      0|                                scope, conn->scope_id,
  719|      0|#endif
  720|      0|                                iface, myhost, sizeof(myhost));
  721|      0|    }
  722|      0|    switch(if2ip_result) {
  ------------------
  |  Branch (722:12): [True: 0, False: 0]
  ------------------
  723|      0|    case IF2IP_NOT_FOUND:
  ------------------
  |  Branch (723:5): [True: 0, False: 0]
  ------------------
  724|      0|      if(iface_input && !host_input) {
  ------------------
  |  Branch (724:10): [True: 0, False: 0]
  |  Branch (724:25): [True: 0, False: 0]
  ------------------
  725|       |        /* Do not fall back to treating it as a hostname */
  726|      0|        char buffer[STRERROR_LEN];
  727|      0|        data->state.os_errno = sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  728|      0|        failf(data, "Could not bind to interface '%s' with errno %d: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  729|      0|              iface, sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
  730|      0|        return CURLE_INTERFACE_FAILED;
  731|      0|      }
  732|      0|      break;
  733|      0|    case IF2IP_AF_NOT_SUPPORTED:
  ------------------
  |  Branch (733:5): [True: 0, False: 0]
  ------------------
  734|       |      /* Signal the caller to try another address family if available */
  735|      0|      return CURLE_UNSUPPORTED_PROTOCOL;
  736|      0|    case IF2IP_FOUND:
  ------------------
  |  Branch (736:5): [True: 0, False: 0]
  ------------------
  737|       |      /*
  738|       |       * We now have the numerical IP address in the 'myhost' buffer
  739|       |       */
  740|      0|      host = myhost;
  741|      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]
  |  |  ------------------
  ------------------
  742|      0|            iface, host, af);
  743|      0|      done = 1;
  744|      0|      break;
  745|      0|    }
  746|      0|    if(!iface_input || host_input) {
  ------------------
  |  Branch (746:8): [True: 0, False: 0]
  |  Branch (746:24): [True: 0, False: 0]
  ------------------
  747|       |      /*
  748|       |       * This was not an interface, resolve the name as a hostname
  749|       |       * or IP number
  750|       |       *
  751|       |       * Temporarily force name resolution to use only the address type
  752|       |       * of the connection. The resolve functions should really be changed
  753|       |       * to take a type parameter instead.
  754|       |       */
  755|      0|      uint8_t dns_queries = (af == AF_INET) ?
  ------------------
  |  Branch (755:29): [True: 0, False: 0]
  ------------------
  756|      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)
  ------------------
  757|      0|#ifdef USE_IPV6
  758|      0|      if(af == AF_INET6)
  ------------------
  |  Branch (758:10): [True: 0, False: 0]
  ------------------
  759|      0|        dns_queries = CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  760|      0|#endif
  761|       |
  762|      0|      (void)Curl_resolv_blocking(data, dns_queries, host, 80, transport, &h);
  763|      0|      if(h) {
  ------------------
  |  Branch (763:10): [True: 0, False: 0]
  ------------------
  764|      0|        int h_af = h->addr->ai_family;
  765|       |        /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
  766|      0|        Curl_printable_address(h->addr, myhost, sizeof(myhost));
  767|      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]
  |  |  ------------------
  ------------------
  768|      0|              host, af, myhost, h_af);
  769|      0|        Curl_dns_entry_unlink(data, &h); /* this will NULL, potential free h */
  770|      0|        if(af != h_af) {
  ------------------
  |  Branch (770:12): [True: 0, False: 0]
  ------------------
  771|       |          /* bad IP version combo, signal the caller to try another address
  772|       |             family if available */
  773|      0|          return CURLE_UNSUPPORTED_PROTOCOL;
  774|      0|        }
  775|      0|        done = 1;
  776|      0|      }
  777|      0|      else {
  778|       |        /*
  779|       |         * provided dev was no interface (or interfaces are not supported
  780|       |         * e.g. Solaris) no ip address and no domain we fail here
  781|       |         */
  782|      0|        done = -1;
  783|      0|      }
  784|      0|    }
  785|       |
  786|      0|    if(done > 0) {
  ------------------
  |  Branch (786:8): [True: 0, False: 0]
  ------------------
  787|      0|#ifdef USE_IPV6
  788|       |      /* IPv6 address */
  789|      0|      if(af == AF_INET6) {
  ------------------
  |  Branch (789:10): [True: 0, False: 0]
  ------------------
  790|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  791|      0|        char *scope_ptr = strchr(myhost, '%');
  792|      0|        if(scope_ptr)
  ------------------
  |  Branch (792:12): [True: 0, False: 0]
  ------------------
  793|      0|          *(scope_ptr++) = '\0';
  794|      0|#endif
  795|      0|        if(curlx_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0) {
  ------------------
  |  Branch (795:12): [True: 0, False: 0]
  ------------------
  796|      0|          si6->sin6_family = AF_INET6;
  797|      0|          si6->sin6_port = htons(port);
  798|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  799|      0|          if(scope_ptr) {
  ------------------
  |  Branch (799:14): [True: 0, False: 0]
  ------------------
  800|       |            /* The "myhost" string either comes from Curl_if2ip or from
  801|       |               Curl_printable_address. The latter returns only numeric scope
  802|       |               IDs and the former returns none at all. Making the scope ID,
  803|       |               if present, known to be numeric */
  804|      0|            curl_off_t scope_id;
  805|      0|            if(curlx_str_number((const char **)CURL_UNCONST(&scope_ptr),
  ------------------
  |  |  808|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  |  Branch (805:16): [True: 0, False: 0]
  ------------------
  806|      0|                                &scope_id, UINT_MAX))
  807|      0|              return CURLE_UNSUPPORTED_PROTOCOL;
  808|      0|            si6->sin6_scope_id = (unsigned int)scope_id;
  809|      0|          }
  810|      0|#endif
  811|      0|        }
  812|      0|        sizeof_sa = sizeof(struct sockaddr_in6);
  813|      0|      }
  814|      0|      else
  815|      0|#endif
  816|       |      /* IPv4 address */
  817|      0|      if((af == AF_INET) &&
  ------------------
  |  Branch (817:10): [True: 0, False: 0]
  ------------------
  818|      0|         (curlx_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) {
  ------------------
  |  Branch (818:10): [True: 0, False: 0]
  ------------------
  819|      0|        si4->sin_family = AF_INET;
  820|      0|        si4->sin_port = htons(port);
  821|      0|        sizeof_sa = sizeof(struct sockaddr_in);
  822|      0|      }
  823|      0|    }
  824|       |
  825|      0|    if(done < 1) {
  ------------------
  |  Branch (825:8): [True: 0, False: 0]
  ------------------
  826|       |      /* errorbuf is set false so failf will overwrite any message already in
  827|       |         the error buffer, so the user receives this error message instead of a
  828|       |         generic resolve error. */
  829|      0|      char buffer[STRERROR_LEN];
  830|      0|      data->state.errorbuf = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  831|      0|      data->state.os_errno = sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  832|      0|      failf(data, "Could not bind to '%s' with errno %d: %s", host,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  833|      0|            sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
  834|      0|      return CURLE_INTERFACE_FAILED;
  835|      0|    }
  836|      0|  }
  837|      0|  else {
  838|       |    /* no device was given, prepare sa to match af's needs */
  839|      0|#ifdef USE_IPV6
  840|      0|    if(af == AF_INET6) {
  ------------------
  |  Branch (840:8): [True: 0, False: 0]
  ------------------
  841|      0|      si6->sin6_family = AF_INET6;
  842|      0|      si6->sin6_port = htons(port);
  843|      0|      sizeof_sa = sizeof(struct sockaddr_in6);
  844|      0|    }
  845|      0|    else
  846|      0|#endif
  847|      0|    if(af == AF_INET) {
  ------------------
  |  Branch (847:8): [True: 0, False: 0]
  ------------------
  848|      0|      si4->sin_family = AF_INET;
  849|      0|      si4->sin_port = htons(port);
  850|      0|      sizeof_sa = sizeof(struct sockaddr_in);
  851|      0|    }
  852|      0|  }
  853|      0|#ifdef IP_BIND_ADDRESS_NO_PORT
  854|      0|  (void)setsockopt(sockfd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &on, sizeof(on));
  855|      0|#endif
  856|      0|  for(;;) {
  857|      0|    if(bind(sockfd, sock, sizeof_sa) >= 0) {
  ------------------
  |  Branch (857:8): [True: 0, False: 0]
  ------------------
  858|       |      /* we succeeded to bind */
  859|      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]
  |  |  ------------------
  ------------------
  860|      0|      conn->bits.bound = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  861|      0|      return CURLE_OK;
  862|      0|    }
  863|       |
  864|      0|    if(--portnum > 0) {
  ------------------
  |  Branch (864:8): [True: 0, False: 0]
  ------------------
  865|      0|      port++; /* try next port */
  866|      0|      if(port == 0)
  ------------------
  |  Branch (866:10): [True: 0, False: 0]
  ------------------
  867|      0|        break;
  868|      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]
  |  |  ------------------
  ------------------
  869|       |      /* We reuse/clobber the port variable here below */
  870|      0|      if(sock->sa_family == AF_INET)
  ------------------
  |  Branch (870:10): [True: 0, False: 0]
  ------------------
  871|      0|        si4->sin_port = htons(port);
  872|      0|#ifdef USE_IPV6
  873|      0|      else
  874|      0|        si6->sin6_port = htons(port);
  875|      0|#endif
  876|      0|    }
  877|      0|    else
  878|      0|      break;
  879|      0|  }
  880|      0|  {
  881|      0|    char buffer[STRERROR_LEN];
  882|      0|    data->state.os_errno = sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  883|      0|    failf(data, "bind failed with errno %d: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  884|      0|          sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
  885|      0|  }
  886|       |
  887|      0|  return CURLE_INTERFACE_FAILED;
  888|      0|}
cf-socket.c:cf_socket_shutdown:
 1048|  3.04k|{
 1049|  3.04k|  if(cf->connected) {
  ------------------
  |  Branch (1049:6): [True: 3.04k, False: 0]
  ------------------
 1050|  3.04k|    struct cf_socket_ctx *ctx = cf->ctx;
 1051|       |
 1052|  3.04k|    CURL_TRC_CF(data, cf, "cf_socket_shutdown, fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((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.04k|   (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.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 1053|       |    /* On TCP, and when the socket looks well and non-blocking mode
 1054|       |     * can be enabled, receive dangling bytes before close to avoid
 1055|       |     * entering RST states unnecessarily. */
 1056|  3.04k|    if(ctx->sock != CURL_SOCKET_BAD &&
  ------------------
  |  |  147|  6.08k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1056:8): [True: 3.04k, False: 0]
  ------------------
 1057|  3.04k|       ctx->transport == TRNSPRT_TCP &&
  ------------------
  |  |  237|  6.08k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (1057:8): [True: 3.04k, False: 0]
  ------------------
 1058|  3.04k|       (curlx_nonblock(ctx->sock, TRUE) >= 0)) {
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  |  Branch (1058:8): [True: 3.04k, False: 0]
  ------------------
 1059|  3.04k|      unsigned char buf[1024];
 1060|  3.04k|      (void)sread(ctx->sock, buf, sizeof(buf));
  ------------------
  |  |  896|  3.04k|#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
  |  |  897|  3.04k|                                     (RECV_TYPE_ARG2)(y), \
  |  |  898|  3.04k|                                     (RECV_TYPE_ARG3)(z), \
  |  |  899|  3.04k|                                     (RECV_TYPE_ARG4)(0))
  ------------------
 1061|  3.04k|    }
 1062|  3.04k|  }
 1063|       |  *done = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1064|  3.04k|  return CURLE_OK;
 1065|  3.04k|}
cf-socket.c:cf_socket_send:
 1565|    376|{
 1566|    376|  struct cf_socket_ctx *ctx = cf->ctx;
 1567|    376|  curl_socket_t fdsave;
 1568|    376|  ssize_t rv;
 1569|    376|  CURLcode result = CURLE_OK;
 1570|    376|  VERBOSE(size_t orig_len = len);
  ------------------
  |  | 1563|    376|#define VERBOSE(x) x
  ------------------
 1571|       |
 1572|    376|  (void)eos;
 1573|    376|  *pnwritten = 0;
 1574|    376|  fdsave = cf->conn->sock[cf->sockindex];
 1575|    376|  cf->conn->sock[cf->sockindex] = ctx->sock;
 1576|       |
 1577|    376|#ifdef DEBUGBUILD
 1578|       |  /* simulate network blocking/partial writes */
 1579|    376|  if(ctx->wblock_percent > 0) {
  ------------------
  |  Branch (1579:6): [True: 0, False: 376]
  ------------------
 1580|      0|    unsigned char c = 0;
 1581|      0|    Curl_rand_bytes(data, FALSE, &c, 1);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1582|      0|    if(c >= ((100 - ctx->wblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (1582:8): [True: 0, False: 0]
  ------------------
 1583|      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]
  |  |  ------------------
  ------------------
 1584|      0|      cf->conn->sock[cf->sockindex] = fdsave;
 1585|      0|      return CURLE_AGAIN;
 1586|      0|    }
 1587|      0|  }
 1588|    376|  if(cf->cft != &Curl_cft_udp && ctx->wpartial_percent > 0 && len > 8) {
  ------------------
  |  Branch (1588:6): [True: 376, False: 0]
  |  Branch (1588:34): [True: 0, False: 376]
  |  Branch (1588:63): [True: 0, False: 0]
  ------------------
 1589|      0|    len = len * ctx->wpartial_percent / 100;
 1590|      0|    if(!len)
  ------------------
  |  Branch (1590:8): [True: 0, False: 0]
  ------------------
 1591|      0|      len = 1;
 1592|      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]
  |  |  ------------------
  ------------------
 1593|      0|                orig_len, len);
 1594|      0|  }
 1595|    376|#endif
 1596|       |
 1597|       |#if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) /* Linux */
 1598|       |  if(cf->conn->bits.tcp_fastopen) {
 1599|       |    rv = sendto(ctx->sock, buf, len, MSG_FASTOPEN,
 1600|       |                &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
 1601|       |    cf->conn->bits.tcp_fastopen = FALSE;
 1602|       |  }
 1603|       |  else
 1604|       |#endif
 1605|    376|    rv = swrite(ctx->sock, buf, len);
  ------------------
  |  |  918|    376|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|    376|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|    376|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|    376|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|    376|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
 1606|       |
 1607|    376|  if(!curlx_sztouz(rv, pnwritten)) {
  ------------------
  |  Branch (1607:6): [True: 0, False: 376]
  ------------------
 1608|      0|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1609|      0|    if(SOCK_EAGAIN(sockerr)
  ------------------
  |  | 1092|      0|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1083|      0|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1092:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1610|      0|#ifndef USE_WINSOCK
 1611|      0|       || (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)
  ------------------
  |  | 1075|      0|#define SOCKEINTR         EINTR
  ------------------
                     || (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)
  ------------------
  |  | 1074|      0|#define SOCKEINPROGRESS   EINPROGRESS
  ------------------
  |  Branch (1611:11): [True: 0, False: 0]
  |  Branch (1611:37): [True: 0, False: 0]
  ------------------
 1612|      0|#endif
 1613|      0|      ) {
 1614|      0|      result = CURLE_AGAIN;  /* EWOULDBLOCK */
 1615|      0|    }
 1616|      0|    else {
 1617|      0|      char buffer[STRERROR_LEN];
 1618|      0|      failf(data, "Send failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1619|      0|            curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1620|      0|      data->state.os_errno = sockerr;
 1621|      0|      result = CURLE_SEND_ERROR;
 1622|      0|    }
 1623|      0|  }
 1624|       |
 1625|       |#ifdef USE_WINSOCK
 1626|       |  if(!result)
 1627|       |    win_update_sndbuf_size(data, ctx);
 1628|       |#endif
 1629|       |
 1630|    376|  CURL_TRC_CF(data, cf, "send(len=%zu) -> %d, %zu",
  ------------------
  |  |  153|    376|  do {                                          \
  |  |  154|    376|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    376|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    752|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 376, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 376, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    752|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 376, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    376|    ((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|    376|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    376|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 376, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 376]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    376|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    376|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 376]
  |  |  ------------------
  ------------------
 1631|    376|              orig_len, (int)result, *pnwritten);
 1632|    376|  cf->conn->sock[cf->sockindex] = fdsave;
 1633|    376|  return result;
 1634|    376|}
cf-socket.c:cf_socket_recv:
 1638|  4.11k|{
 1639|  4.11k|  struct cf_socket_ctx *ctx = cf->ctx;
 1640|  4.11k|  CURLcode result = CURLE_OK;
 1641|  4.11k|  ssize_t rv;
 1642|       |
 1643|  4.11k|  *pnread = 0;
 1644|  4.11k|#ifdef DEBUGBUILD
 1645|       |  /* simulate network blocking/partial reads */
 1646|  4.11k|  if(cf->cft != &Curl_cft_udp && ctx->rblock_percent > 0) {
  ------------------
  |  Branch (1646:6): [True: 4.11k, False: 0]
  |  Branch (1646:34): [True: 0, False: 4.11k]
  ------------------
 1647|      0|    unsigned char c = 0;
 1648|      0|    Curl_rand(data, &c, 1);
  ------------------
  |  |   33|      0|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  ------------------
 1649|      0|    if(c >= ((100 - ctx->rblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (1649:8): [True: 0, False: 0]
  ------------------
 1650|      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]
  |  |  ------------------
  ------------------
 1651|      0|      return CURLE_AGAIN;
 1652|      0|    }
 1653|      0|  }
 1654|  4.11k|  if(cf->cft != &Curl_cft_udp && ctx->recv_max && ctx->recv_max < len) {
  ------------------
  |  Branch (1654:6): [True: 4.11k, False: 0]
  |  Branch (1654:34): [True: 0, False: 4.11k]
  |  Branch (1654:51): [True: 0, False: 0]
  ------------------
 1655|      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]
  |  |  ------------------
  ------------------
 1656|      0|                len, ctx->recv_max);
 1657|      0|    len = ctx->recv_max;
 1658|      0|  }
 1659|  4.11k|#endif
 1660|       |
 1661|  4.11k|  rv = sread(ctx->sock, buf, len);
  ------------------
  |  |  896|  4.11k|#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
  |  |  897|  4.11k|                                     (RECV_TYPE_ARG2)(y), \
  |  |  898|  4.11k|                                     (RECV_TYPE_ARG3)(z), \
  |  |  899|  4.11k|                                     (RECV_TYPE_ARG4)(0))
  ------------------
 1662|       |
 1663|  4.11k|  if(!curlx_sztouz(rv, pnread)) {
  ------------------
  |  Branch (1663:6): [True: 0, False: 4.11k]
  ------------------
 1664|      0|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1665|      0|    if(SOCK_EAGAIN(sockerr)
  ------------------
  |  | 1092|      0|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1083|      0|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1092:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1666|      0|#ifndef USE_WINSOCK
 1667|      0|       || (sockerr == SOCKEINTR)
  ------------------
  |  | 1075|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (1667:11): [True: 0, False: 0]
  ------------------
 1668|      0|#endif
 1669|      0|      ) {
 1670|      0|      result = CURLE_AGAIN;  /* EWOULDBLOCK */
 1671|      0|    }
 1672|      0|    else {
 1673|      0|      char buffer[STRERROR_LEN];
 1674|      0|      failf(data, "Recv failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1675|      0|            curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1676|      0|      data->state.os_errno = sockerr;
 1677|      0|      result = CURLE_RECV_ERROR;
 1678|      0|    }
 1679|      0|  }
 1680|       |
 1681|  4.11k|  CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, %zu", len, (int)result, *pnread);
  ------------------
  |  |  153|  4.11k|  do {                                          \
  |  |  154|  4.11k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  4.11k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  8.22k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 4.11k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 4.11k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  8.22k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 4.11k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  4.11k|    ((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.11k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  4.11k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 4.11k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 4.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.11k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.11k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.11k]
  |  |  ------------------
  ------------------
 1682|  4.11k|  if(!result && !ctx->got_first_byte) {
  ------------------
  |  Branch (1682:6): [True: 4.11k, False: 0]
  |  Branch (1682:17): [True: 2.91k, False: 1.19k]
  ------------------
 1683|  2.91k|    ctx->first_byte_at = *Curl_pgrs_now(data);
 1684|       |    ctx->got_first_byte = TRUE;
  ------------------
  |  |  997|  2.91k|#define TRUE true
  ------------------
 1685|  2.91k|  }
 1686|  4.11k|  return result;
 1687|  4.11k|}
cf-socket.c:cf_socket_cntrl:
 1716|  9.12k|{
 1717|  9.12k|  struct cf_socket_ctx *ctx = cf->ctx;
 1718|       |
 1719|  9.12k|  (void)arg1;
 1720|  9.12k|  (void)arg2;
 1721|  9.12k|  switch(event) {
  ------------------
  |  Branch (1721:10): [True: 6.08k, False: 3.04k]
  ------------------
 1722|  3.04k|  case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  121|  3.04k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (1722:3): [True: 3.04k, False: 6.08k]
  ------------------
 1723|  3.04k|    cf_socket_active(cf, data);
 1724|  3.04k|    cf_socket_update_data(cf, data);
 1725|  3.04k|    break;
 1726|      0|  case CF_CTRL_DATA_SETUP:
  ------------------
  |  |  115|      0|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  |  Branch (1726:3): [True: 0, False: 9.12k]
  ------------------
 1727|      0|    cf_socket_update_data(cf, data);
 1728|      0|    break;
 1729|      0|  case CF_CTRL_FORGET_SOCKET:
  ------------------
  |  |  122|      0|#define CF_CTRL_FORGET_SOCKET    (256 + 1) /* 0          NULL     ignored */
  ------------------
  |  Branch (1729:3): [True: 0, False: 9.12k]
  ------------------
 1730|      0|    ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1731|      0|    break;
 1732|  3.04k|  case CF_CTRL_REPORT_STATS:
  ------------------
  |  |  124|  3.04k|#define CF_CTRL_REPORT_STATS     (256 + 3) /* 0          NULL     ignored */
  ------------------
  |  Branch (1732:3): [True: 3.04k, False: 6.08k]
  ------------------
 1733|  3.04k|    if(cf->connected && !ctx->stats_reported) {
  ------------------
  |  Branch (1733:8): [True: 3.04k, False: 0]
  |  Branch (1733:25): [True: 3.04k, False: 0]
  ------------------
 1734|  3.04k|      struct curltime *ts = NULL;
 1735|  3.04k|      switch(ctx->transport) {
 1736|      0|      case TRNSPRT_UDP:
  ------------------
  |  |  238|      0|#define TRNSPRT_UDP  4
  ------------------
  |  Branch (1736:7): [True: 0, False: 3.04k]
  ------------------
 1737|      0|      case TRNSPRT_QUIC:
  ------------------
  |  |  239|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (1737:7): [True: 0, False: 3.04k]
  ------------------
 1738|       |        /* Since UDP connected sockets work different from TCP, we use the
 1739|       |         * time of the first byte from the peer as the "connect" time. */
 1740|      0|        if(ctx->got_first_byte)
  ------------------
  |  Branch (1740:12): [True: 0, False: 0]
  ------------------
 1741|      0|          ts = &ctx->first_byte_at;
 1742|      0|        break;
 1743|  3.04k|      default:
  ------------------
  |  Branch (1743:7): [True: 3.04k, False: 0]
  ------------------
 1744|  3.04k|        ts = &ctx->connected_at;
 1745|  3.04k|        break;
 1746|  3.04k|      }
 1747|  3.04k|      if(ts) {
  ------------------
  |  Branch (1747:10): [True: 3.04k, False: 0]
  ------------------
 1748|  3.04k|        Curl_pgrsTimeWas(data, TIMER_CONNECT, *ts);
 1749|  3.04k|        ctx->stats_reported = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1750|  3.04k|      }
 1751|  3.04k|    }
 1752|  9.12k|  }
 1753|  9.12k|  return CURLE_OK;
 1754|  9.12k|}
cf-socket.c:cf_socket_active:
 1700|  3.04k|{
 1701|  3.04k|  struct cf_socket_ctx *ctx = cf->ctx;
 1702|       |
 1703|       |  /* use this socket from now on */
 1704|  3.04k|  cf->conn->sock[cf->sockindex] = ctx->sock;
 1705|  3.04k|  set_local_ip(cf, data);
 1706|  3.04k|#ifdef USE_IPV6
 1707|  3.04k|  if(cf->sockindex == FIRSTSOCKET)
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1707:6): [True: 3.04k, False: 0]
  ------------------
 1708|  3.04k|    cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6);
 1709|  3.04k|#endif
 1710|       |  ctx->active = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1711|  3.04k|}
cf-socket.c:cf_socket_update_data:
 1691|  3.04k|{
 1692|       |  /* Update the IP info held in the transfer, if we have that. */
 1693|  3.04k|  if(cf->connected && (cf->sockindex == FIRSTSOCKET)) {
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1693:6): [True: 3.04k, False: 0]
  |  Branch (1693:23): [True: 3.04k, False: 0]
  ------------------
 1694|  3.04k|    struct cf_socket_ctx *ctx = cf->ctx;
 1695|  3.04k|    data->info.primary = ctx->ip;
 1696|  3.04k|  }
 1697|  3.04k|}
cf-socket.c:cf_socket_query:
 1796|  6.08k|{
 1797|  6.08k|  struct cf_socket_ctx *ctx = cf->ctx;
 1798|       |
 1799|  6.08k|  switch(query) {
 1800|      0|  case CF_QUERY_SOCKET:
  ------------------
  |  |  169|      0|#define CF_QUERY_SOCKET             3  /* -          curl_socket_t */
  ------------------
  |  Branch (1800:3): [True: 0, False: 6.08k]
  ------------------
 1801|      0|    DEBUGASSERT(pres2);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1801:5): [True: 0, False: 0]
  |  Branch (1801:5): [True: 0, False: 0]
  ------------------
 1802|      0|    *((curl_socket_t *)pres2) = ctx->sock;
 1803|      0|    return CURLE_OK;
 1804|      0|  case CF_QUERY_TRANSPORT:
  ------------------
  |  |  181|      0|#define CF_QUERY_TRANSPORT         14  /* TRNSPRT_*  - * */
  ------------------
  |  Branch (1804:3): [True: 0, False: 6.08k]
  ------------------
 1805|      0|    DEBUGASSERT(pres1);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1805:5): [True: 0, False: 0]
  |  Branch (1805:5): [True: 0, False: 0]
  ------------------
 1806|      0|    *pres1 = ctx->transport;
 1807|      0|    return CURLE_OK;
 1808|      0|  case CF_QUERY_REMOTE_ADDR:
  ------------------
  |  |  177|      0|#define CF_QUERY_REMOTE_ADDR       10  /* -          `Curl_sockaddr_ex *` */
  ------------------
  |  Branch (1808:3): [True: 0, False: 6.08k]
  ------------------
 1809|      0|    DEBUGASSERT(pres2);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1809:5): [True: 0, False: 0]
  |  Branch (1809:5): [True: 0, False: 0]
  ------------------
 1810|      0|    *((const struct Curl_sockaddr_ex **)pres2) = cf->connected ?
  ------------------
  |  Branch (1810:50): [True: 0, False: 0]
  ------------------
 1811|      0|                                                 &ctx->addr : NULL;
 1812|      0|    return CURLE_OK;
 1813|      0|  case CF_QUERY_CONNECT_REPLY_MS:
  ------------------
  |  |  168|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (1813:3): [True: 0, False: 6.08k]
  ------------------
 1814|      0|    if(ctx->got_first_byte) {
  ------------------
  |  Branch (1814:8): [True: 0, False: 0]
  ------------------
 1815|      0|      timediff_t ms = curlx_ptimediff_ms(&ctx->first_byte_at,
 1816|      0|                                         &ctx->started_at);
 1817|      0|      *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
  ------------------
  |  Branch (1817:16): [True: 0, False: 0]
  ------------------
 1818|      0|    }
 1819|      0|    else
 1820|      0|      *pres1 = -1;
 1821|      0|    return CURLE_OK;
 1822|  3.04k|  case CF_QUERY_IP_INFO:
  ------------------
  |  |  173|  3.04k|#define CF_QUERY_IP_INFO            8  /* TRUE/FALSE struct ip_quadruple */
  ------------------
  |  Branch (1822:3): [True: 3.04k, False: 3.04k]
  ------------------
 1823|  3.04k|#ifdef USE_IPV6
 1824|  3.04k|    *pres1 = (ctx->addr.family == AF_INET6);
 1825|       |#else
 1826|       |    *pres1 = FALSE;
 1827|       |#endif
 1828|  3.04k|    *(struct ip_quadruple *)pres2 = ctx->ip;
 1829|  3.04k|    return CURLE_OK;
 1830|      0|  case CF_QUERY_REALLY_CONNECTED:
  ------------------
  |  |  183|      0|#define CF_QUERY_REALLY_CONNECTED  16  /* TRUE/FALSE - */
  ------------------
  |  Branch (1830:3): [True: 0, False: 6.08k]
  ------------------
 1831|      0|    if(cf->cft != &Curl_cft_udp)
  ------------------
  |  Branch (1831:8): [True: 0, False: 0]
  ------------------
 1832|      0|      *pres1 = cf->connected;
 1833|      0|    else
 1834|      0|      *pres1 = ctx->got_first_byte;
 1835|      0|    return CURLE_OK;
 1836|  3.04k|  default:
  ------------------
  |  Branch (1836:3): [True: 3.04k, False: 3.04k]
  ------------------
 1837|  3.04k|    break;
 1838|  6.08k|  }
 1839|  3.04k|  return cf->next ?
  ------------------
  |  Branch (1839:10): [True: 0, False: 3.04k]
  ------------------
 1840|      0|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 1841|  3.04k|    CURLE_UNKNOWN_OPTION;
 1842|  6.08k|}
cf-socket.c:cf_socket_ctx_init:
  998|  3.04k|{
  999|  3.04k|  memset(ctx, 0, sizeof(*ctx));
 1000|  3.04k|  Curl_peer_link(&ctx->peer, peer);
 1001|  3.04k|  ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1002|  3.04k|  ctx->transport = transport;
 1003|  3.04k|  ctx->addr = *addr;
 1004|       |
 1005|  3.04k|#ifdef DEBUGBUILD
 1006|  3.04k|  {
 1007|  3.04k|    const char *p = getenv("CURL_DBG_SOCK_WBLOCK");
 1008|  3.04k|    if(p) {
  ------------------
  |  Branch (1008:8): [True: 0, False: 3.04k]
  ------------------
 1009|      0|      curl_off_t l;
 1010|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (1010:10): [True: 0, False: 0]
  ------------------
 1011|      0|        ctx->wblock_percent = (int)l;
 1012|      0|    }
 1013|  3.04k|    p = getenv("CURL_DBG_SOCK_WPARTIAL");
 1014|  3.04k|    if(p) {
  ------------------
  |  Branch (1014:8): [True: 0, False: 3.04k]
  ------------------
 1015|      0|      curl_off_t l;
 1016|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (1016:10): [True: 0, False: 0]
  ------------------
 1017|      0|        ctx->wpartial_percent = (int)l;
 1018|      0|    }
 1019|  3.04k|    p = getenv("CURL_DBG_SOCK_RBLOCK");
 1020|  3.04k|    if(p) {
  ------------------
  |  Branch (1020:8): [True: 0, False: 3.04k]
  ------------------
 1021|      0|      curl_off_t l;
 1022|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (1022:10): [True: 0, False: 0]
  ------------------
 1023|      0|        ctx->rblock_percent = (int)l;
 1024|      0|    }
 1025|  3.04k|    p = getenv("CURL_DBG_SOCK_RMAX");
 1026|  3.04k|    if(p) {
  ------------------
  |  Branch (1026:8): [True: 0, False: 3.04k]
  ------------------
 1027|      0|      curl_off_t l;
 1028|      0|      if(!curlx_str_number(&p, &l, CURL_OFF_T_MAX))
  ------------------
  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (1028:10): [True: 0, False: 0]
  ------------------
 1029|      0|        ctx->recv_max = (size_t)l;
 1030|      0|    }
 1031|  3.04k|  }
 1032|  3.04k|#endif
 1033|       |
 1034|  3.04k|  return CURLE_OK;
 1035|  3.04k|}
cf-socket.c:cf_socket_ctx_free:
 1038|  3.04k|{
 1039|  3.04k|  if(ctx) {
  ------------------
  |  Branch (1039:6): [True: 3.04k, False: 0]
  ------------------
 1040|  3.04k|    Curl_peer_unlink(&ctx->peer);
 1041|  3.04k|    curlx_free(ctx);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1042|  3.04k|  }
 1043|  3.04k|}
cf-socket.c:set_local_ip:
 1085|  6.08k|{
 1086|  6.08k|  struct cf_socket_ctx *ctx = cf->ctx;
 1087|  6.08k|  ctx->ip.local_ip[0] = 0;
 1088|  6.08k|  ctx->ip.local_port = 0;
 1089|       |
 1090|  6.08k|#ifdef HAVE_GETSOCKNAME
 1091|  6.08k|  if((ctx->sock != CURL_SOCKET_BAD) &&
  ------------------
  |  |  147|  6.08k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1091:6): [True: 6.08k, False: 0]
  ------------------
 1092|  6.08k|     !(data->conn->scheme->protocol & CURLPROTO_TFTP)) {
  ------------------
  |  | 1099|  6.08k|#define CURLPROTO_TFTP    (1L << 11)
  ------------------
  |  Branch (1092:6): [True: 6.08k, False: 0]
  ------------------
 1093|       |    /* TFTP does not connect, so it cannot get the IP like this */
 1094|  6.08k|    struct Curl_sockaddr_storage ssloc;
 1095|  6.08k|    curl_socklen_t slen = sizeof(struct Curl_sockaddr_storage);
 1096|       |
 1097|  6.08k|    memset(&ssloc, 0, sizeof(ssloc));
 1098|  6.08k|    if(getsockname(ctx->sock, (struct sockaddr *)&ssloc, &slen)) {
  ------------------
  |  Branch (1098:8): [True: 0, False: 6.08k]
  ------------------
 1099|      0|      VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
 1100|      0|      VERBOSE(int sockerr = SOCKERRNO);
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
 1101|      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]
  |  |  ------------------
  ------------------
 1102|      0|            sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1103|      0|    }
 1104|  6.08k|    else {
 1105|  6.08k|      CURLcode result = sockaddr2string((struct sockaddr *)&ssloc, slen,
 1106|  6.08k|                                        ctx->ip.local_ip, &ctx->ip.local_port);
 1107|  6.08k|      if(result)
  ------------------
  |  Branch (1107:10): [True: 0, False: 6.08k]
  ------------------
 1108|      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]
  |  |  ------------------
  ------------------
 1109|  6.08k|    }
 1110|  6.08k|  }
 1111|       |#else
 1112|       |  (void)data;
 1113|       |#endif
 1114|  6.08k|}

Curl_cf_def_query:
  123|  12.1k|{
  124|  12.1k|  return cf->next ?
  ------------------
  |  Branch (124:10): [True: 9.12k, False: 3.04k]
  ------------------
  125|  9.12k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  126|  12.1k|    CURLE_UNKNOWN_OPTION;
  127|  12.1k|}
Curl_conn_trc_filters:
  132|  12.1k|{
  133|  12.1k|  if(CURL_TRC_M_is_verbose(data) && data->conn) {
  ------------------
  |  |  135|  12.1k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  ------------------
  |  |  |  |  329|  24.3k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  24.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 12.1k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 12.1k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  24.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 12.1k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  12.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|  24.3k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  12.1k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (133:37): [True: 0, False: 0]
  ------------------
  134|      0|    struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
  135|       |
  136|      0|    if(cf) {
  ------------------
  |  Branch (136:8): [True: 0, False: 0]
  ------------------
  137|      0|      char msg[256], *buf;
  138|      0|      int blen, n;
  139|       |
  140|      0|      buf = msg;
  141|      0|      blen = sizeof(msg) - 1;
  142|      0|      n = curl_msnprintf(buf, blen, "%s [%d]", info, sockindex);
  143|      0|      buf += n;
  144|      0|      blen -= n;
  145|      0|      for(; cf && blen; cf = cf->next) {
  ------------------
  |  Branch (145:13): [True: 0, False: 0]
  |  Branch (145:19): [True: 0, False: 0]
  ------------------
  146|      0|        n = curl_msnprintf(buf, blen, "[%s%s]",
  147|      0|                           cf->connected ? "" : "!", cf->cft->name);
  ------------------
  |  Branch (147:28): [True: 0, False: 0]
  ------------------
  148|      0|        buf += n;
  149|      0|        blen -= n;
  150|      0|      }
  151|      0|      CURL_TRC_M(data, "%s%s", msg, blen ? "" : "...");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  152|      0|    }
  153|      0|    else
  154|      0|      CURL_TRC_M(data, "%s [%d][-]", info, sockindex);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  155|      0|  }
  156|  12.1k|}
Curl_conn_cf_discard_chain:
  161|  12.1k|{
  162|  12.1k|  struct Curl_cfilter *cfn, *cf = *pcf;
  163|       |
  164|  12.1k|  if(cf) {
  ------------------
  |  Branch (164:6): [True: 3.04k, False: 9.12k]
  ------------------
  165|  3.04k|    *pcf = NULL;
  166|  6.08k|    while(cf) {
  ------------------
  |  Branch (166:11): [True: 3.04k, False: 3.04k]
  ------------------
  167|  3.04k|      cfn = cf->next;
  168|       |      /* prevent destroying filter to mess with its sub-chain, since
  169|       |       * we have the reference now and will call destroy on it.
  170|       |       */
  171|  3.04k|      cf->next = NULL;
  172|  3.04k|      cf->cft->destroy(cf, data);
  173|  3.04k|      curlx_free(cf);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  174|  3.04k|      cf = cfn;
  175|  3.04k|    }
  176|  3.04k|  }
  177|  12.1k|}
Curl_conn_cf_discard_all:
  181|  12.1k|{
  182|  12.1k|  conn->shutdown.start_ms[sockindex] = -1;
  183|  12.1k|  Curl_conn_cf_discard_chain(&conn->cfilter[sockindex], data);
  184|  12.1k|}
Curl_cf_recv:
  188|  4.11k|{
  189|  4.11k|  struct Curl_cfilter *cf;
  190|       |
  191|  4.11k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (191:3): [True: 0, False: 4.11k]
  |  Branch (191:3): [True: 4.11k, False: 0]
  ------------------
  192|  4.11k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (192:3): [True: 0, False: 4.11k]
  |  Branch (192:3): [True: 4.11k, False: 0]
  ------------------
  193|  4.11k|  cf = data->conn->cfilter[sockindex];
  194|  4.11k|  while(cf && !cf->connected)
  ------------------
  |  Branch (194:9): [True: 4.11k, False: 0]
  |  Branch (194:15): [True: 0, False: 4.11k]
  ------------------
  195|      0|    cf = cf->next;
  196|  4.11k|  if(cf)
  ------------------
  |  Branch (196:6): [True: 4.11k, False: 0]
  ------------------
  197|  4.11k|    return cf->cft->do_recv(cf, data, buf, len, pnread);
  198|      0|  failf(data, "recv: no filter connected");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  199|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (199:3): [Folded, False: 0]
  |  Branch (199:3): [Folded, False: 0]
  ------------------
  200|      0|  *pnread = 0;
  201|      0|  return CURLE_FAILED_INIT;
  202|      0|}
Curl_cf_send:
  207|    376|{
  208|    376|  struct Curl_cfilter *cf;
  209|       |
  210|    376|  DEBUGASSERT(data);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (210:3): [True: 0, False: 376]
  |  Branch (210:3): [True: 376, False: 0]
  ------------------
  211|    376|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (211:3): [True: 0, False: 376]
  |  Branch (211:3): [True: 376, False: 0]
  ------------------
  212|    376|  cf = data->conn->cfilter[sockindex];
  213|    376|  while(cf && !cf->connected)
  ------------------
  |  Branch (213:9): [True: 376, False: 0]
  |  Branch (213:15): [True: 0, False: 376]
  ------------------
  214|      0|    cf = cf->next;
  215|    376|  if(cf) {
  ------------------
  |  Branch (215:6): [True: 376, False: 0]
  ------------------
  216|    376|    return cf->cft->do_send(cf, data, buf, len, eos, pnwritten);
  217|    376|  }
  218|      0|  failf(data, "send: no filter connected");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  219|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (219:3): [Folded, False: 0]
  |  Branch (219:3): [Folded, False: 0]
  ------------------
  220|      0|  *pnwritten = 0;
  221|      0|  return CURLE_FAILED_INIT;
  222|      0|}
Curl_cf_create:
  286|  12.1k|{
  287|  12.1k|  struct Curl_cfilter *cf;
  288|  12.1k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  289|       |
  290|  12.1k|  DEBUGASSERT(cft);
  ------------------
  |  | 1027|  12.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (290:3): [True: 0, False: 12.1k]
  |  Branch (290:3): [True: 12.1k, False: 0]
  ------------------
  291|  12.1k|  cf = curlx_calloc(1, sizeof(*cf));
  ------------------
  |  | 1425|  12.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  292|  12.1k|  if(!cf)
  ------------------
  |  Branch (292:6): [True: 0, False: 12.1k]
  ------------------
  293|      0|    goto out;
  294|       |
  295|  12.1k|  cf->cft = cft;
  296|  12.1k|  cf->ctx = ctx;
  297|  12.1k|  result = CURLE_OK;
  298|  12.1k|out:
  299|  12.1k|  *pcf = cf;
  300|  12.1k|  return result;
  301|  12.1k|}
Curl_conn_cf_add:
  307|  6.08k|{
  308|  6.08k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  6.08k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (308:3): [True: 0, False: 6.08k]
  |  Branch (308:3): [True: 6.08k, False: 0]
  ------------------
  309|  6.08k|  DEBUGASSERT(!cf->conn);
  ------------------
  |  | 1027|  6.08k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (309:3): [True: 0, False: 6.08k]
  |  Branch (309:3): [True: 6.08k, False: 0]
  ------------------
  310|  6.08k|  DEBUGASSERT(!cf->next);
  ------------------
  |  | 1027|  6.08k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (310:3): [True: 0, False: 6.08k]
  |  Branch (310:3): [True: 6.08k, False: 0]
  ------------------
  311|       |
  312|  6.08k|  cf->next = conn->cfilter[sockindex];
  313|  6.08k|  cf->conn = conn;
  314|  6.08k|  cf->sockindex = sockindex;
  315|  6.08k|  conn->cfilter[sockindex] = cf;
  316|  6.08k|  CURL_TRC_CF(data, cf, "added");
  ------------------
  |  |  153|  6.08k|  do {                                          \
  |  |  154|  6.08k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  6.08k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  12.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 6.08k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 6.08k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  12.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 6.08k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  6.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|  6.08k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  6.08k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 6.08k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 6.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.08k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.08k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.08k]
  |  |  ------------------
  ------------------
  317|  6.08k|}
Curl_conn_cf_insert_after:
  321|  3.04k|{
  322|  3.04k|  struct Curl_cfilter *tail, **pnext;
  323|       |
  324|  3.04k|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (324:3): [True: 0, False: 3.04k]
  |  Branch (324:3): [True: 3.04k, False: 0]
  ------------------
  325|  3.04k|  DEBUGASSERT(cf_new);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (325:3): [True: 0, False: 3.04k]
  |  Branch (325:3): [True: 3.04k, False: 0]
  ------------------
  326|  3.04k|  DEBUGASSERT(!cf_new->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (326:3): [True: 0, False: 3.04k]
  |  Branch (326:3): [True: 3.04k, False: 0]
  ------------------
  327|       |
  328|  3.04k|  tail = cf_at->next;
  329|  3.04k|  cf_at->next = cf_new;
  330|  3.04k|  do {
  331|  3.04k|    cf_new->conn = cf_at->conn;
  332|  3.04k|    cf_new->sockindex = cf_at->sockindex;
  333|  3.04k|    pnext = &cf_new->next;
  334|  3.04k|    cf_new = cf_new->next;
  335|  3.04k|  } while(cf_new);
  ------------------
  |  Branch (335:11): [True: 0, False: 3.04k]
  ------------------
  336|  3.04k|  *pnext = tail;
  337|  3.04k|}
Curl_conn_cf_connect:
  366|  9.12k|{
  367|  9.12k|  if(cf)
  ------------------
  |  Branch (367:6): [True: 9.12k, False: 0]
  ------------------
  368|  9.12k|    return cf->cft->do_connect(cf, data, done);
  369|      0|  return CURLE_FAILED_INIT;
  370|  9.12k|}
Curl_conn_cntrl_update_info:
  421|  3.04k|{
  422|  3.04k|  cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
                cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  |  121|  3.04k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  423|  3.04k|}
Curl_conn_cntrl_report_stats:
  428|  3.04k|{
  429|  3.04k|  if((unsigned)sockindex < CURL_ARRAYSIZE(conn->cfilter))
  ------------------
  |  | 1251|  3.04k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (429:6): [True: 3.04k, False: 0]
  ------------------
  430|  3.04k|    (void)Curl_conn_cf_cntrl(conn->cfilter[sockindex], data, TRUE,
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  431|  3.04k|                             CF_CTRL_REPORT_STATS, 0, NULL);
  ------------------
  |  |  124|  3.04k|#define CF_CTRL_REPORT_STATS     (256 + 3) /* 0          NULL     ignored */
  ------------------
  432|  3.04k|}
Curl_conn_remove_setup_filters:
  436|  3.04k|{
  437|  3.04k|  struct Curl_cfilter **anchor = &data->conn->cfilter[sockindex];
  438|  15.2k|  while(*anchor) {
  ------------------
  |  Branch (438:9): [True: 12.1k, False: 3.04k]
  ------------------
  439|  12.1k|    struct Curl_cfilter *cf = *anchor;
  440|  12.1k|    if(cf->connected && (cf->cft->flags & CF_TYPE_SETUP)) {
  ------------------
  |  |  213|  12.1k|#define CF_TYPE_SETUP       (1 << 5)
  ------------------
  |  Branch (440:8): [True: 12.1k, False: 0]
  |  Branch (440:25): [True: 9.12k, False: 3.04k]
  ------------------
  441|  9.12k|      *anchor = cf->next;
  442|  9.12k|      cf->next = NULL;
  443|  9.12k|      CURL_TRC_CF(data, cf, "removing connected setup filter");
  ------------------
  |  |  153|  9.12k|  do {                                          \
  |  |  154|  9.12k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.12k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.12k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 9.12k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 9.12k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  9.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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.12k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  9.12k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 9.12k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 9.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.12k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.12k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.12k]
  |  |  ------------------
  ------------------
  444|  9.12k|      cf->cft->destroy(cf, data);
  445|  9.12k|      curlx_free(cf);
  ------------------
  |  | 1428|  9.12k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  446|  9.12k|    }
  447|  3.04k|    else
  448|  3.04k|      anchor = &cf->next;
  449|  12.1k|  }
  450|  3.04k|}
Curl_conn_is_connected:
  460|  23.9k|{
  461|  23.9k|  struct Curl_cfilter *cf;
  462|       |
  463|  23.9k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|  23.9k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 23.9k, False: 0]
  |  |  |  Branch (310:50): [True: 23.9k, False: 0]
  |  |  ------------------
  ------------------
  464|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  465|  23.9k|  cf = conn->cfilter[sockindex];
  466|  23.9k|  if(cf)
  ------------------
  |  Branch (466:6): [True: 20.9k, False: 3.04k]
  ------------------
  467|  20.9k|    return (bool)cf->connected;
  468|  3.04k|  else if(conn->scheme->flags & PROTOPT_NONETWORK)
  ------------------
  |  |  211|  3.04k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (468:11): [True: 0, False: 3.04k]
  ------------------
  469|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  470|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  471|  23.9k|}
Curl_conn_is_multiplex:
  564|  3.04k|{
  565|  3.04k|  struct Curl_cfilter *cf;
  566|       |
  567|  3.04k|  if(!conn || !CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|  3.04k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 3.04k, False: 0]
  |  |  |  Branch (310:50): [True: 3.04k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (567:6): [True: 0, False: 3.04k]
  ------------------
  568|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  569|  3.04k|  for(cf = conn->cfilter[sockindex]; cf; cf = cf->next) {
  ------------------
  |  Branch (569:38): [True: 3.04k, False: 0]
  ------------------
  570|  3.04k|    if(cf->cft->flags & CF_TYPE_MULTIPLEX)
  ------------------
  |  |  210|  3.04k|#define CF_TYPE_MULTIPLEX   (1 << 2)
  ------------------
  |  Branch (570:8): [True: 0, False: 3.04k]
  ------------------
  571|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  572|  3.04k|    if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  208|  3.04k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
                  if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  209|  3.04k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
  |  Branch (572:8): [True: 3.04k, False: 0]
  ------------------
  573|  3.04k|      return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  574|  3.04k|  }
  575|      0|  return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  576|  3.04k|}
Curl_socktype_for_transport:
  586|  3.04k|{
  587|  3.04k|  switch(transport) {
  588|  3.04k|  case TRNSPRT_TCP:
  ------------------
  |  |  237|  3.04k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (588:3): [True: 3.04k, False: 0]
  ------------------
  589|  3.04k|    return SOCK_STREAM;
  590|      0|  case TRNSPRT_UNIX:
  ------------------
  |  |  240|      0|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (590:3): [True: 0, False: 3.04k]
  ------------------
  591|      0|    return SOCK_STREAM;
  592|      0|  default: /* UDP and QUIC */
  ------------------
  |  Branch (592:3): [True: 0, False: 3.04k]
  ------------------
  593|       |    return SOCK_DGRAM;
  594|  3.04k|  }
  595|  3.04k|}
Curl_protocol_for_transport:
  598|  3.04k|{
  599|  3.04k|  switch(transport) {
  600|  3.04k|  case TRNSPRT_TCP:
  ------------------
  |  |  237|  3.04k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (600:3): [True: 3.04k, False: 0]
  ------------------
  601|  3.04k|    return IPPROTO_TCP;
  602|      0|  case TRNSPRT_UNIX:
  ------------------
  |  |  240|      0|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (602:3): [True: 0, False: 3.04k]
  ------------------
  603|      0|    return IPPROTO_IP;
  604|      0|  default: /* UDP and QUIC */
  ------------------
  |  Branch (604:3): [True: 0, False: 3.04k]
  ------------------
  605|       |    return IPPROTO_UDP;
  606|  3.04k|  }
  607|  3.04k|}
Curl_conn_cf_needs_flush:
  662|  6.08k|{
  663|  6.08k|  CURLcode result;
  664|  6.08k|  int pending = 0;
  665|  6.08k|  result = cf ? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH,
  ------------------
  |  |  172|  6.08k|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (665:12): [True: 6.08k, False: 0]
  ------------------
  666|  6.08k|                               &pending, NULL) : CURLE_UNKNOWN_OPTION;
  667|  6.08k|  return (result || !pending) ? FALSE : TRUE;
  ------------------
  |  | 1000|  6.08k|#define FALSE false
  ------------------
                return (result || !pending) ? FALSE : TRUE;
  ------------------
  |  |  997|  6.08k|#define TRUE true
  ------------------
  |  Branch (667:11): [True: 6.08k, False: 0]
  |  Branch (667:21): [True: 0, False: 0]
  ------------------
  668|  6.08k|}
Curl_conn_needs_flush:
  671|  9.00k|{
  672|  9.00k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|  9.00k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 6.08k, False: 2.91k]
  |  |  |  Branch (310:50): [True: 6.08k, False: 0]
  |  |  ------------------
  ------------------
  673|  2.91k|    return FALSE;
  ------------------
  |  | 1000|  2.91k|#define FALSE false
  ------------------
  674|  6.08k|  return Curl_conn_cf_needs_flush(data->conn->cfilter[sockindex], data);
  675|  9.00k|}
Curl_conn_cf_cntrl:
  809|  21.3k|{
  810|  21.3k|  CURLcode result = CURLE_OK;
  811|       |
  812|  48.6k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (812:9): [True: 27.3k, False: 21.3k]
  ------------------
  813|  27.3k|    if(cf->cft->cntrl == Curl_cf_def_cntrl)
  ------------------
  |  Branch (813:8): [True: 12.1k, False: 15.2k]
  ------------------
  814|  12.1k|      continue;
  815|  15.2k|    result = cf->cft->cntrl(cf, data, event, arg1, arg2);
  816|  15.2k|    if(!ignore_result && result)
  ------------------
  |  Branch (816:8): [True: 0, False: 15.2k]
  |  Branch (816:26): [True: 0, False: 0]
  ------------------
  817|      0|      break;
  818|  15.2k|  }
  819|  21.3k|  return result;
  820|  21.3k|}
Curl_conn_cf_get_socket:
  824|  3.04k|{
  825|  3.04k|  curl_socket_t sock;
  826|  3.04k|  if(cf && !cf->cft->query(cf, data, CF_QUERY_SOCKET, NULL, &sock))
  ------------------
  |  |  169|  3.04k|#define CF_QUERY_SOCKET             3  /* -          curl_socket_t */
  ------------------
  |  Branch (826:6): [True: 3.04k, False: 0]
  |  Branch (826:12): [True: 0, False: 3.04k]
  ------------------
  827|      0|    return sock;
  828|  3.04k|  return CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
  829|  3.04k|}
Curl_conn_cf_get_ip_info:
  865|  3.04k|{
  866|  3.04k|  CURLcode result = CURLE_UNKNOWN_OPTION;
  867|  3.04k|  if(cf) {
  ------------------
  |  Branch (867:6): [True: 3.04k, False: 0]
  ------------------
  868|  3.04k|    int ipv6 = 0;
  869|  3.04k|    result = cf->cft->query(cf, data, CF_QUERY_IP_INFO, &ipv6, ipquad);
  ------------------
  |  |  173|  3.04k|#define CF_QUERY_IP_INFO            8  /* TRUE/FALSE struct ip_quadruple */
  ------------------
  870|  3.04k|    *is_ipv6 = !!ipv6;
  871|  3.04k|  }
  872|  3.04k|  return result;
  873|  3.04k|}
Curl_conn_ev_data_setup:
  900|  3.04k|{
  901|  3.04k|  return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
                return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL);
  ------------------
  |  |  115|  3.04k|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  902|  3.04k|}
Curl_conn_ev_data_done:
  926|  3.04k|{
  927|  3.04k|  cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL);
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
                cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL);
  ------------------
  |  |  118|  3.04k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  928|  3.04k|}
Curl_conn_recv:
 1005|  4.11k|{
 1006|  4.11k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1006:3): [True: 0, False: 4.11k]
  |  Branch (1006:3): [True: 4.11k, False: 0]
  ------------------
 1007|  4.11k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1007:3): [True: 0, False: 4.11k]
  |  Branch (1007:3): [True: 4.11k, False: 0]
  ------------------
 1008|  4.11k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|  4.11k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 4.11k, False: 0]
  |  |  |  Branch (310:50): [True: 4.11k, False: 0]
  |  |  ------------------
  ------------------
 1009|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1010|  4.11k|  if(data && data->conn && data->conn->recv[sockindex])
  ------------------
  |  Branch (1010:6): [True: 4.11k, False: 0]
  |  Branch (1010:14): [True: 4.11k, False: 0]
  |  Branch (1010:28): [True: 4.11k, False: 0]
  ------------------
 1011|  4.11k|    return data->conn->recv[sockindex](data, sockindex, buf, len, pnread);
 1012|      0|  *pnread = 0;
 1013|      0|  return CURLE_FAILED_INIT;
 1014|  4.11k|}
Curl_conn_send:
 1019|    376|{
 1020|    376|  size_t write_len = len;
 1021|       |
 1022|    376|  DEBUGASSERT(data);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1022:3): [True: 0, False: 376]
  |  Branch (1022:3): [True: 376, False: 0]
  ------------------
 1023|    376|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1023:3): [True: 0, False: 376]
  |  Branch (1023:3): [True: 376, False: 0]
  ------------------
 1024|    376|  DEBUGASSERT(CONN_SOCK_IDX_VALID(sockindex));
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1024:3): [True: 0, False: 376]
  |  Branch (1024:3): [True: 0, False: 0]
  |  Branch (1024:3): [True: 376, False: 0]
  |  Branch (1024:3): [True: 376, False: 0]
  ------------------
 1025|    376|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|    376|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 376, False: 0]
  |  |  |  Branch (310:50): [True: 376, False: 0]
  |  |  ------------------
  ------------------
 1026|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1027|    376|#ifdef DEBUGBUILD
 1028|    376|  if(write_len) {
  ------------------
  |  Branch (1028:6): [True: 376, False: 0]
  ------------------
 1029|       |    /* Allow debug builds to override this logic to force short sends */
 1030|    376|    const char *p = getenv("CURL_SMALLSENDS");
 1031|    376|    if(p) {
  ------------------
  |  Branch (1031:8): [True: 0, False: 376]
  ------------------
 1032|      0|      curl_off_t altsize;
 1033|      0|      if(!curlx_str_number(&p, &altsize, write_len)) {
  ------------------
  |  Branch (1033:10): [True: 0, False: 0]
  ------------------
 1034|      0|        write_len = (size_t)altsize;
 1035|      0|        if(write_len != len)
  ------------------
  |  Branch (1035:12): [True: 0, False: 0]
  ------------------
 1036|      0|          eos = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1037|      0|      }
 1038|      0|    }
 1039|    376|  }
 1040|    376|#endif
 1041|    376|  if(data && data->conn && data->conn->send[sockindex])
  ------------------
  |  Branch (1041:6): [True: 376, False: 0]
  |  Branch (1041:14): [True: 376, False: 0]
  |  Branch (1041:28): [True: 376, False: 0]
  ------------------
 1042|    376|    return data->conn->send[sockindex](data, sockindex, buf, write_len, eos,
 1043|    376|                                       pnwritten);
 1044|      0|  *pnwritten = 0;
 1045|      0|  return CURLE_FAILED_INIT;
 1046|    376|}
cfilters.c:cf_cntrl_all:
  395|  9.12k|{
  396|  9.12k|  CURLcode result = CURLE_OK;
  397|  9.12k|  int i;
  398|       |
  399|  27.3k|  for(i = 0; i < (int)CURL_ARRAYSIZE(conn->cfilter); ++i) {
  ------------------
  |  | 1251|  27.3k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (399:14): [True: 18.2k, False: 9.12k]
  ------------------
  400|  18.2k|    result = Curl_conn_cf_cntrl(conn->cfilter[i], data, ignore_result,
  401|  18.2k|                                event, arg1, arg2);
  402|  18.2k|    if(!ignore_result && result)
  ------------------
  |  Branch (402:8): [True: 6.08k, False: 12.1k]
  |  Branch (402:26): [True: 0, False: 6.08k]
  ------------------
  403|      0|      break;
  404|  18.2k|  }
  405|  9.12k|  return result;
  406|  9.12k|}

Curl_cpool_init:
  108|  3.74k|{
  109|  3.74k|  Curl_hash_init(&cpool->dest2bundle, size, CURL_HASH_TYPE_BYTES,
  110|  3.74k|                 cpool_bundle_free_entry);
  111|       |
  112|  3.74k|  cpool->share = share;
  113|       |  cpool->initialized = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  114|  3.74k|}
Curl_cpool_destroy:
  231|  3.74k|{
  232|  3.74k|  if(cpool && cpool->initialized && admin) {
  ------------------
  |  Branch (232:6): [True: 3.74k, False: 0]
  |  Branch (232:15): [True: 3.74k, False: 0]
  |  Branch (232:37): [True: 3.74k, False: 0]
  ------------------
  233|  3.74k|    struct connectdata *conn;
  234|  3.74k|    struct Curl_sigpipe_ctx pipe_ctx;
  235|       |
  236|  3.74k|    CURL_TRC_M(admin, "%s[CPOOL] destroy, %zu connections",
  ------------------
  |  |  148|  3.74k|  do {                                   \
  |  |  149|  3.74k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.74k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  237|  3.74k|               cpool->share ? "[SHARE] " : "", cpool->num_conn);
  238|       |    /* Move all connections to the shutdown list */
  239|  3.74k|    sigpipe_init(&pipe_ctx);
  240|  3.74k|    CPOOL_LOCK(cpool, admin);
  ------------------
  |  |   42|  3.74k|  do {                                                                  \
  |  |   43|  3.74k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   44|  3.74k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.74k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.74k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  3.74k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  3.74k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  3.74k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|  3.74k|#define TRUE true
  |  |  ------------------
  |  |   49|  3.74k|    }                                                                   \
  |  |   50|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  |  Branch (240:5): [True: 0, False: 3.74k]
  |  Branch (240:5): [True: 3.74k, False: 0]
  ------------------
  241|  3.74k|    conn = cpool_get_first(cpool);
  242|  3.74k|    if(conn)
  ------------------
  |  Branch (242:8): [True: 0, False: 3.74k]
  ------------------
  243|      0|      sigpipe_apply(admin, &pipe_ctx);
  244|  3.74k|    while(conn) {
  ------------------
  |  Branch (244:11): [True: 0, False: 3.74k]
  ------------------
  245|      0|      cpool_remove_conn(cpool, conn);
  246|      0|      cpool_discard_conn(cpool, admin, conn, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  247|      0|      conn = cpool_get_first(cpool);
  248|      0|    }
  249|  3.74k|    CPOOL_UNLOCK(cpool, admin);
  ------------------
  |  |   53|  3.74k|  do {                                                                  \
  |  |   54|  3.74k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   55|  3.74k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  3.74k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|  3.74k|#define FALSE false
  |  |  ------------------
  |  |   57|  3.74k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.74k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.74k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  3.74k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|  3.74k|    }                                                                   \
  |  |   60|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  |  Branch (249:5): [True: 0, False: 3.74k]
  |  Branch (249:5): [True: 3.74k, False: 0]
  ------------------
  250|  3.74k|    sigpipe_restore(&pipe_ctx);
  251|  3.74k|    Curl_hash_destroy(&cpool->dest2bundle);
  252|  3.74k|  }
  253|  3.74k|}
Curl_cpool_get_instance:
  269|  3.04k|{
  270|  3.04k|  return cpool_get_instance(data);
  271|  3.04k|}
Curl_cpool_xfer_init:
  274|  3.74k|{
  275|  3.74k|  struct cpool *cpool = cpool_get_instance(data);
  276|       |
  277|  3.74k|  if(cpool) {
  ------------------
  |  Branch (277:6): [True: 3.74k, False: 0]
  ------------------
  278|  3.74k|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  3.74k|  do {                                                                  \
  |  |   43|  3.74k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   44|  3.74k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.74k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.74k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  3.74k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  3.74k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  3.74k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|  3.74k|#define TRUE true
  |  |  ------------------
  |  |   49|  3.74k|    }                                                                   \
  |  |   50|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  |  Branch (278:5): [True: 0, False: 3.74k]
  |  Branch (278:5): [True: 3.74k, False: 0]
  ------------------
  279|       |    /* the identifier inside the connection cache */
  280|  3.74k|    data->id = cpool->next_easy_id++;
  281|  3.74k|    if(cpool->next_easy_id == CURL_OFF_T_MAX)
  ------------------
  |  |  540|  3.74k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (281:8): [True: 0, False: 3.74k]
  ------------------
  282|      0|      cpool->next_easy_id = 0;
  283|  3.74k|    data->state.lastconnect_id = -1;
  284|       |
  285|  3.74k|    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  3.74k|  do {                                                                  \
  |  |   54|  3.74k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   55|  3.74k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  3.74k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|  3.74k|#define FALSE false
  |  |  ------------------
  |  |   57|  3.74k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.74k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.74k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  3.74k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|  3.74k|    }                                                                   \
  |  |   60|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  |  Branch (285:5): [True: 0, False: 3.74k]
  |  Branch (285:5): [True: 3.74k, False: 0]
  ------------------
  286|  3.74k|  }
  287|      0|  else {
  288|       |    /* We should not get here, but in a non-debug build, do something */
  289|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (289:5): [Folded, False: 0]
  |  Branch (289:5): [Folded, False: 0]
  ------------------
  290|      0|    data->id = 0;
  291|      0|    data->state.lastconnect_id = -1;
  292|      0|  }
  293|  3.74k|}
Curl_conn_close:
  431|  3.04k|{
  432|  3.04k|  struct cpool *cpool = cpool_get_instance(data);
  433|  3.04k|  cpool_conn_close(cpool, data, conn, aborted);
  434|  3.04k|}
Curl_cpool_check_limits:
  455|  3.04k|{
  456|  3.04k|  struct cpool *cpool = cpool_get_instance(data);
  457|  3.04k|  struct Curl_multi *multi = data->multi;
  458|  3.04k|  struct Curl_easy *admin;
  459|  3.04k|  struct cpool_bundle *bundle;
  460|  3.04k|  size_t dest_limit = 0;
  461|  3.04k|  size_t total_limit = 0;
  462|  3.04k|  size_t shutdowns;
  463|  3.04k|  int res = CPOOL_LIMIT_OK;
  ------------------
  |  |  103|  3.04k|#define CPOOL_LIMIT_OK     0
  ------------------
  464|       |
  465|  3.04k|  if(!cpool)
  ------------------
  |  Branch (465:6): [True: 0, False: 3.04k]
  ------------------
  466|      0|    return CPOOL_LIMIT_OK;
  ------------------
  |  |  103|      0|#define CPOOL_LIMIT_OK     0
  ------------------
  467|       |
  468|       |  /* multi determines the limits, no matter who owns the pool */
  469|  3.04k|  if(multi) {
  ------------------
  |  Branch (469:6): [True: 3.04k, False: 0]
  ------------------
  470|  3.04k|    dest_limit = multi->max_host_connections;
  471|  3.04k|    total_limit = multi->max_total_connections;
  472|  3.04k|  }
  473|       |
  474|  3.04k|  if(!dest_limit && !total_limit)
  ------------------
  |  Branch (474:6): [True: 3.04k, False: 0]
  |  Branch (474:21): [True: 3.04k, False: 0]
  ------------------
  475|  3.04k|    return CPOOL_LIMIT_OK;
  ------------------
  |  |  103|  3.04k|#define CPOOL_LIMIT_OK     0
  ------------------
  476|       |
  477|      0|  admin = Curl_get_admin(data);
  478|      0|  CPOOL_LOCK(cpool, admin);
  ------------------
  |  |   42|      0|  do {                                                                  \
  |  |   43|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|      0|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|      0|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|      0|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   49|      0|    }                                                                   \
  |  |   50|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (478:3): [True: 0, False: 0]
  |  Branch (478:3): [True: 0, False: 0]
  ------------------
  479|      0|  if(dest_limit) {
  ------------------
  |  Branch (479:6): [True: 0, False: 0]
  ------------------
  480|      0|    size_t live;
  481|       |
  482|      0|    bundle = cpool_find_bundle(cpool, conn->destination);
  483|      0|    live = bundle ? Curl_llist_count(&bundle->conns) : 0;
  ------------------
  |  Branch (483:12): [True: 0, False: 0]
  ------------------
  484|      0|    shutdowns =
  485|      0|      multi ? Curl_cshutdn_dest_count(&multi->cshutdn, conn->destination) : 0;
  ------------------
  |  Branch (485:7): [True: 0, False: 0]
  ------------------
  486|      0|    while((live + shutdowns) >= dest_limit) {
  ------------------
  |  Branch (486:11): [True: 0, False: 0]
  ------------------
  487|      0|      if(shutdowns) {
  ------------------
  |  Branch (487:10): [True: 0, False: 0]
  ------------------
  488|       |        /* close one connection in shutdown right away, if we can */
  489|      0|        if(!Curl_cshutdn_close_oldest(&multi->cshutdn, multi->admin,
  ------------------
  |  Branch (489:12): [True: 0, False: 0]
  ------------------
  490|      0|                                      conn->destination))
  491|      0|          break;
  492|      0|      }
  493|      0|      else if(!bundle)
  ------------------
  |  Branch (493:15): [True: 0, False: 0]
  ------------------
  494|      0|        break;
  495|      0|      else {
  496|      0|        struct connectdata *oldest_idle = NULL;
  497|       |        /* The bundle is full. Extract the oldest connection that may
  498|       |         * be removed now, if there is one. */
  499|      0|        oldest_idle = cpool_bundle_get_oldest_idle(bundle, pnow);
  500|      0|        if(!oldest_idle)
  ------------------
  |  Branch (500:12): [True: 0, False: 0]
  ------------------
  501|      0|          break;
  502|       |        /* disconnect the old conn and continue */
  503|      0|        CURL_TRC_M(admin, "Discarding 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]
  |  |  ------------------
  ------------------
  504|      0|                   " from %zu to reach destination limit of %zu",
  505|      0|                   oldest_idle->connection_id,
  506|      0|                   Curl_llist_count(&bundle->conns), dest_limit);
  507|      0|        cpool_evict_conn(cpool, admin, oldest_idle);
  508|       |
  509|       |        /* in case the bundle was destroyed in disconnect, look it up again */
  510|      0|        bundle = cpool_find_bundle(cpool, conn->destination);
  511|      0|        live = bundle ? Curl_llist_count(&bundle->conns) : 0;
  ------------------
  |  Branch (511:16): [True: 0, False: 0]
  ------------------
  512|      0|      }
  513|      0|      shutdowns = multi ?
  ------------------
  |  Branch (513:19): [True: 0, False: 0]
  ------------------
  514|      0|        Curl_cshutdn_dest_count(&multi->cshutdn, conn->destination) : 0;
  515|      0|    }
  516|      0|    if((live + shutdowns) >= dest_limit) {
  ------------------
  |  Branch (516:8): [True: 0, False: 0]
  ------------------
  517|      0|      res = CPOOL_LIMIT_DEST;
  ------------------
  |  |  104|      0|#define CPOOL_LIMIT_DEST   1
  ------------------
  518|      0|      goto out;
  519|      0|    }
  520|      0|  }
  521|       |
  522|      0|  if(total_limit) {
  ------------------
  |  Branch (522:6): [True: 0, False: 0]
  ------------------
  523|      0|    shutdowns = multi ? Curl_cshutdn_count(&multi->cshutdn) : 0;
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|    while((cpool->num_conn + shutdowns) >= total_limit) {
  ------------------
  |  Branch (524:11): [True: 0, False: 0]
  ------------------
  525|      0|      if(shutdowns) {
  ------------------
  |  Branch (525:10): [True: 0, False: 0]
  ------------------
  526|       |        /* close one connection in shutdown right away, if we can */
  527|      0|        if(!Curl_cshutdn_close_oldest(&multi->cshutdn, multi->admin, NULL))
  ------------------
  |  Branch (527:12): [True: 0, False: 0]
  ------------------
  528|      0|          break;
  529|      0|      }
  530|      0|      else {
  531|      0|        struct connectdata *oldest_idle =
  532|      0|          cpool_get_oldest_idle(cpool, pnow, 0);
  533|      0|        if(!oldest_idle)
  ------------------
  |  Branch (533:12): [True: 0, False: 0]
  ------------------
  534|      0|          break;
  535|       |        /* disconnect the old conn and continue */
  536|      0|        CURL_TRC_M(admin, "Discarding 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]
  |  |  ------------------
  ------------------
  537|      0|                   FMT_OFF_T " from %zu to reach total "
  538|      0|                   "limit of %zu",
  539|      0|                   oldest_idle->connection_id, cpool->num_conn, total_limit);
  540|      0|        cpool_evict_conn(cpool, admin, oldest_idle);
  541|      0|      }
  542|      0|      shutdowns = multi ? Curl_cshutdn_count(&multi->cshutdn) : 0;
  ------------------
  |  Branch (542:19): [True: 0, False: 0]
  ------------------
  543|      0|    }
  544|      0|    if((cpool->num_conn + shutdowns) >= total_limit) {
  ------------------
  |  Branch (544:8): [True: 0, False: 0]
  ------------------
  545|      0|      res = CPOOL_LIMIT_TOTAL;
  ------------------
  |  |  105|      0|#define CPOOL_LIMIT_TOTAL  2
  ------------------
  546|      0|      goto out;
  547|      0|    }
  548|      0|  }
  549|       |
  550|      0|out:
  551|      0|  CPOOL_UNLOCK(cpool, admin);
  ------------------
  |  |   53|      0|  do {                                                                  \
  |  |   54|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|      0|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|      0|#define FALSE false
  |  |  ------------------
  |  |   57|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|      0|    }                                                                   \
  |  |   60|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (551:3): [True: 0, False: 0]
  |  Branch (551:3): [True: 0, False: 0]
  ------------------
  552|      0|  return res;
  553|      0|}
Curl_cpool_add:
  558|  3.04k|{
  559|  3.04k|  CURLcode result = CURLE_OK;
  560|  3.04k|  struct cpool_bundle *bundle = NULL;
  561|  3.04k|  struct cpool *cpool = cpool_get_instance(data);
  562|  3.04k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (562:3): [True: 0, False: 3.04k]
  |  Branch (562:3): [True: 3.04k, False: 0]
  ------------------
  563|       |
  564|  3.04k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (564:3): [True: 0, False: 3.04k]
  |  Branch (564:3): [True: 3.04k, False: 0]
  ------------------
  565|  3.04k|  if(!cpool)
  ------------------
  |  Branch (565:6): [True: 0, False: 3.04k]
  ------------------
  566|      0|    return CURLE_FAILED_INIT;
  567|       |
  568|  3.04k|  conn->created = *pnow;
  569|  3.04k|  conn->shutdown.start_ms[FIRSTSOCKET] =
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  570|  3.04k|    conn->shutdown.start_ms[SECONDARYSOCKET] = -1;
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
  571|       |
  572|  3.04k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  3.04k|  do {                                                                  \
  |  |   43|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   44|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  3.04k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  3.04k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  3.04k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|  3.04k|#define TRUE true
  |  |  ------------------
  |  |   49|  3.04k|    }                                                                   \
  |  |   50|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (572:3): [True: 0, False: 3.04k]
  |  Branch (572:3): [True: 3.04k, False: 0]
  ------------------
  573|  3.04k|  bundle = cpool_find_bundle(cpool, conn->destination);
  574|  3.04k|  if(!bundle) {
  ------------------
  |  Branch (574:6): [True: 3.04k, False: 0]
  ------------------
  575|  3.04k|    bundle = cpool_add_bundle(cpool, conn->destination);
  576|  3.04k|    if(!bundle) {
  ------------------
  |  Branch (576:8): [True: 0, False: 3.04k]
  ------------------
  577|      0|      result = CURLE_OUT_OF_MEMORY;
  578|      0|      goto out;
  579|      0|    }
  580|  3.04k|  }
  581|       |
  582|  3.04k|  cpool_bundle_add(bundle, conn);
  583|  3.04k|  conn->connection_id = cpool->next_connection_id++;
  584|  3.04k|  cpool->num_conn++;
  585|  3.04k|  CURL_TRC_M(data, "[CPOOL] added connection %" FMT_OFF_T ". "
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  586|  3.04k|             "The cache now contains %zu members",
  587|  3.04k|             conn->connection_id, cpool->num_conn);
  588|  3.04k|out:
  589|  3.04k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  3.04k|  do {                                                                  \
  |  |   54|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   55|  3.04k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  3.04k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|  3.04k|#define FALSE false
  |  |  ------------------
  |  |   57|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  3.04k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|  3.04k|    }                                                                   \
  |  |   60|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (589:3): [True: 0, False: 3.04k]
  |  Branch (589:3): [True: 3.04k, False: 0]
  ------------------
  590|       |
  591|  3.04k|  return result;
  592|  3.04k|}
Curl_cpool_find:
  706|  3.04k|{
  707|  3.04k|  struct cpool *cpool = cpool_get_instance(data);
  708|  3.04k|  struct cpool_bundle *bundle;
  709|  3.04k|  struct Curl_llist_node *curr;
  710|  3.04k|  struct connectdata *conn;
  711|  3.04k|  bool found = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  712|       |
  713|  3.04k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (713:3): [True: 0, False: 3.04k]
  |  Branch (713:3): [True: 3.04k, False: 0]
  ------------------
  714|  3.04k|  DEBUGASSERT(conn_cb);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (714:3): [True: 0, False: 3.04k]
  |  Branch (714:3): [True: 3.04k, False: 0]
  ------------------
  715|  3.04k|  if(!cpool)
  ------------------
  |  Branch (715:6): [True: 0, False: 3.04k]
  ------------------
  716|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  717|       |
  718|  3.04k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  3.04k|  do {                                                                  \
  |  |   43|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   44|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  3.04k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  3.04k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  3.04k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|  3.04k|#define TRUE true
  |  |  ------------------
  |  |   49|  3.04k|    }                                                                   \
  |  |   50|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (718:3): [True: 0, False: 3.04k]
  |  Branch (718:3): [True: 3.04k, False: 0]
  ------------------
  719|  3.04k|  bundle = Curl_hash_pick(&cpool->dest2bundle,
  720|  3.04k|                          destination, strlen(destination) + 1);
  721|  3.04k|  if(bundle) {
  ------------------
  |  Branch (721:6): [True: 0, False: 3.04k]
  ------------------
  722|      0|    if(data->state.lastconnect_id >= 0) {
  ------------------
  |  Branch (722:8): [True: 0, False: 0]
  ------------------
  723|       |      /* Try to find the previously used connection in this bundle
  724|       |       * and if it still matches, use that one. This assures that
  725|       |       * an authentication involving several requests is using
  726|       |       * the same connection again. */
  727|      0|      curr = Curl_llist_head(&bundle->conns);
  728|      0|      while(curr) {
  ------------------
  |  Branch (728:13): [True: 0, False: 0]
  ------------------
  729|      0|        conn = Curl_node_elem(curr);
  730|      0|        curr = Curl_node_next(curr);
  731|      0|        if(data->state.lastconnect_id == conn->connection_id) {
  ------------------
  |  Branch (731:12): [True: 0, False: 0]
  ------------------
  732|      0|          if(conn_cb(conn, userdata))
  ------------------
  |  Branch (732:14): [True: 0, False: 0]
  ------------------
  733|      0|            found = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  734|      0|          break;
  735|      0|        }
  736|      0|      }
  737|      0|    }
  738|       |
  739|      0|    if(!found) {
  ------------------
  |  Branch (739:8): [True: 0, False: 0]
  ------------------
  740|      0|      curr = Curl_llist_head(&bundle->conns);
  741|      0|      while(curr) {
  ------------------
  |  Branch (741:13): [True: 0, False: 0]
  ------------------
  742|      0|        conn = Curl_node_elem(curr);
  743|      0|        curr = Curl_node_next(curr);
  744|       |        /* Already tried a matching connection above. No need to
  745|       |         * invoke callback again for this one. */
  746|      0|        if((data->state.lastconnect_id != conn->connection_id) &&
  ------------------
  |  Branch (746:12): [True: 0, False: 0]
  ------------------
  747|      0|           conn_cb(conn, userdata)) {
  ------------------
  |  Branch (747:12): [True: 0, False: 0]
  ------------------
  748|      0|          found = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  749|      0|          break;
  750|      0|        }
  751|      0|      }
  752|      0|    }
  753|      0|  }
  754|       |
  755|  3.04k|  if(done_cb) {
  ------------------
  |  Branch (755:6): [True: 3.04k, False: 0]
  ------------------
  756|  3.04k|    found = done_cb(userdata);
  757|  3.04k|  }
  758|  3.04k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  3.04k|  do {                                                                  \
  |  |   54|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   55|  3.04k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  3.04k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|  3.04k|#define FALSE false
  |  |  ------------------
  |  |   57|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  3.04k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|  3.04k|    }                                                                   \
  |  |   60|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (758:3): [True: 0, False: 3.04k]
  |  Branch (758:3): [True: 3.04k, False: 0]
  ------------------
  759|  3.04k|  return found;
  760|  3.04k|}
Curl_cpool_prune_dead:
  794|  3.04k|{
  795|  3.04k|  struct Curl_easy *admin;
  796|  3.04k|  timediff_t elapsed;
  797|       |
  798|  3.04k|  if(!cpool)
  ------------------
  |  Branch (798:6): [True: 0, False: 3.04k]
  ------------------
  799|      0|    return;
  800|       |
  801|  3.04k|  admin = Curl_get_admin(data);
  802|  3.04k|  CPOOL_LOCK(cpool, admin);
  ------------------
  |  |   42|  3.04k|  do {                                                                  \
  |  |   43|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   44|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  3.04k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  3.04k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  3.04k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|  3.04k|#define TRUE true
  |  |  ------------------
  |  |   49|  3.04k|    }                                                                   \
  |  |   50|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (802:3): [True: 0, False: 3.04k]
  |  Branch (802:3): [True: 3.04k, False: 0]
  ------------------
  803|  3.04k|  elapsed = curlx_ptimediff_ms(Curl_pgrs_now(admin), &cpool->last_cleanup);
  804|       |
  805|  3.04k|  if(elapsed >= 1000L) {
  ------------------
  |  Branch (805:6): [True: 3.04k, False: 0]
  ------------------
  806|  3.04k|    struct cpool_reaper_ctx reaper;
  807|       |
  808|  3.04k|    memset(&reaper, 0, sizeof(reaper));
  809|  3.04k|    reaper.now = *Curl_pgrs_now(admin);
  810|  3.04k|    while(cpool_foreach(admin, cpool, &reaper, cpool_reap_dead_cb))
  ------------------
  |  Branch (810:11): [True: 0, False: 3.04k]
  ------------------
  811|      0|      ;
  812|  3.04k|    cpool->last_cleanup = *Curl_pgrs_now(admin);
  813|  3.04k|  }
  814|       |  CPOOL_UNLOCK(cpool, admin);
  ------------------
  |  |   53|  3.04k|  do {                                                                  \
  |  |   54|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   55|  3.04k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  3.04k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|  3.04k|#define FALSE false
  |  |  ------------------
  |  |   57|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  3.04k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|  3.04k|    }                                                                   \
  |  |   60|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (814:3): [True: 0, False: 3.04k]
  |  Branch (814:3): [True: 3.04k, False: 0]
  ------------------
  815|  3.04k|}
Curl_cpool_do_locked:
  896|  3.04k|{
  897|  3.04k|  struct cpool *cpool = cpool_get_instance(data);
  898|  3.04k|  if(cpool) {
  ------------------
  |  Branch (898:6): [True: 3.04k, False: 0]
  ------------------
  899|  3.04k|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  3.04k|  do {                                                                  \
  |  |   43|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   44|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  3.04k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  3.04k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  3.04k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|  3.04k|#define TRUE true
  |  |  ------------------
  |  |   49|  3.04k|    }                                                                   \
  |  |   50|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (899:5): [True: 0, False: 3.04k]
  |  Branch (899:5): [True: 3.04k, False: 0]
  ------------------
  900|  3.04k|    cb(conn, data, cbdata);
  901|  3.04k|    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  3.04k|  do {                                                                  \
  |  |   54|  3.04k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |   55|  3.04k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  3.04k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|  3.04k|#define FALSE false
  |  |  ------------------
  |  |   57|  3.04k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  3.04k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 3.04k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  3.04k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|  3.04k|    }                                                                   \
  |  |   60|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (901:5): [True: 0, False: 3.04k]
  |  Branch (901:5): [True: 3.04k, False: 0]
  ------------------
  902|  3.04k|  }
  903|      0|  else
  904|      0|    cb(conn, data, cbdata);
  905|  3.04k|}
Curl_cpool_conn_was_used:
 1017|  3.04k|{
 1018|  3.04k|  (void)data;
 1019|  3.04k|  conn->lastupkeep_ms = curlx_ptimediff_ms(pnow, &conn->created);
 1020|  3.04k|}
conncache.c:cpool_bundle_free_entry:
  101|  3.04k|{
  102|  3.04k|  cpool_bundle_destroy((struct cpool_bundle *)freethis);
  103|  3.04k|}
conncache.c:cpool_bundle_destroy:
   76|  3.04k|{
   77|  3.04k|  DEBUGASSERT(!Curl_llist_count(&bundle->conns));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 3.04k]
  |  Branch (77:3): [True: 3.04k, False: 0]
  ------------------
   78|  3.04k|  curlx_free(bundle);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  3.04k|}
conncache.c:cpool_get_first:
  118|  3.74k|{
  119|  3.74k|  struct Curl_hash_iterator iter;
  120|  3.74k|  struct Curl_hash_element *he;
  121|  3.74k|  struct cpool_bundle *bundle;
  122|  3.74k|  struct Curl_llist_node *conn_node;
  123|       |
  124|  3.74k|  Curl_hash_start_iterate(&cpool->dest2bundle, &iter);
  125|  3.74k|  for(he = Curl_hash_next_element(&iter); he;
  ------------------
  |  Branch (125:43): [True: 0, False: 3.74k]
  ------------------
  126|  3.74k|      he = Curl_hash_next_element(&iter)) {
  127|      0|    bundle = he->ptr;
  128|      0|    conn_node = Curl_llist_head(&bundle->conns);
  129|      0|    if(conn_node)
  ------------------
  |  Branch (129:8): [True: 0, False: 0]
  ------------------
  130|      0|      return Curl_node_elem(conn_node);
  131|      0|  }
  132|  3.74k|  return NULL;
  133|  3.74k|}
conncache.c:cpool_remove_conn:
  152|  3.04k|{
  153|  3.04k|  struct Curl_llist *list = Curl_node_llist(&conn->cpool_node);
  154|  3.04k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (154:3): [True: 0, False: 3.04k]
  |  Branch (154:3): [True: 3.04k, False: 0]
  ------------------
  155|  3.04k|  if(list) {
  ------------------
  |  Branch (155:6): [True: 3.04k, False: 0]
  ------------------
  156|       |    /* The connection is certainly in the pool, but where? */
  157|  3.04k|    struct cpool_bundle *bundle = cpool_find_bundle(cpool, conn->destination);
  158|  3.04k|    if(bundle && (list == &bundle->conns)) {
  ------------------
  |  Branch (158:8): [True: 3.04k, False: 0]
  |  Branch (158:18): [True: 3.04k, False: 0]
  ------------------
  159|  3.04k|      cpool_bundle_remove(bundle, conn);
  160|  3.04k|      if(!Curl_llist_count(&bundle->conns))
  ------------------
  |  Branch (160:10): [True: 3.04k, False: 0]
  ------------------
  161|  3.04k|        cpool_remove_bundle(cpool, conn->destination);
  162|  3.04k|      conn->bits.in_cpool = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  163|  3.04k|      cpool->num_conn--;
  164|  3.04k|    }
  165|      0|    else {
  166|       |      /* Should have been in the bundle list */
  167|       |      DEBUGASSERT(NULL);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (167:7): [True: 0, False: 0]
  |  Branch (167:7): [True: 0, False: 0]
  ------------------
  168|      0|    }
  169|  3.04k|  }
  170|  3.04k|}
conncache.c:cpool_bundle_remove:
   93|  3.04k|{
   94|  3.04k|  (void)bundle;
   95|  3.04k|  DEBUGASSERT(Curl_node_llist(&conn->cpool_node) == &bundle->conns);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (95:3): [True: 0, False: 3.04k]
  |  Branch (95:3): [True: 3.04k, False: 0]
  ------------------
   96|  3.04k|  Curl_node_remove(&conn->cpool_node);
   97|       |  conn->bits.in_cpool = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   98|  3.04k|}
conncache.c:cpool_remove_bundle:
  144|  3.04k|{
  145|  3.04k|  if(!cpool)
  ------------------
  |  Branch (145:6): [True: 0, False: 3.04k]
  ------------------
  146|      0|    return;
  147|  3.04k|  Curl_hash_delete(&cpool->dest2bundle, destination, strlen(destination) + 1);
  148|  3.04k|}
conncache.c:cpool_discard_conn:
  176|  3.04k|{
  177|  3.04k|  struct Curl_easy *admin;
  178|  3.04k|  bool done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  179|       |
  180|  3.04k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:3): [True: 0, False: 3.04k]
  |  Branch (180:3): [True: 3.04k, False: 0]
  ------------------
  181|  3.04k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (181:3): [True: 0, False: 3.04k]
  |  Branch (181:3): [True: 3.04k, False: 0]
  ------------------
  182|  3.04k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (182:3): [True: 0, False: 3.04k]
  |  Branch (182:3): [True: 3.04k, False: 0]
  ------------------
  183|  3.04k|  DEBUGASSERT(!conn->bits.in_cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (183:3): [True: 0, False: 3.04k]
  |  Branch (183:3): [True: 3.04k, False: 0]
  ------------------
  184|       |
  185|  3.04k|  admin = Curl_get_admin(data);
  186|       |  /*
  187|       |   * If this connection is not marked to force-close, leave it open if there
  188|       |   * are other users of it
  189|       |   */
  190|  3.04k|  if(CONN_INUSE(conn) && !aborted) {
  ------------------
  |  |  356|  6.08k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (356:23): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (190:26): [True: 0, False: 0]
  ------------------
  191|      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]
  |  |  ------------------
  ------------------
  192|      0|               " still in use by %u transfers", conn->connection_id,
  193|      0|               conn->attached_xfers);
  194|      0|    return;
  195|      0|  }
  196|       |
  197|       |  /* treat the connection as aborted in CONNECT_ONLY situations, we do
  198|       |   * not know what the APP did with it. */
  199|  3.04k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (199:6): [True: 0, False: 3.04k]
  ------------------
  200|      0|    aborted = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  201|  3.04k|  conn->bits.aborted = aborted;
  202|       |
  203|       |  /* We do not shutdown dead connections. The term 'dead' can be misleading
  204|       |   * here, as we also mark errored connections/transfers as 'dead'.
  205|       |   * If we do a shutdown for an aborted transfer, the server might think
  206|       |   * it was successful otherwise (for example an ftps: upload). This is
  207|       |   * not what we want. */
  208|  3.04k|  if(aborted)
  ------------------
  |  Branch (208:6): [True: 0, False: 3.04k]
  ------------------
  209|      0|    done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  210|  3.04k|  if(!done) {
  ------------------
  |  Branch (210:6): [True: 3.04k, False: 0]
  ------------------
  211|       |    /* Attempt to shutdown the connection right away. */
  212|  3.04k|    Curl_cshutdn_try_once(admin, conn, &done);
  213|  3.04k|  }
  214|       |
  215|  3.04k|  if(done || !data->multi)
  ------------------
  |  Branch (215:6): [True: 3.04k, False: 0]
  |  Branch (215:14): [True: 0, False: 0]
  ------------------
  216|  3.04k|    Curl_cshutdn_terminate(admin, conn, FALSE);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  217|      0|  else {
  218|      0|    struct Curl_multi *multi = data->multi;
  219|      0|    size_t max_shutdowns = multi->max_total_connections;
  220|      0|    if(cpool->num_conn < max_shutdowns)
  ------------------
  |  Branch (220:8): [True: 0, False: 0]
  ------------------
  221|      0|      max_shutdowns -= cpool->num_conn;
  222|      0|    else if(max_shutdowns)
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|      max_shutdowns = 1;
  224|      0|    else /* no connection limit set, let's restrict growth nevertheless */
  225|      0|      max_shutdowns = CURLMAX(cpool->num_conn / 4, 128);
  ------------------
  |  | 1239|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1239:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  226|      0|    Curl_cshutdn_add(&multi->cshutdn, multi, conn, max_shutdowns);
  227|      0|  }
  228|  3.04k|}
conncache.c:cpool_get_instance:
  256|  22.0k|{
  257|       |  /* admin handles do not necessarily find the correct pool */
  258|  22.0k|  DEBUGASSERT(data->mid);
  ------------------
  |  | 1027|  22.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (258:3): [True: 0, False: 22.0k]
  |  Branch (258:3): [True: 22.0k, False: 0]
  ------------------
  259|  22.0k|  if(CURL_SHARE_KEEP_CONNECT(data->share))
  ------------------
  |  |   41|  22.0k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  ------------------
  |  |  |  Branch (41:4): [True: 0, False: 22.0k]
  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  260|      0|    return &data->share->cpool;
  261|  22.0k|  else if(data->multi_easy)
  ------------------
  |  Branch (261:11): [True: 0, False: 22.0k]
  ------------------
  262|      0|    return &data->multi_easy->cpool;
  263|  22.0k|  else if(data->multi)
  ------------------
  |  Branch (263:11): [True: 22.0k, False: 0]
  ------------------
  264|  22.0k|    return &data->multi->cpool;
  265|      0|  return NULL;
  266|  22.0k|}
conncache.c:cpool_conn_close:
  378|  3.04k|{
  379|  3.04k|  struct Curl_easy *admin;
  380|  3.04k|  bool do_lock;
  381|       |
  382|  3.04k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (382:3): [True: 0, False: 3.04k]
  |  Branch (382:3): [True: 3.04k, False: 0]
  ------------------
  383|  3.04k|  DEBUGASSERT(data && !data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (383:3): [True: 0, False: 3.04k]
  |  Branch (383:3): [True: 0, False: 0]
  |  Branch (383:3): [True: 3.04k, False: 0]
  |  Branch (383:3): [True: 3.04k, False: 0]
  ------------------
  384|  3.04k|  if(!cpool)
  ------------------
  |  Branch (384:6): [True: 0, False: 3.04k]
  ------------------
  385|      0|    return;
  386|       |
  387|       |  /* If this connection is not marked to force-close, leave it open if there
  388|       |   * are other users of it */
  389|  3.04k|  if(CONN_INUSE(conn) && !aborted) {
  ------------------
  |  |  356|  6.08k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (356:23): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (389:26): [True: 0, False: 0]
  ------------------
  390|      0|    DEBUGASSERT(0); /* does this ever happen? */
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (390:5): [Folded, False: 0]
  |  Branch (390:5): [Folded, False: 0]
  ------------------
  391|      0|    DEBUGF(infof(data, "conn terminate when inuse: %u", conn->attached_xfers));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  392|      0|    return;
  393|      0|  }
  394|       |
  395|       |  /* This method may be called while we are under lock, e.g. from a
  396|       |   * user callback in find. */
  397|  3.04k|  admin = Curl_get_admin(data);
  398|  3.04k|  do_lock = !CPOOL_IS_LOCKED(cpool);
  ------------------
  |  |   39|  3.04k|#define CPOOL_IS_LOCKED(c)    ((c) && (c)->locked)
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 3.04k, False: 0]
  |  |  |  Branch (39:39): [True: 3.04k, False: 0]
  |  |  ------------------
  ------------------
  399|  3.04k|  if(do_lock)
  ------------------
  |  Branch (399:6): [True: 0, False: 3.04k]
  ------------------
  400|      0|    CPOOL_LOCK(cpool, admin);
  ------------------
  |  |   42|      0|  do {                                                                  \
  |  |   43|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|      0|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|      0|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|      0|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   49|      0|    }                                                                   \
  |  |   50|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (400:5): [True: 0, False: 0]
  |  Branch (400:5): [True: 0, False: 0]
  ------------------
  401|       |
  402|  3.04k|  if(conn->bits.in_cpool) {
  ------------------
  |  Branch (402:6): [True: 3.04k, False: 0]
  ------------------
  403|  3.04k|    cpool_remove_conn(cpool, conn);
  404|  3.04k|    DEBUGASSERT(!conn->bits.in_cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (404:5): [True: 0, False: 3.04k]
  |  Branch (404:5): [True: 3.04k, False: 0]
  ------------------
  405|  3.04k|  }
  406|       |
  407|       |  /* treat the connection as aborted in CONNECT_ONLY situations,
  408|       |   * so no graceful shutdown is attempted. */
  409|  3.04k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (409:6): [True: 0, False: 3.04k]
  ------------------
  410|      0|    aborted = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  411|       |
  412|  3.04k|  if(data->multi) {
  ------------------
  |  Branch (412:6): [True: 3.04k, False: 0]
  ------------------
  413|       |    /* Add it to the multi's cpool for shutdown handling */
  414|  3.04k|    infof(data, "%s connection #%" FMT_OFF_T,
  ------------------
  |  |  143|  3.04k|  do {                               \
  |  |  144|  3.04k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.04k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.04k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  3.04k|    ((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.08k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 3.04k]
  |  |  ------------------
  |  |  146|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  415|  3.04k|          aborted ? "closing" : "shutting down", conn->connection_id);
  416|  3.04k|    cpool_discard_conn(&data->multi->cpool, data, conn, aborted);
  417|  3.04k|  }
  418|      0|  else {
  419|       |    /* No multi available, terminate */
  420|      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]
  |  |  ------------------
  ------------------
  421|      0|    Curl_cshutdn_terminate(admin, conn, !aborted);
  422|      0|  }
  423|       |
  424|  3.04k|  if(do_lock)
  ------------------
  |  Branch (424:6): [True: 0, False: 3.04k]
  ------------------
  425|       |    CPOOL_UNLOCK(cpool, admin);
  ------------------
  |  |   53|      0|  do {                                                                  \
  |  |   54|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|      0|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1000|      0|#define FALSE false
  |  |  ------------------
  |  |   57|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   59|      0|    }                                                                   \
  |  |   60|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (425:5): [True: 0, False: 0]
  |  Branch (425:5): [True: 0, False: 0]
  ------------------
  426|  3.04k|}
conncache.c:cpool_find_bundle:
  137|  6.08k|{
  138|  6.08k|  return Curl_hash_pick(
  139|  6.08k|    &cpool->dest2bundle, destination, strlen(destination) + 1);
  140|  6.08k|}
conncache.c:cpool_add_bundle:
  297|  3.04k|{
  298|  3.04k|  struct cpool_bundle *bundle;
  299|       |
  300|  3.04k|  bundle = cpool_bundle_create();
  301|  3.04k|  if(!bundle)
  ------------------
  |  Branch (301:6): [True: 0, False: 3.04k]
  ------------------
  302|      0|    return NULL;
  303|       |
  304|  3.04k|  if(!Curl_hash_add(&cpool->dest2bundle,
  ------------------
  |  Branch (304:6): [True: 0, False: 3.04k]
  ------------------
  305|  3.04k|                    destination, strlen(destination) + 1, bundle)) {
  306|      0|    cpool_bundle_destroy(bundle);
  307|      0|    return NULL;
  308|      0|  }
  309|  3.04k|  return bundle;
  310|  3.04k|}
conncache.c:cpool_bundle_create:
   68|  3.04k|{
   69|  3.04k|  struct cpool_bundle *bundle = curlx_calloc(1, sizeof(*bundle));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   70|  3.04k|  if(bundle)
  ------------------
  |  Branch (70:6): [True: 3.04k, False: 0]
  ------------------
   71|  3.04k|    Curl_llist_init(&bundle->conns, NULL);
   72|  3.04k|  return bundle;
   73|  3.04k|}
conncache.c:cpool_bundle_add:
   84|  3.04k|{
   85|  3.04k|  DEBUGASSERT(!Curl_node_llist(&conn->cpool_node));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 3.04k]
  |  Branch (85:3): [True: 3.04k, False: 0]
  ------------------
   86|  3.04k|  Curl_llist_append(&bundle->conns, conn, &conn->cpool_node);
   87|       |  conn->bits.in_cpool = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
   88|  3.04k|}
conncache.c:cpool_foreach:
  612|  3.04k|{
  613|  3.04k|  struct Curl_hash_iterator iter;
  614|  3.04k|  struct Curl_hash_element *he;
  615|       |
  616|  3.04k|  if(!cpool)
  ------------------
  |  Branch (616:6): [True: 0, False: 3.04k]
  ------------------
  617|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  618|       |
  619|  3.04k|  Curl_hash_start_iterate(&cpool->dest2bundle, &iter);
  620|       |
  621|  3.04k|  he = Curl_hash_next_element(&iter);
  622|  3.04k|  while(he) {
  ------------------
  |  Branch (622:9): [True: 0, False: 3.04k]
  ------------------
  623|      0|    struct Curl_llist_node *curr;
  624|      0|    struct cpool_bundle *bundle = he->ptr;
  625|      0|    he = Curl_hash_next_element(&iter);
  626|       |
  627|      0|    curr = Curl_llist_head(&bundle->conns);
  628|      0|    while(curr) {
  ------------------
  |  Branch (628:11): [True: 0, False: 0]
  ------------------
  629|       |      /* Yes, we need to update curr before calling func(), because func()
  630|       |         might decide to remove the connection */
  631|      0|      struct connectdata *conn = Curl_node_elem(curr);
  632|      0|      curr = Curl_node_next(curr);
  633|       |
  634|      0|      if(func(cpool, data, conn, param) == 1) {
  ------------------
  |  Branch (634:10): [True: 0, False: 0]
  ------------------
  635|      0|        return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  636|      0|      }
  637|      0|    }
  638|      0|  }
  639|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  640|  3.04k|}

timeleft_now_ms:
   72|  35.9k|{
   73|  35.9k|  timediff_t timeleft_ms = 0;
   74|  35.9k|  timediff_t ctimeleft_ms = 0;
   75|       |
   76|  35.9k|  if(data->conn && Curl_cshutdn_has_started(data->conn, FIRSTSOCKET))
  ------------------
  |  |  233|  31.5k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (76:6): [True: 31.5k, False: 4.44k]
  |  Branch (76:20): [True: 0, False: 31.5k]
  ------------------
   77|      0|    return Curl_cshutdn_timeleft_ms(data, data->conn, FIRSTSOCKET);
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
   78|  35.9k|  else if(Curl_is_connecting(data)) {
  ------------------
  |  Branch (78:11): [True: 22.6k, False: 13.2k]
  ------------------
   79|  22.6k|    timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ?
  ------------------
  |  Branch (79:30): [True: 22.6k, False: 0]
  ------------------
   80|  22.6k|      data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT;
  ------------------
  |  |   42|      0|#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
  ------------------
   81|  22.6k|    ctimeleft_ms = ctimeout_ms -
   82|  22.6k|      Curl_pgrs_since_ms(data, pnow, TIMER_STARTSINGLE);
   83|  22.6k|    if(!ctimeleft_ms)
  ------------------
  |  Branch (83:8): [True: 0, False: 22.6k]
  ------------------
   84|      0|      ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
   85|  22.6k|  }
   86|  13.2k|  else if(!data->set.timeout || data->set.connect_only) {
  ------------------
  |  Branch (86:11): [True: 0, False: 13.2k]
  |  Branch (86:33): [True: 0, False: 13.2k]
  ------------------
   87|      0|    return 0; /* no timeout in place or checked, return "no limit" */
   88|      0|  }
   89|       |
   90|  35.9k|  if(data->set.timeout) {
  ------------------
  |  Branch (90:6): [True: 35.9k, False: 0]
  ------------------
   91|  35.9k|    timeleft_ms = data->set.timeout -
   92|  35.9k|                  Curl_pgrs_since_ms(data, pnow, TIMER_STARTOP);
   93|  35.9k|    if(!timeleft_ms)
  ------------------
  |  Branch (93:8): [True: 0, False: 35.9k]
  ------------------
   94|      0|      timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
   95|  35.9k|  }
   96|       |
   97|  35.9k|  if(!ctimeleft_ms)
  ------------------
  |  Branch (97:6): [True: 13.2k, False: 22.6k]
  ------------------
   98|  13.2k|    return timeleft_ms;
   99|  22.6k|  else if(!timeleft_ms)
  ------------------
  |  Branch (99:11): [True: 0, False: 22.6k]
  ------------------
  100|      0|    return ctimeleft_ms;
  101|  22.6k|  return CURLMIN(ctimeleft_ms, timeleft_ms);
  ------------------
  |  | 1240|  22.6k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1240:24): [True: 0, False: 22.6k]
  |  |  ------------------
  ------------------
  102|  35.9k|}
Curl_timeleft_ms:
  105|  10.5k|{
  106|  10.5k|  return timeleft_now_ms(data, Curl_pgrs_now(data));
  107|  10.5k|}
Curl_timeleft_now_ms:
  111|  25.3k|{
  112|  25.3k|  return timeleft_now_ms(data, pnow);
  113|  25.3k|}
Curl_conncontrol:
  152|  3.04k|{
  153|  3.04k|  if(!conn) {
  ------------------
  |  Branch (153:6): [True: 0, False: 3.04k]
  ------------------
  154|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (154:5): [Folded, False: 0]
  |  Branch (154:5): [Folded, False: 0]
  ------------------
  155|      0|    return;
  156|      0|  }
  157|  3.04k|  switch(ctrl) {
  158|      0|    case CONNCTRL_CONN_KEEP:
  ------------------
  |  |   62|      0|#define CONNCTRL_CONN_KEEP       0
  ------------------
  |  Branch (158:5): [True: 0, False: 3.04k]
  ------------------
  159|      0|      conn->bits.close = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  160|      0|      break;
  161|  3.04k|    case CONNCTRL_CONN_CLOSE:
  ------------------
  |  |   63|  3.04k|#define CONNCTRL_CONN_CLOSE      1
  ------------------
  |  Branch (161:5): [True: 3.04k, False: 0]
  ------------------
  162|  3.04k|      conn->bits.close = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  163|  3.04k|      break;
  164|      0|    case CONNCTRL_STREAM_CLOSE:
  ------------------
  |  |   64|      0|#define CONNCTRL_STREAM_CLOSE    2
  ------------------
  |  Branch (164:5): [True: 0, False: 3.04k]
  ------------------
  165|       |      /* stream close when multiplexing does not affect connection */
  166|      0|      if(!Curl_conn_is_multiplex(conn, FIRSTSOCKET))
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (166:10): [True: 0, False: 0]
  ------------------
  167|      0|        conn->bits.close = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  168|      0|      break;
  169|      0|    default:
  ------------------
  |  Branch (169:5): [True: 0, False: 3.04k]
  ------------------
  170|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (170:7): [Folded, False: 0]
  |  Branch (170:7): [Folded, False: 0]
  ------------------
  171|      0|      break;
  172|  3.04k|  }
  173|  3.04k|}
Curl_conn_setup:
  179|  3.04k|{
  180|  3.04k|  struct Curl_peer *first_peer = Curl_conn_get_first_peer(conn, sockindex);
  181|  3.04k|  CURLcode result = CURLE_OK;
  182|  3.04k|  uint8_t dns_queries;
  183|       |
  184|  3.04k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (184:3): [True: 0, False: 3.04k]
  |  Branch (184:3): [True: 3.04k, False: 0]
  ------------------
  185|  3.04k|  DEBUGASSERT(conn->scheme);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (185:3): [True: 0, False: 3.04k]
  |  Branch (185:3): [True: 3.04k, False: 0]
  ------------------
  186|  3.04k|  DEBUGASSERT(!conn->cfilter[sockindex]);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (186:3): [True: 0, False: 3.04k]
  |  Branch (186:3): [True: 3.04k, False: 0]
  ------------------
  187|       |
  188|  3.04k|  if(!first_peer)
  ------------------
  |  Branch (188:6): [True: 0, False: 3.04k]
  ------------------
  189|      0|    return CURLE_FAILED_INIT;
  190|       |
  191|  3.04k|#ifndef CURL_DISABLE_HTTP
  192|  3.04k|  if(!conn->cfilter[sockindex] &&
  ------------------
  |  Branch (192:6): [True: 3.04k, False: 0]
  ------------------
  193|  3.04k|     conn->scheme->protocol == CURLPROTO_HTTPS) {
  ------------------
  |  | 1089|  3.04k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (193:6): [True: 0, False: 3.04k]
  ------------------
  194|      0|    DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:5): [True: 0, False: 0]
  |  Branch (194:5): [True: 0, False: 0]
  ------------------
  195|      0|    result = Curl_cf_https_setup(
  196|      0|      data, Curl_conn_get_destination(conn, sockindex), conn, sockindex);
  197|      0|    if(result)
  ------------------
  |  Branch (197:8): [True: 0, False: 0]
  ------------------
  198|      0|      goto out;
  199|      0|  }
  200|  3.04k|#endif /* !CURL_DISABLE_HTTP */
  201|       |
  202|       |  /* Still no cfilter set, apply default. */
  203|  3.04k|  if(!conn->cfilter[sockindex]) {
  ------------------
  |  Branch (203:6): [True: 3.04k, False: 0]
  ------------------
  204|  3.04k|    result = Curl_cf_setup_add(data, conn, sockindex,
  205|  3.04k|                               conn->transport_wanted, ssl_mode);
  206|  3.04k|    if(result)
  ------------------
  |  Branch (206:8): [True: 0, False: 3.04k]
  ------------------
  207|      0|      goto out;
  208|  3.04k|  }
  209|       |
  210|       |  /* Whatever the filter chain will be in the end, it will need the
  211|       |   * resolving of `first_peer`. Add that now so the resolve is started
  212|       |   * right away. */
  213|  3.04k|  dns_queries = Curl_resolv_dns_queries(data, conn->ip_version);
  214|  3.04k|  result = Curl_conn_dns_add_addr_resolve(data, conn, sockindex,
  215|  3.04k|                                          first_peer, dns_queries,
  216|  3.04k|                                          conn->transport_wanted);
  217|  3.04k|  if(result)
  ------------------
  |  Branch (217:6): [True: 0, False: 3.04k]
  ------------------
  218|      0|    goto out;
  219|       |
  220|  3.04k|  DEBUGASSERT(conn->cfilter[sockindex]);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (220:3): [True: 0, False: 3.04k]
  |  Branch (220:3): [True: 3.04k, False: 0]
  ------------------
  221|  3.04k|out:
  222|  3.04k|  return result;
  223|  3.04k|}
Curl_conn_connect:
  263|  3.04k|{
  264|  3.04k|#define CF_CONN_NUM_POLLS_ON_STACK 5
  265|  3.04k|  struct pollfd a_few_on_stack[CF_CONN_NUM_POLLS_ON_STACK];
  266|  3.04k|  struct easy_pollset ps;
  267|  3.04k|  struct curl_pollfds cpfds;
  268|  3.04k|  struct Curl_cfilter *cf;
  269|  3.04k|  CURLcode result = CURLE_OK;
  270|       |
  271|  3.04k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (271:3): [True: 0, False: 3.04k]
  |  Branch (271:3): [True: 3.04k, False: 0]
  ------------------
  272|  3.04k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (272:3): [True: 0, False: 3.04k]
  |  Branch (272:3): [True: 3.04k, False: 0]
  ------------------
  273|  3.04k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|  3.04k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 3.04k, False: 0]
  |  |  |  Branch (310:50): [True: 3.04k, False: 0]
  |  |  ------------------
  ------------------
  274|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  275|       |
  276|  3.04k|  if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  211|  3.04k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (276:6): [True: 0, False: 3.04k]
  ------------------
  277|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  278|      0|    return CURLE_OK;
  279|      0|  }
  280|       |
  281|  3.04k|  cf = data->conn->cfilter[sockindex];
  282|  3.04k|  if(!cf) {
  ------------------
  |  Branch (282:6): [True: 0, False: 3.04k]
  ------------------
  283|      0|    *done = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  284|      0|    return CURLE_FAILED_INIT;
  285|      0|  }
  286|       |
  287|  3.04k|  *done = (bool)cf->connected;
  288|  3.04k|  if(*done)
  ------------------
  |  Branch (288:6): [True: 0, False: 3.04k]
  ------------------
  289|      0|    return CURLE_OK;
  290|       |
  291|  3.04k|  Curl_pollset_init(&ps);
  292|  3.04k|  Curl_pollfds_init(&cpfds, a_few_on_stack, CF_CONN_NUM_POLLS_ON_STACK);
  ------------------
  |  |  264|  3.04k|#define CF_CONN_NUM_POLLS_ON_STACK 5
  ------------------
  293|  3.04k|  while(!*done) {
  ------------------
  |  Branch (293:9): [True: 3.04k, False: 0]
  ------------------
  294|  3.04k|    if(Curl_conn_needs_flush(data, sockindex)) {
  ------------------
  |  Branch (294:8): [True: 0, False: 3.04k]
  ------------------
  295|      0|      DEBUGF(infof(data, "Curl_conn_connect(index=%d), flush", sockindex));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  296|      0|      result = Curl_conn_flush(data, sockindex);
  297|      0|      if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (297:10): [True: 0, False: 0]
  |  Branch (297:20): [True: 0, False: 0]
  ------------------
  298|      0|        goto out;
  299|      0|    }
  300|       |
  301|  3.04k|    result = cf->cft->do_connect(cf, data, done);
  302|  3.04k|    CURL_TRC_CF(data, cf, "Curl_conn_connect(block=%d) -> %d, done=%d",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  303|  3.04k|                blocking, (int)result, *done);
  304|  3.04k|    if(!result && *done) {
  ------------------
  |  Branch (304:8): [True: 3.04k, False: 0]
  |  Branch (304:19): [True: 3.04k, False: 0]
  ------------------
  305|       |      /* A final sanity check on connection security */
  306|  3.04k|      if((data->state.origin->scheme->flags & PROTOPT_SSL) &&
  ------------------
  |  |  204|  3.04k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (306:10): [True: 0, False: 3.04k]
  ------------------
  307|      0|         (sockindex == FIRSTSOCKET) &&
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (307:10): [True: 0, False: 0]
  ------------------
  308|      0|         !Curl_conn_is_ssl(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (308:10): [True: 0, False: 0]
  ------------------
  309|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (309:9): [Folded, False: 0]
  |  Branch (309:9): [Folded, False: 0]
  ------------------
  310|      0|        failf(data, "transfer requires SSL, but not connected via SSL");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  311|      0|        result = CURLE_FAILED_INIT;
  312|      0|        goto out;
  313|      0|      }
  314|       |      /* Now that the complete filter chain is connected, let all filters
  315|       |       * persist information at the connection. E.g. cf-socket sets the
  316|       |       * socket and ip related information. */
  317|  3.04k|      Curl_conn_cntrl_update_info(data, data->conn);
  318|  3.04k|      conn_report_stats(data, sockindex);
  319|  3.04k|      Curl_cpool_conn_was_used(data, data->conn, Curl_pgrs_now(data));
  320|  3.04k|      VERBOSE(result = conn_connect_trace(data, cf));
  ------------------
  |  | 1563|  3.04k|#define VERBOSE(x) x
  ------------------
  321|  3.04k|      VERBOSE(Curl_conn_trc_filters(data, sockindex, "connected"));
  ------------------
  |  | 1563|  3.04k|#define VERBOSE(x) x
  ------------------
  322|  3.04k|      Curl_conn_remove_setup_filters(data, sockindex);
  323|  3.04k|      VERBOSE(Curl_conn_trc_filters(data, sockindex, "reduced to"));
  ------------------
  |  | 1563|  3.04k|#define VERBOSE(x) x
  ------------------
  324|  3.04k|      goto out;
  325|  3.04k|    }
  326|      0|    else if(result) {
  ------------------
  |  Branch (326:13): [True: 0, False: 0]
  ------------------
  327|      0|      CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %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]
  |  |  ------------------
  ------------------
  328|      0|                  (int)result);
  329|      0|      VERBOSE(Curl_conn_trc_filters(data, sockindex, "failed to connect"));
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  ------------------
  330|      0|      conn_report_stats(data, sockindex);
  331|      0|      goto out;
  332|      0|    }
  333|       |
  334|      0|    if(!blocking)
  ------------------
  |  Branch (334:8): [True: 0, False: 0]
  ------------------
  335|      0|      goto out;
  336|      0|    else {
  337|       |      /* check allowed time left */
  338|      0|      const timediff_t timeout_ms = Curl_timeleft_ms(data);
  339|      0|      curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data);
  340|      0|      int rc;
  341|       |
  342|      0|      if(timeout_ms < 0) {
  ------------------
  |  Branch (342:10): [True: 0, False: 0]
  ------------------
  343|       |        /* no need to continue if time already is up */
  344|      0|        failf(data, "connect timeout");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  345|      0|        result = CURLE_OPERATION_TIMEDOUT;
  346|      0|        goto out;
  347|      0|      }
  348|       |
  349|      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]
  |  |  ------------------
  ------------------
  350|      0|      Curl_pollset_reset(&ps);
  351|      0|      Curl_pollfds_reset(&cpfds);
  352|       |      /* In general, we want to send after connect, wait on that. */
  353|      0|      if(sockfd != CURL_SOCKET_BAD)
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (353:10): [True: 0, False: 0]
  ------------------
  354|      0|        result = Curl_pollset_set_out_only(data, &ps, sockfd);
  ------------------
  |  |  172|      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
  |  |  ------------------
  ------------------
  355|      0|      if(!result)
  ------------------
  |  Branch (355:10): [True: 0, False: 0]
  ------------------
  356|      0|        result = Curl_conn_adjust_pollset(data, data->conn, &ps);
  357|      0|      if(result)
  ------------------
  |  Branch (357:10): [True: 0, False: 0]
  ------------------
  358|      0|        goto out;
  359|      0|      result = Curl_pollfds_add_ps(&cpfds, &ps);
  360|      0|      if(result)
  ------------------
  |  Branch (360:10): [True: 0, False: 0]
  ------------------
  361|      0|        goto out;
  362|       |
  363|      0|      rc = Curl_poll(cpfds.pfds, cpfds.n,
  364|      0|                     CURLMIN(timeout_ms, (cpfds.n ? 1000 : 10)));
  ------------------
  |  | 1240|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1240:24): [True: 0, False: 0]
  |  |  |  Branch (1240:31): [True: 0, False: 0]
  |  |  |  Branch (1240:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  365|      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]
  |  |  ------------------
  ------------------
  366|      0|                  rc);
  367|      0|      if(rc < 0) {
  ------------------
  |  Branch (367:10): [True: 0, False: 0]
  ------------------
  368|      0|        result = CURLE_COULDNT_CONNECT;
  369|      0|        goto out;
  370|      0|      }
  371|       |      /* continue iterating */
  372|      0|    }
  373|      0|  }
  374|       |
  375|  3.04k|out:
  376|  3.04k|  Curl_pollset_cleanup(&ps);
  377|  3.04k|  Curl_pollfds_cleanup(&cpfds);
  378|  3.04k|  return result;
  379|  3.04k|}
Curl_conn_get_destination:
  400|  3.04k|{
  401|  3.04k|  return (sockindex == SECONDARYSOCKET) ?
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (401:10): [True: 0, False: 3.04k]
  ------------------
  402|      0|    (conn->via_peer2 ? conn->via_peer2 : conn->origin2) :
  ------------------
  |  Branch (402:6): [True: 0, False: 0]
  ------------------
  403|  3.04k|    (conn->via_peer ? conn->via_peer : conn->origin);
  ------------------
  |  Branch (403:6): [True: 3.04k, False: 1]
  ------------------
  404|  3.04k|}
Curl_conn_get_first_peer:
  408|  12.1k|{
  409|  12.1k|#ifndef CURL_DISABLE_PROXY
  410|  12.1k|  if(conn->socks_proxy.peer)
  ------------------
  |  Branch (410:6): [True: 0, False: 12.1k]
  ------------------
  411|      0|    return conn->socks_proxy.peer;
  412|  12.1k|  if(conn->http_proxy.peer)
  ------------------
  |  Branch (412:6): [True: 0, False: 12.1k]
  ------------------
  413|      0|    return conn->http_proxy.peer;
  414|  12.1k|#endif
  415|  12.1k|  return (sockindex == SECONDARYSOCKET) ?
  ------------------
  |  |  234|  12.1k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (415:10): [True: 0, False: 12.1k]
  ------------------
  416|      0|    (conn->via_peer2 ? conn->via_peer2 : conn->origin2) :
  ------------------
  |  Branch (416:6): [True: 0, False: 0]
  ------------------
  417|  12.1k|    (conn->via_peer ? conn->via_peer : conn->origin);
  ------------------
  |  Branch (417:6): [True: 12.1k, False: 4]
  ------------------
  418|  12.1k|}
connect.c:conn_report_stats:
  252|  3.04k|{
  253|       |  /* We do gather stats for the second socket...yet */
  254|  3.04k|  if(sockindex == FIRSTSOCKET) {
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (254:6): [True: 3.04k, False: 0]
  ------------------
  255|  3.04k|    Curl_conn_cntrl_report_stats(data, data->conn, sockindex);
  256|  3.04k|  }
  257|  3.04k|}
connect.c:conn_connect_trace:
  228|  3.04k|{
  229|  3.04k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|  3.04k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |  323|  3.04k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |  324|  3.04k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  230|  3.04k|    struct ip_quadruple ipquad;
  231|  3.04k|    bool is_ipv6;
  232|  3.04k|    CURLcode result;
  233|       |
  234|  3.04k|    result = Curl_conn_cf_get_ip_info(cf, data, &is_ipv6, &ipquad);
  235|  3.04k|    if(result)
  ------------------
  |  Branch (235:8): [True: 0, False: 3.04k]
  ------------------
  236|      0|      return result;
  237|       |
  238|  3.04k|    infof(data, "Established %sconnection to %s (%s port %u) from %s port %u ",
  ------------------
  |  |  143|  3.04k|  do {                               \
  |  |  144|  3.04k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.04k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.04k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  3.04k|    ((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|  24.3k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 3.04k]
  |  |  |  Branch (145:24): [True: 3.04k, False: 1]
  |  |  |  Branch (145:24): [True: 0, False: 3.04k]
  |  |  |  Branch (145:24): [True: 0, False: 3.04k]
  |  |  ------------------
  |  |  146|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  239|  3.04k|          (cf->sockindex == SECONDARYSOCKET) ? "2nd " : "",
  240|  3.04k|          CURL_CONN_HOST_DISPNAME(data->conn),
  241|  3.04k|          ipquad.remote_ip, ipquad.remote_port,
  242|  3.04k|          ipquad.local_ip, ipquad.local_port);
  243|  3.04k|  }
  244|  3.04k|  return CURLE_OK;
  245|  3.04k|}

Curl_cookie_add:
 1004|  3.74k|{
 1005|  3.74k|  struct Cookie comem;
 1006|  3.74k|  struct Cookie *co;
 1007|  3.74k|  size_t myhash;
 1008|  3.74k|  CURLcode result;
 1009|  3.74k|  bool replaces = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1010|  3.74k|  bool okay;
 1011|       |
 1012|  3.74k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1012:3): [True: 0, False: 3.74k]
  |  Branch (1012:3): [True: 3.74k, False: 0]
  ------------------
 1013|  3.74k|  DEBUGASSERT(MAX_SET_COOKIE_AMOUNT <= 255); /* counter is an unsigned char */
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1013:3): [True: 0, Folded]
  |  Branch (1013:3): [True: 3.74k, Folded]
  ------------------
 1014|  3.74k|  if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT)
  ------------------
  |  |   90|  3.74k|#define MAX_SET_COOKIE_AMOUNT 50
  ------------------
  |  Branch (1014:6): [True: 0, False: 3.74k]
  ------------------
 1015|      0|    return CURLE_OK; /* silently ignore */
 1016|       |
 1017|  3.74k|  co = &comem;
 1018|  3.74k|  memset(co, 0, sizeof(comem));
 1019|       |
 1020|  3.74k|  if(flags & COOKIE_HTTPHEADER)
  ------------------
  |  |  114|  3.74k|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
  |  Branch (1020:6): [True: 0, False: 3.74k]
  ------------------
 1021|      0|    result = parse_cookie_header(data, co, ci, &okay,
 1022|      0|                                 lineptr, domain, path, flags & COOKIE_SECURE);
  ------------------
  |  |  116|      0|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1023|  3.74k|  else
 1024|  3.74k|    result = parse_netscape(co, ci, &okay, lineptr, flags & COOKIE_SECURE);
  ------------------
  |  |  116|  3.74k|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1025|       |
 1026|  3.74k|  if(result || !okay)
  ------------------
  |  Branch (1026:6): [True: 0, False: 3.74k]
  |  Branch (1026:16): [True: 3.74k, False: 0]
  ------------------
 1027|  3.74k|    goto fail;
 1028|       |
 1029|      0|  if(co->prefix_secure && !co->secure)
  ------------------
  |  Branch (1029:6): [True: 0, False: 0]
  |  Branch (1029:27): [True: 0, False: 0]
  ------------------
 1030|       |    /* The __Secure- prefix only requires that the cookie be set secure */
 1031|      0|    goto fail;
 1032|       |
 1033|      0|  if(!(flags & COOKIE_NOPSL) && is_public_suffix(data, co, domain))
  ------------------
  |  |  117|      0|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
  |  Branch (1033:6): [True: 0, False: 0]
  |  Branch (1033:33): [True: 0, False: 0]
  ------------------
 1034|      0|    goto fail;
 1035|       |
 1036|      0|  if(co->prefix_host) {
  ------------------
  |  Branch (1036:6): [True: 0, False: 0]
  ------------------
 1037|       |    /*
 1038|       |     * The __Host- prefix requires the cookie to be secure, have a "/" path
 1039|       |     * and not have a domain set.
 1040|       |     */
 1041|      0|    if(co->secure && co->path && !strcmp(co->path, "/") && !co->tailmatch)
  ------------------
  |  Branch (1041:8): [True: 0, False: 0]
  |  Branch (1041:22): [True: 0, False: 0]
  |  Branch (1041:34): [True: 0, False: 0]
  |  Branch (1041:60): [True: 0, False: 0]
  ------------------
 1042|      0|      ;
 1043|      0|    else
 1044|      0|      goto fail;
 1045|      0|  }
 1046|       |
 1047|      0|  if(!ci->running &&    /* read from a file */
  ------------------
  |  Branch (1047:6): [True: 0, False: 0]
  ------------------
 1048|      0|     ci->newsession &&  /* clean session cookies */
  ------------------
  |  Branch (1048:6): [True: 0, False: 0]
  ------------------
 1049|      0|     !co->expires)      /* this is a session cookie */
  ------------------
  |  Branch (1049:6): [True: 0, False: 0]
  ------------------
 1050|      0|    goto fail;
 1051|       |
 1052|      0|  co->livecookie = ci->running;
 1053|      0|  co->creationtime = ++ci->lastct;
 1054|       |
 1055|      0|  if(!(flags & COOKIE_NOEXPIRE))
  ------------------
  |  |  115|      0|#define COOKIE_NOEXPIRE   (1<<1) /* skip remove_expired() */
  ------------------
  |  Branch (1055:6): [True: 0, False: 0]
  ------------------
 1056|      0|    remove_expired(ci);
 1057|       |
 1058|       |  /*
 1059|       |   * Now we have parsed the incoming line, we must now check if this supersedes
 1060|       |   * an already existing cookie, which it may if the previous have the same
 1061|       |   * domain and path as this.
 1062|       |   */
 1063|      0|  if(!replace_existing(data, co, ci, flags & COOKIE_SECURE, &replaces))
  ------------------
  |  |  116|      0|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
  |  Branch (1063:6): [True: 0, False: 0]
  ------------------
 1064|      0|    goto fail;
 1065|       |
 1066|       |  /* clone the stack struct into heap */
 1067|      0|  co = curlx_memdup(&comem, sizeof(comem));
 1068|      0|  if(!co) {
  ------------------
  |  Branch (1068:6): [True: 0, False: 0]
  ------------------
 1069|      0|    co = &comem;
 1070|      0|    result = CURLE_OUT_OF_MEMORY;
 1071|      0|    goto fail; /* bail out if we are this low on memory */
 1072|      0|  }
 1073|       |
 1074|       |  /* add this cookie to the list */
 1075|      0|  myhash = cookiehash(co->domain);
 1076|      0|  Curl_llist_append(&ci->cookielist[myhash], co, &co->node);
 1077|       |
 1078|      0|  if(ci->running)
  ------------------
  |  Branch (1078:6): [True: 0, False: 0]
  ------------------
 1079|       |    /* Only show this when NOT reading the cookies from a file */
 1080|      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]
  |  |  ------------------
  ------------------
 1081|      0|          "expire %" FMT_OFF_T,
 1082|      0|          replaces ? "Replaced" : "Added", co->name, co->value,
 1083|      0|          co->domain, co->path, co->expires);
 1084|       |
 1085|      0|  if(!replaces)
  ------------------
  |  Branch (1085:6): [True: 0, False: 0]
  ------------------
 1086|      0|    ci->numcookies++; /* one more cookie in the jar */
 1087|       |
 1088|       |  /*
 1089|       |   * Now that we have added a new cookie to the jar, update the expiration
 1090|       |   * tracker in case it is the next one to expire.
 1091|       |   */
 1092|      0|  if(co->expires && (co->expires < ci->next_expiration))
  ------------------
  |  Branch (1092:6): [True: 0, False: 0]
  |  Branch (1092:21): [True: 0, False: 0]
  ------------------
 1093|      0|    ci->next_expiration = co->expires;
 1094|       |
 1095|      0|  if(flags & COOKIE_HTTPHEADER)
  ------------------
  |  |  114|      0|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
  |  Branch (1095:6): [True: 0, False: 0]
  ------------------
 1096|      0|    data->req.setcookies++;
 1097|       |
 1098|      0|  return result;
 1099|  3.74k|fail:
 1100|       |  freecookie(co, FALSE);
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1101|  3.74k|  return result;
 1102|      0|}
Curl_cookie_init:
 1119|  3.74k|{
 1120|  3.74k|  int i;
 1121|  3.74k|  struct CookieInfo *ci = curlx_calloc(1, sizeof(struct CookieInfo));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1122|  3.74k|  if(!ci)
  ------------------
  |  Branch (1122:6): [True: 0, False: 3.74k]
  ------------------
 1123|      0|    return NULL;
 1124|       |
 1125|       |  /* This does not use the destructor callback since we want to add
 1126|       |     and remove to lists while keeping the cookie struct intact */
 1127|   239k|  for(i = 0; i < COOKIE_HASH_SIZE; i++)
  ------------------
  |  |   54|   239k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1127:14): [True: 235k, False: 3.74k]
  ------------------
 1128|   235k|    Curl_llist_init(&ci->cookielist[i], NULL);
 1129|       |  /*
 1130|       |   * Initialize the next_expiration time to signal that we do not have enough
 1131|       |   * information yet.
 1132|       |   */
 1133|  3.74k|  ci->next_expiration = CURL_OFF_T_MAX;
  ------------------
  |  |  540|  3.74k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
 1134|       |
 1135|  3.74k|  return ci;
 1136|  3.74k|}
Curl_cookie_loadfiles:
 1228|  3.74k|{
 1229|  3.74k|  CURLcode result = CURLE_OK;
 1230|  3.74k|  struct curl_slist *list = data->state.cookielist;
 1231|  3.74k|  if(list) {
  ------------------
  |  Branch (1231:6): [True: 3.74k, False: 0]
  ------------------
 1232|  3.74k|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1233|  3.74k|    if(!data->cookies)
  ------------------
  |  Branch (1233:8): [True: 0, False: 3.74k]
  ------------------
 1234|      0|      data->cookies = Curl_cookie_init();
 1235|  3.74k|    if(!data->cookies)
  ------------------
  |  Branch (1235:8): [True: 0, False: 3.74k]
  ------------------
 1236|      0|      result = CURLE_OUT_OF_MEMORY;
 1237|  3.74k|    else {
 1238|  3.74k|      data->state.cookie_engine = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 1239|  7.48k|      while(list) {
  ------------------
  |  Branch (1239:13): [True: 3.74k, False: 3.74k]
  ------------------
 1240|  3.74k|        result = cookie_load(data, list->data, data->cookies, flags);
 1241|  3.74k|        if(result)
  ------------------
  |  Branch (1241:12): [True: 0, False: 3.74k]
  ------------------
 1242|      0|          break;
 1243|  3.74k|        list = list->next;
 1244|  3.74k|      }
 1245|  3.74k|    }
 1246|  3.74k|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1247|  3.74k|  }
 1248|  3.74k|  return result;
 1249|  3.74k|}
Curl_cookie_clearall:
 1429|  3.74k|{
 1430|  3.74k|  if(ci) {
  ------------------
  |  Branch (1430:6): [True: 3.74k, False: 0]
  ------------------
 1431|  3.74k|    unsigned int i;
 1432|   239k|    for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|   239k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1432:16): [True: 235k, False: 3.74k]
  ------------------
 1433|   235k|      struct Curl_llist_node *n;
 1434|   235k|      for(n = Curl_llist_head(&ci->cookielist[i]); n;) {
  ------------------
  |  Branch (1434:52): [True: 0, False: 235k]
  ------------------
 1435|      0|        struct Cookie *c = Curl_node_elem(n);
 1436|      0|        struct Curl_llist_node *e = Curl_node_next(n);
 1437|      0|        Curl_node_remove(n);
 1438|       |        freecookie(c, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1439|      0|        n = e;
 1440|      0|      }
 1441|   235k|    }
 1442|  3.74k|    ci->numcookies = 0;
 1443|  3.74k|  }
 1444|  3.74k|}
Curl_cookie_cleanup:
 1480|  3.74k|{
 1481|  3.74k|  if(ci) {
  ------------------
  |  Branch (1481:6): [True: 3.74k, False: 0]
  ------------------
 1482|  3.74k|    Curl_cookie_clearall(ci);
 1483|  3.74k|    curlx_free(ci); /* free the base struct as well */
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1484|  3.74k|  }
 1485|  3.74k|}
Curl_flush_cookies:
 1673|  7.48k|{
 1674|  7.48k|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1675|       |  /* only save the cookie file if a transfer was started (cookies->running is
 1676|       |     set), as otherwise the cookies were not completely initialized and there
 1677|       |     might be cookie files that were not loaded so saving the file is the
 1678|       |     wrong thing. */
 1679|  7.48k|  if(data->cookies) {
  ------------------
  |  Branch (1679:6): [True: 3.74k, False: 3.74k]
  ------------------
 1680|  3.74k|    const char *cookiejar = CURL_EASY_STR(data, STRING_COOKIEJAR);
  ------------------
  |  | 1234|  3.74k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1681|  3.74k|    if(cookiejar && data->cookies->running) {
  ------------------
  |  Branch (1681:8): [True: 3.74k, False: 0]
  |  Branch (1681:21): [True: 3.74k, False: 0]
  ------------------
 1682|       |      /* if we have a destination file for all the cookies to get dumped to */
 1683|  3.74k|      CURLcode result = cookie_output(data, data->cookies, cookiejar);
 1684|  3.74k|      if(result)
  ------------------
  |  Branch (1684:10): [True: 0, False: 3.74k]
  ------------------
 1685|      0|        infof(data, "WARNING: failed to save cookies in %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__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1686|  3.74k|              cookiejar, curl_easy_strerror(result));
 1687|  3.74k|    }
 1688|       |
 1689|  3.74k|    if(cleanup && (!data->share || (data->cookies != data->share->cookies))) {
  ------------------
  |  Branch (1689:8): [True: 3.74k, False: 0]
  |  Branch (1689:20): [True: 3.74k, False: 0]
  |  Branch (1689:36): [True: 0, False: 0]
  ------------------
 1690|  3.74k|      Curl_cookie_cleanup(data->cookies);
 1691|       |      data->cookies = NULL;
 1692|  3.74k|    }
 1693|  3.74k|  }
 1694|  7.48k|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1695|  7.48k|}
Curl_cookie_run:
 1698|  3.74k|{
 1699|  3.74k|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1700|  3.74k|  if(data->cookies)
  ------------------
  |  Branch (1700:6): [True: 3.74k, False: 0]
  ------------------
 1701|  3.74k|    data->cookies->running = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 1702|  3.74k|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1703|  3.74k|}
cookie.c:parse_netscape:
  672|  3.74k|{
  673|       |  /*
  674|       |   * This line is NOT an HTTP header style line, we do offer support for
  675|       |   * reading the odd netscape cookies-file format here
  676|       |   */
  677|  3.74k|  const char *ptr, *next;
  678|  3.74k|  int fields;
  679|  3.74k|  size_t len;
  680|  3.74k|  *okay = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  681|       |
  682|       |  /*
  683|       |   * In 2008, Internet Explorer introduced HTTP-only cookies to prevent XSS
  684|       |   * attacks. Cookies marked httpOnly are not accessible to JavaScript. In
  685|       |   * Firefox's cookie files, they are prefixed #HttpOnly_ and the rest
  686|       |   * remains as usual, so we skip 10 characters of the line.
  687|       |   */
  688|  3.74k|  if(!strncmp(lineptr, "#HttpOnly_", 10)) {
  ------------------
  |  Branch (688:6): [True: 0, False: 3.74k]
  ------------------
  689|      0|    lineptr += 10;
  690|      0|    co->httponly = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  691|      0|  }
  692|       |
  693|  3.74k|  if(lineptr[0] == '#')
  ------------------
  |  Branch (693:6): [True: 0, False: 3.74k]
  ------------------
  694|       |    /* do not even try the comments */
  695|      0|    return CURLE_OK;
  696|       |
  697|       |  /*
  698|       |   * Now loop through the fields and init the struct we already have
  699|       |   * allocated
  700|       |   */
  701|  3.74k|  fields = 0;
  702|  7.48k|  for(next = lineptr; next; fields++) {
  ------------------
  |  Branch (702:23): [True: 3.74k, False: 3.74k]
  ------------------
  703|  3.74k|    ptr = next;
  704|  3.74k|    len = strcspn(ptr, "\t\r\n");
  705|  3.74k|    next = (ptr[len] == '\t' ? &ptr[len + 1] : NULL);
  ------------------
  |  Branch (705:13): [True: 0, False: 3.74k]
  ------------------
  706|  3.74k|    switch(fields) {
  ------------------
  |  Branch (706:12): [True: 3.74k, False: 0]
  ------------------
  707|  3.74k|    case 0:
  ------------------
  |  Branch (707:5): [True: 3.74k, False: 0]
  ------------------
  708|  3.74k|      if(ptr[0] == '.') { /* skip preceding dots */
  ------------------
  |  Branch (708:10): [True: 0, False: 3.74k]
  ------------------
  709|      0|        ptr++;
  710|      0|        len--;
  711|      0|      }
  712|  3.74k|      co->domain = curlx_memdup0(ptr, len);
  713|  3.74k|      if(!co->domain)
  ------------------
  |  Branch (713:10): [True: 0, False: 3.74k]
  ------------------
  714|      0|        return CURLE_OUT_OF_MEMORY;
  715|  3.74k|      break;
  716|  3.74k|    case 1:
  ------------------
  |  Branch (716:5): [True: 0, False: 3.74k]
  ------------------
  717|       |      /*
  718|       |       * flag: A TRUE/FALSE value indicating if all machines within a given
  719|       |       * domain can access the variable. Set TRUE when the cookie says
  720|       |       * .example.com and to false when the domain is complete www.example.com
  721|       |       */
  722|      0|      co->tailmatch = !!curl_strnequal(ptr, "TRUE", len);
  723|      0|      break;
  724|      0|    case 2:
  ------------------
  |  Branch (724:5): [True: 0, False: 3.74k]
  ------------------
  725|       |      /* The file format allows the path field to remain not filled in */
  726|      0|      if(strncmp("TRUE", ptr, len) && strncmp("FALSE", ptr, len)) {
  ------------------
  |  Branch (726:10): [True: 0, False: 0]
  |  Branch (726:39): [True: 0, False: 0]
  ------------------
  727|       |        /* only if the path does not look like a boolean option! */
  728|      0|        co->path = sanitize_cookie_path(ptr, len);
  729|      0|        if(!co->path)
  ------------------
  |  Branch (729:12): [True: 0, False: 0]
  ------------------
  730|      0|          return CURLE_OUT_OF_MEMORY;
  731|      0|        break;
  732|      0|      }
  733|      0|      else {
  734|       |        /* this does not look like a path, make one up! */
  735|      0|        co->path = curlx_strdup("/");
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  736|      0|        if(!co->path)
  ------------------
  |  Branch (736:12): [True: 0, False: 0]
  ------------------
  737|      0|          return CURLE_OUT_OF_MEMORY;
  738|      0|      }
  739|      0|      fields++; /* add a field and fall down to secure */
  740|      0|      FALLTHROUGH();
  ------------------
  |  |  767|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  741|      0|    case 3:
  ------------------
  |  Branch (741:5): [True: 0, False: 3.74k]
  ------------------
  742|      0|      co->secure = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  743|      0|      if(curl_strnequal(ptr, "TRUE", len)) {
  ------------------
  |  Branch (743:10): [True: 0, False: 0]
  ------------------
  744|      0|        if(secure_origin || ci->running)
  ------------------
  |  Branch (744:12): [True: 0, False: 0]
  |  Branch (744:29): [True: 0, False: 0]
  ------------------
  745|      0|          co->secure = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  746|      0|        else
  747|      0|          return CURLE_OK;
  748|      0|      }
  749|      0|      break;
  750|      0|    case 4:
  ------------------
  |  Branch (750:5): [True: 0, False: 3.74k]
  ------------------
  751|      0|      if(curlx_str_number(&ptr, &co->expires, CURL_OFF_T_MAX))
  ------------------
  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (751:10): [True: 0, False: 0]
  ------------------
  752|      0|        return CURLE_OK;
  753|      0|      break;
  754|      0|    case 5:
  ------------------
  |  Branch (754:5): [True: 0, False: 3.74k]
  ------------------
  755|      0|      co->name = curlx_memdup0(ptr, len);
  756|      0|      if(!co->name)
  ------------------
  |  Branch (756:10): [True: 0, False: 0]
  ------------------
  757|      0|        return CURLE_OUT_OF_MEMORY;
  758|      0|      else {
  759|       |        /* For Netscape file format cookies we check prefix on the name.
  760|       |           These prefixes are matched case sensitively, same as on the
  761|       |           header path and as the 6265bis document specifies. */
  762|      0|        if(!strncmp("__Secure-", co->name, 9))
  ------------------
  |  Branch (762:12): [True: 0, False: 0]
  ------------------
  763|      0|          co->prefix_secure = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  764|      0|        else if(!strncmp("__Host-", co->name, 7))
  ------------------
  |  Branch (764:17): [True: 0, False: 0]
  ------------------
  765|      0|          co->prefix_host = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  766|      0|      }
  767|      0|      break;
  768|      0|    case 6:
  ------------------
  |  Branch (768:5): [True: 0, False: 3.74k]
  ------------------
  769|      0|      co->value = curlx_memdup0(ptr, len);
  770|      0|      if(!co->value)
  ------------------
  |  Branch (770:10): [True: 0, False: 0]
  ------------------
  771|      0|        return CURLE_OUT_OF_MEMORY;
  772|      0|      break;
  773|  3.74k|    }
  774|  3.74k|  }
  775|  3.74k|  if(fields == 6) {
  ------------------
  |  Branch (775:6): [True: 0, False: 3.74k]
  ------------------
  776|       |    /* we got a cookie with blank contents, fix it */
  777|      0|    co->value = curlx_strdup("");
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  778|      0|    if(!co->value)
  ------------------
  |  Branch (778:8): [True: 0, False: 0]
  ------------------
  779|      0|      return CURLE_OUT_OF_MEMORY;
  780|      0|    else
  781|      0|      fields++;
  782|      0|  }
  783|       |
  784|  3.74k|  if(fields != 7)
  ------------------
  |  Branch (784:6): [True: 3.74k, False: 0]
  ------------------
  785|       |    /* we did not find the sufficient number of fields */
  786|  3.74k|    return CURLE_OK;
  787|       |
  788|       |  /* Reject control octets in the name or value, matching the filtering done
  789|       |     for cookies set over HTTP. A cookie loaded from a file is later sent in
  790|       |     request headers, so the same bytes that make a server reject a request
  791|       |     must not slip in through the file. */
  792|      0|  if(invalid_octets(co->name, strlen(co->name)) ||
  ------------------
  |  Branch (792:6): [True: 0, False: 0]
  ------------------
  793|      0|     invalid_octets(co->value, strlen(co->value)))
  ------------------
  |  Branch (793:6): [True: 0, False: 0]
  ------------------
  794|      0|    return CURLE_OK;
  795|       |
  796|      0|  *okay = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  797|      0|  return CURLE_OK;
  798|      0|}
cookie.c:remove_expired:
  274|  7.48k|{
  275|  7.48k|  struct Cookie *co;
  276|  7.48k|  curl_off_t now = (curl_off_t)time(NULL);
  277|  7.48k|  unsigned int i;
  278|       |
  279|       |  /*
  280|       |   * If the earliest expiration timestamp in the jar is in the future we can
  281|       |   * skip scanning the whole jar and instead exit early as there will not be
  282|       |   * any cookies to evict. If we need to evict, reset the next_expiration
  283|       |   * counter in order to track the next one. In case the recorded first
  284|       |   * expiration is the max offset, then perform the safe fallback of checking
  285|       |   * all cookies.
  286|       |   */
  287|  7.48k|  if(now < ci->next_expiration &&
  ------------------
  |  Branch (287:6): [True: 7.48k, False: 0]
  ------------------
  288|  7.48k|     ci->next_expiration != CURL_OFF_T_MAX)
  ------------------
  |  |  540|  7.48k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (288:6): [True: 0, False: 7.48k]
  ------------------
  289|      0|    return;
  290|  7.48k|  else
  291|  7.48k|    ci->next_expiration = CURL_OFF_T_MAX;
  ------------------
  |  |  540|  7.48k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  292|       |
  293|   478k|  for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|   478k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (293:14): [True: 471k, False: 7.48k]
  ------------------
  294|   471k|    struct Curl_llist_node *n;
  295|   471k|    struct Curl_llist_node *e = NULL;
  296|       |
  297|   471k|    for(n = Curl_llist_head(&ci->cookielist[i]); n; n = e) {
  ------------------
  |  Branch (297:50): [True: 0, False: 471k]
  ------------------
  298|      0|      co = Curl_node_elem(n);
  299|      0|      e = Curl_node_next(n);
  300|      0|      if(co->expires) {
  ------------------
  |  Branch (300:10): [True: 0, False: 0]
  ------------------
  301|      0|        if(co->expires < now) {
  ------------------
  |  Branch (301:12): [True: 0, False: 0]
  ------------------
  302|      0|          Curl_node_remove(n);
  303|      0|          freecookie(co, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  304|      0|          ci->numcookies--;
  305|      0|        }
  306|      0|        else if(co->expires < ci->next_expiration)
  ------------------
  |  Branch (306:17): [True: 0, False: 0]
  ------------------
  307|       |          /*
  308|       |           * If this cookie has an expiration timestamp earlier than what we
  309|       |           * have seen so far then record it for the next round of expirations.
  310|       |           */
  311|      0|          ci->next_expiration = co->expires;
  312|      0|      }
  313|      0|    }
  314|   471k|  }
  315|  7.48k|}
cookie.c:freecookie:
   64|  3.74k|{
   65|  3.74k|  curlx_free(co->domain);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   66|  3.74k|  curlx_free(co->path);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   67|  3.74k|  curlx_free(co->name);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   68|  3.74k|  curlx_free(co->value);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   69|  3.74k|  if(maintoo)
  ------------------
  |  Branch (69:6): [True: 0, False: 3.74k]
  ------------------
   70|      0|    curlx_free(co);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   71|  3.74k|}
cookie.c:cookie_load:
 1149|  3.74k|{
 1150|  3.74k|  FILE *handle = NULL;
 1151|  3.74k|  CURLcode result = CURLE_OK;
 1152|  3.74k|  FILE *fp = NULL;
 1153|  3.74k|  DEBUGASSERT(ci);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1153:3): [True: 0, False: 3.74k]
  |  Branch (1153:3): [True: 3.74k, False: 0]
  ------------------
 1154|  3.74k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1154:3): [True: 0, False: 3.74k]
  |  Branch (1154:3): [True: 3.74k, False: 0]
  ------------------
 1155|  3.74k|  DEBUGASSERT(file);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1155:3): [True: 0, False: 3.74k]
  |  Branch (1155:3): [True: 3.74k, False: 0]
  ------------------
 1156|       |
 1157|  3.74k|  ci->newsession = !!(flags & COOKIE_NOSESSION); /* new session? */
  ------------------
  |  |  118|  3.74k|#define COOKIE_NOSESSION  (1<<6) /* drop session cookies */
  ------------------
 1158|  3.74k|  ci->running = FALSE; /* this is not running, this is init */
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1159|       |
 1160|  3.74k|  if(file && *file) {
  ------------------
  |  Branch (1160:6): [True: 3.74k, False: 0]
  |  Branch (1160:14): [True: 3.74k, False: 0]
  ------------------
 1161|  3.74k|    if(!strcmp(file, "-"))
  ------------------
  |  Branch (1161:8): [True: 0, False: 3.74k]
  ------------------
 1162|      0|      fp = stdin;
 1163|  3.74k|    else {
 1164|  3.74k|      fp = curlx_fopen(file, "rb");
  ------------------
  |  |   76|  3.74k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
 1165|  3.74k|      if(!fp)
  ------------------
  |  Branch (1165:10): [True: 0, False: 3.74k]
  ------------------
 1166|      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]
  |  |  ------------------
  ------------------
 1167|  3.74k|      else {
 1168|  3.74k|        curlx_struct_stat stat;
  ------------------
  |  |   65|  3.74k|#define curlx_struct_stat       struct stat
  ------------------
 1169|  3.74k|        if((curlx_fstat(fileno(fp), &stat) != -1) && S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   64|  3.74k|#define curlx_fstat             fstat
  ------------------
  |  Branch (1169:12): [True: 3.74k, False: 0]
  |  Branch (1169:54): [True: 0, False: 3.74k]
  ------------------
 1170|      0|          curlx_fclose(fp);
  ------------------
  |  |   81|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1171|      0|          fp = NULL;
 1172|      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]
  |  |  ------------------
  ------------------
 1173|      0|                file);
 1174|      0|        }
 1175|  3.74k|        else
 1176|  3.74k|          handle = fp;
 1177|  3.74k|      }
 1178|  3.74k|    }
 1179|  3.74k|  }
 1180|       |
 1181|  3.74k|  if(fp) {
  ------------------
  |  Branch (1181:6): [True: 3.74k, False: 0]
  ------------------
 1182|  3.74k|    struct dynbuf buf;
 1183|  3.74k|    bool eof = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1184|  3.74k|    curlx_dyn_init(&buf, MAX_COOKIE_LINE);
  ------------------
  |  |   81|  3.74k|#define MAX_COOKIE_LINE 5000
  ------------------
 1185|  3.74k|    do {
 1186|  3.74k|      result = Curl_get_line(&buf, fp, &eof);
 1187|  3.74k|      if(!result) {
  ------------------
  |  Branch (1187:10): [True: 3.74k, False: 0]
  ------------------
 1188|  3.74k|        const char *lineptr = curlx_dyn_ptr(&buf);
 1189|  3.74k|        bool headerline = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1190|  3.74k|        if(checkprefix("Set-Cookie:", lineptr)) {
  ------------------
  |  |   49|  3.74k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1249|  3.74k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1244|  3.74k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 0, False: 3.74k]
  |  |  ------------------
  ------------------
 1191|       |          /* This is a cookie line, get it! */
 1192|      0|          lineptr += 11;
 1193|      0|          headerline = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1194|      0|          curlx_str_passblanks(&lineptr);
 1195|      0|        }
 1196|       |
 1197|  3.74k|        result = Curl_cookie_add(data, ci, lineptr, NULL, NULL,
 1198|  3.74k|                                 (headerline ? COOKIE_HTTPHEADER : 0) |
  ------------------
  |  |  114|      0|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
  |  Branch (1198:35): [True: 0, False: 3.74k]
  ------------------
 1199|  3.74k|                                 COOKIE_NOEXPIRE | COOKIE_SECURE |
  ------------------
  |  |  115|  3.74k|#define COOKIE_NOEXPIRE   (1<<1) /* skip remove_expired() */
  ------------------
                                               COOKIE_NOEXPIRE | COOKIE_SECURE |
  ------------------
  |  |  116|  3.74k|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1200|  3.74k|                                 (flags & COOKIE_NOPSL));
  ------------------
  |  |  117|  3.74k|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
 1201|       |        /* Ignore individual cookie problems unless we ran out of memory */
 1202|  3.74k|        if(result != CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1202:12): [True: 3.74k, False: 0]
  ------------------
 1203|  3.74k|          result = CURLE_OK;
 1204|  3.74k|      }
 1205|  3.74k|    } while(!result && !eof);
  ------------------
  |  Branch (1205:13): [True: 3.74k, False: 0]
  |  Branch (1205:24): [True: 0, False: 3.74k]
  ------------------
 1206|  3.74k|    curlx_dyn_free(&buf); /* free the line buffer */
 1207|       |
 1208|       |    /*
 1209|       |     * Remove expired cookies from the hash. We must make sure to run this
 1210|       |     * after reading the file, and not on every cookie.
 1211|       |     */
 1212|  3.74k|    remove_expired(ci);
 1213|       |
 1214|  3.74k|    if(handle)
  ------------------
  |  Branch (1214:8): [True: 3.74k, False: 0]
  ------------------
 1215|  3.74k|      curlx_fclose(handle);
  ------------------
  |  |   81|  3.74k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1216|  3.74k|  }
 1217|  3.74k|  data->state.cookie_engine = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 1218|  3.74k|  ci->running = TRUE; /* now, we are running */
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 1219|       |
 1220|  3.74k|  return result;
 1221|  3.74k|}
cookie.c:cookie_output:
 1531|  3.74k|{
 1532|  3.74k|  FILE *out = NULL;
 1533|  3.74k|  bool use_stdout = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1534|  3.74k|  char *tempstore = NULL;
 1535|  3.74k|  CURLcode result = CURLE_OK;
 1536|       |
 1537|  3.74k|  if(!ci)
  ------------------
  |  Branch (1537:6): [True: 0, False: 3.74k]
  ------------------
 1538|       |    /* no cookie engine alive */
 1539|      0|    return CURLE_OK;
 1540|       |
 1541|       |  /* at first, remove expired cookies */
 1542|  3.74k|  remove_expired(ci);
 1543|       |
 1544|  3.74k|  if(!strcmp("-", filename)) {
  ------------------
  |  Branch (1544:6): [True: 0, False: 3.74k]
  ------------------
 1545|       |    /* use stdout */
 1546|      0|    out = stdout;
 1547|      0|    use_stdout = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1548|      0|  }
 1549|  3.74k|  else {
 1550|  3.74k|    result = Curl_fopen(data, filename, &out, &tempstore);
 1551|  3.74k|    if(result)
  ------------------
  |  Branch (1551:8): [True: 0, False: 3.74k]
  ------------------
 1552|      0|      goto error;
 1553|  3.74k|  }
 1554|       |
 1555|  3.74k|  fputs("# Netscape HTTP Cookie File\n"
 1556|  3.74k|        "# https://curl.se/docs/http-cookies.html\n"
 1557|  3.74k|        "# This file was generated by libcurl! Edit at your own risk.\n\n",
 1558|  3.74k|        out);
 1559|       |
 1560|  3.74k|  if(ci->numcookies) {
  ------------------
  |  Branch (1560:6): [True: 0, False: 3.74k]
  ------------------
 1561|      0|    unsigned int i;
 1562|      0|    size_t nvalid = 0;
 1563|      0|    struct Cookie **array;
 1564|      0|    struct Curl_llist_node *n;
 1565|       |
 1566|      0|    array = curlx_calloc(1, sizeof(struct Cookie *) * ci->numcookies);
  ------------------
  |  | 1425|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1567|      0|    if(!array) {
  ------------------
  |  Branch (1567:8): [True: 0, False: 0]
  ------------------
 1568|      0|      result = CURLE_OUT_OF_MEMORY;
 1569|      0|      goto error;
 1570|      0|    }
 1571|       |
 1572|       |    /* only sort the cookies with a domain property */
 1573|      0|    for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|      0|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1573:16): [True: 0, False: 0]
  ------------------
 1574|      0|      for(n = Curl_llist_head(&ci->cookielist[i]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (1574:52): [True: 0, False: 0]
  ------------------
 1575|      0|        struct Cookie *co = Curl_node_elem(n);
 1576|      0|        if(!co->domain)
  ------------------
  |  Branch (1576:12): [True: 0, False: 0]
  ------------------
 1577|      0|          continue;
 1578|      0|        array[nvalid++] = co;
 1579|      0|      }
 1580|      0|    }
 1581|       |
 1582|      0|    qsort(array, nvalid, sizeof(struct Cookie *), cookie_sort_ct);
 1583|       |
 1584|      0|    for(i = 0; i < nvalid; i++) {
  ------------------
  |  Branch (1584:16): [True: 0, False: 0]
  ------------------
 1585|      0|      char *format_ptr = get_netscape_format(array[i]);
 1586|      0|      if(!format_ptr) {
  ------------------
  |  Branch (1586:10): [True: 0, False: 0]
  ------------------
 1587|      0|        curlx_free(array);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1588|      0|        result = CURLE_OUT_OF_MEMORY;
 1589|      0|        goto error;
 1590|      0|      }
 1591|      0|      curl_mfprintf(out, "%s\n", format_ptr);
 1592|      0|      curlx_free(format_ptr);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1593|      0|    }
 1594|       |
 1595|      0|    curlx_free(array);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1596|      0|  }
 1597|       |
 1598|  3.74k|  if(!use_stdout) {
  ------------------
  |  Branch (1598:6): [True: 3.74k, False: 0]
  ------------------
 1599|  3.74k|    curlx_fclose(out);
  ------------------
  |  |   81|  3.74k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1600|  3.74k|    out = NULL;
 1601|  3.74k|    if(tempstore && curlx_rename(tempstore, filename)) {
  ------------------
  |  |   72|      0|#define curlx_rename            rename
  ------------------
  |  Branch (1601:8): [True: 0, False: 3.74k]
  |  Branch (1601:21): [True: 0, False: 0]
  ------------------
 1602|      0|      result = CURLE_WRITE_ERROR;
 1603|      0|      goto error;
 1604|      0|    }
 1605|  3.74k|  }
 1606|       |
 1607|       |  /*
 1608|       |   * If we reach here we have successfully written a cookie file so there is
 1609|       |   * no need to inspect the error, any error case should have jumped into the
 1610|       |   * error block below.
 1611|       |   */
 1612|  3.74k|  curlx_free(tempstore);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1613|  3.74k|  return CURLE_OK;
 1614|       |
 1615|      0|error:
 1616|      0|  if(out && !use_stdout)
  ------------------
  |  Branch (1616:6): [True: 0, False: 0]
  |  Branch (1616:13): [True: 0, False: 0]
  ------------------
 1617|      0|    curlx_fclose(out);
  ------------------
  |  |   81|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1618|      0|  if(tempstore) {
  ------------------
  |  Branch (1618:6): [True: 0, False: 0]
  ------------------
 1619|      0|    unlink(tempstore);
 1620|      0|    curlx_free(tempstore);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1621|      0|  }
 1622|      0|  return result;
 1623|  3.74k|}

Curl_creds_create:
   41|  3.17k|{
   42|  3.17k|  struct Curl_creds *creds = NULL;
   43|  3.17k|  size_t ulen = user ? strlen(user) : 0;
  ------------------
  |  Branch (43:17): [True: 416, False: 2.75k]
  ------------------
   44|  3.17k|  size_t plen = passwd ? strlen(passwd) : 0;
  ------------------
  |  Branch (44:17): [True: 206, False: 2.96k]
  ------------------
   45|  3.17k|  size_t olen = oauth_bearer ? strlen(oauth_bearer) : 0;
  ------------------
  |  Branch (45:17): [True: 105, False: 3.06k]
  ------------------
   46|  3.17k|  size_t salen = sasl_authzid ? strlen(sasl_authzid) : 0;
  ------------------
  |  Branch (46:18): [True: 105, False: 3.06k]
  ------------------
   47|  3.17k|  size_t sslen = sasl_service ? strlen(sasl_service) : 0;
  ------------------
  |  Branch (47:18): [True: 105, False: 3.06k]
  ------------------
   48|  3.17k|  char *s, *buf;
   49|  3.17k|  size_t bufsize;
   50|  3.17k|  CURLcode result = CURLE_OK;
   51|       |
   52|  3.17k|  Curl_creds_unlink(pcreds);
   53|       |
   54|       |  /* Everything empty/NULL, this is the NULL credential */
   55|  3.17k|  if(!user && !passwd && !olen && !salen && !sslen)
  ------------------
  |  Branch (55:6): [True: 2.75k, False: 416]
  |  Branch (55:15): [True: 2.71k, False: 44]
  |  Branch (55:26): [True: 2.71k, False: 0]
  |  Branch (55:35): [True: 2.71k, False: 0]
  |  Branch (55:45): [True: 2.71k, False: 0]
  ------------------
   56|  2.71k|    goto out;
   57|       |
   58|    460|  if((ulen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    460|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (58:6): [True: 0, False: 460]
  ------------------
   59|    460|     (plen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    460|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (59:6): [True: 0, False: 460]
  ------------------
   60|    460|     (olen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    460|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (60:6): [True: 0, False: 460]
  ------------------
   61|    460|     (salen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    460|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (61:6): [True: 0, False: 460]
  ------------------
   62|    460|     (sslen > CURL_MAX_INPUT_LENGTH)) {
  ------------------
  |  |   45|    460|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (62:6): [True: 0, False: 460]
  ------------------
   63|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
   64|      0|    goto out;
   65|      0|  }
   66|       |
   67|       |  /* null-terminator for user already part of struct */
   68|    460|  bufsize = ulen + plen + 1 + olen + 1 + salen + 1 + sslen + 1;
   69|    460|  creds = curlx_calloc(1, sizeof(*creds) + bufsize);
  ------------------
  |  | 1425|    460|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   70|    460|  if(!creds) {
  ------------------
  |  Branch (70:6): [True: 0, False: 460]
  ------------------
   71|      0|    result = CURLE_OUT_OF_MEMORY;
   72|      0|    goto out;
   73|      0|  }
   74|       |
   75|    460|  creds->bufsize = bufsize;
   76|    460|  creds->refcount = 1;
   77|    460|  creds->source = source;
   78|       |  /* Some compilers try to be too smart about our dynamic struct size */
   79|    460|  buf = ((char *)creds) + offsetof(struct Curl_creds, buf);
   80|    460|  creds->user = s = buf;
   81|    460|  if(ulen)
  ------------------
  |  Branch (81:6): [True: 165, False: 295]
  ------------------
   82|    165|    memcpy(s, user, ulen + 1);
   83|    460|  creds->passwd = s = buf + ulen + 1;
   84|    460|  if(plen)
  ------------------
  |  Branch (84:6): [True: 73, False: 387]
  ------------------
   85|     73|    memcpy(s, passwd, plen + 1);
   86|    460|  creds->oauth_bearer = s = buf + ulen + 1 + plen + 1;
   87|    460|  if(olen)
  ------------------
  |  Branch (87:6): [True: 0, False: 460]
  ------------------
   88|      0|    memcpy(s, oauth_bearer, olen + 1);
   89|    460|  creds->sasl_authzid = s = buf + ulen + 1 + plen + 1 + olen + 1;
   90|    460|  if(salen)
  ------------------
  |  Branch (90:6): [True: 0, False: 460]
  ------------------
   91|      0|    memcpy(s, sasl_authzid, salen + 1);
   92|    460|  creds->sasl_service = s = buf + ulen + 1 + plen + 1 + olen + 1 + salen + 1;
   93|    460|  if(sslen)
  ------------------
  |  Branch (93:6): [True: 0, False: 460]
  ------------------
   94|      0|    memcpy(s, sasl_service, sslen + 1);
   95|       |
   96|  3.17k|out:
   97|  3.17k|  if(!result)
  ------------------
  |  Branch (97:6): [True: 3.17k, False: 0]
  ------------------
   98|  3.17k|    *pcreds = creds;
   99|      0|  else
  100|      0|    Curl_creds_unlink(&creds);
  101|  3.17k|  return result;
  102|    460|}
Curl_creds_merge:
  109|  2.99k|{
  110|  2.99k|  struct Curl_creds *creds_out = NULL;
  111|  2.99k|  CURLcode result;
  112|       |
  113|  2.99k|  if(!creds_in) {
  ------------------
  |  Branch (113:6): [True: 2.89k, False: 105]
  ------------------
  114|  2.89k|    result = Curl_creds_create(user, passwd, NULL, NULL, NULL,
  115|  2.89k|                               source, &creds_out);
  116|  2.89k|  }
  117|    105|  else {
  118|    105|    result = Curl_creds_create(user ? user : Curl_creds_user(creds_in),
  ------------------
  |  |   81|     91|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (81:43): [True: 91, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (118:32): [True: 14, False: 91]
  ------------------
  119|    105|                               passwd ? passwd : Curl_creds_passwd(creds_in),
  ------------------
  |  |   82|     93|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 93, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (119:32): [True: 12, False: 93]
  ------------------
  120|    105|                               Curl_creds_oauth_bearer(creds_in),
  ------------------
  |  |   83|    105|#define Curl_creds_oauth_bearer(c)       ((c) ? (c)->oauth_bearer : "")
  |  |  ------------------
  |  |  |  Branch (83:43): [True: 105, False: 0]
  |  |  ------------------
  ------------------
  121|    105|                               Curl_creds_sasl_authzid(creds_in),
  ------------------
  |  |   84|    105|#define Curl_creds_sasl_authzid(c)       ((c) ? (c)->sasl_authzid : "")
  |  |  ------------------
  |  |  |  Branch (84:43): [True: 105, False: 0]
  |  |  ------------------
  ------------------
  122|    105|                               Curl_creds_sasl_service(creds_in),
  ------------------
  |  |   85|    105|#define Curl_creds_sasl_service(c)       ((c) ? (c)->sasl_service : "")
  |  |  ------------------
  |  |  |  Branch (85:43): [True: 105, False: 0]
  |  |  ------------------
  ------------------
  123|    105|                               source, &creds_out);
  124|    105|  }
  125|  2.99k|  Curl_creds_link(pcreds_out, creds_out);
  126|  2.99k|  Curl_creds_unlink(&creds_out);
  127|  2.99k|  return result;
  128|  2.99k|}
Curl_creds_link:
  131|  6.37k|{
  132|  6.37k|  if(*pdest != src) {
  ------------------
  |  Branch (132:6): [True: 946, False: 5.42k]
  ------------------
  133|    946|    Curl_creds_unlink(pdest);
  134|    946|    *pdest = src;
  135|    946|    if(src) {
  ------------------
  |  Branch (135:8): [True: 946, False: 0]
  ------------------
  136|    946|      DEBUGASSERT(src->refcount < UINT32_MAX);
  ------------------
  |  | 1027|    946|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (136:7): [True: 0, False: 946]
  |  Branch (136:7): [True: 946, False: 0]
  ------------------
  137|    946|      src->refcount++;
  138|    946|    }
  139|    946|  }
  140|  6.37k|}
Curl_creds_unlink:
  143|  48.5k|{
  144|  48.5k|  if(*pcreds) {
  ------------------
  |  Branch (144:6): [True: 1.40k, False: 47.1k]
  ------------------
  145|  1.40k|    struct Curl_creds *creds = *pcreds;
  146|       |
  147|  1.40k|    DEBUGASSERT(creds->refcount);
  ------------------
  |  | 1027|  1.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (147:5): [True: 0, False: 1.40k]
  |  Branch (147:5): [True: 1.40k, False: 0]
  ------------------
  148|  1.40k|    *pcreds = NULL;
  149|  1.40k|    if(creds->refcount)
  ------------------
  |  Branch (149:8): [True: 1.40k, False: 0]
  ------------------
  150|  1.40k|      creds->refcount--;
  151|  1.40k|    if(!creds->refcount) {
  ------------------
  |  Branch (151:8): [True: 460, False: 946]
  ------------------
  152|    460|      curlx_memzero(creds, sizeof(*creds) + creds->bufsize);
  153|    460|      curlx_free(creds);
  ------------------
  |  | 1428|    460|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  154|    460|    }
  155|  1.40k|  }
  156|  48.5k|}
Curl_creds_same:
  159|  3.04k|{
  160|  3.04k|  return (c1 == c2) ||
  ------------------
  |  Branch (160:10): [True: 2.71k, False: 331]
  ------------------
  161|    331|         (c1 && c2 &&
  ------------------
  |  Branch (161:11): [True: 0, False: 331]
  |  Branch (161:17): [True: 0, False: 0]
  ------------------
  162|      0|          !Curl_timestrcmp(c1->user, c2->user) &&
  ------------------
  |  Branch (162:11): [True: 0, False: 0]
  ------------------
  163|      0|          !Curl_timestrcmp(c1->passwd, c2->passwd) &&
  ------------------
  |  Branch (163:11): [True: 0, False: 0]
  ------------------
  164|      0|          !Curl_timestrcmp(c1->oauth_bearer, c2->oauth_bearer) &&
  ------------------
  |  Branch (164:11): [True: 0, False: 0]
  ------------------
  165|      0|          !Curl_timestrcmp(c1->sasl_authzid, c2->sasl_authzid) &&
  ------------------
  |  Branch (165:11): [True: 0, False: 0]
  ------------------
  166|      0|          !Curl_timestrcmp(c1->sasl_service, c2->sasl_service));
  ------------------
  |  Branch (166:11): [True: 0, False: 0]
  ------------------
  167|  3.04k|}
Curl_creds_equal:
  170|  3.04k|{
  171|  3.04k|  return Curl_creds_same(c1, c2) &&
  ------------------
  |  Branch (171:10): [True: 2.71k, False: 331]
  ------------------
  172|  2.71k|         ((c1 == c2) || (c1 && c2 && (c1->source == c2->source)));
  ------------------
  |  Branch (172:11): [True: 2.71k, False: 0]
  |  Branch (172:26): [True: 0, False: 0]
  |  Branch (172:32): [True: 0, False: 0]
  |  Branch (172:38): [True: 0, False: 0]
  ------------------
  173|  3.04k|}
Curl_creds_trace:
  178|  3.04k|{
  179|  3.04k|  if(creds) {
  ------------------
  |  Branch (179:6): [True: 0, False: 3.04k]
  ------------------
  180|      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]
  |  |  ------------------
  ------------------
  181|      0|               "sasl_authzid=%s, oauth_bearer=%s, source=%d",
  182|      0|               msg,
  183|      0|               Curl_creds_user(creds),
  184|      0|               Curl_creds_has_passwd(creds) ? "***" : "",
  185|      0|               Curl_creds_sasl_authzid(creds),
  186|      0|               Curl_creds_has_oauth_bearer(creds) ? "***" : "",
  187|      0|               creds->source);
  188|      0|  }
  189|  3.04k|  else
  190|  3.04k|    CURL_TRC_M(data, "%s: -", msg);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  191|  3.04k|}

Curl_cshutdn_start_timer:
   45|  3.04k|{
   46|  3.04k|  struct connectdata *conn = data->conn;
   47|  3.04k|  const struct curltime *pnow = Curl_pgrs_now(data);
   48|       |
   49|  3.04k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (49:3): [True: 0, False: 3.04k]
  |  Branch (49:3): [True: 3.04k, False: 0]
  ------------------
   50|  3.04k|  conn->shutdown.start_ms[sockindex] =
   51|  3.04k|    curlx_ptimediff_ms(pnow, &conn->created);
   52|  3.04k|  conn->shutdown.timeout_ms = (timeout_ms > 0) ?
  ------------------
  |  Branch (52:31): [True: 0, False: 3.04k]
  ------------------
   53|      0|    (timediff_t)timeout_ms :
   54|  3.04k|    ((data->set.shutdowntimeout > 0) ?
  ------------------
  |  Branch (54:6): [True: 0, False: 3.04k]
  ------------------
   55|  3.04k|     data->set.shutdowntimeout : DEFAULT_SHUTDOWN_TIMEOUT_MS);
  ------------------
  |  |   41|  3.04k|#define DEFAULT_SHUTDOWN_TIMEOUT_MS   (2 * 1000)
  ------------------
   56|       |  /* Set a timer, unless we operate on the admin handle */
   57|  3.04k|  if(data->mid)
  ------------------
  |  Branch (57:6): [True: 0, False: 3.04k]
  ------------------
   58|      0|    Curl_expire_set(data, EXPIRE_SHUTDOWN, conn->shutdown.timeout_ms, pnow);
   59|  3.04k|  CURL_TRC_M(data, "shutdown start on%s connection",
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
   60|  3.04k|             sockindex ? " secondary" : "");
   61|  3.04k|}
Curl_cshutdn_timeleft_ms:
   66|  3.04k|{
   67|  3.04k|  timediff_t left_ms;
   68|       |
   69|  3.04k|  if(conn->shutdown.start_ms[sockindex] < 0)
  ------------------
  |  Branch (69:6): [True: 0, False: 3.04k]
  ------------------
   70|      0|    return 0; /* not started or no limits */
   71|       |
   72|  3.04k|  left_ms = conn->shutdown.timeout_ms -
   73|  3.04k|            (curlx_ptimediff_ms(Curl_pgrs_now(data), &conn->created) -
   74|  3.04k|             conn->shutdown.start_ms[sockindex]);
   75|  3.04k|  return left_ms ? left_ms : -1;
  ------------------
  |  Branch (75:10): [True: 3.04k, False: 0]
  ------------------
   76|  3.04k|}
Curl_cshutdn_has_started:
  100|  37.6k|{
  101|  37.6k|  return conn->shutdown.start_ms[sockindex] >= 0;
  102|  37.6k|}
Curl_cshutdn_try_once_idx:
  134|  3.04k|{
  135|  3.04k|  struct Curl_cfilter *cf;
  136|  3.04k|  CURLcode result = CURLE_OK;
  137|  3.04k|  timediff_t timeout_ms;
  138|       |
  139|  3.04k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (139:3): [True: 0, False: 3.04k]
  |  Branch (139:3): [True: 3.04k, False: 0]
  ------------------
  140|       |
  141|  3.04k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  310|  3.04k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 3.04k, False: 0]
  |  |  |  Branch (310:50): [True: 3.04k, False: 0]
  |  |  ------------------
  ------------------
  142|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  143|       |
  144|       |  /* Get the first connected filter that is not shut down already. */
  145|  3.04k|  cf = data->conn->cfilter[sockindex];
  146|  3.04k|  while(cf && (!cf->connected || cf->shutdown))
  ------------------
  |  Branch (146:9): [True: 3.04k, False: 0]
  |  Branch (146:16): [True: 0, False: 3.04k]
  |  Branch (146:34): [True: 0, False: 3.04k]
  ------------------
  147|      0|    cf = cf->next;
  148|       |
  149|  3.04k|  if(!cf) {
  ------------------
  |  Branch (149:6): [True: 0, False: 3.04k]
  ------------------
  150|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  151|      0|    return CURLE_OK;
  152|      0|  }
  153|       |
  154|  3.04k|  *done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  155|  3.04k|  if(!Curl_cshutdn_has_started(data->conn, sockindex)) {
  ------------------
  |  Branch (155:6): [True: 0, False: 3.04k]
  ------------------
  156|      0|    Curl_cshutdn_start_timer(data, sockindex, 0);
  157|      0|  }
  158|  3.04k|  else {
  159|  3.04k|    timeout_ms = Curl_cshutdn_timeleft_ms(data, data->conn, sockindex);
  160|  3.04k|    if(timeout_ms < 0) {
  ------------------
  |  Branch (160:8): [True: 0, False: 3.04k]
  ------------------
  161|       |      /* info message, since this might be regarded as acceptable */
  162|      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]
  |  |  ------------------
  ------------------
  163|      0|      return CURLE_OPERATION_TIMEDOUT;
  164|      0|    }
  165|  3.04k|  }
  166|       |
  167|  6.08k|  while(cf) {
  ------------------
  |  Branch (167:9): [True: 3.04k, False: 3.04k]
  ------------------
  168|  3.04k|    if(!cf->shutdown) {
  ------------------
  |  Branch (168:8): [True: 3.04k, False: 0]
  ------------------
  169|  3.04k|      bool cfdone = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  170|  3.04k|      result = cf->cft->do_shutdown(cf, data, &cfdone);
  171|  3.04k|      if(result) {
  ------------------
  |  Branch (171:10): [True: 0, False: 3.04k]
  ------------------
  172|      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]
  |  |  ------------------
  ------------------
  173|      0|        return result;
  174|      0|      }
  175|  3.04k|      else if(!cfdone) {
  ------------------
  |  Branch (175:15): [True: 0, False: 3.04k]
  ------------------
  176|      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]
  |  |  ------------------
  ------------------
  177|      0|        return CURLE_OK;
  178|      0|      }
  179|  3.04k|      CURL_TRC_CF(data, cf, "shut down successfully");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((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.04k|   (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.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  180|  3.04k|      cf->shutdown = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  181|  3.04k|    }
  182|  3.04k|    cf = cf->next;
  183|  3.04k|  }
  184|  3.04k|  *done = (!result);
  185|  3.04k|  return result;
  186|  3.04k|}
Curl_cshutdn_try_once:
  232|  3.04k|{
  233|  3.04k|  DEBUGASSERT(!admin->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (233:3): [True: 0, False: 3.04k]
  |  Branch (233:3): [True: 3.04k, False: 0]
  ------------------
  234|  3.04k|  DEBUGASSERT(!admin->mid);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (234:3): [True: 0, False: 3.04k]
  |  Branch (234:3): [True: 3.04k, False: 0]
  ------------------
  235|  3.04k|  Curl_attach_connection(admin, conn, FALSE);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  236|  3.04k|  cshutdn_run_once(admin, conn, done);
  237|  3.04k|  CURL_TRC_M(admin, "[SHUTDOWN] shutdown, done=%d", *done);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  238|  3.04k|  Curl_detach_connection(admin);
  239|  3.04k|}
Curl_cshutdn_terminate:
  244|  3.04k|{
  245|  3.04k|  bool done;
  246|       |
  247|       |  /* there must be a connection to close */
  248|  3.04k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 3.04k]
  |  Branch (248:3): [True: 3.04k, False: 0]
  ------------------
  249|       |  /* it must be removed from the connection pool */
  250|  3.04k|  DEBUGASSERT(!conn->bits.in_cpool);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (250:3): [True: 0, False: 3.04k]
  |  Branch (250:3): [True: 3.04k, False: 0]
  ------------------
  251|       |  /* the transfer must be detached from the connection */
  252|  3.04k|  DEBUGASSERT(admin && !admin->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (252:3): [True: 0, False: 3.04k]
  |  Branch (252:3): [True: 0, False: 0]
  |  Branch (252:3): [True: 3.04k, False: 0]
  |  Branch (252:3): [True: 3.04k, False: 0]
  ------------------
  253|  3.04k|  DEBUGASSERT(!admin->mid);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (253:3): [True: 0, False: 3.04k]
  |  Branch (253:3): [True: 3.04k, False: 0]
  ------------------
  254|       |
  255|  3.04k|  Curl_attach_connection(admin, conn, FALSE);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  256|       |
  257|  3.04k|  cshutdn_run_conn_handler(admin, conn);
  258|  3.04k|  if(do_shutdown) {
  ------------------
  |  Branch (258:6): [True: 0, False: 3.04k]
  ------------------
  259|       |    /* Make a last attempt to shutdown handlers and filters, if
  260|       |     * not done so already. */
  261|      0|    cshutdn_run_once(admin, conn, &done);
  262|      0|  }
  263|  3.04k|  CURL_TRC_M(admin, "[SHUTDOWN] %sclosing connection #%" FMT_OFF_T,
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  264|  3.04k|             conn->bits.shutdown_filters ? "" : "force ",
  265|  3.04k|             conn->connection_id);
  266|  3.04k|  Curl_conn_cf_discard_all(admin, conn, SECONDARYSOCKET);
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
  267|  3.04k|  Curl_conn_cf_discard_all(admin, conn, FIRSTSOCKET);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  268|  3.04k|  Curl_detach_connection(admin);
  269|       |
  270|  3.04k|  if(admin->multi)
  ------------------
  |  Branch (270:6): [True: 3.04k, False: 0]
  ------------------
  271|  3.04k|    Curl_multi_ev_conn_done(admin->multi, admin, conn);
  272|  3.04k|  Curl_conn_free(admin, conn);
  273|       |
  274|  3.04k|  if(admin->multi) {
  ------------------
  |  Branch (274:6): [True: 3.04k, False: 0]
  ------------------
  275|  3.04k|    CURL_TRC_M(admin, "[SHUTDOWN] trigger multi connchanged");
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  276|  3.04k|    Curl_multi_connchanged(admin->multi);
  277|  3.04k|  }
  278|  3.04k|}
Curl_cshutdn_init:
  430|  3.74k|{
  431|       |  Curl_llist_init(&cshutdn->list, NULL);
  432|  3.74k|}
Curl_cshutdn_destroy:
  436|  3.74k|{
  437|  3.74k|  if(admin) {
  ------------------
  |  Branch (437:6): [True: 3.74k, False: 0]
  ------------------
  438|  3.74k|    int timeout_ms = 0;
  439|       |    /* for testing, run graceful shutdown */
  440|  3.74k|#ifdef DEBUGBUILD
  441|  3.74k|    {
  442|  3.74k|      const char *p = getenv("CURL_GRACEFUL_SHUTDOWN");
  443|  3.74k|      if(p) {
  ------------------
  |  Branch (443:10): [True: 0, False: 3.74k]
  ------------------
  444|      0|        curl_off_t l;
  445|      0|        if(!curlx_str_number(&p, &l, INT_MAX))
  ------------------
  |  Branch (445:12): [True: 0, False: 0]
  ------------------
  446|      0|          timeout_ms = (int)l;
  447|      0|      }
  448|  3.74k|    }
  449|  3.74k|#endif
  450|  3.74k|    if(Curl_llist_count(&cshutdn->list)) {
  ------------------
  |  Branch (450:8): [True: 0, False: 3.74k]
  ------------------
  451|      0|      CURL_TRC_M(admin, "[SHUTDOWN] destroy, %zu 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]
  |  |  ------------------
  ------------------
  452|      0|                 Curl_llist_count(&cshutdn->list), timeout_ms);
  453|      0|      cshutdn_terminate_all(cshutdn, admin, timeout_ms);
  454|      0|    }
  455|  3.74k|  }
  456|  3.74k|}
Curl_cshutdn_perform:
  524|  3.74k|{
  525|  3.74k|  cshutdn_perform(cshutdn, admin, sigpipe_ctx);
  526|  3.74k|}
cshutdn.c:cshutdn_run_once:
  191|  3.04k|{
  192|  3.04k|  CURLcode r1, r2;
  193|  3.04k|  bool done1, done2;
  194|       |
  195|       |  /* We expect to be attached when called */
  196|  3.04k|  DEBUGASSERT(data->conn == conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (196:3): [True: 0, False: 3.04k]
  |  Branch (196:3): [True: 3.04k, False: 0]
  ------------------
  197|       |
  198|  3.04k|  if(!Curl_cshutdn_has_started(conn, FIRSTSOCKET)) {
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (198:6): [True: 3.04k, False: 0]
  ------------------
  199|  3.04k|    Curl_cshutdn_start_timer(data, FIRSTSOCKET, 0);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  200|  3.04k|  }
  201|       |
  202|  3.04k|  cshutdn_run_conn_handler(data, conn);
  203|       |
  204|  3.04k|  if(conn->bits.shutdown_filters) {
  ------------------
  |  Branch (204:6): [True: 0, False: 3.04k]
  ------------------
  205|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  206|      0|    return;
  207|      0|  }
  208|       |
  209|  3.04k|  if(!conn->bits.connect_only && Curl_conn_is_connected(conn, FIRSTSOCKET))
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (209:6): [True: 3.04k, False: 0]
  |  Branch (209:34): [True: 3.04k, False: 0]
  ------------------
  210|  3.04k|    r1 = Curl_cshutdn_try_once_idx(data, FIRSTSOCKET, &done1);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  211|      0|  else {
  212|      0|    r1 = CURLE_OK;
  213|      0|    done1 = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  214|      0|  }
  215|       |
  216|  3.04k|  if(!conn->bits.connect_only && Curl_conn_is_connected(conn, SECONDARYSOCKET))
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (216:6): [True: 3.04k, False: 0]
  |  Branch (216:34): [True: 0, False: 3.04k]
  ------------------
  217|      0|    r2 = Curl_cshutdn_try_once_idx(data, SECONDARYSOCKET, &done2);
  ------------------
  |  |  234|      0|#define SECONDARYSOCKET 1
  ------------------
  218|  3.04k|  else {
  219|  3.04k|    r2 = CURLE_OK;
  220|  3.04k|    done2 = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  221|  3.04k|  }
  222|       |
  223|       |  /* we are done when any failed or both report success */
  224|  3.04k|  *done = (r1 || r2 || (done1 && done2));
  ------------------
  |  Branch (224:12): [True: 0, False: 3.04k]
  |  Branch (224:18): [True: 0, False: 3.04k]
  |  Branch (224:25): [True: 3.04k, False: 0]
  |  Branch (224:34): [True: 3.04k, False: 0]
  ------------------
  225|  3.04k|  if(*done)
  ------------------
  |  Branch (225:6): [True: 3.04k, False: 0]
  ------------------
  226|  3.04k|    conn->bits.shutdown_filters = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  227|  3.04k|}
cshutdn.c:cshutdn_run_conn_handler:
  106|  6.08k|{
  107|  6.08k|  if(!conn->bits.shutdown_handler) {
  ------------------
  |  Branch (107:6): [True: 3.04k, False: 3.04k]
  ------------------
  108|       |
  109|  3.04k|    if(conn->scheme && conn->scheme->run->disconnect) {
  ------------------
  |  Branch (109:8): [True: 3.04k, False: 0]
  |  Branch (109:24): [True: 0, False: 3.04k]
  ------------------
  110|       |      /* Some disconnect handlers do a blocking wait on server responses.
  111|       |       * FTP/IMAP/SMTP and SFTP are among them. When using the internal
  112|       |       * handle, set an overall short timeout so we do not hang for the
  113|       |       * default 120 seconds. */
  114|      0|      if(data->state.internal) {
  ------------------
  |  Branch (114:10): [True: 0, False: 0]
  ------------------
  115|      0|        data->set.timeout = DEFAULT_SHUTDOWN_TIMEOUT_MS;
  ------------------
  |  |   41|      0|#define DEFAULT_SHUTDOWN_TIMEOUT_MS   (2 * 1000)
  ------------------
  116|      0|        Curl_pgrsTime(data, TIMER_STARTOP);
  117|      0|      }
  118|       |
  119|       |      /* This is set if protocol-specific cleanups should be made */
  120|      0|      DEBUGF(infof(data, "connection #%" FMT_OFF_T
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  121|      0|                   ", shutdown protocol handler (aborted=%d)",
  122|      0|                   conn->connection_id, conn->bits.aborted));
  123|       |      /* There are protocol handlers that block on retrieving
  124|       |       * server responses here (FTP). Set a short timeout. */
  125|      0|      conn->scheme->run->disconnect(data, conn, (bool)conn->bits.aborted);
  126|      0|    }
  127|       |
  128|       |    conn->bits.shutdown_handler = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  129|  3.04k|  }
  130|  6.08k|}
cshutdn.c:cshutdn_perform:
  344|  3.74k|{
  345|  3.74k|  struct Curl_llist_node *e = Curl_llist_head(&cshutdn->list);
  346|  3.74k|  struct Curl_llist_node *enext;
  347|  3.74k|  struct connectdata *conn;
  348|  3.74k|  timediff_t next_expire_ms = 0, ms;
  349|  3.74k|  bool done;
  350|       |
  351|  3.74k|  if(!e)
  ------------------
  |  Branch (351:6): [True: 3.74k, False: 0]
  ------------------
  352|  3.74k|    return;
  353|       |
  354|      0|  CURL_TRC_M(admin, "[SHUTDOWN] perform on %zu 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]
  |  |  ------------------
  ------------------
  355|      0|             Curl_llist_count(&cshutdn->list));
  356|      0|  sigpipe_apply(admin, sigpipe_ctx);
  357|      0|  while(e) {
  ------------------
  |  Branch (357:9): [True: 0, False: 0]
  ------------------
  358|      0|    enext = Curl_node_next(e);
  359|      0|    conn = Curl_node_elem(e);
  360|      0|    Curl_cshutdn_try_once(admin, conn, &done);
  361|      0|    if(done) {
  ------------------
  |  Branch (361:8): [True: 0, False: 0]
  ------------------
  362|      0|      Curl_node_remove(e);
  363|      0|      Curl_cshutdn_terminate(admin, conn, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  364|      0|    }
  365|      0|    else {
  366|       |      /* idata has one timer list, but maybe more than one connection.
  367|       |       * Set EXPIRE_SHUTDOWN to the smallest time left for all. */
  368|      0|      ms = cshutdn_conn_timeleft(admin, conn);
  369|      0|      if(ms && (!next_expire_ms || (ms < next_expire_ms)))
  ------------------
  |  Branch (369:10): [True: 0, False: 0]
  |  Branch (369:17): [True: 0, False: 0]
  |  Branch (369:36): [True: 0, False: 0]
  ------------------
  370|      0|        next_expire_ms = ms;
  371|      0|    }
  372|      0|    e = enext;
  373|      0|  }
  374|       |
  375|      0|  if(next_expire_ms)
  ------------------
  |  Branch (375:6): [True: 0, False: 0]
  ------------------
  376|      0|    Curl_expire(admin, next_expire_ms, EXPIRE_SHUTDOWN);
  377|      0|}

Curl_freeaddrinfo:
   72|  3.04k|{
   73|  3.04k|  struct Curl_addrinfo *vqualifier canext;
   74|  3.04k|  struct Curl_addrinfo *ca;
   75|       |
   76|  6.08k|  for(ca = cahead; ca; ca = canext) {
  ------------------
  |  Branch (76:20): [True: 3.04k, False: 3.04k]
  ------------------
   77|  3.04k|    canext = ca->ai_next;
   78|  3.04k|    curlx_free(ca);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  3.04k|  }
   80|  3.04k|}
Curl_addrinfo_get:
   85|  6.08k|{
   86|  6.08k|  unsigned int i;
   87|  9.12k|  for(i = 0; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (87:14): [True: 6.08k, False: 3.04k]
  ------------------
   88|  6.08k|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (88:8): [True: 3.04k, False: 3.04k]
  ------------------
   89|  3.04k|      if(i == n)
  ------------------
  |  Branch (89:10): [True: 3.04k, False: 0]
  ------------------
   90|  3.04k|        return ai;
   91|      0|      ++i;
   92|      0|    }
   93|  6.08k|  }
   94|  3.04k|  return NULL;
   95|  6.08k|}
Curl_str2addr:
  425|  3.04k|{
  426|  3.04k|  struct in_addr in;
  427|  3.04k|  if(curlx_inet_pton(AF_INET, dotted, &in) > 0)
  ------------------
  |  Branch (427:6): [True: 3.04k, False: 0]
  ------------------
  428|       |    /* This is a dotted IP address 123.123.123.123-style */
  429|  3.04k|    return ip2addr(addrp, AF_INET, &in, dotted, port);
  430|      0|#ifdef USE_IPV6
  431|      0|  {
  432|      0|    struct in6_addr in6;
  433|      0|    if(curlx_inet_pton(AF_INET6, dotted, &in6) > 0)
  ------------------
  |  Branch (433:8): [True: 0, False: 0]
  ------------------
  434|       |      /* This is a dotted IPv6 address ::1-style */
  435|      0|      return ip2addr(addrp, AF_INET6, &in6, dotted, port);
  436|      0|  }
  437|      0|#endif
  438|      0|  return CURLE_BAD_FUNCTION_ARGUMENT; /* bad input format */
  439|      0|}
Curl_is_ipv4addr:
  442|  6.08k|{
  443|  6.08k|  struct in_addr in;
  444|       |  return (curlx_inet_pton(AF_INET, address, &in) > 0);
  445|  6.08k|}
Curl_is_ipaddr:
  448|  3.04k|{
  449|  3.04k|  if(Curl_is_ipv4addr(address))
  ------------------
  |  Branch (449:6): [True: 3.04k, False: 0]
  ------------------
  450|  3.04k|    return TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  451|      0|#ifdef USE_IPV6
  452|      0|  {
  453|      0|    struct in6_addr in6;
  454|      0|    if(curlx_inet_pton(AF_INET6, address, &in6) > 0)
  ------------------
  |  Branch (454:8): [True: 0, False: 0]
  ------------------
  455|       |      /* This is a dotted IPv6 address ::1-style */
  456|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  457|      0|  }
  458|      0|#endif
  459|      0|  return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  460|      0|}
Curl_looks_like_ipv6:
  464|    110|{
  465|    110|  const char *zonep = NULL;
  466|    110|  size_t i = 0, hlen = 0, zlen = 0;
  467|       |
  468|    110|  if(host)
  ------------------
  |  Branch (468:6): [True: 110, False: 0]
  ------------------
  469|    110|    memset(host, 0, sizeof(*host));
  470|    110|  if(zone)
  ------------------
  |  Branch (470:6): [True: 110, False: 0]
  ------------------
  471|    110|    memset(zone, 0, sizeof(*zone));
  472|       |
  473|  1.24k|  for(i = 0; i < len; ++i, ++hlen) {
  ------------------
  |  Branch (473:14): [True: 1.13k, False: 110]
  ------------------
  474|  1.13k|    if(!s[i] || !(ISXDIGIT(s[i]) || (s[i] == ':') || (s[i] == '.')))
  ------------------
  |  |   37|  2.26k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  2.26k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 1.12k, False: 3]
  |  |  |  |  |  Branch (42:38): [True: 168, False: 960]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  2.09k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 436, False: 527]
  |  |  |  |  |  Branch (27:43): [True: 436, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|    527|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 112, False: 415]
  |  |  |  |  |  Branch (28:43): [True: 112, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:8): [True: 0, False: 1.13k]
  |  Branch (474:37): [True: 412, False: 3]
  |  Branch (474:54): [True: 3, False: 0]
  ------------------
  475|      0|      break;
  476|  1.13k|  }
  477|       |
  478|    110|  if((i < len) && (s[i] == '%')) { /* address followed by a zone? */
  ------------------
  |  Branch (478:6): [True: 0, False: 110]
  |  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|    110|  if(i != len)
  ------------------
  |  Branch (491:6): [True: 0, False: 110]
  ------------------
  492|      0|    return FALSE; /* invalid chars in zone */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  493|    110|  if(host && hlen) {
  ------------------
  |  Branch (493:6): [True: 110, False: 0]
  |  Branch (493:14): [True: 110, False: 0]
  ------------------
  494|    110|    host->str = s;
  495|    110|    host->len = hlen;
  496|    110|  }
  497|    110|  if(zone && zlen) {
  ------------------
  |  Branch (497:6): [True: 110, False: 0]
  |  Branch (497:14): [True: 0, False: 110]
  ------------------
  498|      0|    zone->str = zonep;
  499|      0|    zone->len = zlen;
  500|      0|  }
  501|       |  return TRUE;
  ------------------
  |  |  997|    110|#define TRUE true
  ------------------
  502|    110|}
curl_addrinfo.c:ip2addr:
  359|  3.04k|{
  360|  3.04k|  struct Curl_addrinfo *ai;
  361|  3.04k|  size_t addrsize;
  362|  3.04k|  size_t namelen;
  363|  3.04k|  struct sockaddr_in *addr;
  364|  3.04k|#ifdef USE_IPV6
  365|  3.04k|  struct sockaddr_in6 *addr6;
  366|  3.04k|#endif
  367|       |
  368|  3.04k|  DEBUGASSERT(inaddr && hostname);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (368:3): [True: 0, False: 3.04k]
  |  Branch (368:3): [True: 0, False: 0]
  |  Branch (368:3): [True: 3.04k, False: 0]
  |  Branch (368:3): [True: 3.04k, False: 0]
  ------------------
  369|       |
  370|  3.04k|  namelen = strlen(hostname) + 1;
  371|  3.04k|  *addrp = NULL;
  372|       |
  373|  3.04k|  if(af == AF_INET)
  ------------------
  |  Branch (373:6): [True: 3.04k, False: 0]
  ------------------
  374|  3.04k|    addrsize = sizeof(struct sockaddr_in);
  375|      0|#ifdef USE_IPV6
  376|      0|  else if(af == AF_INET6)
  ------------------
  |  Branch (376:11): [True: 0, False: 0]
  ------------------
  377|      0|    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|  3.04k|  ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen);
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  384|  3.04k|  if(!ai)
  ------------------
  |  Branch (384:6): [True: 0, False: 3.04k]
  ------------------
  385|      0|    return CURLE_OUT_OF_MEMORY;
  386|       |  /* put the address after the struct */
  387|  3.04k|  ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
  388|       |  /* then put the name after the address */
  389|  3.04k|  ai->ai_canonname = (char *)ai->ai_addr + addrsize;
  390|  3.04k|  memcpy(ai->ai_canonname, hostname, namelen);
  391|  3.04k|  ai->ai_family = af;
  392|  3.04k|  ai->ai_socktype = SOCK_STREAM;
  393|  3.04k|  ai->ai_addrlen = (curl_socklen_t)addrsize;
  394|       |  /* leave the rest of the struct filled with zero */
  395|       |
  396|  3.04k|  switch(af) {
  ------------------
  |  Branch (396:10): [True: 3.04k, False: 0]
  ------------------
  397|  3.04k|  case AF_INET:
  ------------------
  |  Branch (397:3): [True: 3.04k, False: 0]
  ------------------
  398|  3.04k|    addr = (void *)ai->ai_addr; /* storage area for this info */
  399|       |
  400|  3.04k|    memcpy(&addr->sin_addr, inaddr, sizeof(struct in_addr));
  401|  3.04k|    addr->sin_family = (CURL_SA_FAMILY_T)af;
  402|  3.04k|    addr->sin_port = htons((unsigned short)port);
  403|  3.04k|    break;
  404|       |
  405|      0|#ifdef USE_IPV6
  406|      0|  case AF_INET6:
  ------------------
  |  Branch (406:3): [True: 0, False: 3.04k]
  ------------------
  407|      0|    addr6 = (void *)ai->ai_addr; /* storage area for this info */
  408|       |
  409|      0|    memcpy(&addr6->sin6_addr, inaddr, sizeof(struct in6_addr));
  410|      0|    addr6->sin6_family = (CURL_SA_FAMILY_T)af;
  411|      0|    addr6->sin6_port = htons((unsigned short)port);
  412|      0|    break;
  413|  3.04k|#endif
  414|  3.04k|  }
  415|  3.04k|  *addrp = ai;
  416|  3.04k|  return CURLE_OK;
  417|  3.04k|}

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

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

Curl_share_lock_share:
  378|  18.7k|{
  379|  18.7k|  if(!share)
  ------------------
  |  Branch (379:6): [True: 18.7k, False: 0]
  ------------------
  380|  18.7k|    return CURLSHE_INVALID;
  381|       |
  382|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (382:6): [True: 0, False: 0]
  ------------------
  383|      0|     share->lockfunc) /* only call this if set! */
  ------------------
  |  Branch (383:6): [True: 0, False: 0]
  ------------------
  384|      0|    share->lockfunc(data, type, accesstype, share->clientdata);
  385|       |  /* else if we do not share this, pretend successful lock */
  386|       |
  387|      0|  return CURLSHE_OK;
  388|  18.7k|}
Curl_share_lock:
  392|  18.7k|{
  393|  18.7k|  return Curl_share_lock_share(data->share, data, type, accesstype);
  394|  18.7k|}
Curl_share_unlock_share:
  399|  18.7k|{
  400|  18.7k|  if(!share)
  ------------------
  |  Branch (400:6): [True: 18.7k, False: 0]
  ------------------
  401|  18.7k|    return CURLSHE_INVALID;
  402|       |
  403|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (403:6): [True: 0, False: 0]
  ------------------
  404|      0|     share->unlockfunc) /* only call this if set! */
  ------------------
  |  Branch (404:6): [True: 0, False: 0]
  ------------------
  405|      0|    share->unlockfunc(data, type, share->clientdata);
  406|       |
  407|      0|  return CURLSHE_OK;
  408|  18.7k|}
Curl_share_unlock:
  411|  18.7k|{
  412|  18.7k|  return Curl_share_unlock_share(data->share, data, type);
  413|  18.7k|}
Curl_share_easy_unlink:
  416|  7.48k|{
  417|  7.48k|  struct Curl_share *share = data->share;
  418|       |
  419|  7.48k|  if(share) {
  ------------------
  |  Branch (419:6): [True: 0, False: 7.48k]
  ------------------
  420|      0|    bool locked = share_lock_acquire(share, data);
  421|       |
  422|       |    /* If share caches connections, detach any existing connection and
  423|       |     * forget its identifier. */
  424|      0|    if((share->specifier & (1 << CURL_LOCK_DATA_CONNECT))) {
  ------------------
  |  Branch (424:8): [True: 0, False: 0]
  ------------------
  425|      0|      if(data->conn)
  ------------------
  |  Branch (425:10): [True: 0, False: 0]
  ------------------
  426|      0|        Curl_detach_connection(data);
  427|      0|      data->state.lastconnect_id = -1;
  428|      0|    }
  429|       |
  430|      0|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
  431|      0|    if(share->cookies == data->cookies)
  ------------------
  |  Branch (431:8): [True: 0, False: 0]
  ------------------
  432|      0|      data->cookies = NULL;
  433|      0|#endif
  434|       |
  435|      0|#ifndef CURL_DISABLE_HSTS
  436|      0|    if(share->hsts == data->hsts)
  ------------------
  |  Branch (436:8): [True: 0, False: 0]
  ------------------
  437|      0|      data->hsts = NULL;
  438|      0|#endif
  439|       |#ifdef USE_LIBPSL
  440|       |    if(&share->psl == data->psl)
  441|       |      data->psl = data->multi ? &data->multi->psl : NULL;
  442|       |#endif
  443|       |
  444|      0|    share_unlink(&data->share, data, locked);
  445|      0|  }
  446|  7.48k|  return CURLE_OK;
  447|  7.48k|}

Curl_debug:
  128|  14.3k|{
  129|  14.3k|  if(data->set.verbose) {
  ------------------
  |  Branch (129:6): [True: 14.3k, False: 0]
  ------------------
  130|  14.3k|    static const char s_infotype[CURLINFO_END][3] = {
  131|  14.3k|      "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
  132|  14.3k|    char buf[TRC_LINE_MAX];
  133|  14.3k|    size_t len;
  134|  14.3k|    if(data->set.fdebug) {
  ------------------
  |  Branch (134:8): [True: 14.3k, False: 0]
  ------------------
  135|  14.3k|      struct Curl_mapi_guard guard;
  136|  14.3k|      if(CURL_TRC_IDS(data) && (size < TRC_LINE_MAX)) {
  ------------------
  |  |   90|  28.7k|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  322|  28.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 14.3k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 14.3k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  28.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 14.3k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  14.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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|  28.7k|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  14.3k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (91:3): [True: 14.3k, False: 3]
  |  |  ------------------
  ------------------
                    if(CURL_TRC_IDS(data) && (size < TRC_LINE_MAX)) {
  ------------------
  |  |   78|  14.3k|#define TRC_LINE_MAX 2048
  ------------------
  |  Branch (136:32): [True: 14.3k, False: 57]
  ------------------
  137|  14.3k|        len = trc_print_ids(data, buf, TRC_LINE_MAX);
  ------------------
  |  |   78|  14.3k|#define TRC_LINE_MAX 2048
  ------------------
  138|  14.3k|        len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "%.*s",
  ------------------
  |  |   78|  14.3k|#define TRC_LINE_MAX 2048
  ------------------
  139|  14.3k|                              (int)size, ptr);
  140|  14.3k|        len = trc_end_buf(buf, len, TRC_LINE_MAX, FALSE);
  ------------------
  |  |   78|  14.3k|#define TRC_LINE_MAX 2048
  ------------------
                      len = trc_end_buf(buf, len, TRC_LINE_MAX, FALSE);
  ------------------
  |  | 1000|  14.3k|#define FALSE false
  ------------------
  141|  14.3k|        CURL_CBAPI_START(&guard, data, easy_fdebug);
  ------------------
  |  |  201|  14.3k|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
  142|  14.3k|        (void)(*data->set.fdebug)(data, type, buf, len, data->set.debugdata);
  143|  14.3k|        CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  14.3k|  Curl_cbapi_leave(g)
  ------------------
  144|  14.3k|      }
  145|     60|      else {
  146|     60|        CURL_CBAPI_START(&guard, data, easy_fdebug);
  ------------------
  |  |  201|     60|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
  147|     60|        (void)(*data->set.fdebug)(data, type, CURL_UNCONST(ptr),
  ------------------
  |  |  808|     60|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  148|     60|                                  size, data->set.debugdata);
  149|     60|        CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|     60|  Curl_cbapi_leave(g)
  ------------------
  150|     60|      }
  151|  14.3k|    }
  152|      0|    else {
  153|      0|      switch(type) {
  154|      0|      case CURLINFO_TEXT:
  ------------------
  |  Branch (154:7): [True: 0, False: 0]
  ------------------
  155|      0|      case CURLINFO_HEADER_OUT:
  ------------------
  |  Branch (155:7): [True: 0, False: 0]
  ------------------
  156|      0|      case CURLINFO_HEADER_IN:
  ------------------
  |  Branch (156:7): [True: 0, False: 0]
  ------------------
  157|      0|#ifndef CURL_DISABLE_VERBOSE_STRINGS
  158|      0|        if(CURL_TRC_IDS(data)) {
  ------------------
  |  |   90|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|      0|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (91:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  159|      0|          len = trc_print_ids(data, buf, TRC_LINE_MAX);
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  160|      0|          fwrite(buf, len, 1, data->set.err);
  161|      0|        }
  162|      0|#endif
  163|      0|        fwrite(s_infotype[type], 2, 1, data->set.err);
  164|      0|        fwrite(ptr, size, 1, data->set.err);
  165|      0|        break;
  166|      0|      default: /* nada */
  ------------------
  |  Branch (166:7): [True: 0, False: 0]
  ------------------
  167|      0|        break;
  168|      0|      }
  169|      0|    }
  170|  14.3k|  }
  171|  14.3k|}
Curl_failf:
  177|    826|{
  178|    826|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1027|    826|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 826]
  |  Branch (178:3): [True: 826, False: 0]
  ------------------
  179|    826|  if(data->set.verbose || data->set.errorbuffer) {
  ------------------
  |  Branch (179:6): [True: 826, False: 0]
  |  Branch (179:27): [True: 0, False: 0]
  ------------------
  180|    826|    va_list ap;
  181|    826|    size_t len;
  182|    826|    char error[CURL_ERROR_SIZE + 2];
  183|    826|    va_start(ap, fmt);
  184|    826|    len = curl_mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
  ------------------
  |  |  877|    826|#define CURL_ERROR_SIZE 256
  ------------------
  185|       |
  186|    826|    if(data->set.errorbuffer && !data->state.errorbuf) {
  ------------------
  |  Branch (186:8): [True: 0, False: 826]
  |  Branch (186:33): [True: 0, False: 0]
  ------------------
  187|      0|      curlx_strcopy(data->set.errorbuffer, CURL_ERROR_SIZE, error, len);
  ------------------
  |  |  877|      0|#define CURL_ERROR_SIZE 256
  ------------------
  188|      0|      data->state.errorbuf = TRUE; /* wrote error string */
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  189|      0|    }
  190|    826|    error[len++] = '\n';
  191|    826|    error[len] = '\0';
  192|    826|    trc_write(data, CURLINFO_TEXT, error, len);
  193|       |    va_end(ap);
  194|    826|  }
  195|    826|}
Curl_reset_fail:
  198|  6.08k|{
  199|  6.08k|  if(data->set.errorbuffer)
  ------------------
  |  Branch (199:6): [True: 0, False: 6.08k]
  ------------------
  200|      0|    data->set.errorbuffer[0] = 0;
  201|       |  data->state.errorbuf = FALSE;
  ------------------
  |  | 1000|  6.08k|#define FALSE false
  ------------------
  202|  6.08k|}
Curl_infof:
  271|   313k|{
  272|   313k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1027|   313k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (272:3): [True: 0, False: 313k]
  |  Branch (272:3): [True: 313k, False: 0]
  ------------------
  273|   313k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|   313k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 313k, False: 0]
  |  |  |  Branch (322:14): [True: 313k, False: 0]
  |  |  ------------------
  |  |  323|   313k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 313k, False: 0]
  |  |  ------------------
  |  |  324|   313k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  274|   313k|    va_list ap;
  275|   313k|    va_start(ap, fmt);
  276|   313k|    trc_infof(data, data->state.feat, NULL, 0, fmt, ap);
  277|       |    va_end(ap);
  278|   313k|  }
  279|   313k|}
Curl_trc_opt:
  670|      3|{
  671|      3|  CURLcode result = config ? trc_opt(config) : CURLE_OK;
  ------------------
  |  Branch (671:21): [True: 1, False: 2]
  ------------------
  672|      3|#ifdef DEBUGBUILD
  673|       |  /* CURL_DEBUG can override anything */
  674|      3|  if(!result) {
  ------------------
  |  Branch (674:6): [True: 3, False: 0]
  ------------------
  675|      3|    const char *dbg_config = getenv("CURL_DEBUG");
  676|      3|    if(dbg_config)
  ------------------
  |  Branch (676:8): [True: 0, False: 3]
  ------------------
  677|      0|      result = trc_opt(dbg_config);
  678|      3|  }
  679|      3|#endif /* DEBUGBUILD */
  680|      3|  return result;
  681|      3|}
Curl_trc_init:
  684|      2|{
  685|      2|#ifdef DEBUGBUILD
  686|      2|  return Curl_trc_opt(NULL);
  687|       |#else
  688|       |  return CURLE_OK;
  689|       |#endif
  690|      2|}
curl_trc.c:trc_print_ids:
   94|   326k|{
   95|   326k|  curl_off_t cid = data->state.lastconnect_id;
   96|   326k|  if(data->id >= 0) {
  ------------------
  |  Branch (96:6): [True: 326k, False: 0]
  ------------------
   97|   326k|    if(cid >= 0)
  ------------------
  |  Branch (97:8): [True: 319k, False: 7.07k]
  ------------------
   98|   319k|      return curl_msnprintf(buf, maxlen, CURL_TRC_FMT_IDSDC, data->id, cid);
  ------------------
  |  |   82|   319k|#define CURL_TRC_FMT_IDSDC  "[%" CURL_FORMAT_CURL_OFF_T "-%" \
  |  |   83|   319k|                            CURL_FORMAT_CURL_OFF_T "] "
  ------------------
   99|  7.07k|    else
  100|  7.07k|      return curl_msnprintf(buf, maxlen, CURL_TRC_FMT_IDSD, data->id);
  ------------------
  |  |   81|  7.07k|#define CURL_TRC_FMT_IDSD   "[%" CURL_FORMAT_CURL_OFF_T "-x] "
  ------------------
  101|   326k|  }
  102|      0|  else if(cid >= 0)
  ------------------
  |  Branch (102:11): [True: 0, False: 0]
  ------------------
  103|      0|    return curl_msnprintf(buf, maxlen, CURL_TRC_FMT_IDSC, cid);
  ------------------
  |  |   80|      0|#define CURL_TRC_FMT_IDSC   "[x-%" CURL_FORMAT_CURL_OFF_T "] "
  ------------------
  104|      0|  else {
  105|      0|    return curl_msnprintf(buf, maxlen, "[x-x] ");
  106|      0|  }
  107|   326k|}
curl_trc.c:trc_end_buf:
  110|   327k|{
  111|       |  /* make sure we end the trace line in `buf` properly. It needs
  112|       |   * to end with a terminating '\0' or '\n\0' */
  113|   327k|  if(len >= (maxlen - (addnl ? 2 : 1))) {
  ------------------
  |  Branch (113:6): [True: 22, False: 327k]
  |  Branch (113:24): [True: 313k, False: 14.3k]
  ------------------
  114|     22|    len = maxlen - 5;
  115|     22|    buf[len++] = '.';
  116|     22|    buf[len++] = '.';
  117|     22|    buf[len++] = '.';
  118|     22|    buf[len++] = '\n';
  119|     22|  }
  120|   327k|  else if(addnl)
  ------------------
  |  Branch (120:11): [True: 313k, False: 14.2k]
  ------------------
  121|   313k|    buf[len++] = '\n';
  122|   327k|  buf[len] = '\0';
  123|   327k|  return len;
  124|   327k|}
curl_trc.c:trc_write:
   51|   314k|{
   52|   314k|  if(data->set.verbose) {
  ------------------
  |  Branch (52:6): [True: 314k, False: 0]
  ------------------
   53|   314k|    if(data->set.fdebug) {
  ------------------
  |  Branch (53:8): [True: 314k, False: 0]
  ------------------
   54|   314k|      struct Curl_mapi_guard guard;
   55|   314k|      CURL_CBAPI_START(&guard, data, easy_fdebug);
  ------------------
  |  |  201|   314k|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
   56|   314k|      (void)(*data->set.fdebug)(data, type, CURL_UNCONST(ptr), size,
  ------------------
  |  |  808|   314k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   57|   314k|                                data->set.debugdata);
   58|   314k|      CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|   314k|  Curl_cbapi_leave(g)
  ------------------
   59|   314k|    }
   60|      0|    else {
   61|      0|      static const char s_infotype[CURLINFO_END][3] = {
   62|      0|        "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
   63|      0|      switch(type) {
   64|      0|      case CURLINFO_TEXT:
  ------------------
  |  Branch (64:7): [True: 0, False: 0]
  ------------------
   65|      0|      case CURLINFO_HEADER_OUT:
  ------------------
  |  Branch (65:7): [True: 0, False: 0]
  ------------------
   66|      0|      case CURLINFO_HEADER_IN:
  ------------------
  |  Branch (66:7): [True: 0, False: 0]
  ------------------
   67|      0|        fwrite(s_infotype[type], 2, 1, data->set.err);
   68|      0|        fwrite(ptr, size, 1, data->set.err);
   69|      0|        break;
   70|      0|      default: /* nada */
  ------------------
  |  Branch (70:7): [True: 0, False: 0]
  ------------------
   71|      0|        break;
   72|      0|      }
   73|      0|    }
   74|   314k|  }
   75|   314k|}
curl_trc.c:trc_infof:
  250|   313k|{
  251|   313k|  size_t len = 0;
  252|   313k|  char buf[TRC_LINE_MAX];
  253|       |
  254|   313k|  if(CURL_TRC_IDS(data))
  ------------------
  |  |   90|   313k|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  322|   626k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 313k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 313k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|   626k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 313k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|   313k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|   313k|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|   313k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (91:3): [True: 312k, False: 765]
  |  |  ------------------
  ------------------
  255|   312k|    len += trc_print_ids(data, buf + len, TRC_LINE_MAX - len);
  ------------------
  |  |   78|   312k|#define TRC_LINE_MAX 2048
  ------------------
  256|   313k|  if(feat)
  ------------------
  |  Branch (256:6): [True: 0, False: 313k]
  ------------------
  257|      0|    len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "[%s] ", feat->name);
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  258|   313k|  if(opt_id) {
  ------------------
  |  Branch (258:6): [True: 0, False: 313k]
  ------------------
  259|      0|    if(opt_id_idx > 0)
  ------------------
  |  Branch (259:8): [True: 0, False: 0]
  ------------------
  260|      0|      len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "[%s-%d] ",
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  261|      0|                            opt_id, opt_id_idx);
  262|      0|    else
  263|      0|      len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "[%s] ", opt_id);
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  264|      0|  }
  265|   313k|  len += curl_mvsnprintf(buf + len, TRC_LINE_MAX - len, fmt, ap);
  ------------------
  |  |   78|   313k|#define TRC_LINE_MAX 2048
  ------------------
  266|   313k|  len = trc_end_buf(buf, len, TRC_LINE_MAX, TRUE);
  ------------------
  |  |   78|   313k|#define TRC_LINE_MAX 2048
  ------------------
                len = trc_end_buf(buf, len, TRC_LINE_MAX, TRUE);
  ------------------
  |  |  997|   313k|#define TRUE true
  ------------------
  267|   313k|  trc_write(data, CURLINFO_TEXT, buf, len);
  268|   313k|}
curl_trc.c:trc_opt:
  639|      1|{
  640|      1|  struct Curl_str out;
  641|      1|  while(!curlx_str_until(&config, &out, 32, ',')) {
  ------------------
  |  Branch (641:9): [True: 1, False: 0]
  ------------------
  642|      1|    int lvl = CURL_LOG_LVL_INFO;
  ------------------
  |  |   70|      1|#define CURL_LOG_LVL_INFO  1
  ------------------
  643|      1|    const char *token = curlx_str(&out);
  ------------------
  |  |   49|      1|#define curlx_str(x)    ((x)->str)
  ------------------
  644|       |
  645|      1|    if(*token == '-') {
  ------------------
  |  Branch (645:8): [True: 0, False: 1]
  ------------------
  646|      0|      lvl = CURL_LOG_LVL_NONE;
  ------------------
  |  |   69|      0|#define CURL_LOG_LVL_NONE  0
  ------------------
  647|      0|      curlx_str_nudge(&out, 1);
  648|      0|    }
  649|      1|    else if(*token == '+')
  ------------------
  |  Branch (649:13): [True: 1, False: 0]
  ------------------
  650|      1|      curlx_str_nudge(&out, 1);
  651|       |
  652|      1|    if(curlx_str_casecompare(&out, "all"))
  ------------------
  |  Branch (652:8): [True: 0, False: 1]
  ------------------
  653|      0|      trc_apply_level_by_category(TRC_CT_NONE, lvl);
  ------------------
  |  |  518|      0|#define TRC_CT_NONE        0
  ------------------
  654|      1|    else if(curlx_str_casecompare(&out, "protocol"))
  ------------------
  |  Branch (654:13): [True: 0, False: 1]
  ------------------
  655|      0|      trc_apply_level_by_category(TRC_CT_PROTOCOL, lvl);
  ------------------
  |  |  519|      0|#define TRC_CT_PROTOCOL    (1 << 0)
  ------------------
  656|      1|    else if(curlx_str_casecompare(&out, "network"))
  ------------------
  |  Branch (656:13): [True: 0, False: 1]
  ------------------
  657|      0|      trc_apply_level_by_category(TRC_CT_NETWORK, lvl);
  ------------------
  |  |  520|      0|#define TRC_CT_NETWORK     (1 << 1)
  ------------------
  658|      1|    else if(curlx_str_casecompare(&out, "proxy"))
  ------------------
  |  Branch (658:13): [True: 0, False: 1]
  ------------------
  659|      0|      trc_apply_level_by_category(TRC_CT_PROXY, lvl);
  ------------------
  |  |  521|      0|#define TRC_CT_PROXY       (1 << 2)
  ------------------
  660|      1|    else
  661|      1|      trc_apply_level_by_name(&out, lvl);
  662|       |
  663|      1|    if(curlx_str_single(&config, ','))
  ------------------
  |  Branch (663:8): [True: 1, False: 0]
  ------------------
  664|      1|      break;
  665|      1|  }
  666|      1|  return CURLE_OK;
  667|      1|}
curl_trc.c:trc_apply_level_by_name:
  607|      1|{
  608|      1|  size_t i;
  609|       |
  610|     18|  for(i = 0; i < CURL_ARRAYSIZE(trc_cfts); ++i) {
  ------------------
  |  | 1251|     18|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (610:14): [True: 17, False: 1]
  ------------------
  611|     17|    if(curlx_str_casecompare(token, trc_cfts[i].cft->name)) {
  ------------------
  |  Branch (611:8): [True: 0, False: 17]
  ------------------
  612|      0|      trc_cfts[i].cft->log_level = lvl;
  613|      0|      break;
  614|      0|    }
  615|     17|  }
  616|      1|  for(i = 0; i < CURL_ARRAYSIZE(trc_feats); ++i) {
  ------------------
  |  | 1251|      1|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (616:14): [True: 1, False: 0]
  ------------------
  617|      1|    if(curlx_str_casecompare(token, trc_feats[i].feat->name)) {
  ------------------
  |  Branch (617:8): [True: 1, False: 0]
  ------------------
  618|      1|      trc_feats[i].feat->log_level = lvl;
  619|      1|      break;
  620|      1|    }
  621|      1|  }
  622|      1|}

curlx_dyn_init:
   39|  42.7k|{
   40|  42.7k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  42.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (40:3): [True: 0, False: 42.7k]
  |  Branch (40:3): [True: 42.7k, False: 0]
  ------------------
   41|  42.7k|  DEBUGASSERT(toobig);
  ------------------
  |  | 1027|  42.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (41:3): [True: 0, False: 42.7k]
  |  Branch (41:3): [True: 42.7k, False: 0]
  ------------------
   42|  42.7k|  DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */
  ------------------
  |  | 1027|  42.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (42:3): [True: 0, False: 42.7k]
  |  Branch (42:3): [True: 42.7k, False: 0]
  ------------------
   43|  42.7k|  s->bufr = NULL;
   44|  42.7k|  s->leng = 0;
   45|  42.7k|  s->allc = 0;
   46|  42.7k|  s->toobig = toobig;
   47|  42.7k|#ifdef DEBUGBUILD
   48|  42.7k|  s->init = DYNINIT;
  ------------------
  |  |   32|  42.7k|#define DYNINIT 0xbee51da /* random pattern */
  ------------------
   49|  42.7k|#endif
   50|  42.7k|}
curlx_dyn_free:
   57|  32.7k|{
   58|  32.7k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 0, False: 32.7k]
  |  Branch (58:3): [True: 32.7k, False: 0]
  ------------------
   59|  32.7k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 32.7k]
  |  Branch (59:3): [True: 32.7k, False: 0]
  ------------------
   60|  32.7k|  curlx_safefree(s->bufr);
  ------------------
  |  | 1284|  32.7k|  do {                      \
  |  | 1285|  32.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  32.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  32.7k|    (ptr) = NULL;           \
  |  | 1287|  32.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 32.7k]
  |  |  ------------------
  ------------------
   61|  32.7k|  s->leng = s->allc = 0;
   62|  32.7k|}
curlx_dyn_reset:
  126|  12.7k|{
  127|  12.7k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  12.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 0, False: 12.7k]
  |  Branch (127:3): [True: 12.7k, False: 0]
  ------------------
  128|  12.7k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  12.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 12.7k]
  |  Branch (128:3): [True: 12.7k, False: 0]
  ------------------
  129|  12.7k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  12.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 12.7k, False: 0]
  |  Branch (129:3): [True: 0, False: 0]
  |  Branch (129:3): [True: 11.2k, False: 1.50k]
  |  Branch (129:3): [True: 1.50k, False: 0]
  ------------------
  130|  12.7k|  if(s->leng)
  ------------------
  |  Branch (130:6): [True: 1.50k, False: 11.2k]
  ------------------
  131|  1.50k|    s->bufr[0] = 0;
  132|  12.7k|  s->leng = 0;
  133|  12.7k|}
curlx_dyn_addn:
  163|  1.06M|{
  164|  1.06M|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (164:3): [True: 0, False: 1.06M]
  |  Branch (164:3): [True: 1.06M, False: 0]
  ------------------
  165|  1.06M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 1.06M]
  |  Branch (165:3): [True: 1.06M, False: 0]
  ------------------
  166|  1.06M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 1.06M, False: 0]
  |  Branch (166:3): [True: 0, False: 0]
  |  Branch (166:3): [True: 27.4k, False: 1.03M]
  |  Branch (166:3): [True: 1.03M, False: 0]
  ------------------
  167|  1.06M|  return dyn_nappend(s, mem, len);
  168|  1.06M|}
curlx_dyn_vaddf:
  188|  1.31k|{
  189|  1.31k|#ifdef BUILDING_LIBCURL
  190|  1.31k|  int rc;
  191|  1.31k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (191:3): [True: 0, False: 1.31k]
  |  Branch (191:3): [True: 1.31k, False: 0]
  ------------------
  192|  1.31k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (192:3): [True: 0, False: 1.31k]
  |  Branch (192:3): [True: 1.31k, False: 0]
  ------------------
  193|  1.31k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (193:3): [True: 1.31k, False: 0]
  |  Branch (193:3): [True: 0, False: 0]
  |  Branch (193:3): [True: 1.31k, False: 0]
  |  Branch (193:3): [True: 0, False: 0]
  ------------------
  194|  1.31k|  DEBUGASSERT(fmt);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:3): [True: 0, False: 1.31k]
  |  Branch (194:3): [True: 1.31k, False: 0]
  ------------------
  195|  1.31k|  rc = curlx_dyn_vprintf(s, fmt, ap);
  196|       |
  197|  1.31k|  if(!rc)
  ------------------
  |  Branch (197:6): [True: 1.31k, False: 0]
  ------------------
  198|  1.31k|    return CURLE_OK;
  199|      0|  else if(rc == MERR_TOO_LARGE)
  ------------------
  |  |   29|      0|#define MERR_TOO_LARGE 2
  ------------------
  |  Branch (199:11): [True: 0, False: 0]
  ------------------
  200|      0|    return CURLE_TOO_LARGE;
  201|      0|  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|  1.31k|}
curlx_dyn_addf:
  221|  1.31k|{
  222|  1.31k|  CURLcode result;
  223|  1.31k|  va_list ap;
  224|  1.31k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 0, False: 1.31k]
  |  Branch (224:3): [True: 1.31k, False: 0]
  ------------------
  225|  1.31k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (225:3): [True: 0, False: 1.31k]
  |  Branch (225:3): [True: 1.31k, False: 0]
  ------------------
  226|  1.31k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (226:3): [True: 1.31k, False: 0]
  |  Branch (226:3): [True: 0, False: 0]
  |  Branch (226:3): [True: 1.31k, False: 0]
  |  Branch (226:3): [True: 0, False: 0]
  ------------------
  227|  1.31k|  DEBUGASSERT(strcmp(fmt, "%s")); /* use curlx_dyn_add instead */
  ------------------
  |  | 1027|  1.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 0, False: 1.31k]
  |  Branch (227:3): [True: 1.31k, False: 0]
  ------------------
  228|  1.31k|  va_start(ap, fmt);
  229|  1.31k|  result = curlx_dyn_vaddf(s, fmt, ap);
  230|       |  va_end(ap);
  231|  1.31k|  return result;
  232|  1.31k|}
curlx_dyn_ptr:
  238|  52.9k|{
  239|  52.9k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  52.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 52.9k]
  |  Branch (239:3): [True: 52.9k, False: 0]
  ------------------
  240|  52.9k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  52.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 52.9k]
  |  Branch (240:3): [True: 52.9k, False: 0]
  ------------------
  241|  52.9k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  52.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 52.9k, False: 0]
  |  Branch (241:3): [True: 0, False: 0]
  |  Branch (241:3): [True: 11.2k, False: 41.7k]
  |  Branch (241:3): [True: 41.7k, False: 0]
  ------------------
  242|  52.9k|  return s->bufr;
  243|  52.9k|}
curlx_dyn_uptr:
  261|     80|{
  262|     80|  DEBUGASSERT(s);
  ------------------
  |  | 1027|     80|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (262:3): [True: 0, False: 80]
  |  Branch (262:3): [True: 80, False: 0]
  ------------------
  263|     80|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|     80|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (263:3): [True: 0, False: 80]
  |  Branch (263:3): [True: 80, False: 0]
  ------------------
  264|     80|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|     80|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (264:3): [True: 80, False: 0]
  |  Branch (264:3): [True: 0, False: 0]
  |  Branch (264:3): [True: 0, False: 80]
  |  Branch (264:3): [True: 80, False: 0]
  ------------------
  265|     80|  return (unsigned char *)s->bufr;
  266|     80|}
curlx_dyn_len:
  272|  37.7k|{
  273|  37.7k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 37.7k]
  |  Branch (273:3): [True: 37.7k, False: 0]
  ------------------
  274|  37.7k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (274:3): [True: 0, False: 37.7k]
  |  Branch (274:3): [True: 37.7k, False: 0]
  ------------------
  275|  37.7k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:3): [True: 37.7k, False: 0]
  |  Branch (275:3): [True: 0, False: 0]
  |  Branch (275:3): [True: 13.2k, False: 24.5k]
  |  Branch (275:3): [True: 24.5k, False: 0]
  ------------------
  276|  37.7k|  return s->leng;
  277|  37.7k|}
curlx_dyn_setlen:
  283|  4.61k|{
  284|  4.61k|  DEBUGASSERT(s);
  ------------------
  |  | 1027|  4.61k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (284:3): [True: 0, False: 4.61k]
  |  Branch (284:3): [True: 4.61k, False: 0]
  ------------------
  285|  4.61k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  4.61k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (285:3): [True: 0, False: 4.61k]
  |  Branch (285:3): [True: 4.61k, False: 0]
  ------------------
  286|  4.61k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  4.61k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (286:3): [True: 4.61k, False: 0]
  |  Branch (286:3): [True: 0, False: 0]
  |  Branch (286:3): [True: 0, False: 4.61k]
  |  Branch (286:3): [True: 4.61k, False: 0]
  ------------------
  287|  4.61k|  if(set > s->leng)
  ------------------
  |  Branch (287:6): [True: 0, False: 4.61k]
  ------------------
  288|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  289|  4.61k|  s->leng = set;
  290|  4.61k|  s->bufr[s->leng] = 0;
  291|  4.61k|  return CURLE_OK;
  292|  4.61k|}
dynbuf.c:dyn_nappend:
   69|  1.06M|{
   70|  1.06M|  size_t idx = s->leng;
   71|  1.06M|  size_t a = s->allc;
   72|  1.06M|  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.06M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 0, False: 1.06M]
  |  Branch (75:3): [True: 1.06M, False: 0]
  ------------------
   76|  1.06M|  DEBUGASSERT(s->toobig);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 1.06M]
  |  Branch (76:3): [True: 1.06M, False: 0]
  ------------------
   77|  1.06M|  DEBUGASSERT(idx < s->toobig);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 1.06M]
  |  Branch (77:3): [True: 1.06M, False: 0]
  ------------------
   78|  1.06M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (78:3): [True: 1.06M, False: 0]
  |  Branch (78:3): [True: 0, False: 0]
  |  Branch (78:3): [True: 27.4k, False: 1.03M]
  |  Branch (78:3): [True: 1.03M, False: 0]
  ------------------
   79|  1.06M|  DEBUGASSERT(a <= s->toobig);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 1.06M]
  |  Branch (79:3): [True: 1.06M, False: 0]
  ------------------
   80|  1.06M|  DEBUGASSERT(!len || mem);
  ------------------
  |  | 1027|  1.06M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 1.06M, False: 0]
  |  Branch (80:3): [True: 0, False: 0]
  |  Branch (80:3): [True: 19, False: 1.06M]
  |  Branch (80:3): [True: 1.06M, False: 0]
  ------------------
   81|       |
   82|  1.06M|  if(fit > s->toobig) {
  ------------------
  |  Branch (82:6): [True: 0, False: 1.06M]
  ------------------
   83|      0|    curlx_dyn_free(s);
   84|      0|    return CURLE_TOO_LARGE;
   85|      0|  }
   86|  1.06M|  else if(!a) {
  ------------------
  |  Branch (86:11): [True: 24.7k, False: 1.03M]
  ------------------
   87|  24.7k|    DEBUGASSERT(!idx);
  ------------------
  |  | 1027|  24.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:5): [True: 0, False: 24.7k]
  |  Branch (87:5): [True: 24.7k, False: 0]
  ------------------
   88|       |    /* first invoke */
   89|  24.7k|    if(MIN_FIRST_ALLOC > s->toobig)
  ------------------
  |  |   29|  24.7k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (89:8): [True: 163, False: 24.6k]
  ------------------
   90|    163|      a = s->toobig;
   91|  24.6k|    else if(fit < MIN_FIRST_ALLOC)
  ------------------
  |  |   29|  24.6k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (91:13): [True: 23.8k, False: 769]
  ------------------
   92|  23.8k|      a = MIN_FIRST_ALLOC;
  ------------------
  |  |   29|  23.8k|#define MIN_FIRST_ALLOC 32
  ------------------
   93|    769|    else
   94|    769|      a = fit;
   95|  24.7k|  }
   96|  1.03M|  else {
   97|  1.03M|    while(a < fit)
  ------------------
  |  Branch (97:11): [True: 2.81k, False: 1.03M]
  ------------------
   98|  2.81k|      a *= 2;
   99|  1.03M|    if(a > s->toobig)
  ------------------
  |  Branch (99:8): [True: 154, False: 1.03M]
  ------------------
  100|       |      /* no point in allocating a larger buffer than this is allowed to use */
  101|    154|      a = s->toobig;
  102|  1.03M|  }
  103|       |
  104|  1.06M|  if(a != s->allc) {
  ------------------
  |  Branch (104:6): [True: 27.5k, False: 1.03M]
  ------------------
  105|  27.5k|    void *p = curlx_realloc(s->bufr, a);
  ------------------
  |  | 1427|  27.5k|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
  106|  27.5k|    if(!p) {
  ------------------
  |  Branch (106:8): [True: 0, False: 27.5k]
  ------------------
  107|      0|      curlx_dyn_free(s);
  108|      0|      return CURLE_OUT_OF_MEMORY;
  109|      0|    }
  110|  27.5k|    s->bufr = p;
  111|  27.5k|    s->allc = a;
  112|  27.5k|  }
  113|       |
  114|  1.06M|  if(len)
  ------------------
  |  Branch (114:6): [True: 1.06M, False: 19]
  ------------------
  115|  1.06M|    memcpy(&s->bufr[idx], mem, len);
  116|  1.06M|  s->leng = idx + len;
  117|  1.06M|  s->bufr[s->leng] = 0;
  118|  1.06M|  return CURLE_OK;
  119|  1.06M|}

curlx_inet_ntop:
  190|  3.15k|{
  191|  3.15k|  switch(af) {
  192|  3.04k|  case AF_INET:
  ------------------
  |  Branch (192:3): [True: 3.04k, False: 110]
  ------------------
  193|  3.04k|    return inet_ntop4((const unsigned char *)src, buf, size);
  194|    110|  case AF_INET6:
  ------------------
  |  Branch (194:3): [True: 110, False: 3.04k]
  ------------------
  195|    110|    return inet_ntop6((const unsigned char *)src, buf, size);
  196|      0|  default:
  ------------------
  |  Branch (196:3): [True: 0, False: 3.15k]
  ------------------
  197|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
  198|  3.15k|  }
  199|  3.15k|}
inet_ntop.c:inet_ntop4:
   57|  3.05k|{
   58|  3.05k|  char tmp[sizeof("255.255.255.255")];
   59|  3.05k|  size_t len;
   60|       |
   61|  3.05k|  DEBUGASSERT(size >= 16);
  ------------------
  |  | 1027|  3.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (61:3): [True: 0, False: 3.05k]
  |  Branch (61:3): [True: 3.05k, False: 0]
  ------------------
   62|       |
   63|       |  /* this snprintf() does not overflow the buffer. */
   64|  3.05k|  SNPRINTF(tmp, sizeof(tmp), "%d.%d.%d.%d",
  ------------------
  |  |   43|  3.05k|#define SNPRINTF curl_msnprintf
  ------------------
   65|  3.05k|           ((int)((unsigned char)src[0])) & 0xff,
   66|  3.05k|           ((int)((unsigned char)src[1])) & 0xff,
   67|  3.05k|           ((int)((unsigned char)src[2])) & 0xff,
   68|  3.05k|           ((int)((unsigned char)src[3])) & 0xff);
   69|       |
   70|  3.05k|  len = strlen(tmp);
   71|  3.05k|  if(len == 0 || len >= size)
  ------------------
  |  Branch (71:6): [True: 0, False: 3.05k]
  |  Branch (71:18): [True: 0, False: 3.05k]
  ------------------
   72|      0|    return CURLE_TOO_LARGE;
   73|  3.05k|  curlx_strcopy(dst, size, tmp, len);
   74|  3.05k|  return CURLE_OK;
   75|  3.05k|}
inet_ntop.c:inet_ntop6:
   81|    110|{
   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|    110|  char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
   90|    110|  char *tp;
   91|    110|  struct {
   92|    110|    int base;
   93|    110|    int len;
   94|    110|  } best, cur;
   95|    110|  unsigned int words[IN6ADDRSZ / INT16SZ];
   96|    110|  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|    110|  memset(words, '\0', sizeof(words));
  103|  1.87k|  for(i = 0; i < IN6ADDRSZ; i++)
  ------------------
  |  |   35|  1.87k|#define IN6ADDRSZ       16
  ------------------
  |  Branch (103:14): [True: 1.76k, False: 110]
  ------------------
  104|  1.76k|    words[i / 2] |= ((unsigned int)src[i] << ((1 - (i % 2)) << 3));
  105|       |
  106|    110|  best.base = -1;
  107|    110|  cur.base = -1;
  108|    110|  best.len = 0;
  109|    110|  cur.len = 0;
  110|       |
  111|    990|  for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   35|    990|#define IN6ADDRSZ       16
  ------------------
                for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   37|    990|#define INT16SZ          2
  ------------------
  |  Branch (111:14): [True: 880, False: 110]
  ------------------
  112|    880|    if(words[i] == 0) {
  ------------------
  |  Branch (112:8): [True: 554, False: 326]
  ------------------
  113|    554|      if(cur.base == -1) {
  ------------------
  |  Branch (113:10): [True: 126, False: 428]
  ------------------
  114|    126|        cur.base = i;
  115|    126|        cur.len = 1;
  116|    126|      }
  117|    428|      else
  118|    428|        cur.len++;
  119|    554|    }
  120|    326|    else if(cur.base != -1) {
  ------------------
  |  Branch (120:13): [True: 103, False: 223]
  ------------------
  121|    103|      if(best.base == -1 || cur.len > best.len)
  ------------------
  |  Branch (121:10): [True: 87, False: 16]
  |  Branch (121:29): [True: 5, False: 11]
  ------------------
  122|     92|        best = cur;
  123|    103|      cur.base = -1;
  124|    103|    }
  125|    880|  }
  126|    110|  if((cur.base != -1) && (best.base == -1 || cur.len > best.len))
  ------------------
  |  Branch (126:6): [True: 23, False: 87]
  |  Branch (126:27): [True: 16, False: 7]
  |  Branch (126:46): [True: 3, False: 4]
  ------------------
  127|     19|    best = cur;
  128|    110|  if(best.base != -1 && best.len < 2)
  ------------------
  |  Branch (128:6): [True: 103, False: 7]
  |  Branch (128:25): [True: 10, False: 93]
  ------------------
  129|     10|    best.base = -1;
  130|       |  /* Format the result. */
  131|    110|  tp = tmp;
  132|    966|  for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   35|    966|#define IN6ADDRSZ       16
  ------------------
                for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   37|    966|#define INT16SZ          2
  ------------------
  |  Branch (132:14): [True: 868, False: 98]
  ------------------
  133|       |    /* Are we inside the best run of 0x00's? */
  134|    868|    if(best.base != -1 && i >= best.base && i < (best.base + best.len)) {
  ------------------
  |  Branch (134:8): [True: 732, False: 136]
  |  Branch (134:27): [True: 657, False: 75]
  |  Branch (134:45): [True: 521, False: 136]
  ------------------
  135|    521|      if(i == best.base)
  ------------------
  |  Branch (135:10): [True: 93, False: 428]
  ------------------
  136|     93|        *tp++ = ':';
  137|    521|      continue;
  138|    521|    }
  139|       |
  140|       |    /* Are we following an initial run of 0x00s or any real hex?
  141|       |     */
  142|    347|    if(i)
  ------------------
  |  Branch (142:8): [True: 290, False: 57]
  ------------------
  143|    290|      *tp++ = ':';
  144|       |
  145|       |    /* Is this address an encapsulated IPv4?
  146|       |     */
  147|    347|    if(i == 6 && best.base == 0 &&
  ------------------
  |  Branch (147:8): [True: 59, False: 288]
  |  Branch (147:18): [True: 31, False: 28]
  ------------------
  148|     31|       (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
  ------------------
  |  Branch (148:9): [True: 11, False: 20]
  |  Branch (148:27): [True: 18, False: 2]
  |  Branch (148:44): [True: 1, False: 17]
  ------------------
  149|     12|      CURLcode result = inet_ntop4(src + 12, tp, sizeof(tmp) - (tp - tmp));
  150|     12|      if(result)
  ------------------
  |  Branch (150:10): [True: 0, False: 12]
  ------------------
  151|      0|        return result;
  152|     12|      tp += strlen(tp);
  153|     12|      break;
  154|     12|    }
  155|    335|    else {
  156|       |      /* Lower-case digits. Cannot use the set from mprintf.c since this
  157|       |         needs to work as a curlx function */
  158|    335|      static const unsigned char ldigits[] = "0123456789abcdef";
  159|       |
  160|    335|      unsigned int w = words[i];
  161|       |      /* output lowercase 16-bit hex number but ignore leading zeroes */
  162|    335|      if(w & 0xf000)
  ------------------
  |  Branch (162:10): [True: 70, False: 265]
  ------------------
  163|     70|        *tp++ = ldigits[(w & 0xf000) >> 12];
  164|    335|      if(w & 0xff00)
  ------------------
  |  Branch (164:10): [True: 114, False: 221]
  ------------------
  165|    114|        *tp++ = ldigits[(w & 0x0f00) >> 8];
  166|    335|      if(w & 0xfff0)
  ------------------
  |  Branch (166:10): [True: 162, False: 173]
  ------------------
  167|    162|        *tp++ = ldigits[(w & 0x00f0) >> 4];
  168|    335|      *tp++ = ldigits[(w & 0x000f)];
  169|    335|    }
  170|    347|  }
  171|       |
  172|       |  /* Was it a trailing run of 0x00's?
  173|       |   */
  174|    110|  if(best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
  ------------------
  |  |   35|     93|#define IN6ADDRSZ       16
  ------------------
                if(best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
  ------------------
  |  |   37|     93|#define INT16SZ          2
  ------------------
  |  Branch (174:6): [True: 93, False: 17]
  |  Branch (174:25): [True: 18, False: 75]
  ------------------
  175|     18|    *tp++ = ':';
  176|       |
  177|       |  /* Check for overflow, copy, and we are done. */
  178|    110|  if((size_t)(tp - tmp) >= size)
  ------------------
  |  Branch (178:6): [True: 17, False: 93]
  ------------------
  179|     17|    return CURLE_TOO_LARGE;
  180|     93|  curlx_strcopy(dst, size, tmp, tp - tmp);
  181|     93|  return CURLE_OK;
  182|    110|}

curlx_inet_pton:
  202|  12.3k|{
  203|  12.3k|  switch(af) {
  204|  12.1k|  case AF_INET:
  ------------------
  |  Branch (204:3): [True: 12.1k, False: 219]
  ------------------
  205|  12.1k|    return inet_pton4(src, (unsigned char *)dst);
  206|    219|  case AF_INET6:
  ------------------
  |  Branch (206:3): [True: 219, False: 12.1k]
  ------------------
  207|    219|    return inet_pton6(src, (unsigned char *)dst);
  208|      0|  default:
  ------------------
  |  Branch (208:3): [True: 0, False: 12.3k]
  ------------------
  209|      0|    return -1;
  210|  12.3k|  }
  211|       |  /* NOTREACHED */
  212|  12.3k|}
inet_pton.c:inet_pton4:
   63|  12.2k|{
   64|  12.2k|  int saw_digit, octets, ch;
   65|  12.2k|  unsigned char tmp[INADDRSZ], *tp;
   66|       |
   67|  12.2k|  saw_digit = 0;
   68|  12.2k|  octets = 0;
   69|  12.2k|  tp = tmp;
   70|  12.2k|  *tp = 0;
   71|   146k|  while((ch = (unsigned char)*src++) != '\0') {
  ------------------
  |  Branch (71:9): [True: 134k, False: 12.1k]
  ------------------
   72|   134k|    if(ISDIGIT(ch)) {
  ------------------
  |  |   42|   134k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 97.4k, False: 36.5k]
  |  |  |  Branch (42:38): [True: 97.4k, False: 5]
  |  |  ------------------
  ------------------
   73|  97.4k|      unsigned int val = (*tp * 10) + (ch - '0');
   74|       |
   75|  97.4k|      if(saw_digit && *tp == 0)
  ------------------
  |  Branch (75:10): [True: 48.7k, False: 48.7k]
  |  Branch (75:23): [True: 1, False: 48.7k]
  ------------------
   76|      1|        return 0;
   77|  97.4k|      if(val > 255)
  ------------------
  |  Branch (77:10): [True: 4, False: 97.4k]
  ------------------
   78|      4|        return 0;
   79|  97.4k|      *tp = (unsigned char)val;
   80|  97.4k|      if(!saw_digit) {
  ------------------
  |  Branch (80:10): [True: 48.7k, False: 48.7k]
  ------------------
   81|  48.7k|        if(++octets > 4)
  ------------------
  |  Branch (81:12): [True: 0, False: 48.7k]
  ------------------
   82|      0|          return 0;
   83|  48.7k|        saw_digit = 1;
   84|  48.7k|      }
   85|  97.4k|    }
   86|  36.5k|    else if(ch == '.' && saw_digit) {
  ------------------
  |  Branch (86:13): [True: 36.5k, False: 5]
  |  Branch (86:26): [True: 36.5k, False: 7]
  ------------------
   87|  36.5k|      if(octets == 4)
  ------------------
  |  Branch (87:10): [True: 1, False: 36.5k]
  ------------------
   88|      1|        return 0;
   89|  36.5k|      *++tp = 0;
   90|  36.5k|      saw_digit = 0;
   91|  36.5k|    }
   92|     12|    else
   93|     12|      return 0;
   94|   134k|  }
   95|  12.1k|  if(octets < 4)
  ------------------
  |  Branch (95:6): [True: 14, False: 12.1k]
  ------------------
   96|     14|    return 0;
   97|  12.1k|  memcpy(dst, tmp, INADDRSZ);
  ------------------
  |  |   36|  12.1k|#define INADDRSZ         4
  ------------------
   98|  12.1k|  return 1;
   99|  12.1k|}
inet_pton.c:inet_pton6:
  114|    219|{
  115|    219|  unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
  116|    219|  const char *curtok;
  117|    219|  int ch, saw_xdigit;
  118|    219|  size_t val;
  119|       |
  120|    219|  memset((tp = tmp), 0, IN6ADDRSZ);
  ------------------
  |  |   35|    219|#define IN6ADDRSZ       16
  ------------------
  121|    219|  endp = tp + IN6ADDRSZ;
  ------------------
  |  |   35|    219|#define IN6ADDRSZ       16
  ------------------
  122|    219|  colonp = NULL;
  123|       |  /* Leading :: requires some special handling. */
  124|    219|  if(*src == ':' && *++src != ':')
  ------------------
  |  Branch (124:6): [True: 63, False: 156]
  |  Branch (124:21): [True: 7, False: 56]
  ------------------
  125|      7|    return 0;
  126|    212|  curtok = src;
  127|    212|  saw_xdigit = 0;
  128|    212|  val = 0;
  129|  1.84k|  while((ch = (unsigned char)*src++) != '\0') {
  ------------------
  |  Branch (129:9): [True: 1.67k, False: 166]
  ------------------
  130|  1.67k|    if(ISXDIGIT(ch)) {
  ------------------
  |  |   37|  1.67k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  3.35k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 1.64k, False: 35]
  |  |  |  |  |  Branch (42:38): [True: 337, False: 1.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  3.01k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 358, False: 981]
  |  |  |  |  |  Branch (27:43): [True: 358, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|    981|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 439, False: 542]
  |  |  |  |  |  Branch (28:43): [True: 439, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  1.13k|      val <<= 4;
  132|  1.13k|      val |= curlx_hexval(ch);
  ------------------
  |  |  111|  1.13k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  133|  1.13k|      if(++saw_xdigit > 4)
  ------------------
  |  Branch (133:10): [True: 5, False: 1.12k]
  ------------------
  134|      5|        return 0;
  135|  1.12k|      continue;
  136|  1.13k|    }
  137|    542|    if(ch == ':') {
  ------------------
  |  Branch (137:8): [True: 507, False: 35]
  ------------------
  138|    507|      curtok = src;
  139|    507|      if(!saw_xdigit) {
  ------------------
  |  Branch (139:10): [True: 113, False: 394]
  ------------------
  140|    113|        if(colonp)
  ------------------
  |  Branch (140:12): [True: 4, False: 109]
  ------------------
  141|      4|          return 0;
  142|    109|        colonp = tp;
  143|    109|        continue;
  144|    113|      }
  145|    394|      if(tp + INT16SZ > endp)
  ------------------
  |  |   37|    394|#define INT16SZ          2
  ------------------
  |  Branch (145:10): [True: 2, False: 392]
  ------------------
  146|      2|        return 0;
  147|    392|      *tp++ = (unsigned char)((val >> 8) & 0xff);
  148|    392|      *tp++ = (unsigned char)(val & 0xff);
  149|    392|      saw_xdigit = 0;
  150|    392|      val = 0;
  151|    392|      continue;
  152|    394|    }
  153|     35|    if(ch == '.' && ((tp + INADDRSZ) <= endp) &&
  ------------------
  |  |   36|     35|#define INADDRSZ         4
  ------------------
  |  Branch (153:8): [True: 35, False: 0]
  |  Branch (153:21): [True: 34, False: 1]
  ------------------
  154|     34|       inet_pton4(curtok, tp) > 0) {
  ------------------
  |  Branch (154:8): [True: 2, False: 32]
  ------------------
  155|      2|      tp += INADDRSZ;
  ------------------
  |  |   36|      2|#define INADDRSZ         4
  ------------------
  156|      2|      saw_xdigit = 0;
  157|      2|      break;    /* '\0' was seen by inet_pton4(). */
  158|      2|    }
  159|     33|    return 0;
  160|     35|  }
  161|    168|  if(saw_xdigit) {
  ------------------
  |  Branch (161:6): [True: 108, False: 60]
  ------------------
  162|    108|    if(tp + INT16SZ > endp)
  ------------------
  |  |   37|    108|#define INT16SZ          2
  ------------------
  |  Branch (162:8): [True: 5, False: 103]
  ------------------
  163|      5|      return 0;
  164|    103|    *tp++ = (unsigned char)((val >> 8) & 0xff);
  165|    103|    *tp++ = (unsigned char)(val & 0xff);
  166|    103|  }
  167|    163|  if(colonp) {
  ------------------
  |  Branch (167:6): [True: 104, False: 59]
  ------------------
  168|       |    /*
  169|       |     * Since some memmove()'s erroneously fail to handle
  170|       |     * overlapping regions, we do the shift by hand.
  171|       |     */
  172|    104|    const ssize_t n = tp - colonp;
  173|    104|    ssize_t i;
  174|       |
  175|    104|    if(tp == endp)
  ------------------
  |  Branch (175:8): [True: 1, False: 103]
  ------------------
  176|      1|      return 0;
  177|    473|    for(i = 1; i <= n; i++) {
  ------------------
  |  Branch (177:16): [True: 370, False: 103]
  ------------------
  178|    370|      *(endp - i) = *(colonp + n - i);
  179|    370|      *(colonp + n - i) = 0;
  180|    370|    }
  181|    103|    tp = endp;
  182|    103|  }
  183|    162|  if(tp != endp)
  ------------------
  |  Branch (183:6): [True: 52, False: 110]
  ------------------
  184|     52|    return 0;
  185|    110|  memcpy(dst, tmp, IN6ADDRSZ);
  ------------------
  |  |   35|    110|#define IN6ADDRSZ       16
  ------------------
  186|    110|  return 1;
  187|    162|}

curlx_nonblock:
   47|  6.08k|{
   48|  6.08k|#ifdef HAVE_FCNTL_O_NONBLOCK
   49|       |  /* most recent Unix versions */
   50|  6.08k|  int flags;
   51|  6.08k|  flags = sfcntl(sockfd, F_GETFL, 0);
  ------------------
  |  |  950|  6.08k|#  define sfcntl  fcntl
  ------------------
   52|  6.08k|  if(flags < 0)
  ------------------
  |  Branch (52:6): [True: 0, False: 6.08k]
  ------------------
   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|  6.08k|  if(!!(flags & O_NONBLOCK) == !!nonblock)
  ------------------
  |  Branch (57:6): [True: 3.04k, False: 3.04k]
  ------------------
   58|  3.04k|    return 0;
   59|  3.04k|  if(nonblock)
  ------------------
  |  Branch (59:6): [True: 3.04k, False: 0]
  ------------------
   60|  3.04k|    flags |= O_NONBLOCK;
   61|      0|  else
   62|      0|    flags &= ~O_NONBLOCK;
   63|  3.04k|  return sfcntl(sockfd, F_SETFL, flags);
  ------------------
  |  |  950|  3.04k|#  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|  6.08k|}

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

curlx_memdup0:
   86|  41.4k|{
   87|  41.4k|  char *buf = (length < SIZE_MAX) ? curlx_malloc(length + 1) : NULL;
  ------------------
  |  | 1423|  41.4k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  |  Branch (87:15): [True: 41.4k, False: 0]
  ------------------
   88|  41.4k|  if(!buf)
  ------------------
  |  Branch (88:6): [True: 0, False: 41.4k]
  ------------------
   89|      0|    return NULL;
   90|  41.4k|  if(length) {
  ------------------
  |  Branch (90:6): [True: 29.8k, False: 11.5k]
  ------------------
   91|  29.8k|    DEBUGASSERT(src); /* must never be NULL */
  ------------------
  |  | 1027|  29.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (91:5): [True: 0, False: 29.8k]
  |  Branch (91:5): [True: 29.8k, False: 0]
  ------------------
   92|  29.8k|    memcpy(buf, src, length);
   93|  29.8k|  }
   94|  41.4k|  buf[length] = 0;
   95|  41.4k|  return buf;
   96|  41.4k|}
curlx_memzero:
  113|  11.6k|{
  114|  11.6k|  if(buf)
  ------------------
  |  Branch (114:6): [True: 11.6k, False: 0]
  ------------------
  115|  11.6k|    curlx_memzero_low(buf, size);
  ------------------
  |  | 1602|  11.6k|#define curlx_memzero_low(buf, size)  explicit_bzero(buf, size)
  ------------------
  116|  11.6k|}
curlx_strzero:
  120|  16.9k|{
  121|  16.9k|  if(buf)
  ------------------
  |  Branch (121:6): [True: 164, False: 16.8k]
  ------------------
  122|    164|    curlx_memzero_low(buf, strlen(buf));
  ------------------
  |  | 1602|    164|#define curlx_memzero_low(buf, size)  explicit_bzero(buf, size)
  ------------------
  123|  16.9k|}

curlx_str_init:
   27|  3.85k|{
   28|       |  out->str = NULL;
   29|  3.85k|  out->len = 0;
   30|  3.85k|}
curlx_str_assign:
   33|  9.12k|{
   34|  9.12k|  out->str = str;
   35|  9.12k|  out->len = len;
   36|  9.12k|}
curlx_str_until:
   51|  3.85k|{
   52|  3.85k|  const char *s;
   53|  3.85k|  size_t len = 0;
   54|  3.85k|  DEBUGASSERT(linep);
  ------------------
  |  | 1027|  3.85k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (54:3): [True: 0, False: 3.85k]
  |  Branch (54:3): [True: 3.85k, False: 0]
  ------------------
   55|  3.85k|  DEBUGASSERT(*linep);
  ------------------
  |  | 1027|  3.85k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (55:3): [True: 0, False: 3.85k]
  |  Branch (55:3): [True: 3.85k, False: 0]
  ------------------
   56|  3.85k|  DEBUGASSERT(out);
  ------------------
  |  | 1027|  3.85k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 3.85k]
  |  Branch (56:3): [True: 3.85k, False: 0]
  ------------------
   57|  3.85k|  DEBUGASSERT(delim);
  ------------------
  |  | 1027|  3.85k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 3.85k]
  |  Branch (57:3): [True: 3.85k, False: 0]
  ------------------
   58|  3.85k|  s = *linep;
   59|       |
   60|  3.85k|  curlx_str_init(out);
   61|  8.73k|  while(*s && (*s != delim)) {
  ------------------
  |  Branch (61:9): [True: 4.99k, False: 3.74k]
  |  Branch (61:15): [True: 4.88k, False: 110]
  ------------------
   62|  4.88k|    s++;
   63|  4.88k|    if(++len > max) {
  ------------------
  |  Branch (63:8): [True: 0, False: 4.88k]
  ------------------
   64|      0|      return STRE_BIG;
  ------------------
  |  |   29|      0|#define STRE_BIG      1
  ------------------
   65|      0|    }
   66|  4.88k|  }
   67|  3.85k|  if(!len)
  ------------------
  |  Branch (67:6): [True: 0, False: 3.85k]
  ------------------
   68|      0|    return STRE_SHORT;
  ------------------
  |  |   30|      0|#define STRE_SHORT    2
  ------------------
   69|  3.85k|  out->str = *linep;
   70|  3.85k|  out->len = len;
   71|  3.85k|  *linep = s; /* point to the first byte after the word */
   72|  3.85k|  return STRE_OK;
  ------------------
  |  |   28|  3.85k|#define STRE_OK       0
  ------------------
   73|  3.85k|}
curlx_str_word:
   78|  3.74k|{
   79|  3.74k|  return curlx_str_until(linep, out, max, ' ');
   80|  3.74k|}
curlx_str_single:
  139|  7.58k|{
  140|  7.58k|  DEBUGASSERT(linep && *linep);
  ------------------
  |  | 1027|  7.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (140:3): [True: 0, False: 7.58k]
  |  Branch (140:3): [True: 0, False: 0]
  |  Branch (140:3): [True: 7.58k, False: 0]
  |  Branch (140:3): [True: 7.58k, False: 0]
  ------------------
  141|  7.58k|  if(**linep != byte)
  ------------------
  |  Branch (141:6): [True: 7.49k, False: 86]
  ------------------
  142|  7.49k|    return STRE_BYTE;
  ------------------
  |  |   33|  7.49k|#define STRE_BYTE     5
  ------------------
  143|     86|  (*linep)++; /* move over it */
  144|     86|  return STRE_OK;
  ------------------
  |  |   28|     86|#define STRE_OK       0
  ------------------
  145|  7.58k|}
curlx_str_singlespace:
  150|  3.74k|{
  151|  3.74k|  return curlx_str_single(linep, ' ');
  152|  3.74k|}
curlx_str_number:
  209|   730k|{
  210|   730k|  return str_num_base(linep, nump, max, 10);
  211|   730k|}
curlx_str_hex:
  216|     15|{
  217|     15|  return str_num_base(linep, nump, max, 16);
  218|     15|}
curlx_str_octal:
  223|    659|{
  224|    659|  return str_num_base(linep, nump, max, 8);
  225|    659|}
curlx_str_casecompare:
  253|     22|{
  254|     22|  size_t clen = check ? strlen(check) : 0;
  ------------------
  |  Branch (254:17): [True: 22, False: 0]
  ------------------
  255|     22|  return ((str->len == clen) && curl_strnequal(str->str, check, clen));
  ------------------
  |  Branch (255:11): [True: 4, False: 18]
  |  Branch (255:33): [True: 1, False: 3]
  ------------------
  256|     22|}
curlx_str_nudge:
  272|      1|{
  273|      1|  if(num <= str->len) {
  ------------------
  |  Branch (273:6): [True: 1, False: 0]
  ------------------
  274|      1|    str->str += num;
  275|      1|    str->len -= num;
  276|      1|    return STRE_OK;
  ------------------
  |  |   28|      1|#define STRE_OK       0
  ------------------
  277|      1|  }
  278|      0|  return STRE_OVERFLOW;
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  279|      1|}
curlx_str_passblanks:
  314|  7.48k|{
  315|  7.48k|  while(ISBLANK(**linep))
  ------------------
  |  |   43|  7.48k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 7.48k]
  |  |  |  Branch (43:38): [True: 0, False: 7.48k]
  |  |  ------------------
  ------------------
  316|      0|    (*linep)++; /* move over it */
  317|  7.48k|}
strparse.c:str_num_base:
  172|   731k|{
  173|   731k|  curl_off_t num = 0;
  174|   731k|  const char *p;
  175|   731k|  int m = (base == 10) ? '9' :   /* the largest digit possible */
  ------------------
  |  Branch (175:11): [True: 730k, False: 674]
  ------------------
  176|   731k|    (base == 16) ? 'f' : '7';
  ------------------
  |  Branch (176:5): [True: 15, False: 659]
  ------------------
  177|   731k|  DEBUGASSERT(linep && *linep && nump);
  ------------------
  |  | 1027|   731k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 731k]
  |  Branch (177:3): [True: 0, False: 0]
  |  Branch (177:3): [True: 0, False: 0]
  |  Branch (177:3): [True: 731k, False: 0]
  |  Branch (177:3): [True: 731k, False: 0]
  |  Branch (177:3): [True: 731k, False: 0]
  ------------------
  178|   731k|  DEBUGASSERT((base == 8) || (base == 10) || (base == 16));
  ------------------
  |  | 1027|   731k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 731k, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  |  Branch (178:3): [True: 659, False: 730k]
  |  Branch (178:3): [True: 730k, False: 15]
  |  Branch (178:3): [True: 15, False: 0]
  ------------------
  179|   731k|  DEBUGASSERT(max >= 0); /* mostly to catch SIZE_MAX, which is too large */
  ------------------
  |  | 1027|   731k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 731k]
  |  Branch (179:3): [True: 731k, False: 0]
  ------------------
  180|   731k|  *nump = 0;
  181|   731k|  p = *linep;
  182|   731k|  if(!valid_digit(*p, m))
  ------------------
  |  |  156|   731k|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 646k, False: 84.3k]
  |  |  |  Branch (156:20): [True: 72.9k, False: 574k]
  |  |  |  Branch (156:36): [True: 72.9k, False: 1]
  |  |  ------------------
  ------------------
  183|   658k|    return STRE_NO_NUM;
  ------------------
  |  |   36|   658k|#define STRE_NO_NUM   8
  ------------------
  184|  72.9k|  if(max < base) {
  ------------------
  |  Branch (184:6): [True: 96, False: 72.8k]
  ------------------
  185|       |    /* special-case low max scenario because check needs to be different */
  186|    310|    do {
  187|    310|      int n = curlx_hexval(*p++);
  ------------------
  |  |  111|    310|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  188|    310|      num = (num * base) + n;
  189|    310|      if(num > max)
  ------------------
  |  Branch (189:10): [True: 25, False: 285]
  ------------------
  190|     25|        return STRE_OVERFLOW;
  ------------------
  |  |   35|     25|#define STRE_OVERFLOW 7
  ------------------
  191|    310|    } while(valid_digit(*p, m));
  ------------------
  |  |  156|    285|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 237, False: 48]
  |  |  |  Branch (156:20): [True: 214, False: 23]
  |  |  |  Branch (156:36): [True: 214, False: 0]
  |  |  ------------------
  ------------------
  192|     96|  }
  193|  72.8k|  else {
  194|  76.7k|    do {
  195|  76.7k|      int n = curlx_hexval(*p++);
  ------------------
  |  |  111|  76.7k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  196|  76.7k|      if(num > ((max - n) / base))
  ------------------
  |  Branch (196:10): [True: 37, False: 76.6k]
  ------------------
  197|     37|        return STRE_OVERFLOW;
  ------------------
  |  |   35|     37|#define STRE_OVERFLOW 7
  ------------------
  198|  76.6k|      num = (num * base) + n;
  199|  76.6k|    } while(valid_digit(*p, m));
  ------------------
  |  |  156|  76.6k|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 73.8k, False: 2.88k]
  |  |  |  Branch (156:20): [True: 3.86k, False: 69.9k]
  |  |  |  Branch (156:36): [True: 3.86k, False: 0]
  |  |  ------------------
  ------------------
  200|  72.8k|  }
  201|  72.9k|  *nump = num;
  202|  72.9k|  *linep = p;
  203|  72.9k|  return STRE_OK;
  ------------------
  |  |   28|  72.9k|#define STRE_OK       0
  ------------------
  204|  72.9k|}

curlx_pnow:
   52|   149k|{
   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|   149k|  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|   149k|#ifdef HAVE_CLOCK_GETTIME_MONOTONIC_RAW
   75|   149k|  if(
   76|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   77|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   78|       |    have_clock_gettime &&
   79|       |#endif
   80|   149k|    (clock_gettime(CLOCK_MONOTONIC_RAW, &tsnow) == 0)) {
  ------------------
  |  Branch (80:5): [True: 149k, False: 0]
  ------------------
   81|   149k|    pnow->tv_sec = tsnow.tv_sec;
   82|   149k|    pnow->tv_usec = (int)(tsnow.tv_nsec / 1000);
   83|   149k|  }
   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|   149k|}
curlx_ptimediff_ms:
  188|  15.2k|{
  189|  15.2k|  timediff_t diff = (timediff_t)newer->tv_sec - older->tv_sec;
  190|  15.2k|  if(diff >= (TIMEDIFF_T_MAX / 1000))
  ------------------
  |  |   33|  15.2k|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  540|  15.2k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (190:6): [True: 0, False: 15.2k]
  ------------------
  191|      0|    return TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  192|  15.2k|  else if(diff <= (TIMEDIFF_T_MIN / 1000))
  ------------------
  |  |   34|  15.2k|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  542|  15.2k|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  540|  15.2k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (192:11): [True: 0, False: 15.2k]
  ------------------
  193|      0|    return TIMEDIFF_T_MIN;
  ------------------
  |  |   34|      0|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  542|      0|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|  15.2k|  return (diff * 1000) + ((newer->tv_usec - older->tv_usec) / 1000);
  195|  15.2k|}
curlx_ptimediff_us:
  228|   115k|{
  229|   115k|  timediff_t diff = (timediff_t)newer->tv_sec - older->tv_sec;
  230|   115k|  if(diff >= (TIMEDIFF_T_MAX / 1000000))
  ------------------
  |  |   33|   115k|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  540|   115k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (230:6): [True: 0, False: 115k]
  ------------------
  231|      0|    return TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  232|   115k|  else if(diff <= (TIMEDIFF_T_MIN / 1000000))
  ------------------
  |  |   34|   115k|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  542|   115k|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  540|   115k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (232:11): [True: 0, False: 115k]
  ------------------
  233|      0|    return TIMEDIFF_T_MIN;
  ------------------
  |  |   34|      0|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  542|      0|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|   115k|  return (diff * 1000000) + newer->tv_usec - older->tv_usec;
  235|   115k|}

curlx_uztosi:
   69|  3.74k|{
   70|  3.74k|  DEBUGASSERT(uznum <= (size_t)CURL_MASK_SINT);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (70:3): [True: 0, False: 3.74k]
  |  Branch (70:3): [True: 3.74k, False: 0]
  ------------------
   71|  3.74k|  return (int)(uznum & (size_t)CURL_MASK_SINT);
  ------------------
  |  |   44|  3.74k|#define CURL_MASK_SINT    (CURL_MASK_UINT >> 1)
  |  |  ------------------
  |  |  |  |   43|  3.74k|#define CURL_MASK_UINT    ((unsigned int)~0)
  |  |  ------------------
  ------------------
   72|  3.74k|}
curlx_uitouz:
  183|  4.11k|{
  184|  4.11k|  return (size_t)uinum;
  185|  4.11k|}
curlx_sotouz_range:
  188|    341|{
  189|    341|  if(sonum < 0)
  ------------------
  |  Branch (189:6): [True: 0, False: 341]
  ------------------
  190|      0|    return uzmin;
  191|       |#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T
  192|       |  if(sonum > SIZE_MAX)
  193|       |    return uzmax;
  194|       |#endif
  195|    341|  return CURLMIN(CURLMAX((size_t)sonum, uzmin), uzmax);
  ------------------
  |  | 1240|    682|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1240:24): [True: 341, False: 0]
  |  |  |  Branch (1240:25): [True: 338, False: 3]
  |  |  |  Branch (1240:37): [True: 338, False: 3]
  |  |  ------------------
  ------------------
  196|    341|}
curlx_sztouz:
  199|  4.48k|{
  200|  4.48k|  if(sznum < 0) {
  ------------------
  |  Branch (200:6): [True: 0, False: 4.48k]
  ------------------
  201|      0|    *puznum = 0;
  202|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  203|      0|  }
  204|  4.48k|  *puznum = (size_t)sznum;
  205|       |  return TRUE;
  ------------------
  |  |  997|  4.48k|#define TRUE true
  ------------------
  206|  4.48k|}

Curl_cw_out_done:
  490|  3.04k|{
  491|  3.04k|  struct Curl_cwriter *cw_out;
  492|  3.04k|  CURLcode result = CURLE_OK;
  493|       |
  494|  3.04k|  cw_out = Curl_cwriter_get_by_type(data, &Curl_cwt_out);
  495|  3.04k|  if(cw_out) {
  ------------------
  |  Branch (495:6): [True: 561, False: 2.48k]
  ------------------
  496|    561|    CURL_TRC_WRITE(data, "[OUT] done");
  ------------------
  |  |  158|    561|  do {                                                     \
  |  |  159|    561|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|    561|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.12k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 561, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 561, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.12k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 561, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    561|    ((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|    561|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    561|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 561]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    561|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|    561|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 561]
  |  |  ------------------
  ------------------
  497|    561|    result = Curl_client_flush(data);
  498|    561|    if(!result)
  ------------------
  |  Branch (498:8): [True: 561, False: 0]
  ------------------
  499|    561|      result = cw_out_do_flush(data, cw_out, TRUE);
  ------------------
  |  |  997|    561|#define TRUE true
  ------------------
  500|    561|  }
  501|  3.04k|  return result;
  502|  3.04k|}
cw-out.c:cw_out_init:
  107|    561|{
  108|    561|  struct cw_out_ctx *ctx = writer->ctx;
  109|    561|  (void)data;
  110|    561|  ctx->buf = NULL;
  111|       |  ctx->tail = NULL;
  112|    561|  ctx->buffered_len = 0;
  113|    561|  return CURLE_OK;
  114|    561|}
cw-out.c:cw_out_write:
  426|  14.3k|{
  427|  14.3k|  struct cw_out_ctx *ctx = writer->ctx;
  428|  14.3k|  CURLcode result;
  429|  14.3k|  bool flush_all = !!(type & CLIENTWRITE_EOS);
  ------------------
  |  |   50|  14.3k|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  430|       |
  431|  14.3k|  if((type & CLIENTWRITE_BODY) ||
  ------------------
  |  |   43|  14.3k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (431:6): [True: 14.3k, False: 0]
  ------------------
  432|  14.3k|     ((type & CLIENTWRITE_HEADER) && data->set.include_header)) {
  ------------------
  |  |   45|      0|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
  |  Branch (432:7): [True: 0, False: 0]
  |  Branch (432:38): [True: 0, False: 0]
  ------------------
  433|  14.3k|    cw_out_type otype = (!blen && (type & CLIENTWRITE_0LEN)) ?
  ------------------
  |  |   51|      0|#define CLIENTWRITE_0LEN    (1 << 8) /* write even 0-length buffers */
  ------------------
  |  Branch (433:26): [True: 0, False: 14.3k]
  |  Branch (433:35): [True: 0, False: 0]
  ------------------
  434|  14.3k|                        CW_OUT_BODY_0LEN : CW_OUT_BODY;
  435|  14.3k|    result = cw_out_do_write(ctx, data, otype, flush_all, buf, blen);
  436|  14.3k|    if(result)
  ------------------
  |  Branch (436:8): [True: 0, False: 14.3k]
  ------------------
  437|      0|      return result;
  438|  14.3k|  }
  439|       |
  440|  14.3k|  if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
  ------------------
  |  |   45|  14.3k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
  ------------------
  |  |   44|  14.3k|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
  |  Branch (440:6): [True: 0, False: 14.3k]
  ------------------
  441|      0|    result = cw_out_do_write(ctx, data, CW_OUT_HDS, flush_all, buf, blen);
  442|      0|    if(result)
  ------------------
  |  Branch (442:8): [True: 0, False: 0]
  ------------------
  443|      0|      return result;
  444|      0|  }
  445|       |
  446|  14.3k|  return CURLE_OK;
  447|  14.3k|}
cw-out.c:cw_out_do_write:
  376|  14.3k|{
  377|  14.3k|  CURLcode result = CURLE_OK;
  378|       |
  379|       |  /* if we have buffered data and the last chunk buffered is of a
  380|       |   * different type than what we are writing now, try to flush all */
  381|  14.3k|  if(ctx->tail && ctx->tail->type != otype) {
  ------------------
  |  Branch (381:6): [True: 0, False: 14.3k]
  |  Branch (381:19): [True: 0, False: 0]
  ------------------
  382|      0|    result = cw_out_flush_chain(ctx, data, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  383|      0|    if(result)
  ------------------
  |  Branch (383:8): [True: 0, False: 0]
  ------------------
  384|      0|      goto out;
  385|      0|  }
  386|       |
  387|  14.3k|  if(ctx->buf) {
  ------------------
  |  Branch (387:6): [True: 0, False: 14.3k]
  ------------------
  388|       |    /* still have buffered data, append and flush */
  389|      0|    result = cw_out_append(ctx, data, otype, buf, blen);
  390|      0|    if(result)
  ------------------
  |  Branch (390:8): [True: 0, False: 0]
  ------------------
  391|      0|      goto out;
  392|      0|    result = cw_out_flush_chain(ctx, data, flush_all);
  393|      0|    if(result)
  ------------------
  |  Branch (393:8): [True: 0, False: 0]
  ------------------
  394|      0|      goto out;
  395|      0|  }
  396|  14.3k|  else {
  397|       |    /* nothing buffered, try direct write */
  398|  14.3k|    size_t consumed;
  399|  14.3k|    result = cw_out_ptr_flush(ctx, data, otype, flush_all,
  400|  14.3k|                              buf, blen, &consumed);
  401|  14.3k|    if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (401:8): [True: 0, False: 14.3k]
  |  Branch (401:18): [True: 0, False: 0]
  ------------------
  402|      0|      return result;
  403|  14.3k|    result = CURLE_OK;
  404|  14.3k|    if(consumed < blen) {
  ------------------
  |  Branch (404:8): [True: 0, False: 14.3k]
  ------------------
  405|       |      /* did not write all, append the rest */
  406|      0|      result = cw_out_append(ctx, data, otype,
  407|      0|                             buf + consumed, blen - consumed);
  408|      0|      if(result)
  ------------------
  |  Branch (408:10): [True: 0, False: 0]
  ------------------
  409|      0|        goto out;
  410|      0|    }
  411|  14.3k|  }
  412|       |
  413|  14.3k|out:
  414|  14.3k|  if(result) {
  ------------------
  |  Branch (414:6): [True: 0, False: 14.3k]
  ------------------
  415|       |    /* We do not want to invoke client callbacks a second time after
  416|       |     * encountering an error. See issue #13337 */
  417|       |    ctx->errored = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  418|      0|    cw_out_bufs_free(ctx);
  419|      0|  }
  420|  14.3k|  return result;
  421|  14.3k|}
cw-out.c:cw_out_ptr_flush:
  223|  14.3k|{
  224|  14.3k|  curl_write_callback wcb = NULL;
  225|  14.3k|  void *wcb_data;
  226|  14.3k|  size_t max_write, min_write;
  227|  14.3k|  size_t wlen, nwritten = 0;
  228|  14.3k|  CURLcode result = CURLE_OK;
  229|       |
  230|       |  /* If we errored once, we do not invoke the client callback again */
  231|  14.3k|  if(ctx->errored)
  ------------------
  |  Branch (231:6): [True: 0, False: 14.3k]
  ------------------
  232|      0|    return CURLE_WRITE_ERROR;
  233|       |
  234|       |  /* write callbacks may get NULLed by the client between calls. */
  235|  14.3k|  cw_get_writefunc(data, otype, &wcb, &wcb_data, &max_write, &min_write);
  236|  14.3k|  if(!wcb) {
  ------------------
  |  Branch (236:6): [True: 0, False: 14.3k]
  ------------------
  237|      0|    *pconsumed = blen;
  238|      0|    return CURLE_OK;
  239|      0|  }
  240|       |
  241|  14.3k|  *pconsumed = 0;
  242|  14.3k|  if(otype == CW_OUT_BODY_0LEN) {
  ------------------
  |  Branch (242:6): [True: 0, False: 14.3k]
  ------------------
  243|      0|    DEBUGASSERT(!blen);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (243:5): [True: 0, False: 0]
  |  Branch (243:5): [True: 0, False: 0]
  ------------------
  244|      0|    return cw_out_cb_write(data, wcb, wcb_data, otype,
  245|      0|                           buf, blen, &nwritten);
  246|      0|  }
  247|  14.3k|  else {
  248|  28.7k|    while(blen && !data->req.writer.paused) {
  ------------------
  |  Branch (248:11): [True: 14.3k, False: 14.3k]
  |  Branch (248:19): [True: 14.3k, False: 0]
  ------------------
  249|  14.3k|      if(!flush_all && blen < min_write)
  ------------------
  |  Branch (249:10): [True: 14.3k, False: 0]
  |  Branch (249:24): [True: 0, False: 14.3k]
  ------------------
  250|      0|        break;
  251|  14.3k|      wlen = max_write ? CURLMIN(blen, max_write) : blen;
  ------------------
  |  | 1240|  14.3k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1240:24): [True: 14.3k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (251:14): [True: 14.3k, False: 0]
  ------------------
  252|  14.3k|      if(otype == CW_OUT_BODY)
  ------------------
  |  Branch (252:10): [True: 14.3k, False: 0]
  ------------------
  253|  14.3k|        result = Curl_pgrs_deliver_check(data, wlen);
  254|  14.3k|      if(!result)
  ------------------
  |  Branch (254:10): [True: 14.3k, False: 0]
  ------------------
  255|  14.3k|        result = cw_out_cb_write(data, wcb, wcb_data, otype,
  256|  14.3k|                                 buf, wlen, &nwritten);
  257|  14.3k|      if(result)
  ------------------
  |  Branch (257:10): [True: 0, False: 14.3k]
  ------------------
  258|      0|        return result;
  259|  14.3k|      if(otype == CW_OUT_BODY)
  ------------------
  |  Branch (259:10): [True: 14.3k, False: 0]
  ------------------
  260|  14.3k|        Curl_pgrs_deliver_inc(data, nwritten);
  261|  14.3k|      *pconsumed += nwritten;
  262|  14.3k|      blen -= nwritten;
  263|  14.3k|      buf += nwritten;
  264|  14.3k|    }
  265|  14.3k|  }
  266|  14.3k|  return CURLE_OK;
  267|  14.3k|}
cw-out.c:cw_get_writefunc:
  141|  14.3k|{
  142|  14.3k|  switch(otype) {
  143|  14.3k|  case CW_OUT_BODY:
  ------------------
  |  Branch (143:3): [True: 14.3k, False: 0]
  ------------------
  144|  14.3k|  case CW_OUT_BODY_0LEN:
  ------------------
  |  Branch (144:3): [True: 0, False: 14.3k]
  ------------------
  145|  14.3k|    *pwcb = data->set.fwrite_func;
  146|  14.3k|    *pwcb_data = data->set.out;
  147|  14.3k|    *pmax_write = CURL_MAX_WRITE_SIZE;
  ------------------
  |  |  267|  14.3k|#define CURL_MAX_WRITE_SIZE 16384
  ------------------
  148|       |    /* if we ever want buffering of BODY output, we can set `min_write`
  149|       |     * the preferred size. The default should always be to pass data
  150|       |     * to the client as it comes without delay */
  151|  14.3k|    *pmin_write = 0;
  152|  14.3k|    break;
  153|      0|  case CW_OUT_HDS:
  ------------------
  |  Branch (153:3): [True: 0, False: 14.3k]
  ------------------
  154|      0|    *pwcb = data->set.fwrite_header ? data->set.fwrite_header :
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|             (data->set.writeheader ? data->set.fwrite_func : NULL);
  ------------------
  |  Branch (155:15): [True: 0, False: 0]
  ------------------
  156|      0|    *pwcb_data = data->set.writeheader;
  157|      0|    *pmax_write = 0; /* do not chunk-write headers, write them as they are */
  158|      0|    *pmin_write = 0;
  159|      0|    break;
  160|      0|  default:
  ------------------
  |  Branch (160:3): [True: 0, False: 14.3k]
  ------------------
  161|      0|    *pwcb = NULL;
  162|      0|    *pwcb_data = NULL;
  163|      0|    *pmax_write = CURL_MAX_WRITE_SIZE;
  ------------------
  |  |  267|      0|#define CURL_MAX_WRITE_SIZE 16384
  ------------------
  164|      0|    *pmin_write = 0;
  165|  14.3k|  }
  166|  14.3k|}
cw-out.c:cw_out_cb_write:
  174|  14.3k|{
  175|  14.3k|  size_t nwritten;
  176|  14.3k|  CURLcode result;
  177|       |
  178|  14.3k|  NOVERBOSE((void)otype);
  ------------------
  |  | 1564|  14.3k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1135|  14.3k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1135:35): [Folded, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|       |
  180|  14.3k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  14.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:3): [True: 0, False: 14.3k]
  |  Branch (180:3): [True: 14.3k, False: 0]
  ------------------
  181|  14.3k|  *pnwritten = 0;
  182|  14.3k|  {
  183|  14.3k|    struct Curl_mapi_guard guard;
  184|  14.3k|    CURL_CBAPI_START(&guard, data, easy_cw_out_cb);
  ------------------
  |  |  201|  14.3k|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
  185|  14.3k|    nwritten = wcb((char *)CURL_UNCONST(buf), 1, blen, wcb_data);
  ------------------
  |  |  808|  14.3k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  186|  14.3k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  14.3k|  Curl_cbapi_leave(g)
  ------------------
  187|  14.3k|  }
  188|  14.3k|  CURL_TRC_WRITE(data, "[OUT] wrote %zu %s bytes, type=%x -> %zu",
  ------------------
  |  |  158|  14.3k|  do {                                                     \
  |  |  159|  14.3k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  14.3k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  28.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 14.3k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 14.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  28.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 14.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  14.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|  14.3k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  14.3k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  14.3k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (160:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  161|  14.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  189|  14.3k|                 blen, (otype == CW_OUT_HDS) ? "header" : "body",
  190|  14.3k|                 (unsigned int)otype, nwritten);
  191|  14.3k|  if(nwritten == CURL_WRITEFUNC_PAUSE) {
  ------------------
  |  |  279|  14.3k|#define CURL_WRITEFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (191:6): [True: 0, False: 14.3k]
  ------------------
  192|      0|    if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  211|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (192:8): [True: 0, False: 0]
  ------------------
  193|       |      /* Protocols that work without network cannot be paused. This is
  194|       |         actually only file:// now, and it cannot pause since the transfer is
  195|       |         not done using the "normal" procedure. */
  196|      0|      failf(data, "Write callback asked for PAUSE when not supported");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  197|      0|      return CURLE_WRITE_ERROR;
  198|      0|    }
  199|      0|    data->req.writer.paused = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  200|      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]
  |  |  ------------------
  ------------------
  201|      0|    result = Curl_xfer_pause_recv(data, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  202|      0|    return result ? result : CURLE_AGAIN;
  ------------------
  |  Branch (202:12): [True: 0, False: 0]
  ------------------
  203|      0|  }
  204|  14.3k|  else if(nwritten == CURL_WRITEFUNC_ERROR) {
  ------------------
  |  |  283|  14.3k|#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
  ------------------
  |  Branch (204:11): [True: 0, False: 14.3k]
  ------------------
  205|      0|    failf(data, "client returned ERROR on write of %zu bytes", blen);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  206|      0|    return CURLE_WRITE_ERROR;
  207|      0|  }
  208|  14.3k|  else if(nwritten != blen) {
  ------------------
  |  Branch (208:11): [True: 0, False: 14.3k]
  ------------------
  209|      0|    failf(data, "Failure writing output to destination, "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  210|      0|          "passed %zu returned %zu", blen, nwritten);
  211|      0|    return CURLE_WRITE_ERROR;
  212|      0|  }
  213|  14.3k|  *pnwritten = nwritten;
  214|  14.3k|  return CURLE_OK;
  215|  14.3k|}
cw-out.c:cw_out_bufs_free:
  117|    561|{
  118|    561|  while(ctx->buf) {
  ------------------
  |  Branch (118:9): [True: 0, False: 561]
  ------------------
  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|    561|  ctx->buffered_len = 0;
  125|    561|}
cw-out.c:cw_out_flush:
  474|    561|{
  475|       |  return cw_out_do_flush(data, writer, FALSE);
  ------------------
  |  | 1000|    561|#define FALSE false
  ------------------
  476|    561|}
cw-out.c:cw_out_close:
  128|    561|{
  129|    561|  struct cw_out_ctx *ctx = writer->ctx;
  130|       |
  131|    561|  (void)data;
  132|    561|  cw_out_bufs_free(ctx);
  133|    561|}
cw-out.c:cw_out_do_flush:
  452|  1.12k|{
  453|  1.12k|  struct cw_out_ctx *ctx = (struct cw_out_ctx *)cw_out;
  454|       |
  455|  1.12k|  if(ctx->errored)
  ------------------
  |  Branch (455:6): [True: 0, False: 1.12k]
  ------------------
  456|      0|    return CURLE_WRITE_ERROR;
  457|       |
  458|  1.12k|  if(!data->req.writer.paused && ctx->buf) {
  ------------------
  |  Branch (458:6): [True: 1.12k, False: 0]
  |  Branch (458:34): [True: 0, False: 1.12k]
  ------------------
  459|      0|    CURLcode result;
  460|       |
  461|      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]
  |  |  ------------------
  ------------------
  462|      0|    result = cw_out_flush_chain(ctx, data, flush_all);
  463|      0|    if(result) {
  ------------------
  |  Branch (463:8): [True: 0, False: 0]
  ------------------
  464|      0|      ctx->errored = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  465|      0|      cw_out_bufs_free(ctx);
  466|      0|      return result;
  467|      0|    }
  468|      0|  }
  469|  1.12k|  return CURLE_OK;
  470|  1.12k|}

curl_global_init:
  229|      2|{
  230|      2|  CURLcode result;
  231|      2|  global_init_lock();
  ------------------
  |  |   92|      2|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  232|       |
  233|      2|  result = global_init(flags, TRUE);
  ------------------
  |  |  997|      2|#define TRUE true
  ------------------
  234|       |
  235|      2|  global_init_unlock();
  ------------------
  |  |   93|      2|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  236|       |
  237|      2|  return result;
  238|      2|}
curl_global_trace:
  326|      1|{
  327|      1|#ifndef CURL_DISABLE_VERBOSE_STRINGS
  328|      1|  CURLcode result;
  329|      1|  global_init_lock();
  ------------------
  |  |   92|      1|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  330|       |
  331|      1|  result = Curl_trc_opt(config);
  332|       |
  333|      1|  global_init_unlock();
  ------------------
  |  |   93|      1|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  334|       |
  335|      1|  return result;
  336|       |#else
  337|       |  (void)config;
  338|       |  return CURLE_OK;
  339|       |#endif
  340|      1|}
curl_easy_init:
  364|  7.48k|{
  365|  7.48k|  CURLcode result;
  366|  7.48k|  struct Curl_easy *data;
  367|       |
  368|       |  /* Make sure we inited the global SSL stuff */
  369|  7.48k|  global_init_lock();
  ------------------
  |  |   92|  7.48k|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  370|       |
  371|  7.48k|  if(!initialized) {
  ------------------
  |  Branch (371:6): [True: 0, False: 7.48k]
  ------------------
  372|      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);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  373|      0|    if(result) {
  ------------------
  |  Branch (373:8): [True: 0, False: 0]
  ------------------
  374|       |      /* something in the global init failed, return nothing */
  375|      0|      DEBUGF(curl_mfprintf(stderr, "Error: curl_global_init failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  376|      0|      global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  377|      0|      return NULL;
  378|      0|    }
  379|      0|  }
  380|  7.48k|  global_init_unlock();
  ------------------
  |  |   93|  7.48k|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  381|       |
  382|       |  /* We use Curl_open() with undefined URL so far */
  383|  7.48k|  result = Curl_open(&data);
  384|  7.48k|  if(result) {
  ------------------
  |  Branch (384:6): [True: 0, False: 7.48k]
  ------------------
  385|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  386|      0|    return NULL;
  387|      0|  }
  388|       |
  389|  7.48k|  return data;
  390|  7.48k|}
curl_easy_cleanup:
  882|  3.74k|{
  883|  3.74k|  struct Curl_eapi_guard guard;
  884|       |
  885|  3.74k|  if(CURL_EAPI_ENTER(&guard, curl, easy_cleanup, NULL)) {
  ------------------
  |  |  163|  3.74k|  Curl_eapi_enter((g), (curl), CURL_EAPI_FN_##fn, (r)) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 3.74k, False: 0]
  |  |  |  Branch (163:59): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
  886|  3.74k|    struct Curl_easy *data = curl;
  887|  3.74k|    struct Curl_sigpipe_ctx sigpipe_ctx;
  888|  3.74k|    sigpipe_ignore(data, &sigpipe_ctx);
  889|  3.74k|    Curl_close(&data);
  890|  3.74k|    sigpipe_restore(&sigpipe_ctx);
  891|  3.74k|  }
  892|  3.74k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|  3.74k|  Curl_eapi_leave(g)
  ------------------
  893|  3.74k|}
Curl_meta_set:
 1444|  3.04k|{
 1445|  3.04k|  DEBUGASSERT(meta_data); /* never set to NULL */
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1445:3): [True: 0, False: 3.04k]
  |  Branch (1445:3): [True: 3.04k, False: 0]
  ------------------
 1446|  3.04k|  if(!Curl_hash_add2(&data->meta_hash, key, strlen(key) + 1,
  ------------------
  |  Branch (1446:6): [True: 0, False: 3.04k]
  ------------------
 1447|  3.04k|                     meta_data, meta_dtor)) {
 1448|      0|    meta_dtor(key, strlen(key) + 1, meta_data);
 1449|      0|    return CURLE_OUT_OF_MEMORY;
 1450|      0|  }
 1451|  3.04k|  return CURLE_OK;
 1452|  3.04k|}
Curl_meta_remove:
 1455|  6.78k|{
 1456|  6.78k|  Curl_hash_delete(&data->meta_hash, key, strlen(key) + 1);
 1457|  6.78k|}
Curl_meta_get:
 1460|  3.04k|{
 1461|  3.04k|  return Curl_hash_pick(&data->meta_hash, key, strlen(key) + 1);
 1462|  3.04k|}
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: 2, False: 0]
  ------------------
  137|       |    /* Setup the default memory functions here (again) */
  138|      2|    Curl_cmalloc = (curl_malloc_callback)malloc;
  139|      2|    Curl_cfree = (curl_free_callback)free;
  140|      2|    Curl_crealloc = (curl_realloc_callback)realloc;
  141|      2|    Curl_cstrdup = (curl_strdup_callback)CURLX_STRDUP_LOW;
  ------------------
  |  | 1417|      2|#define CURLX_STRDUP_LOW strdup
  ------------------
  142|      2|    Curl_ccalloc = (curl_calloc_callback)calloc;
  143|      2|  }
  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"));
  ------------------
  |  | 1013|      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"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  177|      0|    goto fail;
  178|      0|  }
  179|       |
  180|      2|  if(!Curl_vquic_init()) {
  ------------------
  |  |   84|      2|#define Curl_vquic_init() 1
  ------------------
  |  Branch (180:6): [Folded, False: 2]
  ------------------
  181|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_vquic_init failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  182|      0|    goto fail;
  183|      0|  }
  184|       |
  185|      2|  if(Curl_amiga_init()) {
  ------------------
  |  |   36|      2|#define Curl_amiga_init()    CURLE_OK
  |  |  ------------------
  |  |  |  Branch (36:30): [Folded, False: 2]
  |  |  ------------------
  ------------------
  186|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_amiga_init failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  187|      0|    goto fail;
  188|      0|  }
  189|       |
  190|      2|  if(Curl_macos_init()) {
  ------------------
  |  |   31|      2|#define Curl_macos_init() CURLE_OK
  |  |  ------------------
  |  |  |  Branch (31:27): [Folded, False: 2]
  |  |  ------------------
  ------------------
  191|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_macos_init failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  192|      0|    goto fail;
  193|      0|  }
  194|       |
  195|      2|  if(Curl_async_global_init()) {
  ------------------
  |  Branch (195:6): [True: 0, False: 2]
  ------------------
  196|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_async_global_init failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  197|      0|    goto fail;
  198|      0|  }
  199|       |
  200|      2|  if(Curl_ssh_init()) {
  ------------------
  |  |  259|      2|#define Curl_ssh_init() 0
  |  |  ------------------
  |  |  |  Branch (259:25): [Folded, False: 2]
  |  |  ------------------
  ------------------
  201|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssh_init failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  202|      0|    goto fail;
  203|      0|  }
  204|       |
  205|      2|#ifdef DEBUGBUILD
  206|      2|  if(getenv("CURL_GLOBAL_INIT"))
  ------------------
  |  Branch (206:6): [True: 0, False: 2]
  ------------------
  207|       |    /* alloc data that will leak if *cleanup() is not called! */
  208|      0|    leakpointer = curlx_malloc(1);
  ------------------
  |  | 1423|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  209|      2|#endif
  210|       |
  211|      2|  return CURLE_OK;
  212|       |
  213|      0|fail:
  214|       |#ifdef USE_WINSOCK
  215|       |  if(winsock_initialized) {
  216|       |    WSACleanup();
  217|       |    winsock_initialized = FALSE;
  218|       |  }
  219|       |#endif
  220|      0|  initialized--; /* undo the increase */
  221|      0|  return CURLE_FAILED_INIT;
  222|      2|}

easy.c:curl_simple_lock_lock:
   64|  7.48k|{
   65|  7.48k|  for(;;) {
   66|  7.48k|    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
  ------------------
  |  Branch (66:8): [True: 7.48k, False: 0]
  ------------------
   67|  7.48k|      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|  7.48k|}
easy.c:curl_simple_lock_unlock:
   84|  7.48k|{
   85|  7.48k|  atomic_store_explicit(lock, false, memory_order_release);
   86|  7.48k|}

Curl_urldecode:
  160|    417|{
  161|    417|  size_t alloc;
  162|    417|  char *ns;
  163|    417|  uint8_t reject_limit;
  164|       |
  165|    417|  DEBUGASSERT(string);
  ------------------
  |  | 1027|    417|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 417]
  |  Branch (165:3): [True: 417, False: 0]
  ------------------
  166|    417|  DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */
  ------------------
  |  | 1027|    417|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 0, False: 417]
  |  Branch (166:3): [True: 417, False: 0]
  ------------------
  167|       |
  168|    417|  alloc = (length ? length : strlen(string));
  ------------------
  |  Branch (168:12): [True: 0, False: 417]
  ------------------
  169|    417|  ns = curlx_malloc(alloc + 1);
  ------------------
  |  | 1423|    417|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  170|       |
  171|    417|  if(!ns)
  ------------------
  |  Branch (171:6): [True: 0, False: 417]
  ------------------
  172|      0|    return CURLE_OUT_OF_MEMORY;
  173|       |
  174|       |  /* store output string */
  175|    417|  *ostring = ns;
  176|       |
  177|    417|  reject_limit = (ctrl == REJECT_CTRL) ? 0x20 :
  ------------------
  |  Branch (177:18): [True: 417, False: 0]
  ------------------
  178|    417|    (ctrl == REJECT_ZERO) ? 1 : 0;
  ------------------
  |  Branch (178:5): [True: 0, False: 0]
  ------------------
  179|       |
  180|  45.5k|  while(alloc) {
  ------------------
  |  Branch (180:9): [True: 45.1k, False: 415]
  ------------------
  181|  45.1k|    uint8_t in;
  182|       |
  183|  45.1k|    if(*string == '%') {
  ------------------
  |  Branch (183:8): [True: 40.7k, False: 4.33k]
  ------------------
  184|  40.7k|      if(alloc > 2) {
  ------------------
  |  Branch (184:10): [True: 40.7k, False: 86]
  ------------------
  185|  40.7k|        uint8_t h1 = hextable[(uint8_t)string[1]];
  186|  40.7k|        uint8_t h2 = hextable[(uint8_t)string[2]];
  187|  40.7k|        if(!((h1 | h2) & 0xf0)) {
  ------------------
  |  Branch (187:12): [True: 940, False: 39.7k]
  ------------------
  188|    940|          in = (uint8_t)((h1 << 4) | h2);
  189|    940|          string += 3;
  190|    940|          alloc -= 3;
  191|    940|          if(in < reject_limit)
  ------------------
  |  Branch (191:14): [True: 2, False: 938]
  ------------------
  192|      2|            goto error;
  193|    938|          *ns++ = (char)in;
  194|    938|          continue;
  195|    940|        }
  196|  40.7k|      }
  197|  39.8k|      in = '%';
  198|  39.8k|      string++;
  199|  39.8k|      alloc--;
  200|  39.8k|      *ns++ = (char)in;
  201|  39.8k|      continue;
  202|  40.7k|    }
  203|  4.33k|    else {
  204|  4.33k|      const char *p = memchr(string + 1, '%', alloc - 1);
  205|  4.33k|      size_t n = p ? (size_t)(p - string) : alloc;
  ------------------
  |  Branch (205:18): [True: 4.08k, False: 245]
  ------------------
  206|       |
  207|  4.33k|      if(reject_limit) {
  ------------------
  |  Branch (207:10): [True: 4.33k, False: 0]
  ------------------
  208|  4.33k|        if(reject_limit == 1) {
  ------------------
  |  Branch (208:12): [True: 0, False: 4.33k]
  ------------------
  209|      0|          if(memchr(string, 0, n))
  ------------------
  |  Branch (209:14): [True: 0, False: 0]
  ------------------
  210|      0|            goto error;
  211|      0|        }
  212|  4.33k|        else {
  213|  4.33k|          size_t i;
  214|   453k|          for(i = 0; i < n; i++) {
  ------------------
  |  Branch (214:22): [True: 449k, False: 4.33k]
  ------------------
  215|   449k|            if((uint8_t)string[i] < 0x20)
  ------------------
  |  Branch (215:16): [True: 0, False: 449k]
  ------------------
  216|      0|              goto error;
  217|   449k|          }
  218|  4.33k|        }
  219|  4.33k|      }
  220|       |
  221|  4.33k|      memcpy(ns, string, n);
  222|  4.33k|      ns += n;
  223|  4.33k|      string += n;
  224|  4.33k|      alloc -= n;
  225|  4.33k|    }
  226|  45.1k|  }
  227|    415|  *ns = 0; /* terminate it */
  228|       |
  229|    415|  if(olen)
  ------------------
  |  Branch (229:6): [True: 188, False: 227]
  ------------------
  230|       |    /* store output size */
  231|    188|    *olen = (size_t)(ns - *ostring);
  232|       |
  233|    415|  return CURLE_OK;
  234|      2|error:
  235|       |  curlx_safefree(*ostring);
  ------------------
  |  | 1284|      2|  do {                      \
  |  | 1285|      2|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      2|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      2|    (ptr) = NULL;           \
  |  | 1287|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  236|      2|  return CURLE_URL_MALFORMAT;
  237|    417|}
curl_free:
  274|  6.99k|{
  275|  6.99k|  curlx_free(p);
  ------------------
  |  | 1428|  6.99k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  276|  6.99k|}
Curl_hexbyte:
  308|   269k|{
  309|   269k|  dest[0] = Curl_udigits[val >> 4];
  310|   269k|  dest[1] = Curl_udigits[val & 0x0F];
  311|   269k|}

Curl_wildcard_dtor:
  189|  11.2k|{
  190|  11.2k|  struct WildcardData *wc = *wcp;
  191|  11.2k|  if(!wc)
  ------------------
  |  Branch (191:6): [True: 11.2k, False: 0]
  ------------------
  192|  11.2k|    return;
  193|       |
  194|      0|  if(wc->dtor) {
  ------------------
  |  Branch (194:6): [True: 0, False: 0]
  ------------------
  195|      0|    wc->dtor(wc->ftpwc);
  196|      0|    wc->dtor = ZERO_NULL;
  ------------------
  |  | 1110|      0|#define ZERO_NULL 0
  ------------------
  197|      0|    wc->ftpwc = NULL;
  198|      0|  }
  199|      0|  DEBUGASSERT(!wc->ftpwc);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (199:3): [True: 0, False: 0]
  |  Branch (199:3): [True: 0, False: 0]
  ------------------
  200|       |
  201|      0|  Curl_llist_destroy(&wc->filelist, NULL);
  202|      0|  curlx_safefree(wc->path);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  203|      0|  curlx_safefree(wc->pattern);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  204|      0|  wc->state = CURLWC_INIT;
  205|      0|  curlx_free(wc);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  206|       |  *wcp = NULL;
  207|      0|}

curl_getenv:
   27|  6.08k|{
   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 null */
   60|       |    if(rc < bufsize)
   61|       |      return buf;
   62|       |
   63|       |    /* else rc is bytes needed, try again */
   64|       |  }
   65|       |#else
   66|  6.08k|  char *env = getenv(variable);
   67|  6.08k|  return (env && env[0]) ? curlx_strdup(env) : NULL;
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  |  Branch (67:11): [True: 0, False: 6.08k]
  |  Branch (67:18): [True: 0, False: 0]
  ------------------
   68|  6.08k|#endif
   69|  6.08k|}

Curl_initinfo:
   42|  11.2k|{
   43|  11.2k|  struct Progress *pro = &data->progress;
   44|  11.2k|  struct PureInfo *info = &data->info;
   45|       |
   46|  11.2k|  memset(&pro->delta, 0, sizeof(pro->delta));
   47|  11.2k|  memset(&pro->total, 0, sizeof(pro->total));
   48|  11.2k|  pro->startransfer_added = FALSE;
  ------------------
  |  | 1000|  11.2k|#define FALSE false
  ------------------
   49|       |
   50|  11.2k|  info->httpcode = 0;
   51|  11.2k|  info->httpproxycode = 0;
   52|  11.2k|  info->httpversion = 0;
   53|  11.2k|  info->filetime = -1; /* -1 is an illegal time and thus means unknown */
   54|  11.2k|  info->timecond = FALSE;
  ------------------
  |  | 1000|  11.2k|#define FALSE false
  ------------------
   55|       |
   56|  11.2k|  info->header_size = 0;
   57|  11.2k|  info->request_size = 0;
   58|  11.2k|  info->proxyauthavail = 0;
   59|  11.2k|  info->httpauthavail = 0;
   60|  11.2k|  info->proxyauthpicked = 0;
   61|  11.2k|  info->httpauthpicked = 0;
   62|  11.2k|  info->numconnects = 0;
   63|       |
   64|  11.2k|  curlx_safefree(info->contenttype);
  ------------------
  |  | 1284|  11.2k|  do {                      \
  |  | 1285|  11.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  11.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  11.2k|    (ptr) = NULL;           \
  |  | 1287|  11.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 11.2k]
  |  |  ------------------
  ------------------
   65|  11.2k|  curlx_safefree(info->wouldredirect);
  ------------------
  |  | 1284|  11.2k|  do {                      \
  |  | 1285|  11.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  11.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  11.2k|    (ptr) = NULL;           \
  |  | 1287|  11.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 11.2k]
  |  |  ------------------
  ------------------
   66|       |
   67|  11.2k|  memset(&info->primary, 0, sizeof(info->primary));
   68|  11.2k|  info->retry_after = 0;
   69|       |
   70|  11.2k|  info->conn_scheme = 0;
   71|  11.2k|  info->conn_protocol = 0;
   72|  11.2k|  info->used_proxy = 0;
   73|       |
   74|  11.2k|#ifdef USE_SSL
   75|  11.2k|  Curl_ssl_free_certinfo(data);
   76|  11.2k|#endif
   77|  11.2k|}

hash_str:
   59|  24.3k|{
   60|  24.3k|  const char *key_str = (const char *)key;
   61|  24.3k|  const char *end = key_str + key_length;
   62|  24.3k|  size_t h = 5381;
   63|       |
   64|   450k|  while(key_str < end) {
  ------------------
  |  Branch (64:9): [True: 426k, False: 24.3k]
  ------------------
   65|   426k|    size_t j = (size_t)*key_str++;
   66|   426k|    h += h << 5;
   67|   426k|    h ^= j;
   68|   426k|  }
   69|       |
   70|  24.3k|  return (h % slots_num);
   71|  24.3k|}
Curl_hash_init:
  176|  25.4k|{
  177|  25.4k|  DEBUGASSERT(h);
  ------------------
  |  | 1027|  25.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 25.4k]
  |  Branch (177:3): [True: 25.4k, False: 0]
  ------------------
  178|  25.4k|  DEBUGASSERT(slots);
  ------------------
  |  | 1027|  25.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 25.4k]
  |  Branch (178:3): [True: 25.4k, False: 0]
  ------------------
  179|  25.4k|  DEBUGASSERT((unsigned int)type < CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1027|  25.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 25.4k]
  |  Branch (179:3): [True: 25.4k, False: 0]
  ------------------
  180|  25.4k|  DEBUGASSERT(dtor);
  ------------------
  |  | 1027|  25.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:3): [True: 0, False: 25.4k]
  |  Branch (180:3): [True: 25.4k, False: 0]
  ------------------
  181|       |
  182|  25.4k|  h->table = NULL;
  183|  25.4k|  h->dtor = dtor;
  184|  25.4k|  h->size = 0;
  185|  25.4k|  h->slots = slots;
  186|  25.4k|  h->type = (uint8_t)type;
  187|  25.4k|#ifdef DEBUGBUILD
  188|  25.4k|  h->init = HASHINIT;
  ------------------
  |  |   32|  25.4k|#define HASHINIT 0x7017e781
  ------------------
  189|  25.4k|#endif
  190|  25.4k|}
Curl_hash_add2:
  253|  9.12k|{
  254|  9.12k|  const struct hash_functions *functions;
  255|  9.12k|  struct Curl_hash_element *he, **slot;
  256|       |
  257|  9.12k|  DEBUGASSERT(h);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (257:3): [True: 0, False: 9.12k]
  |  Branch (257:3): [True: 9.12k, False: 0]
  ------------------
  258|  9.12k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (258:3): [True: 0, False: 9.12k]
  |  Branch (258:3): [True: 9.12k, False: 0]
  ------------------
  259|  9.12k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (259:3): [True: 0, False: 9.12k]
  |  Branch (259:3): [True: 9.12k, False: 0]
  ------------------
  260|  9.12k|  if(!hash_key_is_valid(h->type, key_len))
  ------------------
  |  Branch (260:6): [True: 0, False: 9.12k]
  ------------------
  261|      0|    return NULL;
  262|  9.12k|  if(!h->table) {
  ------------------
  |  Branch (262:6): [True: 9.12k, False: 0]
  ------------------
  263|  9.12k|    h->table = curlx_calloc(h->slots, sizeof(struct Curl_hash_element *));
  ------------------
  |  | 1425|  9.12k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  264|  9.12k|    if(!h->table)
  ------------------
  |  Branch (264:8): [True: 0, False: 9.12k]
  ------------------
  265|      0|      return NULL; /* OOM */
  266|  9.12k|  }
  267|       |
  268|  9.12k|  functions = hash_get_functions(h->type);
  269|  9.12k|  slot = &h->table[functions->hash(key, key_len, h->slots)];
  270|  9.12k|  for(he = *slot; he; he = he->next) {
  ------------------
  |  Branch (270:19): [True: 0, False: 9.12k]
  ------------------
  271|      0|    if(functions->compare(hash_elem_key(he), he->key_len, key, key_len)) {
  ------------------
  |  Branch (271:8): [True: 0, False: 0]
  ------------------
  272|       |      /* existing key entry, overwrite by clearing old pointer */
  273|      0|      hash_elem_clear_ptr(h, he);
  274|      0|      he->ptr = p;
  275|      0|      he->dtor = dtor;
  276|      0|      return p;
  277|      0|    }
  278|      0|  }
  279|       |
  280|  9.12k|  he = hash_elem_create(key, key_len, p, dtor);
  281|  9.12k|  if(!he)
  ------------------
  |  Branch (281:6): [True: 0, False: 9.12k]
  ------------------
  282|      0|    return NULL; /* OOM */
  283|       |
  284|  9.12k|  hash_elem_link(h, slot, he);
  285|  9.12k|  return p; /* return the new entry */
  286|  9.12k|}
Curl_hash_add:
  298|  6.08k|{
  299|       |  return Curl_hash_add2(h, key, key_len, p, NULL);
  300|  6.08k|}
Curl_hash_delete:
  308|  12.8k|{
  309|  12.8k|  const struct hash_functions *functions;
  310|       |
  311|  12.8k|  DEBUGASSERT(h);
  ------------------
  |  | 1027|  12.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (311:3): [True: 0, False: 12.8k]
  |  Branch (311:3): [True: 12.8k, False: 0]
  ------------------
  312|  12.8k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1027|  12.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (312:3): [True: 0, False: 12.8k]
  |  Branch (312:3): [True: 12.8k, False: 0]
  ------------------
  313|  12.8k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  12.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (313:3): [True: 0, False: 12.8k]
  |  Branch (313:3): [True: 12.8k, False: 0]
  ------------------
  314|  12.8k|  if(!hash_key_is_valid(h->type, key_len))
  ------------------
  |  Branch (314:6): [True: 0, False: 12.8k]
  ------------------
  315|      0|    return 1;
  316|  12.8k|  if(h->table) {
  ------------------
  |  Branch (316:6): [True: 9.12k, False: 3.74k]
  ------------------
  317|  9.12k|    struct Curl_hash_element *he, **he_anchor;
  318|       |
  319|  9.12k|    functions = hash_get_functions(h->type);
  320|  9.12k|    he_anchor = &h->table[functions->hash(key, key_len, h->slots)];
  321|  9.12k|    while(*he_anchor) {
  ------------------
  |  Branch (321:11): [True: 6.08k, False: 3.04k]
  ------------------
  322|  6.08k|      he = *he_anchor;
  323|  6.08k|      if(functions->compare(hash_elem_key(he), he->key_len, key, key_len)) {
  ------------------
  |  Branch (323:10): [True: 6.08k, False: 0]
  ------------------
  324|  6.08k|        hash_elem_unlink(h, he_anchor, he);
  325|  6.08k|        hash_elem_destroy(h, he);
  326|  6.08k|        return 0;
  327|  6.08k|      }
  328|      0|      he_anchor = &he->next;
  329|      0|    }
  330|  9.12k|  }
  331|  6.78k|  return 1;
  332|  12.8k|}
Curl_hash_pick:
  339|  18.2k|{
  340|  18.2k|  const struct hash_functions *functions;
  341|       |
  342|  18.2k|  DEBUGASSERT(h);
  ------------------
  |  | 1027|  18.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (342:3): [True: 0, False: 18.2k]
  |  Branch (342:3): [True: 18.2k, False: 0]
  ------------------
  343|  18.2k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  18.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (343:3): [True: 0, False: 18.2k]
  |  Branch (343:3): [True: 18.2k, False: 0]
  ------------------
  344|  18.2k|  if(!hash_key_is_valid(h->type, key_len))
  ------------------
  |  Branch (344:6): [True: 0, False: 18.2k]
  ------------------
  345|      0|    return NULL;
  346|  18.2k|  if(h->table) {
  ------------------
  |  Branch (346:6): [True: 6.08k, False: 12.1k]
  ------------------
  347|  6.08k|    struct Curl_hash_element *he;
  348|  6.08k|    DEBUGASSERT(h->slots);
  ------------------
  |  | 1027|  6.08k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (348:5): [True: 0, False: 6.08k]
  |  Branch (348:5): [True: 6.08k, False: 0]
  ------------------
  349|  6.08k|    functions = hash_get_functions(h->type);
  350|  6.08k|    he = h->table[functions->hash(key, key_len, h->slots)];
  351|  6.08k|    while(he) {
  ------------------
  |  Branch (351:11): [True: 6.08k, False: 0]
  ------------------
  352|  6.08k|      if(functions->compare(hash_elem_key(he), he->key_len, key, key_len)) {
  ------------------
  |  Branch (352:10): [True: 6.08k, False: 0]
  ------------------
  353|  6.08k|        return he->ptr;
  354|  6.08k|      }
  355|      0|      he = he->next;
  356|      0|    }
  357|  6.08k|  }
  358|  12.1k|  return NULL;
  359|  18.2k|}
Curl_hash_destroy:
  369|  25.4k|{
  370|  25.4k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  25.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (370:3): [True: 0, False: 25.4k]
  |  Branch (370:3): [True: 25.4k, False: 0]
  ------------------
  371|  25.4k|  if(h->table) {
  ------------------
  |  Branch (371:6): [True: 9.12k, False: 16.3k]
  ------------------
  372|  9.12k|    Curl_hash_clean(h);
  373|  9.12k|    curlx_safefree(h->table);
  ------------------
  |  | 1284|  9.12k|  do {                      \
  |  | 1285|  9.12k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  9.12k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  9.12k|    (ptr) = NULL;           \
  |  | 1287|  9.12k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 9.12k]
  |  |  ------------------
  ------------------
  374|  9.12k|  }
  375|  25.4k|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1027|  25.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (375:3): [True: 0, False: 25.4k]
  |  Branch (375:3): [True: 25.4k, False: 0]
  ------------------
  376|  25.4k|  h->slots = 0;
  377|  25.4k|}
Curl_hash_clean:
  384|  9.12k|{
  385|  9.12k|  if(h && h->table) {
  ------------------
  |  Branch (385:6): [True: 9.12k, False: 0]
  |  Branch (385:11): [True: 9.12k, False: 0]
  ------------------
  386|  9.12k|    struct Curl_hash_element *he, **he_anchor;
  387|  9.12k|    size_t i;
  388|  9.12k|    DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (388:5): [True: 0, False: 9.12k]
  |  Branch (388:5): [True: 9.12k, False: 0]
  ------------------
  389|   590k|    for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (389:16): [True: 581k, False: 9.12k]
  ------------------
  390|   581k|      he_anchor = &h->table[i];
  391|   584k|      while(*he_anchor) {
  ------------------
  |  Branch (391:13): [True: 3.04k, False: 581k]
  ------------------
  392|  3.04k|        he = *he_anchor;
  393|  3.04k|        hash_elem_unlink(h, he_anchor, he);
  394|  3.04k|        hash_elem_destroy(h, he);
  395|  3.04k|      }
  396|   581k|    }
  397|  9.12k|  }
  398|  9.12k|}
Curl_hash_count:
  401|  3.04k|{
  402|  3.04k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (402:3): [True: 0, False: 3.04k]
  |  Branch (402:3): [True: 3.04k, False: 0]
  ------------------
  403|  3.04k|  return h->size;
  404|  3.04k|}
Curl_hash_clean_with_criterium:
  409|  3.04k|{
  410|  3.04k|  size_t i;
  411|       |
  412|  3.04k|  if(!h || !h->table)
  ------------------
  |  Branch (412:6): [True: 0, False: 3.04k]
  |  Branch (412:12): [True: 0, False: 3.04k]
  ------------------
  413|      0|    return;
  414|       |
  415|  3.04k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (415:3): [True: 0, False: 3.04k]
  |  Branch (415:3): [True: 3.04k, False: 0]
  ------------------
  416|   219k|  for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (416:14): [True: 216k, False: 3.04k]
  ------------------
  417|   216k|    struct Curl_hash_element *he, **he_anchor = &h->table[i];
  418|   219k|    while(*he_anchor) {
  ------------------
  |  Branch (418:11): [True: 3.04k, False: 216k]
  ------------------
  419|       |      /* ask the callback function if we shall remove this entry or not */
  420|  3.04k|      if(!comp || comp(user, (*he_anchor)->ptr)) {
  ------------------
  |  Branch (420:10): [True: 0, False: 3.04k]
  |  Branch (420:19): [True: 0, False: 3.04k]
  ------------------
  421|      0|        he = *he_anchor;
  422|      0|        hash_elem_unlink(h, he_anchor, he);
  423|      0|        hash_elem_destroy(h, he);
  424|      0|      }
  425|  3.04k|      else
  426|  3.04k|        he_anchor = &(*he_anchor)->next;
  427|  3.04k|    }
  428|   216k|  }
  429|  3.04k|}
Curl_hash_start_iterate:
  433|  6.78k|{
  434|  6.78k|  DEBUGASSERT(hash->init == HASHINIT);
  ------------------
  |  | 1027|  6.78k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (434:3): [True: 0, False: 6.78k]
  |  Branch (434:3): [True: 6.78k, False: 0]
  ------------------
  435|  6.78k|  iter->hash = hash;
  436|  6.78k|  iter->slot_index = 0;
  437|  6.78k|  iter->current = NULL;
  438|  6.78k|#ifdef DEBUGBUILD
  439|  6.78k|  iter->init = ITERINIT;
  ------------------
  |  |   33|  6.78k|#define ITERINIT 0x5FEDCBA9
  ------------------
  440|  6.78k|#endif
  441|  6.78k|}
Curl_hash_next_element:
  445|  6.78k|{
  446|  6.78k|  struct Curl_hash *h;
  447|  6.78k|  DEBUGASSERT(iter->init == ITERINIT);
  ------------------
  |  | 1027|  6.78k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (447:3): [True: 0, False: 6.78k]
  |  Branch (447:3): [True: 6.78k, False: 0]
  ------------------
  448|  6.78k|  h = iter->hash;
  449|  6.78k|  if(!h->table)
  ------------------
  |  Branch (449:6): [True: 3.74k, False: 3.04k]
  ------------------
  450|  3.74k|    return NULL; /* empty hash, nothing to return */
  451|       |
  452|       |  /* Get the next element in the current list, if any */
  453|  3.04k|  if(iter->current)
  ------------------
  |  Branch (453:6): [True: 0, False: 3.04k]
  ------------------
  454|      0|    iter->current = iter->current->next;
  455|       |
  456|       |  /* If we have reached the end of the list, find the next one */
  457|  3.04k|  if(!iter->current) {
  ------------------
  |  Branch (457:6): [True: 3.04k, False: 0]
  ------------------
  458|  3.04k|    size_t i;
  459|   298k|    for(i = iter->slot_index; i < h->slots; i++) {
  ------------------
  |  Branch (459:31): [True: 295k, False: 3.04k]
  ------------------
  460|   295k|      if(h->table[i]) {
  ------------------
  |  Branch (460:10): [True: 0, False: 295k]
  ------------------
  461|      0|        iter->current = h->table[i];
  462|      0|        iter->slot_index = i + 1;
  463|      0|        break;
  464|      0|      }
  465|   295k|    }
  466|  3.04k|  }
  467|       |
  468|  3.04k|  return iter->current;
  469|  6.78k|}
hash.c:hash_key_is_valid:
  124|  40.2k|{
  125|  40.2k|  return (type == CURL_HASH_TYPE_BYTES) ||
  ------------------
  |  Branch (125:10): [True: 37.2k, False: 3.04k]
  ------------------
  126|  3.04k|    ((type == CURL_HASH_TYPE_SOCKET) &&
  ------------------
  |  Branch (126:6): [True: 3.04k, False: 0]
  ------------------
  127|  3.04k|     (key_len == sizeof(curl_socket_t)));
  ------------------
  |  Branch (127:6): [True: 3.04k, False: 0]
  ------------------
  128|  40.2k|}
hash.c:hash_get_functions:
  116|  24.3k|{
  117|  24.3k|  DEBUGASSERT(CURL_ARRAYSIZE(hash_functions) == CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1027|  24.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (117:3): [True: 0, Folded]
  |  Branch (117:3): [True: 24.3k, Folded]
  ------------------
  118|  24.3k|  if((unsigned int)type >= CURL_HASH_TYPE_LAST)
  ------------------
  |  Branch (118:6): [True: 0, False: 24.3k]
  ------------------
  119|      0|    type = CURL_HASH_TYPE_BYTES;
  120|  24.3k|  return &hash_functions[type];
  121|  24.3k|}
hash.c:compare_bytes:
  106|  12.1k|{
  107|  12.1k|  return (key1_len == key2_len) && !memcmp(key1, key2, key1_len);
  ------------------
  |  Branch (107:10): [True: 12.1k, False: 0]
  |  Branch (107:36): [True: 12.1k, False: 0]
  ------------------
  108|  12.1k|}
hash.c:hash_elem_key:
   75|  24.3k|{
   76|       |  return (char *)he + offsetof(struct Curl_hash_element, key);
   77|  24.3k|}
hash.c:hash_elem_clear_ptr:
  214|  9.12k|{
  215|  9.12k|  DEBUGASSERT(h);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (215:3): [True: 0, False: 9.12k]
  |  Branch (215:3): [True: 9.12k, False: 0]
  ------------------
  216|  9.12k|  DEBUGASSERT(he);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (216:3): [True: 0, False: 9.12k]
  |  Branch (216:3): [True: 9.12k, False: 0]
  ------------------
  217|  9.12k|  if(he->ptr) {
  ------------------
  |  Branch (217:6): [True: 9.12k, False: 0]
  ------------------
  218|  9.12k|    if(he->dtor)
  ------------------
  |  Branch (218:8): [True: 3.04k, False: 6.08k]
  ------------------
  219|  3.04k|      he->dtor(hash_elem_key(he), he->key_len, he->ptr);
  220|  6.08k|    else
  221|  6.08k|      h->dtor(he->ptr);
  222|       |    he->ptr = NULL;
  223|  9.12k|  }
  224|  9.12k|}
hash.c:hash_elem_create:
  196|  9.12k|{
  197|  9.12k|  struct Curl_hash_element *he;
  198|       |
  199|       |  /* allocate the struct plus memory after it to store the key */
  200|  9.12k|  he = curlx_malloc(sizeof(struct Curl_hash_element) + key_len);
  ------------------
  |  | 1423|  9.12k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  201|  9.12k|  if(he) {
  ------------------
  |  Branch (201:6): [True: 9.12k, False: 0]
  ------------------
  202|  9.12k|    he->next = NULL;
  203|       |    /* copy the key */
  204|  9.12k|    memcpy(hash_elem_key(he), key, key_len);
  205|  9.12k|    he->key_len = key_len;
  206|  9.12k|    he->ptr = p;
  207|  9.12k|    he->dtor = dtor;
  208|  9.12k|  }
  209|  9.12k|  return he;
  210|  9.12k|}
hash.c:hash_elem_link:
  244|  9.12k|{
  245|  9.12k|  he->next = *he_anchor;
  246|  9.12k|  *he_anchor = he;
  247|  9.12k|  ++h->size;
  248|  9.12k|}
hash.c:hash_elem_unlink:
  236|  9.12k|{
  237|  9.12k|  *he_anchor = he->next;
  238|  9.12k|  --h->size;
  239|  9.12k|}
hash.c:hash_elem_destroy:
  228|  9.12k|{
  229|  9.12k|  hash_elem_clear_ptr(h, he);
  230|  9.12k|  curlx_free(he);
  ------------------
  |  | 1428|  9.12k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  231|  9.12k|}

Curl_headers_init:
  443|  3.04k|{
  444|  3.04k|  struct Curl_cwriter *writer;
  445|  3.04k|  CURLcode result;
  446|       |
  447|  3.04k|  if(data->conn && (data->conn->scheme->protocol & PROTO_FAMILY_HTTP)) {
  ------------------
  |  |   82|  3.04k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|  3.04k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|  3.04k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   61|  3.04k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   83|  3.04k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   62|  3.04k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (447:6): [True: 3.04k, False: 0]
  |  Branch (447:20): [True: 0, False: 3.04k]
  ------------------
  448|       |    /* avoid installing it twice */
  449|      0|    if(Curl_cwriter_get_by_name(data, hds_cw_collect.name))
  ------------------
  |  Branch (449:8): [True: 0, False: 0]
  ------------------
  450|      0|      return CURLE_OK;
  451|       |
  452|      0|    result = Curl_cwriter_create(&writer, data, &hds_cw_collect,
  453|      0|                                 CURL_CW_PROTOCOL);
  454|      0|    if(result)
  ------------------
  |  Branch (454:8): [True: 0, False: 0]
  ------------------
  455|      0|      return result;
  456|       |
  457|      0|    result = Curl_cwriter_add(data, writer);
  458|      0|    if(result) {
  ------------------
  |  Branch (458:8): [True: 0, False: 0]
  ------------------
  459|      0|      Curl_cwriter_free(data, writer);
  460|      0|      return result;
  461|      0|    }
  462|      0|  }
  463|  3.04k|  return CURLE_OK;
  464|  3.04k|}
Curl_headers_cleanup:
  470|  11.2k|{
  471|  11.2k|  struct Curl_llist_node *e;
  472|  11.2k|  struct Curl_llist_node *n;
  473|       |
  474|  11.2k|  for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) {
  ------------------
  |  Branch (474:51): [True: 0, False: 11.2k]
  ------------------
  475|      0|    struct Curl_header_store *hs = Curl_node_elem(e);
  476|      0|    n = Curl_node_next(e);
  477|      0|    curlx_free(hs);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  478|      0|  }
  479|  11.2k|  headers_reset(data);
  480|  11.2k|  return CURLE_OK;
  481|  11.2k|}
headers.c:headers_reset:
  403|  11.2k|{
  404|       |  Curl_llist_init(&data->state.httphdrs, NULL);
  405|  11.2k|  data->state.nh_count = 0;
  406|  11.2k|}

Curl_hsts_init:
   69|  3.74k|{
   70|  3.74k|  struct hsts *h = curlx_calloc(1, sizeof(struct hsts));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   71|  3.74k|  if(h) {
  ------------------
  |  Branch (71:6): [True: 3.74k, False: 0]
  ------------------
   72|       |    Curl_llist_init(&h->list, NULL);
   73|  3.74k|  }
   74|  3.74k|  return h;
   75|  3.74k|}
Curl_hsts_cleanup:
   80|  7.48k|{
   81|  7.48k|  struct hsts *h = *hp;
   82|  7.48k|  if(h) {
  ------------------
  |  Branch (82:6): [True: 3.74k, False: 3.74k]
  ------------------
   83|  3.74k|    struct Curl_llist_node *e;
   84|  3.74k|    struct Curl_llist_node *n;
   85|  3.74k|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (85:40): [True: 0, False: 3.74k]
  ------------------
   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)
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
   89|      0|    }
   90|  3.74k|    curlx_free(h->filename);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|  3.74k|    curlx_free(h);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   92|       |    *hp = NULL;
   93|  3.74k|  }
   94|  7.48k|}
Curl_hsts_save:
  371|  7.48k|{
  372|  7.48k|  struct Curl_llist_node *e;
  373|  7.48k|  struct Curl_llist_node *n;
  374|  7.48k|  CURLcode result = CURLE_OK;
  375|  7.48k|  FILE *out;
  376|  7.48k|  char *tempstore = NULL;
  377|       |
  378|  7.48k|  if(!h)
  ------------------
  |  Branch (378:6): [True: 3.74k, False: 3.74k]
  ------------------
  379|       |    /* no cache activated */
  380|  3.74k|    return CURLE_OK;
  381|       |
  382|       |  /* if no new name is given, use the one we stored from the load */
  383|  3.74k|  if(!file && h->filename)
  ------------------
  |  Branch (383:6): [True: 0, False: 3.74k]
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|    file = h->filename;
  385|       |
  386|  3.74k|  if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1084|  3.74k|#define CURLHSTS_READONLYFILE (1L << 1)
  ------------------
  |  Branch (386:6): [True: 0, False: 3.74k]
  |  Branch (386:44): [True: 0, False: 3.74k]
  |  Branch (386:53): [True: 0, False: 3.74k]
  ------------------
  387|       |    /* marked as read-only, no file or zero length filename */
  388|      0|    goto skipsave;
  389|       |
  390|  3.74k|  result = Curl_fopen(data, file, &out, &tempstore);
  391|  3.74k|  if(!result) {
  ------------------
  |  Branch (391:6): [True: 3.74k, False: 0]
  ------------------
  392|  3.74k|    fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n"
  393|  3.74k|          "# This file was generated by libcurl! Edit at your own risk.\n",
  394|  3.74k|          out);
  395|  3.74k|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (395:40): [True: 0, False: 3.74k]
  ------------------
  396|      0|      struct stsentry *sts = Curl_node_elem(e);
  397|      0|      n = Curl_node_next(e);
  398|      0|      hsts_out(sts, out);
  399|      0|    }
  400|  3.74k|    curlx_fclose(out);
  ------------------
  |  |   81|  3.74k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  401|  3.74k|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   72|      0|#define curlx_rename            rename
  ------------------
  |  Branch (401:8): [True: 3.74k, False: 0]
  |  Branch (401:19): [True: 0, False: 3.74k]
  |  Branch (401:32): [True: 0, False: 0]
  ------------------
  402|      0|      result = CURLE_WRITE_ERROR;
  403|       |
  404|  3.74k|    if(result && tempstore)
  ------------------
  |  Branch (404:8): [True: 0, False: 3.74k]
  |  Branch (404:18): [True: 0, False: 0]
  ------------------
  405|      0|      unlink(tempstore);
  406|  3.74k|  }
  407|  3.74k|  curlx_free(tempstore);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  408|  3.74k|skipsave:
  409|  3.74k|  if(data->set.hsts_write) {
  ------------------
  |  Branch (409:6): [True: 0, False: 3.74k]
  ------------------
  410|       |    /* if there is a write callback */
  411|      0|    struct curl_index i; /* count */
  412|      0|    i.total = Curl_llist_count(&h->list);
  413|      0|    i.index = 0;
  414|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (414:40): [True: 0, False: 0]
  ------------------
  415|      0|      struct stsentry *sts = Curl_node_elem(e);
  416|      0|      bool stop;
  417|      0|      n = Curl_node_next(e);
  418|      0|      result = hsts_push(data, &i, sts, &stop);
  419|      0|      if(result || stop)
  ------------------
  |  Branch (419:10): [True: 0, False: 0]
  |  Branch (419:20): [True: 0, False: 0]
  ------------------
  420|      0|        break;
  421|      0|      i.index++;
  422|      0|    }
  423|      0|  }
  424|  3.74k|  return result;
  425|  3.74k|}
Curl_hsts_loadfile:
  604|  3.74k|{
  605|  3.74k|  DEBUGASSERT(h);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (605:3): [True: 0, False: 3.74k]
  |  Branch (605:3): [True: 3.74k, False: 0]
  ------------------
  606|  3.74k|  (void)data;
  607|  3.74k|  return hsts_load(h, file);
  608|  3.74k|}
Curl_hsts_loadcb:
  614|  3.74k|{
  615|  3.74k|  if(h)
  ------------------
  |  Branch (615:6): [True: 3.74k, False: 0]
  ------------------
  616|  3.74k|    return hsts_pull(data, h);
  617|      0|  return CURLE_OK;
  618|  3.74k|}
Curl_hsts_loadfiles:
  621|  3.74k|{
  622|  3.74k|  CURLcode result = CURLE_OK;
  623|  3.74k|  struct curl_slist *l = data->state.hstslist;
  624|  3.74k|  if(l) {
  ------------------
  |  Branch (624:6): [True: 3.74k, False: 0]
  ------------------
  625|  3.74k|    Curl_share_lock(data, CURL_LOCK_DATA_HSTS, CURL_LOCK_ACCESS_SINGLE);
  626|       |
  627|  7.48k|    while(l) {
  ------------------
  |  Branch (627:11): [True: 3.74k, False: 3.74k]
  ------------------
  628|  3.74k|      result = Curl_hsts_loadfile(data, data->hsts, l->data);
  629|  3.74k|      if(result)
  ------------------
  |  Branch (629:10): [True: 0, False: 3.74k]
  ------------------
  630|      0|        break;
  631|  3.74k|      l = l->next;
  632|  3.74k|    }
  633|  3.74k|    Curl_share_unlock(data, CURL_LOCK_DATA_HSTS);
  634|  3.74k|  }
  635|  3.74k|  return result;
  636|  3.74k|}
hsts.c:hsts_load:
  559|  3.74k|{
  560|  3.74k|  CURLcode result = CURLE_OK;
  561|  3.74k|  FILE *fp;
  562|       |
  563|       |  /* we need a private copy of the filename so that the hsts cache file
  564|       |     name survives an easy handle reset */
  565|  3.74k|  curlx_free(h->filename);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  566|  3.74k|  h->filename = curlx_strdup(file);
  ------------------
  |  | 1422|  3.74k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  567|  3.74k|  if(!h->filename)
  ------------------
  |  Branch (567:6): [True: 0, False: 3.74k]
  ------------------
  568|      0|    return CURLE_OUT_OF_MEMORY;
  569|       |
  570|  3.74k|  fp = curlx_fopen(file, FOPEN_READTEXT);
  ------------------
  |  |   76|  3.74k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  571|  3.74k|  if(fp) {
  ------------------
  |  Branch (571:6): [True: 3.74k, False: 0]
  ------------------
  572|  3.74k|    curlx_struct_stat stat;
  ------------------
  |  |   65|  3.74k|#define curlx_struct_stat       struct stat
  ------------------
  573|  3.74k|    if((curlx_fstat(fileno(fp), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   64|  3.74k|#define curlx_fstat             fstat
  ------------------
  |  Branch (573:8): [True: 0, False: 3.74k]
  |  Branch (573:50): [True: 3.74k, False: 0]
  ------------------
  574|  3.74k|      struct dynbuf buf;
  575|  3.74k|      bool eof = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  576|  3.74k|      curlx_dyn_init(&buf, MAX_HSTS_LINE);
  ------------------
  |  |   41|  3.74k|#define MAX_HSTS_LINE    4095
  ------------------
  577|  3.74k|      do {
  578|  3.74k|        result = Curl_get_line(&buf, fp, &eof);
  579|  3.74k|        if(!result) {
  ------------------
  |  Branch (579:12): [True: 3.74k, False: 0]
  ------------------
  580|  3.74k|          const char *lineptr = curlx_dyn_ptr(&buf);
  581|  3.74k|          curlx_str_passblanks(&lineptr);
  582|       |
  583|       |          /* Skip empty or commented lines, since we know the line will have
  584|       |             a trailing newline from Curl_get_line we can treat length 1 as
  585|       |             empty. */
  586|  3.74k|          if((*lineptr == '#') || strlen(lineptr) <= 1)
  ------------------
  |  Branch (586:14): [True: 0, False: 3.74k]
  |  Branch (586:35): [True: 3.74k, False: 0]
  ------------------
  587|  3.74k|            continue;
  588|       |
  589|      0|          hsts_add(h, lineptr);
  590|      0|        }
  591|  3.74k|      } while(!result && !eof);
  ------------------
  |  Branch (591:15): [True: 3.74k, False: 0]
  |  Branch (591:26): [True: 0, False: 3.74k]
  ------------------
  592|  3.74k|      curlx_dyn_free(&buf); /* free the line buffer */
  593|  3.74k|    }
  594|  3.74k|    curlx_fclose(fp);
  ------------------
  |  |   81|  3.74k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  595|  3.74k|  }
  596|  3.74k|  return result;
  597|  3.74k|}
hsts.c:hsts_pull:
  511|  3.74k|{
  512|       |  /* if the HSTS read callback is set, use it */
  513|  3.74k|  if(data->set.hsts_read) {
  ------------------
  |  Branch (513:6): [True: 0, False: 3.74k]
  ------------------
  514|      0|    CURLSTScode sc;
  515|      0|    DEBUGASSERT(h);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (515:5): [True: 0, False: 0]
  |  Branch (515:5): [True: 0, False: 0]
  ------------------
  516|      0|    do {
  517|      0|      char buffer[MAX_HSTS_HOSTLEN + 1];
  518|      0|      struct curl_hstsentry e;
  519|      0|      e.name = buffer;
  520|      0|      e.namelen = sizeof(buffer) - 1;
  521|      0|      e.includeSubDomains = FALSE; /* default */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  522|      0|      e.expire[0] = 0;
  523|      0|      e.expire[MAX_HSTS_DATELEN] = 0;
  ------------------
  |  |   43|      0|#define MAX_HSTS_DATELEN 17
  ------------------
  524|      0|      e.name[0] = 0; /* to make it clean */
  525|      0|      e.name[MAX_HSTS_HOSTLEN] = 0;
  ------------------
  |  |   42|      0|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  526|      0|      sc = data->set.hsts_read(data, &e, data->set.hsts_read_userp);
  527|      0|      if(sc == CURLSTS_OK) {
  ------------------
  |  Branch (527:10): [True: 0, False: 0]
  ------------------
  528|      0|        CURLcode result;
  529|      0|        const char *date = e.expire;
  530|      0|        if(!e.name[0] || e.expire[MAX_HSTS_DATELEN] ||
  ------------------
  |  |   43|      0|#define MAX_HSTS_DATELEN 17
  ------------------
  |  Branch (530:12): [True: 0, False: 0]
  |  Branch (530:26): [True: 0, False: 0]
  ------------------
  531|      0|           e.name[MAX_HSTS_HOSTLEN])
  ------------------
  |  |   42|      0|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  |  Branch (531:12): [True: 0, False: 0]
  ------------------
  532|       |          /* bail out if no name was stored or if a null-terminator is gone */
  533|      0|          return CURLE_BAD_FUNCTION_ARGUMENT;
  534|      0|        if(!date[0])
  ------------------
  |  Branch (534:12): [True: 0, False: 0]
  ------------------
  535|      0|          date = UNLIMITED;
  ------------------
  |  |   44|      0|#define UNLIMITED        "unlimited"
  ------------------
  536|      0|        result = hsts_add_host_expire(h, e.name, strlen(e.name),
  537|      0|                                      date, strlen(date),
  538|       |                                      /* bitfield to bool conversion: */
  539|      0|                                      e.includeSubDomains ? TRUE : FALSE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
                                                    e.includeSubDomains ? TRUE : FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  |  Branch (539:39): [True: 0, False: 0]
  ------------------
  540|      0|        if(result)
  ------------------
  |  Branch (540:12): [True: 0, False: 0]
  ------------------
  541|      0|          return result;
  542|      0|      }
  543|      0|      else if(sc == CURLSTS_FAIL)
  ------------------
  |  Branch (543:15): [True: 0, False: 0]
  ------------------
  544|      0|        return CURLE_ABORTED_BY_CALLBACK;
  545|      0|    } while(sc == CURLSTS_OK);
  ------------------
  |  Branch (545:13): [True: 0, False: 0]
  ------------------
  546|      0|  }
  547|  3.74k|  return CURLE_OK;
  548|  3.74k|}

Curl_http_neg_init:
   89|  3.74k|{
   90|  3.74k|  memset(neg, 0, sizeof(*neg));
   91|  3.74k|  neg->accept_09 = data->set.http09_allowed;
   92|  3.74k|  switch(data->set.httpwant) {
   93|      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 (93:3): [True: 0, False: 3.74k]
  ------------------
   94|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V1x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
   95|      0|    neg->only_10 = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
   96|      0|    break;
   97|      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 (97:3): [True: 0, False: 3.74k]
  ------------------
   98|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V1x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
   99|      0|    break;
  100|      0|  case CURL_HTTP_VERSION_2_0:
  ------------------
  |  | 2343|      0|#define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
  ------------------
  |  Branch (100:3): [True: 0, False: 3.74k]
  ------------------
  101|      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)
  ------------------
  102|      0|    neg->h2_upgrade = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  103|      0|    break;
  104|      0|  case CURL_HTTP_VERSION_2TLS:
  ------------------
  |  | 2344|      0|#define CURL_HTTP_VERSION_2TLS  4L /* use version 2 for HTTPS, version 1.1 for
  ------------------
  |  Branch (104:3): [True: 0, False: 3.74k]
  ------------------
  105|      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)
  ------------------
  106|      0|    break;
  107|      0|  case CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE:
  ------------------
  |  | 2346|      0|#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
  ------------------
  |  Branch (107:3): [True: 0, False: 3.74k]
  ------------------
  108|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V2x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  109|      0|    data->state.http_neg.h2_prior_knowledge = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  110|      0|    break;
  111|      0|  case CURL_HTTP_VERSION_3:
  ------------------
  |  | 2348|      0|#define CURL_HTTP_VERSION_3     30L /* Use HTTP/3, fallback to HTTP/2 or
  ------------------
  |  Branch (111:3): [True: 0, False: 3.74k]
  ------------------
  112|      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)
  ------------------
  113|      0|    neg->allowed = neg->wanted;
  114|      0|    break;
  115|      0|  case CURL_HTTP_VERSION_3ONLY:
  ------------------
  |  | 2352|      0|#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
  ------------------
  |  Branch (115:3): [True: 0, False: 3.74k]
  ------------------
  116|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V3x);
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  117|      0|    break;
  118|  3.74k|  case CURL_HTTP_VERSION_NONE:
  ------------------
  |  | 2338|  3.74k|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (118:3): [True: 3.74k, False: 0]
  ------------------
  119|  3.74k|  default:
  ------------------
  |  Branch (119:3): [True: 0, False: 3.74k]
  ------------------
  120|  3.74k|    neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|  3.74k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|  3.74k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  121|  3.74k|    neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   40|  3.74k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   41|  3.74k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                  neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   42|  3.74k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  122|  3.74k|    break;
  123|  3.74k|  }
  124|  3.74k|}

Curl_http_auth_cleanup_digest:
  183|  7.48k|{
  184|  7.48k|  Curl_auth_digest_cleanup(&data->state.digest);
  185|  7.48k|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  186|  7.48k|}

Curl_is_ASCII_str:
  238|  6.18k|{
  239|  6.18k|  if(s && s->len) {
  ------------------
  |  Branch (239:6): [True: 6.18k, False: 0]
  |  Branch (239:11): [True: 6.18k, False: 0]
  ------------------
  240|  6.18k|    const unsigned char *ch = (const unsigned char *)s->str;
  241|  6.18k|    size_t i;
  242|   272k|    for(i = 0; i < s->len; ++i) {
  ------------------
  |  Branch (242:16): [True: 266k, False: 6.00k]
  ------------------
  243|   266k|      if(ch[i] & 0x80)
  ------------------
  |  Branch (243:10): [True: 185, False: 266k]
  ------------------
  244|    185|        return FALSE;
  ------------------
  |  | 1000|    185|#define FALSE false
  ------------------
  245|   266k|    }
  246|  6.18k|  }
  247|  6.00k|  return TRUE;
  ------------------
  |  |  997|  6.00k|#define TRUE true
  ------------------
  248|  6.18k|}
Curl_idn_decode:
  315|    185|{
  316|    185|  char *d = NULL;
  317|    185|  CURLcode result = idn_decode(input, &d);
  318|    185|#ifdef USE_LIBIDN2
  319|    185|  if(!result) {
  ------------------
  |  Branch (319:6): [True: 0, False: 185]
  ------------------
  320|      0|    char *c = curlx_strdup(d);
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  321|      0|    idn2_free(d);
  322|      0|    if(c)
  ------------------
  |  Branch (322:8): [True: 0, False: 0]
  ------------------
  323|      0|      d = c;
  324|      0|    else
  325|      0|      result = CURLE_OUT_OF_MEMORY;
  326|      0|  }
  327|    185|#endif
  328|    185|  if(!result) {
  ------------------
  |  Branch (328:6): [True: 0, False: 185]
  ------------------
  329|      0|    if(!d[0]) { /* ended up zero length, not acceptable */
  ------------------
  |  Branch (329:8): [True: 0, False: 0]
  ------------------
  330|      0|      result = CURLE_URL_MALFORMAT;
  331|      0|      curlx_free(d);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  332|      0|    }
  333|      0|    else
  334|      0|      *output = d;
  335|      0|  }
  336|    185|  return result;
  337|    185|}
idn.c:idn_decode:
  260|    185|{
  261|    185|  char *decoded = NULL;
  262|    185|  CURLcode result = CURLE_OK;
  263|    185|#ifdef USE_LIBIDN2
  264|    185|  if(idn2_check_version(IDN2_VERSION)) {
  ------------------
  |  Branch (264:6): [True: 185, False: 0]
  ------------------
  265|    185|    int flags = IDN2_NFC_INPUT
  266|    185|#if IDN2_VERSION_NUMBER >= 0x00140000
  267|       |      /* IDN2_NFC_INPUT: Normalize input string using normalization form C.
  268|       |         IDN2_NONTRANSITIONAL: Perform Unicode TR46 non-transitional
  269|       |         processing. */
  270|    185|      | IDN2_NONTRANSITIONAL
  271|    185|#endif
  272|    185|      ;
  273|    185|    int rc = IDN2_LOOKUP(input, &decoded, flags);
  ------------------
  |  |   41|    185|  idn2_lookup_ul((const char *)(name), (char **)(host), flags)
  ------------------
  274|    185|    if(rc != IDN2_OK)
  ------------------
  |  Branch (274:8): [True: 185, False: 0]
  ------------------
  275|       |      /* fallback to TR46 Transitional mode for better IDNA2003
  276|       |         compatibility */
  277|    185|      rc = IDN2_LOOKUP(input, &decoded, IDN2_TRANSITIONAL);
  ------------------
  |  |   41|    185|  idn2_lookup_ul((const char *)(name), (char **)(host), flags)
  ------------------
  278|    185|    if(rc != IDN2_OK)
  ------------------
  |  Branch (278:8): [True: 185, False: 0]
  ------------------
  279|    185|      result = CURLE_URL_MALFORMAT;
  280|    185|  }
  281|      0|  else
  282|       |    /* a too old libidn2 version */
  283|      0|    result = CURLE_NOT_BUILT_IN;
  284|       |#elif defined(USE_WIN32_IDN)
  285|       |  result = win32_idn_to_ascii(input, &decoded);
  286|       |#elif defined(USE_APPLE_IDN)
  287|       |  result = mac_idn_to_ascii(input, &decoded);
  288|       |#endif
  289|    185|  if(!result)
  ------------------
  |  Branch (289:6): [True: 0, False: 185]
  ------------------
  290|      0|    *output = decoded;
  291|    185|  return result;
  292|    185|}

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

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

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

Curl_mime_cleanpart:
 1099|  14.9k|{
 1100|  14.9k|  if(part) {
  ------------------
  |  Branch (1100:6): [True: 0, False: 14.9k]
  ------------------
 1101|      0|    cleanup_part_content(part);
 1102|      0|    curl_slist_free_all(part->curlheaders);
 1103|      0|    if(part->flags & MIME_USERHEADERS_OWNER)
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1103:8): [True: 0, False: 0]
  ------------------
 1104|      0|      curl_slist_free_all(part->userheaders);
 1105|      0|    curlx_safefree(part->mimetype);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1106|      0|    curlx_safefree(part->name);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1107|       |    curlx_safefree(part->filename);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1108|      0|    Curl_mime_initpart(part);
 1109|      0|  }
 1110|  14.9k|}
curl_mime_free:
 1114|  3.74k|{
 1115|  3.74k|  curl_mimepart *part;
 1116|       |
 1117|  3.74k|  if(!mime)
  ------------------
  |  Branch (1117:6): [True: 3.74k, False: 0]
  ------------------
 1118|  3.74k|    return;
 1119|       |
 1120|      0|  mime_subparts_unbind(mime);  /* Be sure it is not referenced anymore. */
 1121|       |
 1122|      0|  while(mime) {
  ------------------
  |  Branch (1122:9): [True: 0, False: 0]
  ------------------
 1123|      0|    part = mime->firstpart;
 1124|      0|    if(part) {
  ------------------
  |  Branch (1124:8): [True: 0, False: 0]
  ------------------
 1125|      0|      mime->firstpart = part->nextpart;
 1126|      0|      if(part->kind == MIMEKIND_MULTIPART && part->arg &&
  ------------------
  |  Branch (1126:10): [True: 0, False: 0]
  |  Branch (1126:46): [True: 0, False: 0]
  ------------------
 1127|      0|         part->freefunc == mime_subparts_free) {
  ------------------
  |  Branch (1127:10): [True: 0, False: 0]
  ------------------
 1128|      0|        curl_mime *subparts = (curl_mime *)part->arg;
 1129|      0|        part->freefunc = NULL;
 1130|      0|        cleanup_part_content(part);
 1131|      0|        subparts->parent = mime->parent;
 1132|      0|        mime->parent = (curl_mimepart *)subparts;
 1133|      0|      }
 1134|      0|      Curl_mime_cleanpart(part);
 1135|      0|      curlx_free(part);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1136|      0|    }
 1137|      0|    else {
 1138|      0|      curl_mime *parent = (curl_mime *)mime->parent;
 1139|      0|      curlx_free(mime);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1140|      0|      mime = parent;
 1141|      0|    }
 1142|      0|  }
 1143|      0|}

curl_mvsnprintf:
 1236|   664k|{
 1237|   664k|  int retcode;
 1238|   664k|  struct nsprintf info;
 1239|       |
 1240|   664k|  info.buffer = buffer;
 1241|   664k|  info.length = 0;
 1242|   664k|  info.max = maxlength;
 1243|       |
 1244|   664k|  retcode = formatf(&info, addbyter, addrun, NULL, format, args);
 1245|   664k|  if(info.max) {
  ------------------
  |  Branch (1245:6): [True: 664k, False: 0]
  ------------------
 1246|       |    /* we terminate this with a zero byte */
 1247|   664k|    if(info.max == info.length) {
  ------------------
  |  Branch (1247:8): [True: 51, False: 664k]
  ------------------
 1248|       |      /* we are at maximum, scrap the last letter */
 1249|     51|      info.buffer[-1] = 0;
 1250|     51|      DEBUGASSERT(retcode);
  ------------------
  |  | 1027|     51|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1250:7): [True: 0, False: 51]
  |  Branch (1250:7): [True: 51, False: 0]
  ------------------
 1251|     51|      retcode--; /* do not count the nul byte */
 1252|     51|    }
 1253|   664k|    else
 1254|   664k|      info.buffer[0] = 0;
 1255|   664k|  }
 1256|   664k|  return retcode;
 1257|   664k|}
curl_msnprintf:
 1260|   350k|{
 1261|   350k|  int retcode;
 1262|   350k|  va_list args; /* argument pointer */
 1263|   350k|  va_start(args, format);
 1264|   350k|  retcode = curl_mvsnprintf(buffer, maxlength, format, args);
 1265|       |  va_end(args);
 1266|   350k|  return retcode;
 1267|   350k|}
curlx_dyn_vprintf:
 1365|  1.31k|{
 1366|  1.31k|  struct asprintf info;
 1367|  1.31k|  info.b = dyn;
 1368|  1.31k|  info.merr = MERR_OK;
  ------------------
  |  |   27|  1.31k|#define MERR_OK        0
  ------------------
 1369|  1.31k|  info.nstage = 0;
 1370|       |
 1371|  1.31k|  (void)formatf(&info, alloc_addbyter, alloc_addrun, alloc_flush,
 1372|  1.31k|                format, args);
 1373|  1.31k|  if(!info.merr)
  ------------------
  |  Branch (1373:6): [True: 1.31k, False: 0]
  ------------------
 1374|  1.31k|    (void)alloc_flush(&info);
 1375|  1.31k|  if(info.merr) {
  ------------------
  |  Branch (1375:6): [True: 0, False: 1.31k]
  ------------------
 1376|      0|    curlx_dyn_free(info.b);
 1377|      0|    return info.merr;
 1378|      0|  }
 1379|  1.31k|  return 0;
 1380|  1.31k|}
curl_mvaprintf:
 1383|  6.29k|{
 1384|  6.29k|  struct asprintf info;
 1385|  6.29k|  struct dynbuf dyn;
 1386|  6.29k|  info.b = &dyn;
 1387|  6.29k|  curlx_dyn_init(info.b, DYN_APRINTF);
  ------------------
  |  |   70|  6.29k|#define DYN_APRINTF         8000000
  ------------------
 1388|  6.29k|  info.merr = MERR_OK;
  ------------------
  |  |   27|  6.29k|#define MERR_OK        0
  ------------------
 1389|  6.29k|  info.nstage = 0;
 1390|       |
 1391|  6.29k|  (void)formatf(&info, alloc_addbyter, alloc_addrun, alloc_flush,
 1392|  6.29k|                format, args);
 1393|  6.29k|  if(!info.merr)
  ------------------
  |  Branch (1393:6): [True: 6.29k, False: 0]
  ------------------
 1394|  6.29k|    (void)alloc_flush(&info);
 1395|  6.29k|  if(info.merr) {
  ------------------
  |  Branch (1395:6): [True: 0, False: 6.29k]
  ------------------
 1396|      0|    curlx_dyn_free(info.b);
 1397|      0|    return NULL;
 1398|      0|  }
 1399|  6.29k|  if(curlx_dyn_len(info.b))
  ------------------
  |  Branch (1399:6): [True: 6.29k, False: 0]
  ------------------
 1400|  6.29k|    return curlx_dyn_ptr(info.b);
 1401|      0|  return curlx_strdup("");
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1402|  6.29k|}
curl_maprintf:
 1405|  6.29k|{
 1406|  6.29k|  va_list args;
 1407|  6.29k|  char *s;
 1408|  6.29k|  va_start(args, format);
 1409|  6.29k|  s = curl_mvaprintf(format, args);
 1410|       |  va_end(args);
 1411|  6.29k|  return s;
 1412|  6.29k|}
mprintf.c:formatf:
 1086|   672k|{
 1087|   672k|  int done = 0;   /* number of characters written */
 1088|   672k|  int i;
 1089|   672k|  int ocount = 0; /* number of output segments */
 1090|   672k|  int icount = 0; /* number of input arguments */
 1091|       |
 1092|   672k|  struct outsegment output[MAX_SEGMENTS];
 1093|   672k|  struct va_input input[MAX_PARAMETERS];
 1094|   672k|  char work[BUFFSIZE + 2];
 1095|       |
 1096|       |  /* Parse the format string */
 1097|   672k|  if(parsefmt(format, output, input, &ocount, &icount, ap_save))
  ------------------
  |  Branch (1097:6): [True: 0, False: 672k]
  ------------------
 1098|      0|    return 0;
 1099|       |
 1100|  2.10M|  for(i = 0; i < ocount; i++) {
  ------------------
  |  Branch (1100:14): [True: 1.43M, False: 672k]
  ------------------
 1101|  1.43M|    struct outsegment *optr = &output[i];
 1102|  1.43M|    struct va_input *iptr = &input[optr->input];
 1103|  1.43M|    struct mproperty p;
 1104|  1.43M|    size_t outlen = optr->outlen;
 1105|       |
 1106|  1.43M|    if(outlen) {
  ------------------
  |  Branch (1106:8): [True: 1.13M, False: 302k]
  ------------------
 1107|  1.13M|      if(stream_zrun(userp, stream, streamn, optr->start, outlen, &done))
  ------------------
  |  Branch (1107:10): [True: 0, False: 1.13M]
  ------------------
 1108|      0|        return done;
 1109|  1.13M|      if(optr->flags & FLAGS_SUBSTR)
  ------------------
  |  Branch (1109:10): [True: 357k, False: 774k]
  ------------------
 1110|       |        /* this is a substring */
 1111|   357k|        continue;
 1112|  1.13M|    }
 1113|       |
 1114|  1.07M|    p.flags = optr->flags;
 1115|       |
 1116|       |    /* pick up the specified width */
 1117|  1.07M|    if(p.flags & FLAGS_WIDTHPARAM) {
  ------------------
  |  Branch (1117:8): [True: 0, False: 1.07M]
  ------------------
 1118|      0|      p.width = (int)input[optr->width].val.nums;
 1119|      0|      if(p.width < 0) {
  ------------------
  |  Branch (1119:10): [True: 0, False: 0]
  ------------------
 1120|       |        /* "A negative field width is taken as a '-' flag followed by a
 1121|       |           positive field width." */
 1122|      0|        if(p.width == INT_MIN)
  ------------------
  |  Branch (1122:12): [True: 0, False: 0]
  ------------------
 1123|      0|          p.width = INT_MAX;
 1124|      0|        else
 1125|      0|          p.width = -p.width;
 1126|      0|        p.flags |= FLAGS_LEFT;
 1127|      0|        p.flags &= ~(unsigned int)FLAGS_PAD_NIL;
 1128|      0|      }
 1129|      0|    }
 1130|  1.07M|    else
 1131|  1.07M|      p.width = optr->width;
 1132|       |
 1133|       |    /* pick up the specified precision */
 1134|  1.07M|    if(p.flags & FLAGS_PRECPARAM) {
  ------------------
  |  Branch (1134:8): [True: 15.5k, False: 1.06M]
  ------------------
 1135|  15.5k|      p.prec = (int)input[optr->precision].val.nums;
 1136|  15.5k|      if(p.prec < 0)
  ------------------
  |  Branch (1136:10): [True: 0, False: 15.5k]
  ------------------
 1137|       |        /* "A negative precision is taken as if the precision were
 1138|       |           omitted." */
 1139|      0|        p.prec = -1;
 1140|  15.5k|    }
 1141|  1.06M|    else if(p.flags & FLAGS_PREC)
  ------------------
  |  Branch (1141:13): [True: 69.8k, False: 991k]
  ------------------
 1142|  69.8k|      p.prec = optr->precision;
 1143|   991k|    else
 1144|   991k|      p.prec = -1;
 1145|       |
 1146|  1.07M|    switch(iptr->type) {
 1147|  84.3k|    case MTYPE_INTU:
  ------------------
  |  Branch (1147:5): [True: 84.3k, False: 992k]
  ------------------
 1148|  85.1k|    case MTYPE_LONGU:
  ------------------
  |  Branch (1148:5): [True: 752, False: 1.07M]
  ------------------
 1149|  85.1k|    case MTYPE_LONGLONGU:
  ------------------
  |  Branch (1149:5): [True: 0, False: 1.07M]
  ------------------
 1150|  85.1k|      p.flags |= FLAGS_UNSIGNED;
 1151|  85.1k|      if(out_number(userp, stream, streamn, &p, iptr->val.numu, 0, work,
  ------------------
  |  Branch (1151:10): [True: 0, False: 85.1k]
  ------------------
 1152|  85.1k|                    &done))
 1153|      0|        return done;
 1154|  85.1k|      break;
 1155|       |
 1156|   236k|    case MTYPE_INT:
  ------------------
  |  Branch (1156:5): [True: 236k, False: 840k]
  ------------------
 1157|   886k|    case MTYPE_LONG:
  ------------------
  |  Branch (1157:5): [True: 649k, False: 427k]
  ------------------
 1158|   886k|    case MTYPE_LONGLONG:
  ------------------
  |  Branch (1158:5): [True: 0, False: 1.07M]
  ------------------
 1159|   886k|      if(out_number(userp, stream, streamn, &p, iptr->val.numu,
  ------------------
  |  Branch (1159:10): [True: 0, False: 886k]
  ------------------
 1160|   886k|                    iptr->val.nums, work, &done))
 1161|      0|        return done;
 1162|   886k|      break;
 1163|       |
 1164|   886k|    case MTYPE_STRING:
  ------------------
  |  Branch (1164:5): [True: 105k, False: 971k]
  ------------------
 1165|   105k|      if(out_string(userp, stream, streamn, &p, iptr->val.str, &done))
  ------------------
  |  Branch (1165:10): [True: 41, False: 105k]
  ------------------
 1166|     41|        return done;
 1167|   105k|      break;
 1168|       |
 1169|   105k|    case MTYPE_PTR:
  ------------------
  |  Branch (1169:5): [True: 0, False: 1.07M]
  ------------------
 1170|      0|      if(out_pointer(userp, stream, streamn, &p, iptr->val.ptr, work,
  ------------------
  |  Branch (1170:10): [True: 0, False: 0]
  ------------------
 1171|      0|                     &done))
 1172|      0|        return done;
 1173|      0|      break;
 1174|       |
 1175|      0|    case MTYPE_DOUBLE:
  ------------------
  |  Branch (1175:5): [True: 0, False: 1.07M]
  ------------------
 1176|      0|    case MTYPE_LONGDOUBLE:
  ------------------
  |  Branch (1176:5): [True: 0, False: 1.07M]
  ------------------
 1177|      0|      if(out_double(userp, stream, streamn, &p, iptr->val.dnum, work,
  ------------------
  |  Branch (1177:10): [True: 0, False: 0]
  ------------------
 1178|      0|                    &done))
 1179|      0|        return done;
 1180|      0|      break;
 1181|       |
 1182|      0|    case MTYPE_INTPTR:
  ------------------
  |  Branch (1182:5): [True: 0, False: 1.07M]
  ------------------
 1183|       |      /* %n is observable by the caller, so commit what is pending first and
 1184|       |         perform it only if that succeeded, as a sink that never holds output
 1185|       |         would. */
 1186|      0|      if(flush && flush(userp))
  ------------------
  |  Branch (1186:10): [True: 0, False: 0]
  |  Branch (1186:19): [True: 0, False: 0]
  ------------------
 1187|      0|        return done;
 1188|       |      /* Answer the count of characters written. */
 1189|      0|      if(p.flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (1189:10): [True: 0, False: 0]
  ------------------
 1190|      0|        *(int64_t *)iptr->val.ptr = (int64_t)done;
 1191|      0|      else if(p.flags & FLAGS_LONG)
  ------------------
  |  Branch (1191:15): [True: 0, False: 0]
  ------------------
 1192|      0|        *(long *)iptr->val.ptr = (long)done;
 1193|      0|      else if(!(p.flags & FLAGS_SHORT))
  ------------------
  |  Branch (1193:15): [True: 0, False: 0]
  ------------------
 1194|      0|        *(int *)iptr->val.ptr = done;
 1195|      0|      else
 1196|      0|        *(short *)iptr->val.ptr = (short)done;
 1197|      0|      break;
 1198|       |
 1199|      0|    default:
  ------------------
  |  Branch (1199:5): [True: 0, False: 1.07M]
  ------------------
 1200|      0|      break;
 1201|  1.07M|    }
 1202|  1.07M|  }
 1203|   672k|  return done;
 1204|   672k|}
mprintf.c:parsefmt:
  443|   672k|{
  444|   672k|  const char *fmt = format;
  445|   672k|  int param_num = 0;
  446|   672k|  int max_param = -1;
  447|   672k|  int i;
  448|   672k|  int ocount = 0;
  449|   672k|  unsigned char usedinput[MAX_PARAMETERS / 8];
  450|   672k|  size_t outlen = 0;
  451|   672k|  struct outsegment *optr;
  452|   672k|  int use_dollar = DOLLAR_UNKNOWN;
  453|   672k|  const char *start = fmt;
  454|       |
  455|       |  /* clear, set a bit for each used input */
  456|   672k|  memset(usedinput, 0, sizeof(usedinput));
  457|       |
  458|  3.84M|  while(*fmt) {
  ------------------
  |  Branch (458:9): [True: 3.17M, False: 672k]
  ------------------
  459|  3.17M|    if(*fmt == '%') {
  ------------------
  |  Branch (459:8): [True: 1.07M, False: 2.09M]
  ------------------
  460|  1.07M|      struct va_input *iptr;
  461|  1.07M|      FormatType type;
  462|  1.07M|      unsigned int flags = 0;
  463|  1.07M|      int width = 0;
  464|  1.07M|      int precision = 0;
  465|  1.07M|      int param = -1;
  466|  1.07M|      int rc;
  467|  1.07M|      fmt++;
  468|  1.07M|      outlen = (size_t)(fmt - start - 1);
  469|  1.07M|      if(*fmt == '%') {
  ------------------
  |  Branch (469:10): [True: 14, False: 1.07M]
  ------------------
  470|       |        /* this means a %% that should be output only as %. Create an output
  471|       |           segment. */
  472|     14|        if(outlen) {
  ------------------
  |  Branch (472:12): [True: 0, False: 14]
  ------------------
  473|      0|          optr = &out[ocount++];
  474|      0|          if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|      0|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (474:14): [True: 0, False: 0]
  ------------------
  475|      0|            return PFMT_MANYSEGS;
  ------------------
  |  |  178|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  476|      0|          optr->input = 0;
  477|      0|          optr->flags = FLAGS_SUBSTR;
  478|      0|          optr->start = start;
  479|      0|          optr->outlen = outlen;
  480|      0|        }
  481|     14|        start = fmt;
  482|     14|        fmt++;
  483|     14|        continue; /* while */
  484|     14|      }
  485|       |
  486|  1.07M|      if(use_dollar != DOLLAR_NOPE) {
  ------------------
  |  Branch (486:10): [True: 658k, False: 418k]
  ------------------
  487|   658k|        param = dollarstring(fmt, &fmt);
  488|   658k|        if(param < 0) {
  ------------------
  |  Branch (488:12): [True: 658k, False: 0]
  ------------------
  489|   658k|          if(use_dollar == DOLLAR_USE)
  ------------------
  |  Branch (489:14): [True: 0, False: 658k]
  ------------------
  490|       |            /* illegal combo */
  491|      0|            return PFMT_DOLLAR;
  ------------------
  |  |  168|      0|#define PFMT_DOLLAR      1 /* bad dollar for main param */
  ------------------
  492|       |
  493|       |          /* we got no positional, get the next arg */
  494|   658k|          param = -1;
  495|   658k|          use_dollar = DOLLAR_NOPE;
  496|   658k|        }
  497|      0|        else
  498|      0|          use_dollar = DOLLAR_USE;
  499|   658k|      }
  500|       |
  501|  1.07M|      rc = parse_flags(&fmt, &flags, use_dollar, &precision, &width);
  502|  1.07M|      if(rc)
  ------------------
  |  Branch (502:10): [True: 0, False: 1.07M]
  ------------------
  503|      0|        return rc;
  504|       |
  505|  1.07M|      if(parse_conversion(*fmt, &flags, &type))
  ------------------
  |  Branch (505:10): [True: 0, False: 1.07M]
  ------------------
  506|      0|        continue;
  507|       |
  508|  1.07M|      if(flags & FLAGS_WIDTHPARAM) {
  ------------------
  |  Branch (508:10): [True: 0, False: 1.07M]
  ------------------
  509|      0|        if(width < 0)
  ------------------
  |  Branch (509:12): [True: 0, False: 0]
  ------------------
  510|      0|          width = param_num++;
  511|      0|        else {
  512|       |          /* if this identifies a parameter already used, this is illegal */
  513|      0|          if(is_arg_used(usedinput, width))
  ------------------
  |  |  156|      0|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  |  |  ------------------
  |  |  |  Branch (156:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  514|      0|            return PFMT_WIDTHARG;
  ------------------
  |  |  176|      0|#define PFMT_WIDTHARG    9 /* attempted to use same arg twice, for width */
  ------------------
  515|      0|        }
  516|      0|        if(width >= MAX_PARAMETERS)
  ------------------
  |  |   33|      0|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (516:12): [True: 0, False: 0]
  ------------------
  517|      0|          return PFMT_MANYARGS;
  ------------------
  |  |  171|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  518|      0|        if(width >= max_param)
  ------------------
  |  Branch (518:12): [True: 0, False: 0]
  ------------------
  519|      0|          max_param = width;
  520|       |
  521|      0|        in[width].type = MTYPE_WIDTH;
  522|       |        /* mark as used */
  523|      0|        mark_arg_used(usedinput, width);
  ------------------
  |  |  157|      0|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  524|      0|      }
  525|       |
  526|  1.07M|      if(flags & FLAGS_PRECPARAM) {
  ------------------
  |  Branch (526:10): [True: 15.5k, False: 1.06M]
  ------------------
  527|  15.5k|        if(precision < 0)
  ------------------
  |  Branch (527:12): [True: 15.5k, False: 0]
  ------------------
  528|  15.5k|          precision = param_num++;
  529|      0|        else {
  530|       |          /* if this identifies a parameter already used, this is illegal */
  531|      0|          if(is_arg_used(usedinput, precision))
  ------------------
  |  |  156|      0|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  |  |  ------------------
  |  |  |  Branch (156:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  532|      0|            return PFMT_PRECARG;
  ------------------
  |  |  177|      0|#define PFMT_PRECARG    10 /* attempted to use same arg twice, for prec */
  ------------------
  533|      0|        }
  534|  15.5k|        if(precision >= MAX_PARAMETERS)
  ------------------
  |  |   33|  15.5k|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (534:12): [True: 0, False: 15.5k]
  ------------------
  535|      0|          return PFMT_MANYARGS;
  ------------------
  |  |  171|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  536|  15.5k|        if(precision >= max_param)
  ------------------
  |  Branch (536:12): [True: 15.5k, False: 0]
  ------------------
  537|  15.5k|          max_param = precision;
  538|       |
  539|  15.5k|        in[precision].type = MTYPE_PRECISION;
  540|  15.5k|        mark_arg_used(usedinput, precision);
  ------------------
  |  |  157|  15.5k|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  541|  15.5k|      }
  542|       |
  543|       |      /* Handle the specifier */
  544|  1.07M|      if(param < 0)
  ------------------
  |  Branch (544:10): [True: 1.07M, False: 0]
  ------------------
  545|  1.07M|        param = param_num++;
  546|  1.07M|      if(param >= MAX_PARAMETERS)
  ------------------
  |  |   33|  1.07M|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (546:10): [True: 0, False: 1.07M]
  ------------------
  547|      0|        return PFMT_MANYARGS;
  ------------------
  |  |  171|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  548|  1.07M|      if(param >= max_param)
  ------------------
  |  Branch (548:10): [True: 1.07M, False: 0]
  ------------------
  549|  1.07M|        max_param = param;
  550|       |
  551|  1.07M|      iptr = &in[param];
  552|  1.07M|      iptr->type = type;
  553|       |
  554|       |      /* mark this input as used */
  555|  1.07M|      mark_arg_used(usedinput, param);
  ------------------
  |  |  157|  1.07M|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  556|       |
  557|  1.07M|      fmt++;
  558|  1.07M|      optr = &out[ocount++];
  559|  1.07M|      if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|  1.07M|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (559:10): [True: 0, False: 1.07M]
  ------------------
  560|      0|        return PFMT_MANYSEGS;
  ------------------
  |  |  178|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  561|  1.07M|      optr->input = (unsigned int)param;
  562|  1.07M|      optr->flags = flags;
  563|  1.07M|      optr->width = width;
  564|  1.07M|      optr->precision = precision;
  565|  1.07M|      optr->start = start;
  566|  1.07M|      optr->outlen = outlen;
  567|  1.07M|      start = fmt;
  568|  1.07M|    }
  569|  2.09M|    else
  570|  2.09M|      fmt++;
  571|  3.17M|  }
  572|       |
  573|       |  /* is there a trailing piece */
  574|   672k|  outlen = (size_t)(fmt - start);
  575|   672k|  if(outlen) {
  ------------------
  |  Branch (575:6): [True: 357k, False: 314k]
  ------------------
  576|   357k|    optr = &out[ocount++];
  577|   357k|    if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|   357k|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (577:8): [True: 0, False: 357k]
  ------------------
  578|      0|      return PFMT_MANYSEGS;
  ------------------
  |  |  178|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  579|   357k|    optr->input = 0;
  580|   357k|    optr->flags = FLAGS_SUBSTR;
  581|   357k|    optr->start = start;
  582|   357k|    optr->outlen = outlen;
  583|   357k|  }
  584|       |
  585|       |  /* Read the arg list parameters into our data list */
  586|  1.76M|  for(i = 0; i < max_param + 1; i++) {
  ------------------
  |  Branch (586:14): [True: 1.09M, False: 672k]
  ------------------
  587|  1.09M|    struct va_input *iptr = &in[i];
  588|  1.09M|    if(!is_arg_used(usedinput, i))
  ------------------
  |  |  156|  1.09M|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  ------------------
  |  Branch (588:8): [True: 0, False: 1.09M]
  ------------------
  589|       |      /* bad input */
  590|      0|      return PFMT_INPUTGAP;
  ------------------
  |  |  175|      0|#define PFMT_INPUTGAP    8 /* gap in arguments */
  ------------------
  591|       |
  592|       |    /* based on the type, read the correct argument */
  593|  1.09M|    switch(iptr->type) {
  594|   105k|    case MTYPE_STRING:
  ------------------
  |  Branch (594:5): [True: 105k, False: 986k]
  ------------------
  595|   105k|      iptr->val.str = va_arg(arglist, const char *);
  596|   105k|      break;
  597|       |
  598|      0|    case MTYPE_INTPTR:
  ------------------
  |  Branch (598:5): [True: 0, False: 1.09M]
  ------------------
  599|      0|    case MTYPE_PTR:
  ------------------
  |  Branch (599:5): [True: 0, False: 1.09M]
  ------------------
  600|      0|      iptr->val.ptr = va_arg(arglist, void *);
  601|      0|      break;
  602|       |
  603|      0|    case MTYPE_LONGLONGU:
  ------------------
  |  Branch (603:5): [True: 0, False: 1.09M]
  ------------------
  604|      0|      iptr->val.numu = va_arg(arglist, uint64_t);
  605|      0|      break;
  606|       |
  607|      0|    case MTYPE_LONGLONG:
  ------------------
  |  Branch (607:5): [True: 0, False: 1.09M]
  ------------------
  608|      0|      iptr->val.nums = va_arg(arglist, int64_t);
  609|      0|      break;
  610|       |
  611|    752|    case MTYPE_LONGU:
  ------------------
  |  Branch (611:5): [True: 752, False: 1.09M]
  ------------------
  612|    752|      iptr->val.numu = va_arg(arglist, unsigned long);
  613|    752|      break;
  614|       |
  615|   649k|    case MTYPE_LONG:
  ------------------
  |  Branch (615:5): [True: 649k, False: 442k]
  ------------------
  616|   649k|      iptr->val.nums = va_arg(arglist, long);
  617|   649k|      break;
  618|       |
  619|  84.3k|    case MTYPE_INTU:
  ------------------
  |  Branch (619:5): [True: 84.3k, False: 1.00M]
  ------------------
  620|  84.3k|      iptr->val.numu = va_arg(arglist, unsigned int);
  621|  84.3k|      break;
  622|       |
  623|   236k|    case MTYPE_INT:
  ------------------
  |  Branch (623:5): [True: 236k, False: 855k]
  ------------------
  624|   236k|    case MTYPE_WIDTH:
  ------------------
  |  Branch (624:5): [True: 0, False: 1.09M]
  ------------------
  625|   252k|    case MTYPE_PRECISION:
  ------------------
  |  Branch (625:5): [True: 15.5k, False: 1.07M]
  ------------------
  626|   252k|      iptr->val.nums = va_arg(arglist, int);
  627|   252k|      break;
  628|       |
  629|      0|    case MTYPE_DOUBLE:
  ------------------
  |  Branch (629:5): [True: 0, False: 1.09M]
  ------------------
  630|      0|      iptr->val.dnum = va_arg(arglist, double);
  631|      0|      break;
  632|       |
  633|      0|    case MTYPE_LONGDOUBLE:
  ------------------
  |  Branch (633:5): [True: 0, False: 1.09M]
  ------------------
  634|      0|      iptr->val.dnum = (double)va_arg(arglist, long double);
  635|      0|      break;
  636|       |
  637|      0|    default:
  ------------------
  |  Branch (637:5): [True: 0, False: 1.09M]
  ------------------
  638|      0|      DEBUGASSERT(NULL); /* unexpected */
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (638:7): [True: 0, False: 0]
  |  Branch (638:7): [True: 0, False: 0]
  ------------------
  639|      0|      break;
  640|  1.09M|    }
  641|  1.09M|  }
  642|   672k|  *ipieces = max_param + 1;
  643|   672k|  *opieces = ocount;
  644|       |
  645|   672k|  return PFMT_OK;
  ------------------
  |  |  167|   672k|#define PFMT_OK          0
  ------------------
  646|   672k|}
mprintf.c:dollarstring:
  147|   658k|{
  148|   658k|  curl_off_t num;
  149|   658k|  if(curlx_str_number(&p, &num, MAX_PARAMETERS) ||
  ------------------
  |  |   33|   658k|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (149:6): [True: 658k, False: 0]
  ------------------
  150|      0|     curlx_str_single(&p, '$') || !num)
  ------------------
  |  Branch (150:6): [True: 0, False: 0]
  |  Branch (150:35): [True: 0, False: 0]
  ------------------
  151|   658k|    return -1;
  152|      0|  *end = p;
  153|      0|  return (int)num - 1;
  154|   658k|}
mprintf.c:parse_flags:
  182|  1.07M|{
  183|  1.07M|  const char *fmt = *fmtp;
  184|  1.07M|  bool loopit = TRUE;
  ------------------
  |  |  997|  1.07M|#define TRUE true
  ------------------
  185|  1.07M|  unsigned int flags = 0;
  186|  1.07M|  int width = 0;
  187|  1.07M|  int precision = 0;
  188|       |
  189|       |  /* Handle the flags */
  190|  1.81M|  do {
  191|  1.81M|    switch(*fmt++) {
  192|      0|    case ' ':
  ------------------
  |  Branch (192:5): [True: 0, False: 1.81M]
  ------------------
  193|      0|      flags |= FLAGS_SPACE;
  194|      0|      break;
  195|      0|    case '+':
  ------------------
  |  Branch (195:5): [True: 0, False: 1.81M]
  ------------------
  196|      0|      flags |= FLAGS_SHOWSIGN;
  197|      0|      break;
  198|      0|    case '-':
  ------------------
  |  Branch (198:5): [True: 0, False: 1.81M]
  ------------------
  199|      0|      flags |= FLAGS_LEFT;
  200|      0|      flags &= ~(unsigned int)FLAGS_PAD_NIL;
  201|      0|      break;
  202|      0|    case '#':
  ------------------
  |  Branch (202:5): [True: 0, False: 1.81M]
  ------------------
  203|      0|      flags |= FLAGS_ALT;
  204|      0|      break;
  205|  85.3k|    case '.':
  ------------------
  |  Branch (205:5): [True: 85.3k, False: 1.72M]
  ------------------
  206|  85.3k|      if('*' == *fmt) {
  ------------------
  |  Branch (206:10): [True: 15.5k, False: 69.8k]
  ------------------
  207|       |        /* The precision is picked from a specified parameter */
  208|  15.5k|        flags |= FLAGS_PRECPARAM;
  209|  15.5k|        fmt++;
  210|       |
  211|  15.5k|        if(use_dollar == DOLLAR_USE) {
  ------------------
  |  Branch (211:12): [True: 0, False: 15.5k]
  ------------------
  212|      0|          precision = dollarstring(fmt, &fmt);
  213|      0|          if(precision < 0)
  ------------------
  |  Branch (213:14): [True: 0, False: 0]
  ------------------
  214|       |            /* illegal combo */
  215|      0|            return PFMT_DOLLARPREC;
  ------------------
  |  |  170|      0|#define PFMT_DOLLARPREC  3 /* bad dollar use for precision */
  ------------------
  216|      0|        }
  217|  15.5k|        else
  218|       |          /* get it from the next argument */
  219|  15.5k|          precision = -1;
  220|  15.5k|      }
  221|  69.8k|      else {
  222|  69.8k|        bool is_neg;
  223|  69.8k|        curl_off_t num;
  224|  69.8k|        flags |= FLAGS_PREC;
  225|  69.8k|        is_neg = ('-' == *fmt);
  226|  69.8k|        if(is_neg)
  ------------------
  |  Branch (226:12): [True: 0, False: 69.8k]
  ------------------
  227|      0|          fmt++;
  228|  69.8k|        if(curlx_str_number(&fmt, &num, INT_MAX))
  ------------------
  |  Branch (228:12): [True: 0, False: 69.8k]
  ------------------
  229|      0|          return PFMT_PREC;
  ------------------
  |  |  172|      0|#define PFMT_PREC        5 /* precision overflow */
  ------------------
  230|  69.8k|        precision = (int)num;
  231|  69.8k|        if(is_neg)
  ------------------
  |  Branch (231:12): [True: 0, False: 69.8k]
  ------------------
  232|      0|          precision = -precision;
  233|  69.8k|      }
  234|  85.3k|      if((flags & (FLAGS_PREC | FLAGS_PRECPARAM)) ==
  ------------------
  |  Branch (234:10): [True: 0, False: 85.3k]
  ------------------
  235|  85.3k|         (FLAGS_PREC | FLAGS_PRECPARAM))
  236|       |        /* it is not permitted to use both kinds of precision for the same
  237|       |           argument */
  238|      0|        return PFMT_PRECMIX;
  ------------------
  |  |  173|      0|#define PFMT_PRECMIX     6 /* bad mix of precision specifiers */
  ------------------
  239|  85.3k|      break;
  240|  85.3k|    case 'h':
  ------------------
  |  Branch (240:5): [True: 0, False: 1.81M]
  ------------------
  241|      0|      flags |= FLAGS_SHORT;
  242|      0|      break;
  243|       |#ifdef _WIN32
  244|       |    case 'I':
  245|       |      /* Non-ANSI integer extensions I32 I64 */
  246|       |      if((fmt[0] == '3') && (fmt[1] == '2')) {
  247|       |        flags |= FLAGS_LONG;
  248|       |        fmt += 2;
  249|       |      }
  250|       |      else if((fmt[0] == '6') && (fmt[1] == '4')) {
  251|       |        flags |= FLAGS_LONGLONG;
  252|       |        fmt += 2;
  253|       |      }
  254|       |      else {
  255|       |#if SIZEOF_CURL_OFF_T > SIZEOF_LONG
  256|       |        flags |= FLAGS_LONGLONG;
  257|       |#else
  258|       |        flags |= FLAGS_LONG;
  259|       |#endif
  260|       |      }
  261|       |      break;
  262|       |#endif /* _WIN32 */
  263|   649k|    case 'l':
  ------------------
  |  Branch (263:5): [True: 649k, False: 1.16M]
  ------------------
  264|   649k|      if(flags & FLAGS_LONG)
  ------------------
  |  Branch (264:10): [True: 0, False: 649k]
  ------------------
  265|      0|        flags |= FLAGS_LONGLONG;
  266|   649k|      else
  267|   649k|        flags |= FLAGS_LONG;
  268|   649k|      break;
  269|      0|    case 'L':
  ------------------
  |  Branch (269:5): [True: 0, False: 1.81M]
  ------------------
  270|      0|      flags |= FLAGS_LONGDOUBLE;
  271|      0|      break;
  272|      0|    case 'q':
  ------------------
  |  Branch (272:5): [True: 0, False: 1.81M]
  ------------------
  273|      0|      flags |= FLAGS_LONGLONG;
  274|      0|      break;
  275|    752|    case 'z':
  ------------------
  |  Branch (275:5): [True: 752, False: 1.81M]
  ------------------
  276|       |      /* the code below generates a warning if -Wunreachable-code is
  277|       |         used */
  278|       |#if SIZEOF_SIZE_T > SIZEOF_LONG
  279|       |      flags |= FLAGS_LONGLONG;
  280|       |#else
  281|    752|      flags |= FLAGS_LONG;
  282|    752|#endif
  283|    752|      break;
  284|      0|    case 'O':
  ------------------
  |  Branch (284:5): [True: 0, False: 1.81M]
  ------------------
  285|       |#if SIZEOF_CURL_OFF_T > SIZEOF_LONG
  286|       |      flags |= FLAGS_LONGLONG;
  287|       |#else
  288|      0|      flags |= FLAGS_LONG;
  289|      0|#endif
  290|      0|      break;
  291|      0|    case '0':
  ------------------
  |  Branch (291:5): [True: 0, False: 1.81M]
  ------------------
  292|      0|      if(!(flags & FLAGS_LEFT))
  ------------------
  |  Branch (292:10): [True: 0, False: 0]
  ------------------
  293|      0|        flags |= FLAGS_PAD_NIL;
  294|      0|      FALLTHROUGH();
  ------------------
  |  |  767|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  295|      0|    case '1':
  ------------------
  |  Branch (295:5): [True: 0, False: 1.81M]
  ------------------
  296|      0|    case '2':
  ------------------
  |  Branch (296:5): [True: 0, False: 1.81M]
  ------------------
  297|      0|    case '3':
  ------------------
  |  Branch (297:5): [True: 0, False: 1.81M]
  ------------------
  298|      0|    case '4':
  ------------------
  |  Branch (298:5): [True: 0, False: 1.81M]
  ------------------
  299|      0|    case '5':
  ------------------
  |  Branch (299:5): [True: 0, False: 1.81M]
  ------------------
  300|      0|    case '6':
  ------------------
  |  Branch (300:5): [True: 0, False: 1.81M]
  ------------------
  301|      0|    case '7':
  ------------------
  |  Branch (301:5): [True: 0, False: 1.81M]
  ------------------
  302|      0|    case '8':
  ------------------
  |  Branch (302:5): [True: 0, False: 1.81M]
  ------------------
  303|      0|    case '9': {
  ------------------
  |  Branch (303:5): [True: 0, False: 1.81M]
  ------------------
  304|      0|      curl_off_t num;
  305|      0|      flags |= FLAGS_WIDTH;
  306|      0|      fmt--;
  307|      0|      if(curlx_str_number(&fmt, &num, INT_MAX))
  ------------------
  |  Branch (307:10): [True: 0, False: 0]
  ------------------
  308|      0|        return PFMT_WIDTH;
  ------------------
  |  |  174|      0|#define PFMT_WIDTH       7 /* width overflow */
  ------------------
  309|      0|      width = (int)num;
  310|      0|      break;
  311|      0|    }
  312|      0|    case '*':  /* read width from argument list */
  ------------------
  |  Branch (312:5): [True: 0, False: 1.81M]
  ------------------
  313|      0|      flags |= FLAGS_WIDTHPARAM;
  314|      0|      if(use_dollar == DOLLAR_USE) {
  ------------------
  |  Branch (314:10): [True: 0, False: 0]
  ------------------
  315|      0|        width = dollarstring(fmt, &fmt);
  316|      0|        if(width < 0)
  ------------------
  |  Branch (316:12): [True: 0, False: 0]
  ------------------
  317|       |          /* illegal combo */
  318|      0|          return PFMT_DOLLARWIDTH;
  ------------------
  |  |  169|      0|#define PFMT_DOLLARWIDTH 2 /* bad dollar use for width */
  ------------------
  319|      0|      }
  320|      0|      else
  321|       |        /* pick from the next argument */
  322|      0|        width = -1;
  323|      0|      break;
  324|  1.07M|    default:
  ------------------
  |  Branch (324:5): [True: 1.07M, False: 735k]
  ------------------
  325|  1.07M|      loopit = FALSE;
  ------------------
  |  | 1000|  1.07M|#define FALSE false
  ------------------
  326|  1.07M|      fmt--;
  327|  1.07M|      break;
  328|  1.81M|    } /* switch */
  329|  1.81M|  } while(loopit); /* do */
  ------------------
  |  Branch (329:11): [True: 735k, False: 1.07M]
  ------------------
  330|  1.07M|  *flagsp = flags;
  331|  1.07M|  *precp = precision;
  332|  1.07M|  *widthp = width;
  333|  1.07M|  *fmtp = fmt;
  334|  1.07M|  return PFMT_OK;
  ------------------
  |  |  167|  1.07M|#define PFMT_OK          0
  ------------------
  335|  1.07M|}
mprintf.c:parse_conversion:
  339|  1.07M|{
  340|  1.07M|  unsigned int flags = *flagp;
  341|  1.07M|  FormatType type;
  342|  1.07M|  switch(f) {
  343|      0|  case 'S':
  ------------------
  |  Branch (343:3): [True: 0, False: 1.07M]
  ------------------
  344|      0|    flags |= FLAGS_ALT;
  345|      0|    type = MTYPE_STRING;
  346|      0|    break;
  347|   105k|  case 's':
  ------------------
  |  Branch (347:3): [True: 105k, False: 971k]
  ------------------
  348|   105k|    type = MTYPE_STRING;
  349|   105k|    break;
  350|      0|  case 'n':
  ------------------
  |  Branch (350:3): [True: 0, False: 1.07M]
  ------------------
  351|      0|    type = MTYPE_INTPTR;
  352|      0|    break;
  353|      0|  case 'p':
  ------------------
  |  Branch (353:3): [True: 0, False: 1.07M]
  ------------------
  354|      0|    type = MTYPE_PTR;
  355|      0|    break;
  356|   671k|  case 'd':
  ------------------
  |  Branch (356:3): [True: 671k, False: 405k]
  ------------------
  357|   671k|  case 'i':
  ------------------
  |  Branch (357:3): [True: 0, False: 1.07M]
  ------------------
  358|   671k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (358:8): [True: 0, False: 671k]
  ------------------
  359|      0|      type = MTYPE_LONGLONG;
  360|   671k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (360:13): [True: 649k, False: 21.3k]
  ------------------
  361|   649k|      type = MTYPE_LONG;
  362|  21.3k|    else
  363|  21.3k|      type = MTYPE_INT;
  364|   671k|    break;
  365|  15.1k|  case 'u':
  ------------------
  |  Branch (365:3): [True: 15.1k, False: 1.06M]
  ------------------
  366|  15.1k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (366:8): [True: 0, False: 15.1k]
  ------------------
  367|      0|      type = MTYPE_LONGLONGU;
  368|  15.1k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (368:13): [True: 752, False: 14.3k]
  ------------------
  369|    752|      type = MTYPE_LONGU;
  370|  14.3k|    else
  371|  14.3k|      type = MTYPE_INTU;
  372|  15.1k|    flags |= FLAGS_UNSIGNED;
  373|  15.1k|    break;
  374|      0|  case 'o':
  ------------------
  |  Branch (374:3): [True: 0, False: 1.07M]
  ------------------
  375|      0|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (375:8): [True: 0, False: 0]
  ------------------
  376|      0|      type = MTYPE_LONGLONGU;
  377|      0|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (377:13): [True: 0, False: 0]
  ------------------
  378|      0|      type = MTYPE_LONGU;
  379|      0|    else
  380|      0|      type = MTYPE_INTU;
  381|      0|    flags |= FLAGS_OCTAL | FLAGS_UNSIGNED;
  382|      0|    break;
  383|  69.9k|  case 'x':
  ------------------
  |  Branch (383:3): [True: 69.9k, False: 1.00M]
  ------------------
  384|  69.9k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (384:8): [True: 0, False: 69.9k]
  ------------------
  385|      0|      type = MTYPE_LONGLONGU;
  386|  69.9k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (386:13): [True: 0, False: 69.9k]
  ------------------
  387|      0|      type = MTYPE_LONGU;
  388|  69.9k|    else
  389|  69.9k|      type = MTYPE_INTU;
  390|  69.9k|    flags |= FLAGS_HEX | FLAGS_UNSIGNED;
  391|  69.9k|    break;
  392|      0|  case 'X':
  ------------------
  |  Branch (392:3): [True: 0, False: 1.07M]
  ------------------
  393|      0|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (393:8): [True: 0, False: 0]
  ------------------
  394|      0|      type = MTYPE_LONGLONGU;
  395|      0|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (395:13): [True: 0, False: 0]
  ------------------
  396|      0|      type = MTYPE_LONGU;
  397|      0|    else
  398|      0|      type = MTYPE_INTU;
  399|      0|    flags |= FLAGS_HEX | FLAGS_UPPER | FLAGS_UNSIGNED;
  400|      0|    break;
  401|   215k|  case 'c':
  ------------------
  |  Branch (401:3): [True: 215k, False: 861k]
  ------------------
  402|   215k|    type = MTYPE_INT;
  403|   215k|    flags |= FLAGS_CHAR;
  404|   215k|    break;
  405|      0|  case 'f':
  ------------------
  |  Branch (405:3): [True: 0, False: 1.07M]
  ------------------
  406|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (406:12): [True: 0, False: 0]
  ------------------
  407|      0|    break;
  408|      0|  case 'F':
  ------------------
  |  Branch (408:3): [True: 0, False: 1.07M]
  ------------------
  409|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (409:12): [True: 0, False: 0]
  ------------------
  410|      0|    flags |= FLAGS_UPPER;
  411|      0|    break;
  412|      0|  case 'e':
  ------------------
  |  Branch (412:3): [True: 0, False: 1.07M]
  ------------------
  413|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (413:12): [True: 0, False: 0]
  ------------------
  414|      0|    flags |= FLAGS_FLOATE;
  415|      0|    break;
  416|      0|  case 'E':
  ------------------
  |  Branch (416:3): [True: 0, False: 1.07M]
  ------------------
  417|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (417:12): [True: 0, False: 0]
  ------------------
  418|      0|    flags |= FLAGS_FLOATE | FLAGS_UPPER;
  419|      0|    break;
  420|      0|  case 'g':
  ------------------
  |  Branch (420:3): [True: 0, False: 1.07M]
  ------------------
  421|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (421:12): [True: 0, False: 0]
  ------------------
  422|      0|    flags |= FLAGS_FLOATG;
  423|      0|    break;
  424|      0|  case 'G':
  ------------------
  |  Branch (424:3): [True: 0, False: 1.07M]
  ------------------
  425|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (425:12): [True: 0, False: 0]
  ------------------
  426|      0|    flags |= FLAGS_FLOATG | FLAGS_UPPER;
  427|      0|    break;
  428|      0|  default:
  ------------------
  |  Branch (428:3): [True: 0, False: 1.07M]
  ------------------
  429|       |    /* invalid instruction, disregard and continue */
  430|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  431|  1.07M|  } /* switch */
  432|       |
  433|  1.07M|  *flagp |= flags;
  434|  1.07M|  *typep = type;
  435|       |  return FALSE;
  ------------------
  |  | 1000|  1.07M|#define FALSE false
  ------------------
  436|  1.07M|}
mprintf.c:stream_zrun:
  724|  1.23M|{
  725|  1.23M|  size_t n = 0;
  726|  5.41M|  while(n < len && str[n])
  ------------------
  |  Branch (726:9): [True: 4.17M, False: 1.23M]
  |  Branch (726:20): [True: 4.17M, False: 2.64k]
  ------------------
  727|  4.17M|    n++;
  728|  1.23M|  return stream_run(userp, stream, streamn,
  729|  1.23M|                    (const unsigned char *)str, n, donep);
  730|  1.23M|}
mprintf.c:stream_run:
  670|  1.99M|{
  671|  1.99M|  if(!len)
  ------------------
  |  Branch (671:6): [True: 47.0k, False: 1.94M]
  ------------------
  672|  47.0k|    return FALSE;
  ------------------
  |  | 1000|  47.0k|#define FALSE false
  ------------------
  673|  1.94M|  if(streamn) {
  ------------------
  |  Branch (673:6): [True: 1.94M, False: 0]
  ------------------
  674|  1.94M|    size_t n = streamn(buf, len, userp);
  675|  1.94M|    *donep += (int)n;
  676|  1.94M|    return n != len;
  677|  1.94M|  }
  678|      0|  while(len--) {
  ------------------
  |  Branch (678:9): [True: 0, False: 0]
  ------------------
  679|      0|    if(stream(*buf++, userp))
  ------------------
  |  Branch (679:8): [True: 0, False: 0]
  ------------------
  680|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  681|      0|    (*donep)++;
  682|      0|  }
  683|      0|  return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  684|      0|}
mprintf.c:out_number:
  828|   971k|{
  829|   971k|  const unsigned char *digits = Curl_ldigits;
  830|   971k|  int flags = p->flags;
  831|   971k|  int width = p->width;
  832|   971k|  int prec = p->prec;
  833|   971k|  bool is_alt = flags & FLAGS_ALT;
  834|   971k|  bool is_neg = FALSE;
  ------------------
  |  | 1000|   971k|#define FALSE false
  ------------------
  835|   971k|  int base = 10;
  836|       |
  837|       |  /* 'workend' points to the final buffer byte position, but with an extra
  838|       |     byte as margin to avoid the (FALSE?) warning Coverity gives us
  839|       |     otherwise */
  840|   971k|  char *workend = &work[BUFFSIZE - 2];
  ------------------
  |  |   31|   971k|#define BUFFSIZE 326 /* buffer for long-to-str and float-to-str calcs, should
  ------------------
  841|   971k|  char *w;
  842|       |
  843|   971k|  if(flags & FLAGS_CHAR) {
  ------------------
  |  Branch (843:6): [True: 215k, False: 756k]
  ------------------
  844|       |    /* Character. */
  845|   215k|    if(!(flags & FLAGS_LEFT)) {
  ------------------
  |  Branch (845:8): [True: 215k, False: 0]
  ------------------
  846|   215k|      if(stream_pad(userp, stream, streamn, ' ', width - 1, donep))
  ------------------
  |  Branch (846:10): [True: 0, False: 215k]
  ------------------
  847|      0|        return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  848|   215k|      width = 1;
  849|   215k|    }
  850|   215k|    OUTCHAR((char)num);
  ------------------
  |  |   43|   215k|  do {                                    \
  |  |   44|   215k|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 215k]
  |  |  ------------------
  |  |   45|   215k|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|   215k|    (*donep)++;                           \
  |  |   47|   215k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 215k]
  |  |  ------------------
  ------------------
  851|   215k|    if(flags & FLAGS_LEFT) {
  ------------------
  |  Branch (851:8): [True: 0, False: 215k]
  ------------------
  852|      0|      if(stream_pad(userp, stream, streamn, ' ', width - 1, donep))
  ------------------
  |  Branch (852:10): [True: 0, False: 0]
  ------------------
  853|      0|        return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  854|      0|    }
  855|   215k|    return FALSE;
  ------------------
  |  | 1000|   215k|#define FALSE false
  ------------------
  856|   215k|  }
  857|   756k|  if(flags & FLAGS_OCTAL)
  ------------------
  |  Branch (857:6): [True: 0, False: 756k]
  ------------------
  858|       |    /* Octal unsigned integer */
  859|      0|    base = 8;
  860|       |
  861|   756k|  else if(flags & FLAGS_HEX) {
  ------------------
  |  Branch (861:11): [True: 69.9k, False: 686k]
  ------------------
  862|       |    /* Hexadecimal unsigned integer */
  863|  69.9k|    digits = (flags & FLAGS_UPPER) ? Curl_udigits : Curl_ldigits;
  ------------------
  |  Branch (863:14): [True: 0, False: 69.9k]
  ------------------
  864|  69.9k|    base = 16;
  865|  69.9k|  }
  866|   686k|  else if(flags & FLAGS_UNSIGNED)
  ------------------
  |  Branch (866:11): [True: 15.1k, False: 671k]
  ------------------
  867|       |    /* Decimal unsigned integer */
  868|  15.1k|    ;
  869|       |
  870|   671k|  else {
  871|       |    /* Decimal integer. */
  872|   671k|    is_neg = (nums < 0);
  873|   671k|    if(is_neg) {
  ------------------
  |  Branch (873:8): [True: 0, False: 671k]
  ------------------
  874|       |      /* signed_num might fail to hold absolute negative minimum by 1 */
  875|      0|      int64_t signed_num; /* Used to convert negative in positive. */
  876|      0|      signed_num = nums + (int64_t)1;
  877|      0|      signed_num = -signed_num;
  878|      0|      num = (uint64_t)signed_num;
  879|      0|      num += (uint64_t)1;
  880|      0|    }
  881|   671k|  }
  882|       |
  883|       |  /* Supply a default precision if none was given. */
  884|   756k|  if(prec == -1)
  ------------------
  |  Branch (884:6): [True: 686k, False: 69.8k]
  ------------------
  885|   686k|    prec = 1;
  886|       |
  887|       |  /* Put the number in WORK. */
  888|   756k|  w = workend;
  889|   756k|  DEBUGASSERT(base <= 16);
  ------------------
  |  | 1027|   756k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (889:3): [True: 0, False: 756k]
  |  Branch (889:3): [True: 756k, False: 0]
  ------------------
  890|   756k|  switch(base) {
  891|   686k|  case 10:
  ------------------
  |  Branch (891:3): [True: 686k, False: 69.9k]
  ------------------
  892|   734k|    while(num > 0) {
  ------------------
  |  Branch (892:11): [True: 48.6k, False: 686k]
  ------------------
  893|  48.6k|      *w-- = (char)('0' + (num % 10));
  894|  48.6k|      num /= 10;
  895|  48.6k|    }
  896|   686k|    break;
  897|  69.9k|  default:
  ------------------
  |  Branch (897:3): [True: 69.9k, False: 686k]
  ------------------
  898|   201k|    while(num > 0) {
  ------------------
  |  Branch (898:11): [True: 131k, False: 69.9k]
  ------------------
  899|   131k|      *w-- = digits[num % base];
  900|   131k|      num /= base;
  901|   131k|    }
  902|  69.9k|    break;
  903|   756k|  }
  904|   756k|  width -= (int)(workend - w);
  905|   756k|  prec -= (int)(workend - w);
  906|       |
  907|   756k|  if(is_alt && base == 8 && prec <= 0) {
  ------------------
  |  Branch (907:6): [True: 0, False: 756k]
  |  Branch (907:16): [True: 0, False: 0]
  |  Branch (907:29): [True: 0, False: 0]
  ------------------
  908|      0|    *w-- = '0';
  909|      0|    --width;
  910|      0|  }
  911|       |
  912|   756k|  if(prec > 0) {
  ------------------
  |  Branch (912:6): [True: 666k, False: 90.0k]
  ------------------
  913|   666k|    width -= prec;
  914|  1.33M|    while(prec-- > 0 && w >= work)
  ------------------
  |  Branch (914:11): [True: 669k, False: 666k]
  |  Branch (914:25): [True: 669k, False: 0]
  ------------------
  915|   669k|      *w-- = '0';
  916|   666k|  }
  917|       |
  918|   756k|  if(is_alt && base == 16)
  ------------------
  |  Branch (918:6): [True: 0, False: 756k]
  |  Branch (918:16): [True: 0, False: 0]
  ------------------
  919|      0|    width -= 2;
  920|       |
  921|   756k|  if(is_neg || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE))
  ------------------
  |  Branch (921:6): [True: 0, False: 756k]
  |  Branch (921:16): [True: 0, False: 756k]
  |  Branch (921:44): [True: 0, False: 756k]
  ------------------
  922|      0|    --width;
  923|       |
  924|   756k|  if(!(flags & FLAGS_LEFT) && !(flags & FLAGS_PAD_NIL)) {
  ------------------
  |  Branch (924:6): [True: 756k, False: 0]
  |  Branch (924:31): [True: 756k, False: 0]
  ------------------
  925|   756k|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (925:8): [True: 0, False: 756k]
  ------------------
  926|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  927|   756k|    width = 0;
  928|   756k|  }
  929|       |
  930|   756k|  if(is_neg)
  ------------------
  |  Branch (930:6): [True: 0, False: 756k]
  ------------------
  931|      0|    OUTCHAR('-');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  932|   756k|  else if(flags & FLAGS_SHOWSIGN)
  ------------------
  |  Branch (932:11): [True: 0, False: 756k]
  ------------------
  933|      0|    OUTCHAR('+');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  934|   756k|  else if(flags & FLAGS_SPACE)
  ------------------
  |  Branch (934:11): [True: 0, False: 756k]
  ------------------
  935|      0|    OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  936|       |
  937|   756k|  if(is_alt && base == 16) {
  ------------------
  |  Branch (937:6): [True: 0, False: 756k]
  |  Branch (937:16): [True: 0, False: 0]
  ------------------
  938|      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;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  939|      0|    if(flags & FLAGS_UPPER)
  ------------------
  |  Branch (939:8): [True: 0, False: 0]
  ------------------
  940|      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;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  941|      0|    else
  942|      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;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  943|      0|  }
  944|       |
  945|   756k|  if(!(flags & FLAGS_LEFT) && (flags & FLAGS_PAD_NIL)) {
  ------------------
  |  Branch (945:6): [True: 756k, False: 0]
  |  Branch (945:31): [True: 0, False: 756k]
  ------------------
  946|      0|    if(stream_pad(userp, stream, streamn, '0', width, donep))
  ------------------
  |  Branch (946:8): [True: 0, False: 0]
  ------------------
  947|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  948|      0|    width = 0;
  949|      0|  }
  950|       |
  951|       |  /* Write the number. */
  952|   756k|  if(stream_run(userp, stream, streamn, (const unsigned char *)w + 1,
  ------------------
  |  Branch (952:6): [True: 0, False: 756k]
  ------------------
  953|   756k|                (size_t)(workend - w), donep))
  954|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  955|       |
  956|   756k|  if(flags & FLAGS_LEFT) {
  ------------------
  |  Branch (956:6): [True: 0, False: 756k]
  ------------------
  957|      0|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (957:8): [True: 0, False: 0]
  ------------------
  958|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  959|      0|  }
  960|       |
  961|   756k|  return FALSE;
  ------------------
  |  | 1000|   756k|#define FALSE false
  ------------------
  962|   756k|}
mprintf.c:stream_pad:
  698|  1.07M|{
  699|  1.07M|  const unsigned char *src;
  700|  1.07M|  if(num <= 0)
  ------------------
  |  Branch (700:6): [True: 1.07M, False: 0]
  ------------------
  701|  1.07M|    return FALSE;
  ------------------
  |  | 1000|  1.07M|#define FALSE false
  ------------------
  702|      0|  if(pad == '0')
  ------------------
  |  Branch (702:6): [True: 0, False: 0]
  ------------------
  703|      0|    src = (const unsigned char *)pad_zeros;
  704|      0|  else
  705|      0|    src = (const unsigned char *)pad_spaces;
  706|      0|  while(num > PAD_RUN) {
  ------------------
  |  |  691|      0|#define PAD_RUN 16 /* strlen() of both of the above */
  ------------------
  |  Branch (706:9): [True: 0, False: 0]
  ------------------
  707|      0|    if(stream_run(userp, stream, streamn, src, PAD_RUN, donep))
  ------------------
  |  |  691|      0|#define PAD_RUN 16 /* strlen() of both of the above */
  ------------------
  |  Branch (707:8): [True: 0, False: 0]
  ------------------
  708|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  709|      0|    num -= PAD_RUN;
  ------------------
  |  |  691|      0|#define PAD_RUN 16 /* strlen() of both of the above */
  ------------------
  710|      0|  }
  711|      0|  return stream_run(userp, stream, streamn, src, (size_t)num, donep);
  712|      0|}
mprintf.c:out_string:
  972|   105k|{
  973|   105k|  int flags = p->flags;
  974|   105k|  int width = p->width;
  975|   105k|  int prec = p->prec;
  976|   105k|  size_t len;
  977|       |
  978|   105k|  if(!str) {
  ------------------
  |  Branch (978:6): [True: 0, False: 105k]
  ------------------
  979|       |    /* Write null string if there is space. */
  980|      0|    if(prec == -1 || prec >= (int)CURL_CSTRLEN(nilstr)) {
  ------------------
  |  | 1244|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  |  Branch (980:8): [True: 0, False: 0]
  |  Branch (980:22): [True: 0, False: 0]
  ------------------
  981|      0|      str = nilstr;
  982|      0|      len = CURL_CSTRLEN(nilstr);
  ------------------
  |  | 1244|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  983|       |      /* Disable quotes around (nil) */
  984|      0|      flags &= ~(unsigned int)FLAGS_ALT;
  985|      0|    }
  986|      0|    else {
  987|      0|      str = "";
  988|      0|      len = 0;
  989|      0|    }
  990|      0|  }
  991|   105k|  else if(prec != -1)
  ------------------
  |  Branch (991:11): [True: 15.5k, False: 89.9k]
  ------------------
  992|  15.5k|    len = (size_t)prec;
  993|  89.9k|  else if(*str == '\0')
  ------------------
  |  Branch (993:11): [True: 45.4k, False: 44.5k]
  ------------------
  994|  45.4k|    len = 0;
  995|  44.5k|  else
  996|  44.5k|    len = strlen(str);
  997|       |
  998|   105k|  width -= (len > INT_MAX) ? INT_MAX : (int)len;
  ------------------
  |  Branch (998:12): [True: 0, False: 105k]
  ------------------
  999|       |
 1000|   105k|  if(flags & FLAGS_ALT)
  ------------------
  |  Branch (1000:6): [True: 0, False: 105k]
  ------------------
 1001|      0|    OUTCHAR('"');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1002|       |
 1003|   105k|  if(!(flags & FLAGS_LEFT)) {
  ------------------
  |  Branch (1003:6): [True: 105k, False: 0]
  ------------------
 1004|   105k|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (1004:8): [True: 0, False: 105k]
  ------------------
 1005|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1006|   105k|    width = 0;
 1007|   105k|  }
 1008|       |
 1009|   105k|  if(stream_zrun(userp, stream, streamn, str, len, donep))
  ------------------
  |  Branch (1009:6): [True: 41, False: 105k]
  ------------------
 1010|     41|    return TRUE;
  ------------------
  |  |  997|     41|#define TRUE true
  ------------------
 1011|   105k|  if(flags & FLAGS_LEFT) {
  ------------------
  |  Branch (1011:6): [True: 0, False: 105k]
  ------------------
 1012|      0|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (1012:8): [True: 0, False: 0]
  ------------------
 1013|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1014|      0|  }
 1015|       |
 1016|   105k|  if(flags & FLAGS_ALT)
  ------------------
  |  Branch (1016:6): [True: 0, False: 105k]
  ------------------
 1017|      0|    OUTCHAR('"');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  997|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1018|       |
 1019|   105k|  return FALSE;
  ------------------
  |  | 1000|   105k|#define FALSE false
  ------------------
 1020|   105k|}
mprintf.c:addbyter:
 1208|   215k|{
 1209|   215k|  struct nsprintf *infop = f;
 1210|   215k|  if(infop->length < infop->max) {
  ------------------
  |  Branch (1210:6): [True: 215k, False: 0]
  ------------------
 1211|       |    /* only do this if we have not reached max length yet */
 1212|   215k|    *infop->buffer++ = (char)outc; /* store */
 1213|   215k|    infop->length++; /* we are now one byte larger */
 1214|   215k|    return 0;     /* fputc() returns like this on success */
 1215|   215k|  }
 1216|      0|  return 1;
 1217|   215k|}
mprintf.c:addrun:
 1221|  1.91M|{
 1222|  1.91M|  struct nsprintf *infop = f;
 1223|  1.91M|  size_t fit = infop->max - infop->length;
 1224|  1.91M|  if(len > fit)
  ------------------
  |  Branch (1224:6): [True: 41, False: 1.91M]
  ------------------
 1225|     41|    len = fit;
 1226|  1.91M|  if(len) {
  ------------------
  |  Branch (1226:6): [True: 1.91M, False: 0]
  ------------------
 1227|  1.91M|    memcpy(infop->buffer, buf, len);
 1228|  1.91M|    infop->buffer += len;
 1229|  1.91M|    infop->length += len;
 1230|  1.91M|  }
 1231|  1.91M|  return len;
 1232|  1.91M|}
mprintf.c:alloc_fits:
 1301|  30.9k|{
 1302|  30.9k|  return (infop->b->leng + infop->nstage + more + 1) <= infop->b->toobig;
 1303|  30.9k|}
mprintf.c:alloc_addrun:
 1325|  28.5k|{
 1326|  28.5k|  struct asprintf *infop = f;
 1327|  28.5k|  size_t accepted = 0;
 1328|  59.4k|  while(accepted < len) {
  ------------------
  |  Branch (1328:9): [True: 30.9k, False: 28.5k]
  ------------------
 1329|  30.9k|    size_t room = sizeof(infop->stage) - infop->nstage;
 1330|  30.9k|    size_t n;
 1331|  30.9k|    if(!room) {
  ------------------
  |  Branch (1331:8): [True: 2.42k, False: 28.5k]
  ------------------
 1332|  2.42k|      if(alloc_flush(infop))
  ------------------
  |  Branch (1332:10): [True: 0, False: 2.42k]
  ------------------
 1333|      0|        return accepted; /* accepted < len aborts formatting */
 1334|  2.42k|      room = sizeof(infop->stage);
 1335|  2.42k|    }
 1336|  30.9k|    n = len - accepted;
 1337|  30.9k|    if(n > room)
  ------------------
  |  Branch (1337:8): [True: 2.42k, False: 28.5k]
  ------------------
 1338|  2.42k|      n = room;
 1339|  30.9k|    if(!alloc_fits(infop, n)) {
  ------------------
  |  Branch (1339:8): [True: 0, False: 30.9k]
  ------------------
 1340|       |      /* Run does not fit the dynbuf size limit. Stage what does, then
 1341|       |         append the first byte that does not on its own, so the limit is
 1342|       |         reported at exactly that byte. */
 1343|      0|      size_t fits = infop->b->toobig - infop->b->leng - infop->nstage - 1;
 1344|      0|      if(fits) {
  ------------------
  |  Branch (1344:10): [True: 0, False: 0]
  ------------------
 1345|      0|        memcpy(&infop->stage[infop->nstage], buf + accepted, fits);
 1346|      0|        infop->nstage += fits;
 1347|      0|        accepted += fits;
 1348|      0|      }
 1349|      0|      if(alloc_flush(infop))
  ------------------
  |  Branch (1349:10): [True: 0, False: 0]
  ------------------
 1350|      0|        return accepted;
 1351|      0|      if(alloc_addn(infop, buf + accepted, 1))
  ------------------
  |  Branch (1351:10): [True: 0, False: 0]
  ------------------
 1352|      0|        return accepted; /* accepted < len aborts formatting */
 1353|      0|      accepted++;
 1354|      0|      continue;
 1355|      0|    }
 1356|  30.9k|    memcpy(&infop->stage[infop->nstage], buf + accepted, n);
 1357|  30.9k|    infop->nstage += n;
 1358|  30.9k|    accepted += n;
 1359|  30.9k|  }
 1360|  28.5k|  return accepted;
 1361|  28.5k|}
mprintf.c:alloc_flush:
 1272|  10.0k|{
 1273|  10.0k|  struct asprintf *infop = f;
 1274|  10.0k|  if(infop->nstage) {
  ------------------
  |  Branch (1274:6): [True: 10.0k, False: 0]
  ------------------
 1275|  10.0k|    CURLcode result = curlx_dyn_addn(infop->b, infop->stage, infop->nstage);
 1276|  10.0k|    infop->nstage = 0;
 1277|  10.0k|    if(result) {
  ------------------
  |  Branch (1277:8): [True: 0, False: 10.0k]
  ------------------
 1278|      0|      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|      0|#define MERR_MEM       1
  ------------------
  |  Branch (1278:21): [True: 0, False: 0]
  ------------------
 1279|      0|      return 1; /* fail */
 1280|      0|    }
 1281|  10.0k|  }
 1282|  10.0k|  return 0;
 1283|  10.0k|}

Curl_multi_handle:
  231|  3.74k|{
  232|  3.74k|  struct Curl_multi *multi = curlx_calloc(1, sizeof(struct Curl_multi));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  233|       |
  234|  3.74k|  if(!multi)
  ------------------
  |  Branch (234:6): [True: 0, False: 3.74k]
  ------------------
  235|      0|    return NULL;
  236|       |
  237|  3.74k|  multi->magic = CURLMULTI_MAGIC_NUMBER;
  ------------------
  |  |   41|  3.74k|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  ------------------
  238|       |
  239|       |  /* Initialisation order is important here!
  240|       |   * easy_init() does a lazy check on curl_global_init() which sets
  241|       |   * up platform specific things we need. For example calling curlx_pnow()
  242|       |   * before this is not safe. */
  243|  3.74k|  multi->admin = curl_easy_init();
  244|  3.74k|  if(!multi->admin) {
  ------------------
  |  Branch (244:6): [True: 0, False: 3.74k]
  ------------------
  245|      0|    curlx_free(multi);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  246|      0|    return NULL;
  247|      0|  }
  248|  3.74k|  multi->admin->multi = multi;
  249|  3.74k|  multi->admin->state.internal = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  250|       |
  251|       |  /* Now we can use curlx_* things safely */
  252|  3.74k|  curlx_pnow(&multi->now);
  253|  3.74k|  Curl_timeouts_init(&multi->timeouts, &multi->now);
  254|  3.74k|  multi_timeouts_init(multi->admin);
  255|       |
  256|  3.74k|  Curl_dnscache_init(&multi->dnscache, dnssize);
  257|  3.74k|  Curl_mntfy_init(multi);
  258|  3.74k|  Curl_multi_ev_init(multi, ev_hashsize);
  259|  3.74k|  Curl_uint32_tbl_init(&multi->xfers);
  260|  3.74k|  Curl_uint32_bset_init(&multi->process);
  261|  3.74k|  Curl_uint32_bset_init(&multi->dirty);
  262|  3.74k|  Curl_uint32_bset_init(&multi->pending);
  263|  3.74k|  Curl_uint32_bset_init(&multi->msgsent);
  264|  3.74k|  Curl_hash_init(&multi->proto_hash, 23, CURL_HASH_TYPE_BYTES, ph_freeentry);
  265|  3.74k|  Curl_cshutdn_init(&multi->cshutdn);
  266|       |
  267|  3.74k|  multi->multiplexing = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  268|  3.74k|  multi->max_concurrent_streams = 100;
  269|  3.74k|#ifdef ENABLE_WAKEUP
  270|  3.74k|  multi->wakeup_pair[0] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.74k|#define CURL_SOCKET_BAD (-1)
  ------------------
  271|  3.74k|  multi->wakeup_pair[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.74k|#define CURL_SOCKET_BAD (-1)
  ------------------
  272|  3.74k|#endif
  273|  3.74k|#ifdef ENABLE_INTERNAL_WAKEUP
  274|  3.74k|  multi->wakeup_internal[0] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.74k|#define CURL_SOCKET_BAD (-1)
  ------------------
  275|  3.74k|  multi->wakeup_internal[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  3.74k|#define CURL_SOCKET_BAD (-1)
  ------------------
  276|  3.74k|#endif
  277|       |
  278|  3.74k|  if(Curl_uint32_bset_resize(&multi->process, xfer_table_size) ||
  ------------------
  |  Branch (278:6): [True: 0, False: 3.74k]
  ------------------
  279|  3.74k|     Curl_uint32_bset_resize(&multi->pending, xfer_table_size) ||
  ------------------
  |  Branch (279:6): [True: 0, False: 3.74k]
  ------------------
  280|  3.74k|     Curl_uint32_bset_resize(&multi->dirty, xfer_table_size) ||
  ------------------
  |  Branch (280:6): [True: 0, False: 3.74k]
  ------------------
  281|  3.74k|     Curl_uint32_bset_resize(&multi->msgsent, xfer_table_size) ||
  ------------------
  |  Branch (281:6): [True: 0, False: 3.74k]
  ------------------
  282|  3.74k|     Curl_uint32_tbl_resize(&multi->xfers, xfer_table_size))
  ------------------
  |  Branch (282:6): [True: 0, False: 3.74k]
  ------------------
  283|      0|    goto error;
  284|       |
  285|  3.74k|#ifdef DEBUGBUILD
  286|  3.74k|  if(getenv("CURL_DEBUG"))
  ------------------
  |  Branch (286:6): [True: 0, False: 3.74k]
  ------------------
  287|      0|    multi->admin->set.verbose = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  288|  3.74k|#endif
  289|  3.74k|  Curl_uint32_tbl_add(&multi->xfers, multi->admin, &multi->admin->mid);
  290|  3.74k|  Curl_uint32_bset_add(&multi->process, multi->admin->mid);
  291|       |
  292|  3.74k|  Curl_cpool_init(&multi->cpool, NULL, chashsize);
  293|       |
  294|  3.74k|#ifdef USE_SSL
  295|  3.74k|  if(Curl_ssl_scache_create(sesssize, 2, &multi->ssl_scache))
  ------------------
  |  Branch (295:6): [True: 0, False: 3.74k]
  ------------------
  296|      0|    goto error;
  297|       |#else
  298|       |  (void)sesssize;
  299|       |#endif
  300|       |
  301|       |#ifdef USE_WINSOCK
  302|       |  multi->wsa_event = WSACreateEvent();
  303|       |  if(multi->wsa_event == WSA_INVALID_EVENT)
  304|       |    goto error;
  305|       |#endif
  306|  3.74k|#ifdef ENABLE_WAKEUP
  307|       |  /* When enabled, rely on this to work. We ignore this in previous
  308|       |   * versions, but that seems an unnecessary complication. */
  309|  3.74k|  if(Curl_wakeup_init(multi->wakeup_pair, TRUE) < 0)
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  |  Branch (309:6): [True: 0, False: 3.74k]
  ------------------
  310|      0|    goto error;
  311|  3.74k|#endif
  312|  3.74k|#ifdef ENABLE_INTERNAL_WAKEUP
  313|  3.74k|  if(Curl_wakeup_init(multi->wakeup_internal, TRUE) < 0)
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  |  Branch (313:6): [True: 0, False: 3.74k]
  ------------------
  314|      0|    goto error;
  315|  3.74k|#endif
  316|       |
  317|  3.74k|  if(Curl_probeipv6(multi))
  ------------------
  |  Branch (317:6): [True: 0, False: 3.74k]
  ------------------
  318|      0|    goto error;
  319|       |
  320|  3.74k|#ifdef USE_RESOLV_THREADED
  321|  3.74k|  if(xfer_table_size < CURL_XFER_TABLE_SIZE) { /* easy multi */
  ------------------
  |  |   52|  3.74k|#define CURL_XFER_TABLE_SIZE 128
  ------------------
  |  Branch (321:6): [True: 0, False: 3.74k]
  ------------------
  322|      0|    if(Curl_async_thrdd_multi_init(multi, 0, 2, 10))
  ------------------
  |  Branch (322:8): [True: 0, False: 0]
  ------------------
  323|      0|      goto error;
  324|      0|  }
  325|  3.74k|  else { /* real multi handle */
  326|  3.74k|    if(Curl_async_thrdd_multi_init(multi, 0, 20, 2000))
  ------------------
  |  Branch (326:8): [True: 0, False: 3.74k]
  ------------------
  327|      0|      goto error;
  328|  3.74k|  }
  329|  3.74k|#endif
  330|       |
  331|  3.74k|  return multi;
  332|       |
  333|      0|error:
  334|       |
  335|      0|#ifdef USE_RESOLV_THREADED
  336|      0|  Curl_async_thrdd_multi_destroy(multi, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  337|      0|#endif
  338|      0|  Curl_multi_ev_cleanup(multi);
  339|      0|  Curl_hash_destroy(&multi->proto_hash);
  340|      0|  Curl_dnscache_destroy(&multi->dnscache);
  341|      0|  Curl_cpool_destroy(&multi->cpool, multi->admin);
  342|      0|  Curl_cshutdn_destroy(&multi->cshutdn, multi->admin);
  343|      0|#ifdef USE_SSL
  344|      0|  Curl_ssl_scache_destroy(multi->ssl_scache);
  345|      0|#endif
  346|      0|  if(multi->admin) {
  ------------------
  |  Branch (346:6): [True: 0, False: 0]
  ------------------
  347|      0|    Curl_multi_ev_xfer_done(multi, multi->admin);
  348|      0|    multi->admin->multi = NULL;
  349|      0|    Curl_close(&multi->admin);
  350|      0|  }
  351|      0|  Curl_mntfy_cleanup(multi);
  352|       |
  353|      0|  Curl_uint32_bset_destroy(&multi->process);
  354|      0|  Curl_uint32_bset_destroy(&multi->dirty);
  355|      0|  Curl_uint32_bset_destroy(&multi->pending);
  356|      0|  Curl_uint32_bset_destroy(&multi->msgsent);
  357|      0|  Curl_uint32_tbl_destroy(&multi->xfers);
  358|      0|#ifdef ENABLE_WAKEUP
  359|      0|  Curl_wakeup_destroy(multi->wakeup_pair);
  360|      0|#endif
  361|      0|#ifdef ENABLE_INTERNAL_WAKEUP
  362|      0|  Curl_wakeup_destroy(multi->wakeup_internal);
  363|      0|#endif
  364|       |
  365|      0|  curlx_free(multi);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  366|       |  return NULL;
  367|  3.74k|}
curl_multi_init:
  370|  3.74k|{
  371|  3.74k|  return Curl_multi_handle(CURL_XFER_TABLE_SIZE,
  ------------------
  |  |   52|  3.74k|#define CURL_XFER_TABLE_SIZE 128
  ------------------
  372|  3.74k|                           CURL_SOCKET_HASH_TABLE_SIZE,
  ------------------
  |  |   58|  3.74k|#define CURL_SOCKET_HASH_TABLE_SIZE 911
  ------------------
  373|  3.74k|                           CURL_CONNECTION_HASH_SIZE,
  ------------------
  |  |   62|  3.74k|#define CURL_CONNECTION_HASH_SIZE 97
  ------------------
  374|  3.74k|                           CURL_DNS_HASH_SIZE,
  ------------------
  |  |   66|  3.74k|#define CURL_DNS_HASH_SIZE 71
  ------------------
  375|  3.74k|                           CURL_TLS_SESSION_SIZE);
  ------------------
  |  |   70|  3.74k|#define CURL_TLS_SESSION_SIZE 25
  ------------------
  376|  3.74k|}
Curl_is_connecting:
  393|  35.9k|{
  394|  35.9k|  return data->mstate < MSTATE_DO;
  395|  35.9k|}
Curl_multi_add_handle:
  464|  3.74k|{
  465|  3.74k|  CURLMcode mresult;
  466|       |
  467|       |  /* Prevent users from adding same easy handle more than once and prevent
  468|       |     adding to more than one multi stack */
  469|  3.74k|  if(data->multi)
  ------------------
  |  Branch (469:6): [True: 0, False: 3.74k]
  ------------------
  470|      0|    return CURLM_ADDED_ALREADY;
  471|       |
  472|  3.74k|  if(multi->dead) {
  ------------------
  |  Branch (472:6): [True: 0, False: 3.74k]
  ------------------
  473|       |    /* a "dead" handle cannot get added transfers while any existing easy
  474|       |       handles are still alive - but if there are none alive anymore, it is
  475|       |       fine to start over and unmark the "deadness" of this handle.
  476|       |       This means only the admin handle MUST be present. */
  477|      0|    if((Curl_uint32_tbl_count(&multi->xfers) != 1) ||
  ------------------
  |  Branch (477:8): [True: 0, False: 0]
  ------------------
  478|      0|       !Curl_uint32_tbl_contains(&multi->xfers, 0))
  ------------------
  |  Branch (478:8): [True: 0, False: 0]
  ------------------
  479|      0|      return CURLM_ABORTED_BY_CALLBACK;
  480|      0|    multi->dead = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  481|      0|    Curl_uint32_bset_clear(&multi->process);
  482|      0|    Curl_uint32_bset_clear(&multi->dirty);
  483|      0|    Curl_uint32_bset_clear(&multi->pending);
  484|      0|    Curl_uint32_bset_clear(&multi->msgsent);
  485|      0|  }
  486|       |
  487|  3.74k|  if(data->multi_easy) {
  ------------------
  |  Branch (487:6): [True: 0, False: 3.74k]
  ------------------
  488|       |    /* if this easy handle was previously used for curl_easy_perform(), there
  489|       |       is a private multi handle here that we can kill */
  490|      0|    curl_multi_cleanup(data->multi_easy);
  491|      0|    data->multi_easy = NULL;
  492|      0|  }
  493|       |
  494|       |  /* Insert the easy into the multi->xfers table, assigning it a `mid`. */
  495|  3.74k|  if(multi_xfers_add(multi, data))
  ------------------
  |  Branch (495:6): [True: 0, False: 3.74k]
  ------------------
  496|      0|    return CURLM_OUT_OF_MEMORY;
  497|       |
  498|       |  /* Initialize timeouts for this handle */
  499|  3.74k|  multi_timeouts_init(data);
  500|       |
  501|       |  /*
  502|       |   * No failure allowed in this function beyond this point. No modification
  503|       |   * of easy nor multi handle allowed before this except for potential
  504|       |   * multi's connection pool growing which will not be undone in this
  505|       |   * function no matter what.
  506|       |   */
  507|  3.74k|  if(data->set.errorbuffer)
  ------------------
  |  Branch (507:6): [True: 0, False: 3.74k]
  ------------------
  508|      0|    data->set.errorbuffer[0] = 0;
  509|       |
  510|  3.74k|  data->state.os_errno = 0;
  511|       |
  512|       |  /* make the Curl_easy refer back to this multi handle - before
  513|       |     Curl_expire() is called. */
  514|  3.74k|  data->multi = multi;
  515|       |
  516|       |  /* set the easy handle */
  517|  3.74k|  multistate(data, MSTATE_INIT);
  ------------------
  |  |  198|  3.74k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
  518|       |  /* not yet passed INIT state */
  519|  3.74k|  data->state.really_alive = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  520|       |
  521|       |#ifdef USE_LIBPSL
  522|       |  /* Do the same for PSL. */
  523|       |  if(data->share && (data->share->specifier & (1 << CURL_LOCK_DATA_PSL)))
  524|       |    data->psl = &data->share->psl;
  525|       |  else
  526|       |    data->psl = &multi->psl;
  527|       |#endif
  528|       |
  529|       |  /* add the easy handle to the process set */
  530|  3.74k|  Curl_uint32_bset_add(&multi->process, data->mid);
  531|  3.74k|  ++multi->xfers_alive;
  532|  3.74k|  ++multi->xfers_total_ever;
  533|       |
  534|  3.74k|  Curl_cpool_xfer_init(data);
  535|  3.74k|  multi_warn_debug(multi, data);
  536|       |
  537|       |  /* Make sure the new handle will run */
  538|  3.74k|  Curl_multi_mark_dirty(data);
  539|       |
  540|       |  /* Necessary in event based processing, where dirty handles trigger
  541|       |   * a timeout callback invocation. */
  542|  3.74k|  mresult = Curl_update_timer(multi);
  543|  3.74k|  if(mresult) {
  ------------------
  |  Branch (543:6): [True: 0, False: 3.74k]
  ------------------
  544|      0|    data->multi = NULL; /* not anymore */
  545|      0|    Curl_uint32_tbl_remove(&multi->xfers, data->mid);
  546|      0|    data->mid = UINT32_MAX;
  547|      0|    return mresult;
  548|      0|  }
  549|       |
  550|       |  /* The admin handle only ever has default timeouts set. To improve the
  551|       |     state somewhat we clone the timeouts from each added handle so that the
  552|       |     admin handle always has the same timeouts as the most recently added
  553|       |     easy handle. */
  554|  3.74k|  multi->admin->set.timeout = data->set.timeout;
  555|  3.74k|  multi->admin->set.server_response_timeout =
  556|  3.74k|    data->set.server_response_timeout;
  557|  3.74k|  multi->admin->set.no_signal = data->set.no_signal;
  558|       |
  559|  3.74k|  CURL_TRC_M(data, "added to multi, mid=%u, running=%u, total=%u",
  ------------------
  |  |  148|  3.74k|  do {                                   \
  |  |  149|  3.74k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.74k|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.74k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.74k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  560|  3.74k|             data->mid, multi_xfers_running(multi),
  561|  3.74k|             Curl_uint32_tbl_count(&multi->xfers));
  562|  3.74k|  return CURLM_OK;
  563|  3.74k|}
curl_multi_add_handle:
  566|  3.74k|{
  567|  3.74k|  struct Curl_mapi_guard guard;
  568|  3.74k|  CURLMcode mresult;
  569|       |
  570|  3.74k|  if(CURL_MAPI_ENTER(&guard, m, multi_add_handle, &mresult)) {
  ------------------
  |  |  190|  3.74k|  Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 3.74k, False: 0]
  |  |  |  Branch (190:56): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
  571|  3.74k|    struct Curl_easy *data = curl;
  572|       |    /* Verify that we got a somewhat good easy handle too */
  573|  3.74k|    if(!GOOD_EASY_HANDLE(data))
  ------------------
  |  |   34|  3.74k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  3.74k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  997|  3.74k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 3.74k, False: 0]
  |  |  |  Branch (34:12): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   35|  3.74k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1000|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (573:8): [True: 0, False: 3.74k]
  |  Branch (573:9): [True: 0, False: 0]
  |  Branch (573:9): [True: 0, False: 0]
  ------------------
  574|      0|      mresult = CURLM_BAD_EASY_HANDLE;
  575|  3.74k|    else
  576|  3.74k|      mresult = Curl_multi_add_handle(m, data);
  577|  3.74k|  }
  578|  3.74k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  3.74k|  Curl_mapi_leave(g)
  ------------------
  579|  3.74k|  return mresult;
  580|  3.74k|}
Curl_multi_remove_handle:
  762|  3.74k|{
  763|  3.74k|  CURLMcode mresult;
  764|  3.74k|  bool premature;
  765|  3.74k|  uint32_t mid;
  766|       |
  767|       |  /* Prevent users from trying to remove same easy handle more than once */
  768|  3.74k|  if(!data->multi)
  ------------------
  |  Branch (768:6): [True: 0, False: 3.74k]
  ------------------
  769|      0|    return CURLM_OK; /* it is already removed so let's say it is fine! */
  770|       |
  771|       |  /* Prevent users from trying to remove an easy handle from the wrong multi */
  772|  3.74k|  if(data->multi != multi)
  ------------------
  |  Branch (772:6): [True: 0, False: 3.74k]
  ------------------
  773|      0|    return CURLM_BAD_EASY_HANDLE;
  774|       |
  775|  3.74k|  if(data->mid == UINT32_MAX) {
  ------------------
  |  Branch (775:6): [True: 0, False: 3.74k]
  ------------------
  776|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (776:5): [Folded, False: 0]
  |  Branch (776:5): [Folded, False: 0]
  ------------------
  777|      0|    return CURLM_INTERNAL_ERROR;
  778|      0|  }
  779|  3.74k|  if(Curl_uint32_tbl_get(&multi->xfers, data->mid) != data) {
  ------------------
  |  Branch (779:6): [True: 0, False: 3.74k]
  ------------------
  780|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (780:5): [Folded, False: 0]
  |  Branch (780:5): [Folded, False: 0]
  ------------------
  781|      0|    return CURLM_INTERNAL_ERROR;
  782|      0|  }
  783|       |
  784|  3.74k|  premature = (data->mstate < MSTATE_COMPLETED);
  785|       |
  786|  3.74k|  if(data->conn) {
  ------------------
  |  Branch (786:6): [True: 0, False: 3.74k]
  ------------------
  787|       |    /* If the 'state' is not INIT or COMPLETED, we might need to do something
  788|       |       nice to put the easy_handle in a good known state when this returns. */
  789|      0|    if(premature && (data->mstate > MSTATE_DO))
  ------------------
  |  Branch (789:8): [True: 0, False: 0]
  |  Branch (789:21): [True: 0, False: 0]
  ------------------
  790|      0|      streamclose(data->conn);
  ------------------
  |  |   68|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   64|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
  791|       |
  792|       |    /* multi_done() clears the association between the easy handle and the
  793|       |       connection.
  794|       |       Note that this ignores the return code because there is
  795|       |       nothing really useful to do with it anyway! */
  796|      0|    (void)multi_done(data, data->result, premature);
  797|      0|  }
  798|       |
  799|       |  /* The timer must be shut down before data->multi is set to NULL, else
  800|       |     data's splaynode would remain in the splay tree after curl_easy_cleanup is
  801|       |     called. Do it after multi_done() in case that sets another time! */
  802|  3.74k|  Curl_expire_clear_all(data);
  803|       |
  804|       |  /* In MSGSENT, it was deducted from `multi->xfers_alive` already. */
  805|  3.74k|  if(data->mstate != MSTATE_MSGSENT)
  ------------------
  |  Branch (805:6): [True: 0, False: 3.74k]
  ------------------
  806|      0|    --multi->xfers_alive;
  807|       |
  808|  3.74k|  if(data->state.really_alive) {
  ------------------
  |  Branch (808:6): [True: 0, False: 3.74k]
  ------------------
  809|      0|    data->state.really_alive = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  810|      0|    --multi->xfers_really_alive;
  811|      0|    if(!multi->xfers_really_alive)
  ------------------
  |  Branch (811:8): [True: 0, False: 0]
  ------------------
  812|      0|      (void)multi_assess_wakeup(multi);
  813|      0|  }
  814|       |
  815|  3.74k|  Curl_wildcard_dtor(&data->wildcard);
  816|       |
  817|  3.74k|  data->mstate = MSTATE_COMPLETED;
  818|       |
  819|       |  /* Remove the association between the connection and the handle */
  820|  3.74k|  Curl_detach_connection(data);
  821|       |
  822|       |  /* Tell event handling that this transfer is definitely going away */
  823|  3.74k|  Curl_multi_ev_xfer_done(multi, data);
  824|       |
  825|  3.74k|  if(data->set.connect_only) {
  ------------------
  |  Branch (825:6): [True: 0, False: 3.74k]
  ------------------
  826|      0|    if(data->multi_easy) {
  ------------------
  |  Branch (826:8): [True: 0, False: 0]
  ------------------
  827|      0|      if(data->state.lastconnect_id != -1) {
  ------------------
  |  Branch (827:10): [True: 0, False: 0]
  ------------------
  828|       |        /* Mark any connect-only connection for closure */
  829|      0|        struct connectdata *conn;
  830|      0|        (void)Curl_getconnectinfo(data, &conn);
  831|      0|        if(conn && conn->bits.connect_only)
  ------------------
  |  Branch (831:12): [True: 0, False: 0]
  |  Branch (831:20): [True: 0, False: 0]
  ------------------
  832|      0|          connclose(conn);
  ------------------
  |  |   69|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   63|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  833|      0|      }
  834|      0|    }
  835|      0|    else {
  836|       |      /* This removes a handle that was part the multi interface that used
  837|       |         CONNECT_ONLY, that connection is now left alive but since this handle
  838|       |         has bits.close set nothing can use that connection anymore and it is
  839|       |         forbidden from reuse. This easy handle cannot find the connection
  840|       |         anymore once removed from the multi handle
  841|       |
  842|       |         Better close the connection here, at once. */
  843|      0|      struct connectdata *conn;
  844|      0|      (void)Curl_getconnectinfo(data, &conn);
  845|      0|      if(conn)
  ------------------
  |  Branch (845:10): [True: 0, False: 0]
  ------------------
  846|      0|        Curl_conn_close(data, conn, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  847|      0|    }
  848|      0|  }
  849|       |
  850|       |#ifdef USE_LIBPSL
  851|       |  /* Remove the PSL association. */
  852|       |  if(data->psl == &multi->psl)
  853|       |    data->psl = NULL;
  854|       |#endif
  855|       |
  856|       |  /* clear the association to this multi handle */
  857|  3.74k|  mid = data->mid;
  858|  3.74k|  DEBUGASSERT(Curl_uint32_tbl_contains(&multi->xfers, mid));
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (858:3): [True: 0, False: 3.74k]
  |  Branch (858:3): [True: 3.74k, False: 0]
  ------------------
  859|  3.74k|  Curl_uint32_tbl_remove(&multi->xfers, mid);
  860|  3.74k|  Curl_uint32_bset_remove(&multi->process, mid);
  861|  3.74k|  Curl_uint32_bset_remove(&multi->dirty, mid);
  862|  3.74k|  Curl_uint32_bset_remove(&multi->pending, mid);
  863|  3.74k|  Curl_uint32_bset_remove(&multi->msgsent, mid);
  864|  3.74k|  data->multi = NULL;
  865|  3.74k|  data->mid = UINT32_MAX;
  866|  3.74k|  data->master_mid = UINT32_MAX;
  867|       |
  868|       |  /* A pending transfer *might* be able to run now. */
  869|  3.74k|  multi_schedule_pending(multi);
  870|  3.74k|  mresult = Curl_update_timer(multi);
  871|  3.74k|  if(mresult)
  ------------------
  |  Branch (871:6): [True: 0, False: 3.74k]
  ------------------
  872|      0|    return mresult;
  873|       |
  874|  3.74k|  mresult = multi_assess_wakeup(multi);
  875|  3.74k|  if(mresult) {
  ------------------
  |  Branch (875:6): [True: 0, False: 3.74k]
  ------------------
  876|      0|    failf(data, "error enabling wakeup listening: %d", mresult);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  877|      0|    return mresult;
  878|      0|  }
  879|       |
  880|  3.74k|  CURL_TRC_M(data, "removed from multi, mid=%u, running=%u, total=%u",
  ------------------
  |  |  148|  3.74k|  do {                                   \
  |  |  149|  3.74k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.74k|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.74k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.74k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  881|  3.74k|             mid, multi_xfers_running(multi),
  882|  3.74k|             Curl_uint32_tbl_count(&multi->xfers));
  883|  3.74k|  return CURLM_OK;
  884|  3.74k|}
curl_multi_remove_handle:
  887|  3.74k|{
  888|  3.74k|  struct Curl_mapi_guard guard;
  889|  3.74k|  CURLMcode mresult;
  890|       |
  891|  3.74k|  if(CURL_MAPI_ENTER(&guard, m, multi_remove_handle, &mresult)) {
  ------------------
  |  |  190|  3.74k|  Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 3.74k, False: 0]
  |  |  |  Branch (190:56): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
  892|  3.74k|    struct Curl_easy *data = curl;
  893|  3.74k|    if(!GOOD_EASY_HANDLE(data))
  ------------------
  |  |   34|  3.74k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  3.74k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  997|  3.74k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 3.74k, False: 0]
  |  |  |  Branch (34:12): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   35|  3.74k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1000|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (893:8): [True: 0, False: 3.74k]
  |  Branch (893:9): [True: 0, False: 0]
  |  Branch (893:9): [True: 0, False: 0]
  ------------------
  894|      0|      mresult = CURLM_BAD_EASY_HANDLE;
  895|  3.74k|    else
  896|  3.74k|      mresult = Curl_multi_remove_handle(m, data);
  897|  3.74k|  }
  898|  3.74k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  3.74k|  Curl_mapi_leave(g)
  ------------------
  899|  3.74k|  return mresult;
  900|  3.74k|}
Curl_detach_connection:
  915|  24.0k|{
  916|  24.0k|  struct connectdata *conn = data->conn;
  917|  24.0k|  if(conn) {
  ------------------
  |  Branch (917:6): [True: 9.12k, False: 14.9k]
  ------------------
  918|       |    /* this should never happen, prevent underflow */
  919|  9.12k|    DEBUGASSERT(conn->attached_xfers);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (919:5): [True: 0, False: 9.12k]
  |  Branch (919:5): [True: 9.12k, False: 0]
  ------------------
  920|  9.12k|    if(conn->attached_xfers) {
  ------------------
  |  Branch (920:8): [True: 9.12k, False: 0]
  ------------------
  921|  9.12k|      conn->attached_xfers--;
  922|  9.12k|      if(!conn->attached_xfers)
  ------------------
  |  Branch (922:10): [True: 9.12k, False: 0]
  ------------------
  923|  9.12k|        conn->attached_multi = NULL;
  924|  9.12k|    }
  925|  9.12k|  }
  926|  24.0k|  data->conn = NULL;
  927|  24.0k|}
Curl_attach_connection:
  939|  9.12k|{
  940|  9.12k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (940:3): [True: 0, False: 9.12k]
  |  Branch (940:3): [True: 9.12k, False: 0]
  ------------------
  941|  9.12k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (941:3): [True: 0, False: 9.12k]
  |  Branch (941:3): [True: 9.12k, False: 0]
  ------------------
  942|  9.12k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (942:3): [True: 0, False: 9.12k]
  |  Branch (942:3): [True: 9.12k, False: 0]
  ------------------
  943|  9.12k|  DEBUGASSERT(conn->attached_xfers < UINT32_MAX);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (943:3): [True: 0, False: 9.12k]
  |  Branch (943:3): [True: 9.12k, False: 0]
  ------------------
  944|  9.12k|  data->conn = conn;
  945|  9.12k|  if(matched)
  ------------------
  |  Branch (945:6): [True: 3.04k, False: 6.08k]
  ------------------
  946|  3.04k|    data->state.lastconnect_id = conn->connection_id;
  947|  6.08k|  else
  948|  9.12k|    DEBUGASSERT(!data->mid); /* admin handle */
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (948:5): [True: 0, False: 6.08k]
  |  Branch (948:5): [True: 6.08k, False: 0]
  ------------------
  949|  9.12k|  conn->attached_xfers++;
  950|       |  /* all attached transfers must be from the same multi */
  951|  9.12k|  if(!conn->attached_multi)
  ------------------
  |  Branch (951:6): [True: 9.12k, False: 0]
  ------------------
  952|  9.12k|    conn->attached_multi = data->multi;
  953|  9.12k|  DEBUGASSERT(conn->attached_multi == data->multi);
  ------------------
  |  | 1027|  9.12k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (953:3): [True: 0, False: 9.12k]
  |  Branch (953:3): [True: 9.12k, False: 0]
  ------------------
  954|       |
  955|  9.12k|  if(conn->scheme && conn->scheme->run->attach)
  ------------------
  |  Branch (955:6): [True: 9.12k, False: 0]
  |  Branch (955:22): [True: 0, False: 9.12k]
  ------------------
  956|      0|    conn->scheme->run->attach(data, conn);
  957|  9.12k|}
Curl_multi_connchanged:
 1742|  3.04k|{
 1743|       |  multi->recheckstate = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1744|  3.04k|}
curl_multi_perform:
 2968|  3.74k|{
 2969|  3.74k|  struct Curl_mapi_guard guard;
 2970|  3.74k|  CURLMcode mresult;
 2971|       |
 2972|  3.74k|  if(CURL_MAPI_ENTER(&guard, m, multi_perform, &mresult)) {
  ------------------
  |  |  190|  3.74k|  Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 3.74k, False: 0]
  |  |  |  Branch (190:56): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 2973|  3.74k|    mresult = multi_perform(m, running_handles);
 2974|  3.74k|  }
 2975|  3.74k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  3.74k|  Curl_mapi_leave(g)
  ------------------
 2976|  3.74k|  return mresult;
 2977|  3.74k|}
curl_multi_cleanup:
 2980|  3.74k|{
 2981|  3.74k|  struct Curl_mapi_guard guard;
 2982|  3.74k|  CURLMcode mresult;
 2983|       |
 2984|  3.74k|  if(CURL_MAPI_ENTER(&guard, m, multi_cleanup, &mresult)) {
  ------------------
  |  |  190|  3.74k|  Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 3.74k, False: 0]
  |  |  |  Branch (190:56): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 2985|  3.74k|    struct Curl_multi *multi = m;
 2986|  3.74k|    void *entry;
 2987|  3.74k|    uint32_t mid;
 2988|       |
 2989|       |    /* First remove all remaining easy handles,
 2990|       |     * close internal ones. admin handle is special */
 2991|  3.74k|    if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) {
  ------------------
  |  Branch (2991:8): [True: 3.74k, False: 0]
  ------------------
 2992|  3.74k|      do {
 2993|  3.74k|        struct Curl_easy *data = entry;
 2994|  3.74k|        if(!GOOD_EASY_HANDLE(data)) {
  ------------------
  |  |   34|  3.74k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  3.74k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  997|  3.74k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 3.74k, False: 0]
  |  |  |  Branch (34:12): [True: 3.74k, False: 0]
  |  |  ------------------
  |  |   35|  3.74k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1000|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (2994:12): [True: 0, False: 3.74k]
  |  Branch (2994:13): [True: 0, False: 0]
  |  Branch (2994:13): [True: 0, False: 0]
  ------------------
 2995|      0|          mresult = CURLM_BAD_HANDLE;
 2996|      0|          goto out;
 2997|      0|        }
 2998|       |
 2999|  3.74k|#ifdef DEBUGBUILD
 3000|  3.74k|        if(mid != data->mid) {
  ------------------
  |  Branch (3000:12): [True: 0, False: 3.74k]
  ------------------
 3001|      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]
  |  |  ------------------
  ------------------
 3002|      0|                     "but unexpected data->mid=%u\n", mid, data->mid);
 3003|      0|          DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3003:11): [Folded, False: 0]
  |  Branch (3003:11): [Folded, False: 0]
  ------------------
 3004|      0|        }
 3005|  3.74k|#endif
 3006|       |
 3007|  3.74k|        if(data == multi->admin)
  ------------------
  |  Branch (3007:12): [True: 3.74k, False: 0]
  ------------------
 3008|  3.74k|          continue;
 3009|       |
 3010|      0|        if(!data->state.done && data->conn)
  ------------------
  |  Branch (3010:12): [True: 0, False: 0]
  |  Branch (3010:33): [True: 0, False: 0]
  ------------------
 3011|       |          /* if DONE was never called for this handle */
 3012|      0|          (void)multi_done(data, CURLE_OK, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 3013|       |
 3014|      0|        data->multi = NULL; /* clear the association */
 3015|      0|        Curl_uint32_tbl_remove(&multi->xfers, mid);
 3016|      0|        data->mid = UINT32_MAX;
 3017|       |
 3018|       |#ifdef USE_LIBPSL
 3019|       |        if(data->psl == &multi->psl)
 3020|       |          data->psl = NULL;
 3021|       |#endif
 3022|      0|        if(data->state.internal)
  ------------------
  |  Branch (3022:12): [True: 0, False: 0]
  ------------------
 3023|      0|          Curl_close(&data);
 3024|  3.74k|      } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry));
  ------------------
  |  Branch (3024:15): [True: 0, False: 3.74k]
  ------------------
 3025|  3.74k|    }
 3026|       |
 3027|  3.74k|#ifdef USE_RESOLV_THREADED
 3028|  3.74k|    Curl_async_thrdd_multi_destroy(multi, !multi->quick_exit);
 3029|  3.74k|#endif
 3030|  3.74k|    Curl_cpool_destroy(&multi->cpool, multi->admin);
 3031|  3.74k|    Curl_cshutdn_destroy(&multi->cshutdn, multi->admin);
 3032|  3.74k|    if(multi->admin) {
  ------------------
  |  Branch (3032:8): [True: 3.74k, False: 0]
  ------------------
 3033|  3.74k|      CURL_TRC_M(multi->admin, "multi_cleanup, closing admin handle, done");
  ------------------
  |  |  148|  3.74k|  do {                                   \
  |  |  149|  3.74k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.74k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
 3034|  3.74k|      multi->admin->multi = NULL;
 3035|  3.74k|      Curl_uint32_tbl_remove(&multi->xfers, multi->admin->mid);
 3036|  3.74k|      Curl_close(&multi->admin);
 3037|  3.74k|    }
 3038|       |
 3039|  3.74k|    multi->magic = 0; /* not good anymore */
 3040|       |
 3041|  3.74k|    Curl_multi_ev_cleanup(multi);
 3042|  3.74k|    Curl_hash_destroy(&multi->proto_hash);
 3043|  3.74k|    Curl_dnscache_destroy(&multi->dnscache);
 3044|  3.74k|    Curl_psl_destroy(&multi->psl);
 3045|  3.74k|#ifdef USE_SSL
 3046|  3.74k|    Curl_ssl_scache_destroy(multi->ssl_scache);
 3047|  3.74k|#endif
 3048|       |
 3049|       |#ifdef USE_WINSOCK
 3050|       |    WSACloseEvent(multi->wsa_event);
 3051|       |#endif
 3052|  3.74k|#ifdef ENABLE_WAKEUP
 3053|  3.74k|  Curl_wakeup_destroy(multi->wakeup_pair);
 3054|  3.74k|#endif
 3055|  3.74k|#ifdef ENABLE_INTERNAL_WAKEUP
 3056|  3.74k|  Curl_wakeup_destroy(multi->wakeup_internal);
 3057|  3.74k|#endif
 3058|       |
 3059|  3.74k|    multi_xfer_bufs_free(multi);
 3060|  3.74k|    Curl_mntfy_cleanup(multi);
 3061|  3.74k|#ifdef DEBUGBUILD
 3062|  3.74k|    if(Curl_uint32_tbl_count(&multi->xfers)) {
  ------------------
  |  Branch (3062:8): [True: 0, False: 3.74k]
  ------------------
 3063|      0|      multi_xfer_tbl_dump(multi);
 3064|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3064:7): [Folded, False: 0]
  |  Branch (3064:7): [Folded, False: 0]
  ------------------
 3065|      0|    }
 3066|  3.74k|#endif
 3067|  3.74k|    Curl_uint32_bset_destroy(&multi->process);
 3068|  3.74k|    Curl_uint32_bset_destroy(&multi->dirty);
 3069|  3.74k|    Curl_uint32_bset_destroy(&multi->pending);
 3070|  3.74k|    Curl_uint32_bset_destroy(&multi->msgsent);
 3071|  3.74k|    Curl_uint32_tbl_destroy(&multi->xfers);
 3072|  3.74k|    curlx_memzero(multi, sizeof(*multi));
 3073|  3.74k|    curlx_free(multi);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3074|       |
 3075|  3.74k|    mresult = CURLM_OK;
 3076|  3.74k|  }
 3077|  3.74k|out:
 3078|  3.74k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  3.74k|  Curl_mapi_leave(g)
  ------------------
 3079|  3.74k|  return mresult;
 3080|  3.74k|}
curl_multi_info_read:
 3090|  7.48k|{
 3091|  7.48k|  struct Curl_mapi_guard guard;
 3092|  7.48k|  CURLMsg *msg_result = NULL;
 3093|       |
 3094|  7.48k|  *msgs_in_queue = 0; /* default to none */
 3095|  7.48k|  if(CURL_MAPI_ENTER(&guard, m, multi_info_read, NULL)) {
  ------------------
  |  |  190|  7.48k|  Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 7.48k, False: 0]
  |  |  |  Branch (190:56): [True: 7.48k, False: 0]
  |  |  ------------------
  ------------------
 3096|  7.48k|    struct Curl_multi *multi = m;
 3097|  7.48k|    uint32_t mid;
 3098|  7.48k|    if(Curl_uint32_bset_first(&multi->msgsent, &mid)) {
  ------------------
  |  Branch (3098:8): [True: 3.74k, False: 3.74k]
  ------------------
 3099|  3.74k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3100|       |
 3101|  3.74k|      DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3101:7): [True: 0, False: 3.74k]
  |  Branch (3101:7): [True: 3.74k, False: 0]
  ------------------
 3102|  3.74k|      Curl_uint32_bset_remove(&multi->msgsent, mid);
 3103|  3.74k|      *msgs_in_queue =
 3104|  3.74k|        curlx_uztosi(Curl_uint32_bset_count(&multi->msgsent));
 3105|  3.74k|      if(data)
  ------------------
  |  Branch (3105:10): [True: 3.74k, False: 0]
  ------------------
 3106|  3.74k|        msg_result = &data->msg;
 3107|  3.74k|    }
 3108|  7.48k|  }
 3109|  7.48k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  7.48k|  Curl_mapi_leave(g)
  ------------------
 3110|  7.48k|  return msg_result;
 3111|  7.48k|}
Curl_multi_will_close:
 3114|  3.04k|{
 3115|  3.04k|  if(data) {
  ------------------
  |  Branch (3115:6): [True: 3.04k, False: 0]
  ------------------
 3116|  3.04k|    struct Curl_multi *multi = data->multi;
 3117|  3.04k|    if(multi) {
  ------------------
  |  Branch (3117:8): [True: 3.04k, False: 0]
  ------------------
 3118|  3.04k|      CURL_TRC_M(data, "Curl_multi_will_close fd=%" FMT_SOCKET_T, s);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.04k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 3119|  3.04k|      Curl_multi_ev_socket_done(multi, data, s);
 3120|  3.04k|    }
 3121|  3.04k|  }
 3122|  3.04k|}
Curl_update_timer:
 3567|  11.2k|{
 3568|  11.2k|  timediff_t timeouts_offset_us = 0;
 3569|  11.2k|  int timeout_ms;
 3570|  11.2k|  int rc;
 3571|  11.2k|  bool set_value = FALSE;
  ------------------
  |  | 1000|  11.2k|#define FALSE false
  ------------------
 3572|       |
 3573|  11.2k|  if(!multi->timer_cb || multi->dead)
  ------------------
  |  Branch (3573:6): [True: 11.2k, False: 0]
  |  Branch (3573:26): [True: 0, False: 0]
  ------------------
 3574|  11.2k|    return CURLM_OK;
 3575|      0|  multi_timeout(multi, &timeouts_offset_us, &timeout_ms);
 3576|       |
 3577|      0|  if(timeout_ms < 0 && !multi->last_timeout_set) {
  ------------------
  |  Branch (3577:6): [True: 0, False: 0]
  |  Branch (3577:24): [True: 0, False: 0]
  ------------------
 3578|       |    /* nothing to do */
 3579|      0|  }
 3580|      0|  else if(timeout_ms < 0) {
  ------------------
  |  Branch (3580:11): [True: 0, False: 0]
  ------------------
 3581|       |    /* there is no timeout now but there was one previously */
 3582|      0|    CURL_TRC_M(multi->admin, "[TIMER] clear");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 3583|      0|    timeout_ms = -1; /* normalize */
 3584|      0|    set_value = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 3585|      0|  }
 3586|      0|  else if(!multi->last_timeout_set) {
  ------------------
  |  Branch (3586:11): [True: 0, False: 0]
  ------------------
 3587|      0|    CURL_TRC_M(multi->admin, "[TIMER] set %dms, none before", timeout_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__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3588|      0|    set_value = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 3589|      0|  }
 3590|      0|  else if(multi->last_expire_offset_us != timeouts_offset_us) {
  ------------------
  |  Branch (3590:11): [True: 0, False: 0]
  ------------------
 3591|       |    /* We had a timeout before and have one now, the absolute timestamp
 3592|       |     * differs. The relative timeout_ms may be the same, but the starting
 3593|       |     * point differs. Let the application restart its timer. */
 3594|      0|    CURL_TRC_M(multi->admin, "[TIMER] set %dms, replace previous",
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 3595|      0|               timeout_ms);
 3596|      0|    set_value = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 3597|      0|  }
 3598|      0|  else {
 3599|       |    /* We have same expire time as previously. Our relative 'timeout_ms'
 3600|       |     * may be different now, but the application has the timer running
 3601|       |     * and we do not to tell it to start this again. */
 3602|      0|  }
 3603|       |
 3604|      0|  if(set_value) {
  ------------------
  |  Branch (3604:6): [True: 0, False: 0]
  ------------------
 3605|      0|    struct Curl_mapi_guard guard;
 3606|       |
 3607|      0|    multi->last_expire_offset_us = timeouts_offset_us;
 3608|      0|    multi->last_timeout_set = timeout_ms >= 0;
 3609|      0|    CURL_CBAPI_MULTI_START(&guard, multi, multi_timer_cb);
  ------------------
  |  |  203|      0|  Curl_cbapi_enter((g), NULL, (m), CURL_CBAPI_FN_##fn)
  ------------------
 3610|      0|    rc = multi->timer_cb(multi, timeout_ms, multi->timer_userp);
 3611|      0|    CURL_CBAPI_MULTI_END(&guard);
  ------------------
  |  |  207|      0|  Curl_cbapi_leave(g)
  ------------------
 3612|      0|    if(rc == -1) {
  ------------------
  |  Branch (3612:8): [True: 0, False: 0]
  ------------------
 3613|      0|      multi->dead = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 3614|      0|      return CURLM_ABORTED_BY_CALLBACK;
 3615|      0|    }
 3616|      0|  }
 3617|      0|  return CURLM_OK;
 3618|      0|}
Curl_expire_set:
 3734|  7.48k|{
 3735|  7.48k|  struct Curl_multi *multi = data->multi;
 3736|  7.48k|  struct expire_timers *timeouts = &data->state.timeouts;
 3737|  7.48k|  uint8_t prev_id = timeouts->first;
 3738|  7.48k|  struct curltime set;
 3739|       |
 3740|       |  /* this is only interesting while there is still an associated multi struct
 3741|       |     remaining! */
 3742|  7.48k|  if(!multi)
  ------------------
  |  Branch (3742:6): [True: 0, False: 7.48k]
  ------------------
 3743|      0|    return;
 3744|  7.48k|  DEBUGASSERT(eid < EXPIRE_LAST);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3744:3): [True: 0, False: 7.48k]
  |  Branch (3744:3): [True: 7.48k, False: 0]
  ------------------
 3745|  7.48k|  if(ms > INT_MAX)
  ------------------
  |  Branch (3745:6): [True: 0, False: 7.48k]
  ------------------
 3746|       |    /* Cap ridiculous timeouts, 31-bit ms is still 3.5 weeks. When the time
 3747|       |       goes to the user, it must fit in this size. */
 3748|      0|    ms = INT_MAX;
 3749|       |
 3750|  7.48k|  set = *pnow;
 3751|  7.48k|  set.tv_sec += (time_t)(ms / 1000); /* may be a 64 to 32-bit conversion */
 3752|  7.48k|  set.tv_usec += (int)(ms % 1000) * 1000;
 3753|  7.48k|  if(set.tv_usec >= 1000000) {
  ------------------
  |  Branch (3753:6): [True: 2.21k, False: 5.26k]
  ------------------
 3754|  2.21k|    set.tv_sec++;
 3755|  2.21k|    set.tv_usec -= 1000000;
 3756|  2.21k|  }
 3757|       |
 3758|       |  /* Add the timeout, will replace any previous value for this timer. */
 3759|  7.48k|  multi_set_timeout(data, &set, eid);
 3760|  7.48k|  DEBUGASSERT(timeouts->first < EXPIRE_LAST);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3760:3): [True: 0, False: 7.48k]
  |  Branch (3760:3): [True: 7.48k, False: 0]
  ------------------
 3761|       |
 3762|  7.48k|  if(Curl_timeouts_has(data)) {
  ------------------
  |  Branch (3762:6): [True: 3.74k, False: 3.74k]
  ------------------
 3763|       |    /* data has already a timeout registered. If the first timer
 3764|       |     * was NOT the one we just set AND is still the first one,
 3765|       |     * nothing changed from the timeouts point of view. The
 3766|       |     * set timer triggers after the one already registered. Leave. */
 3767|  3.74k|    if((prev_id != eid) && (prev_id == timeouts->first))
  ------------------
  |  Branch (3767:8): [True: 3.74k, False: 0]
  |  Branch (3767:28): [True: 3.74k, False: 0]
  ------------------
 3768|  3.74k|      return;
 3769|       |
 3770|       |    /* Since this is an updated time, we must remove data from
 3771|       |     * timeouts and then add it again. */
 3772|      0|    Curl_timeouts_remove(&multi->timeouts, data);
 3773|      0|  }
 3774|       |
 3775|       |  /* Insert the new timer expiry since it is our local minimum. */
 3776|  3.74k|  Curl_timeouts_add(&multi->timeouts, data,
 3777|  3.74k|                    timeouts->offset_us[timeouts->first]);
 3778|  3.74k|}
Curl_expire_clear:
 3790|  3.04k|{
 3791|       |  /* remove the timer, if there */
 3792|  3.04k|  multi_clear_timeout(data, eid);
 3793|  3.04k|  CURL_TRC_TIMER(data, eid, "cleared");
  ------------------
  |  |  173|  3.04k|  do {                                        \
  |  |  174|  3.04k|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  3.04k|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 3794|  3.04k|}
Curl_expire_clear_all:
 3800|  14.9k|{
 3801|  14.9k|  struct Curl_multi *multi = data->multi;
 3802|       |
 3803|       |  /* this is only interesting while there is still an associated multi struct
 3804|       |     remaining! */
 3805|  14.9k|  if(!multi)
  ------------------
  |  Branch (3805:6): [True: 7.48k, False: 7.48k]
  ------------------
 3806|  7.48k|    return;
 3807|       |
 3808|  7.48k|  if(Curl_timeouts_remove(&multi->timeouts, data)) {
  ------------------
  |  Branch (3808:6): [True: 3.74k, False: 3.74k]
  ------------------
 3809|       |    /* Since this is an cleared time, we must remove the previous entry from
 3810|       |       the splay tree */
 3811|  3.74k|    multi_timeouts_init(data);
 3812|       |
 3813|  3.74k|    if(data->id >= 0)
  ------------------
  |  Branch (3813:8): [True: 3.74k, False: 0]
  ------------------
 3814|  3.74k|      CURL_TRC_M(data, "[TIMEOUT] all cleared");
  ------------------
  |  |  148|  3.74k|  do {                                   \
  |  |  149|  3.74k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.74k|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.74k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.74k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
 3815|  3.74k|  }
 3816|  7.48k|}
curl_multi_get_handles:
 3900|  3.74k|{
 3901|  3.74k|  struct Curl_mapi_guard guard;
 3902|  3.74k|  CURL **a = NULL;
 3903|       |
 3904|  3.74k|  if(CURL_MAPI_ENTER(&guard, m, multi_get_handles, NULL)) {
  ------------------
  |  |  190|  3.74k|  Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 3.74k, False: 0]
  |  |  |  Branch (190:56): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 3905|  3.74k|    struct Curl_multi *multi = m;
 3906|  3.74k|    void *entry;
 3907|  3.74k|    size_t count = Curl_uint32_tbl_count(&multi->xfers);
 3908|       |
 3909|  3.74k|    a = curlx_malloc(sizeof(struct Curl_easy *) * (count + 1));
  ------------------
  |  | 1423|  3.74k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 3910|  3.74k|    if(a) {
  ------------------
  |  Branch (3910:8): [True: 3.74k, False: 0]
  ------------------
 3911|  3.74k|      unsigned int i = 0;
 3912|  3.74k|      uint32_t mid;
 3913|       |
 3914|  3.74k|      if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) {
  ------------------
  |  Branch (3914:10): [True: 3.74k, False: 0]
  ------------------
 3915|  7.48k|        do {
 3916|  7.48k|          struct Curl_easy *data = entry;
 3917|  7.48k|          DEBUGASSERT(i < count);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3917:11): [True: 0, False: 7.48k]
  |  Branch (3917:11): [True: 7.48k, False: 0]
  ------------------
 3918|  7.48k|          if(!data->state.internal)
  ------------------
  |  Branch (3918:14): [True: 3.74k, False: 3.74k]
  ------------------
 3919|  3.74k|            a[i++] = data;
 3920|  7.48k|        } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry));
  ------------------
  |  Branch (3920:17): [True: 3.74k, False: 3.74k]
  ------------------
 3921|  3.74k|      }
 3922|  3.74k|      a[i] = NULL; /* last entry is a NULL */
 3923|  3.74k|    }
 3924|  3.74k|  }
 3925|  3.74k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  3.74k|  Curl_mapi_leave(g)
  ------------------
 3926|  3.74k|  return a;
 3927|  3.74k|}
Curl_multi_get_easy:
 4151|  11.2k|{
 4152|  11.2k|  struct Curl_easy *data = Curl_uint32_tbl_get(&multi->xfers, mid);
 4153|  11.2k|  if(GOOD_EASY_HANDLE(data))
  ------------------
  |  |   34|  11.2k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  11.2k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  997|  11.2k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:3): [True: 11.2k, False: 0]
  |  |  |  Branch (34:5): [True: 11.2k, False: 0]
  |  |  |  Branch (34:12): [True: 11.2k, False: 0]
  |  |  ------------------
  |  |   35|  11.2k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1000|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (4153:6): [True: 0, False: 0]
  |  Branch (4153:6): [True: 0, False: 0]
  ------------------
 4154|  11.2k|    return data;
 4155|      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]
  |  |  ------------------
  ------------------
 4156|      0|             mid);
 4157|      0|  Curl_uint32_tbl_remove(&multi->xfers, mid);
 4158|       |  return NULL;
 4159|  11.2k|}
Curl_multi_mark_dirty:
 4186|  3.74k|{
 4187|  3.74k|  if(data->multi && data->mid != UINT32_MAX)
  ------------------
  |  Branch (4187:6): [True: 3.74k, False: 0]
  |  Branch (4187:21): [True: 3.74k, False: 0]
  ------------------
 4188|  3.74k|    Curl_uint32_bset_add(&data->multi->dirty, data->mid);
 4189|  3.74k|}
multi.c:multi_xfers_add:
  410|  3.74k|{
  411|  3.74k|  uint32_t capacity = Curl_uint32_tbl_capacity(&multi->xfers);
  412|  3.74k|  uint32_t new_size = 0;
  413|       |  /* Prepare to make this into a CURLMOPT_MAX_TRANSFERS, because some
  414|       |   * applications may want to prevent a run-away of their memory use. */
  415|       |  /* UINT_MAX is our "invalid" id, do not let the table grow up to that. */
  416|  3.74k|  const uint32_t max_capacity = UINT_MAX - 1;
  417|       |
  418|  3.74k|  if(capacity < max_capacity) {
  ------------------
  |  Branch (418:6): [True: 3.74k, False: 0]
  ------------------
  419|       |    /* We want `multi->xfers` to have "sufficient" free rows, so that we do
  420|       |     * not have to reuse the `mid` from a removed easy right away.
  421|       |     * Check if an 8th of the capacity is still free */
  422|  3.74k|    uint32_t used = Curl_uint32_tbl_count(&multi->xfers);
  423|  3.74k|    uint32_t unused = capacity - used;
  424|  3.74k|    uint32_t min_unused = CURLMAX(capacity >> 3, 4);
  ------------------
  |  | 1239|  3.74k|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1239:24): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
  425|  3.74k|    if(unused < min_unused) {
  ------------------
  |  Branch (425:8): [True: 0, False: 3.74k]
  ------------------
  426|       |      /* Grow by 50% of current capacity, in range of [128, 2048],
  427|       |       * which means the table grows max by 16kb on 64-bit arch. */
  428|      0|      uint32_t growth = CURLMIN(CURLMAX(capacity >> 1, 128), 2048);
  ------------------
  |  | 1240|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1240:24): [True: 0, False: 0]
  |  |  |  Branch (1240:25): [True: 0, False: 0]
  |  |  |  Branch (1240:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  429|       |      /* Make sure the uint arithmetic here works on the corner
  430|       |       * cases where we are close to max_capacity or UINT_MAX */
  431|      0|      if((max_capacity - growth) <= capacity)
  ------------------
  |  Branch (431:10): [True: 0, False: 0]
  ------------------
  432|      0|        new_size = max_capacity;
  433|      0|      else
  434|      0|        new_size = capacity + growth;
  435|      0|    }
  436|  3.74k|  }
  437|       |
  438|  3.74k|  if(new_size > capacity) {
  ------------------
  |  Branch (438:6): [True: 0, False: 3.74k]
  ------------------
  439|       |    /* Grow the bitsets first. Should one fail, we do not need
  440|       |     * to downsize the already resized ones. The sets continue
  441|       |     * to work properly when larger than the table, but not
  442|       |     * the other way around. */
  443|      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]
  |  |  ------------------
  ------------------
  444|      0|    if(Curl_uint32_bset_resize(&multi->process, new_size) ||
  ------------------
  |  Branch (444:8): [True: 0, False: 0]
  ------------------
  445|      0|       Curl_uint32_bset_resize(&multi->dirty, new_size) ||
  ------------------
  |  Branch (445:8): [True: 0, False: 0]
  ------------------
  446|      0|       Curl_uint32_bset_resize(&multi->pending, new_size) ||
  ------------------
  |  Branch (446:8): [True: 0, False: 0]
  ------------------
  447|      0|       Curl_uint32_bset_resize(&multi->msgsent, new_size) ||
  ------------------
  |  Branch (447:8): [True: 0, False: 0]
  ------------------
  448|      0|       Curl_uint32_tbl_resize(&multi->xfers, new_size))
  ------------------
  |  Branch (448:8): [True: 0, False: 0]
  ------------------
  449|      0|      return CURLM_OUT_OF_MEMORY;
  450|      0|  }
  451|       |
  452|       |  /* Insert the easy into the table now */
  453|  3.74k|  if(!Curl_uint32_tbl_add(&multi->xfers, data, &data->mid)) {
  ------------------
  |  Branch (453:6): [True: 0, False: 3.74k]
  ------------------
  454|       |    /* MUST only happen when table is full */
  455|      0|    DEBUGASSERT(Curl_uint32_tbl_capacity(&multi->xfers) <=
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (455:5): [True: 0, False: 0]
  |  Branch (455:5): [True: 0, False: 0]
  ------------------
  456|      0|                Curl_uint32_tbl_count(&multi->xfers));
  457|      0|    return CURLM_OUT_OF_MEMORY;
  458|      0|  }
  459|  3.74k|  return CURLM_OK;
  460|  3.74k|}
multi.c:mstate:
  157|  33.5k|{
  158|  33.5k|  CURLMstate oldstate = data->mstate;
  159|  33.5k|  static const mstate_enter_func state_enter[MSTATE_LAST] = {
  160|  33.5k|    NULL,                      /* INIT */
  161|  33.5k|    NULL,                      /* PENDING */
  162|  33.5k|    NULL,                      /* SETUP */
  163|  33.5k|    mstate_enter_connect,      /* CONNECT */
  164|  33.5k|    NULL,                      /* CONNECTING */
  165|  33.5k|    NULL,                      /* PROTOCONNECT */
  166|  33.5k|    NULL,                      /* PROTOCONNECTING */
  167|  33.5k|    NULL,                      /* DO */
  168|  33.5k|    NULL,                      /* DOING */
  169|  33.5k|    NULL,                      /* DOING_MORE */
  170|  33.5k|    mstate_enter_did,          /* DID */
  171|  33.5k|    NULL,                      /* PERFORMING */
  172|  33.5k|    NULL,                      /* RATELIMITING */
  173|  33.5k|    mstate_enter_done,         /* DONE */
  174|  33.5k|    mstate_enter_completed,    /* COMPLETED */
  175|       |    NULL                       /* MSGSENT */
  176|  33.5k|  };
  177|       |
  178|  33.5k|  if(oldstate == state)
  ------------------
  |  Branch (178:6): [True: 3.74k, False: 29.8k]
  ------------------
  179|       |    /* do not bother when the new state is the same as the old state */
  180|  3.74k|    return;
  181|       |
  182|  29.8k|#ifdef DEBUGBUILD
  183|  29.8k|  NOVERBOSE((void)lineno);
  ------------------
  |  | 1564|  29.8k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1135|  29.8k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1135:35): [Folded, False: 29.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  184|  29.8k|  CURL_TRC_M(data, "-> [%s] (line %d)", CURL_MSTATE_NAME(state), lineno);
  ------------------
  |  |  148|  29.8k|  do {                                   \
  |  |  149|  29.8k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  29.8k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  29.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  59.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 29.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 29.8k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  59.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 29.8k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  29.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|  29.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  29.8k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 29.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  29.8k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  29.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 29.8k]
  |  |  ------------------
  ------------------
  185|       |#else
  186|       |  CURL_TRC_M(data, "-> [%s]", CURL_MSTATE_NAME(state));
  187|       |#endif
  188|       |
  189|       |  /* really switching state */
  190|  29.8k|  data->mstate = state;
  191|  29.8k|  if(state_enter[state])
  ------------------
  |  Branch (191:6): [True: 13.2k, False: 16.6k]
  ------------------
  192|  13.2k|    state_enter[state](data, oldstate);
  193|  29.8k|}
multi.c:mstate_enter_connect:
  101|  3.74k|{
  102|  3.74k|  (void)from_state;
  103|  3.74k|  Curl_init_CONNECT(data);
  104|  3.74k|}
multi.c:mstate_enter_did:
  108|  2.86k|{
  109|  2.86k|  (void)from_state;
  110|  2.86k|  data->req.chunk = FALSE;
  ------------------
  |  | 1000|  2.86k|#define FALSE false
  ------------------
  111|  2.86k|  Curl_pgrsTime(data, TIMER_PRETRANSFER);
  112|  2.86k|  if(!CURL_REQ_WANT_SEND(data))
  ------------------
  |  |   39|  2.86k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  2.86k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  |  Branch (112:6): [True: 2.86k, False: 0]
  ------------------
  113|  2.86k|    Curl_pgrsTime(data, TIMER_POSTRANSFER);
  114|  2.86k|}
multi.c:mstate_enter_done:
  118|  2.86k|{
  119|  2.86k|  (void)from_state;
  120|  2.86k|  CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE);
  ------------------
  |  |   51|  2.86k|  do {                                                \
  |  |   52|  2.86k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 2.86k, False: 0]
  |  |  |  Branch (52:15): [True: 2.86k, False: 0]
  |  |  |  Branch (52:29): [True: 0, False: 2.86k]
  |  |  ------------------
  |  |   53|  2.86k|      Curl_mntfy_add((d), (t));                       \
  |  |   54|  2.86k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (54:11): [Folded, False: 2.86k]
  |  |  ------------------
  ------------------
  121|  2.86k|}
multi.c:mstate_enter_completed:
  125|  3.74k|{
  126|       |  /* we sometimes directly jump to COMPLETED, trigger things
  127|       |   * we then missed. */
  128|  3.74k|  if(from_state < MSTATE_DID) {
  ------------------
  |  Branch (128:6): [True: 876, False: 2.86k]
  ------------------
  129|    876|    Curl_pgrsTime(data, TIMER_PRETRANSFER);
  130|    876|    Curl_pgrsTime(data, TIMER_POSTRANSFER);
  131|    876|    Curl_pgrsTime(data, TIMER_STARTTRANSFER);
  132|    876|  }
  133|  3.74k|  Curl_pgrsCompleted(data);
  134|  3.74k|  if(from_state < MSTATE_DONE)
  ------------------
  |  Branch (134:6): [True: 876, False: 2.86k]
  ------------------
  135|    876|    CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE);
  ------------------
  |  |   51|    876|  do {                                                \
  |  |   52|    876|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 876, False: 0]
  |  |  |  Branch (52:15): [True: 876, False: 0]
  |  |  |  Branch (52:29): [True: 0, False: 876]
  |  |  ------------------
  |  |   53|    876|      Curl_mntfy_add((d), (t));                       \
  |  |   54|    876|  } while(0)
  |  |  ------------------
  |  |  |  Branch (54:11): [Folded, False: 876]
  |  |  ------------------
  ------------------
  136|       |  /* changing to COMPLETED means it is in process and needs to go */
  137|  3.74k|  DEBUGASSERT(Curl_uint32_bset_contains(&data->multi->process, data->mid));
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (137:3): [True: 0, False: 3.74k]
  |  Branch (137:3): [True: 3.74k, False: 0]
  ------------------
  138|  3.74k|  Curl_uint32_bset_remove(&data->multi->process, data->mid);
  139|  3.74k|  Curl_uint32_bset_remove(&data->multi->pending, data->mid); /* to be sure */
  140|       |
  141|  3.74k|  if(Curl_uint32_bset_empty(&data->multi->process)) {
  ------------------
  |  Branch (141:6): [True: 0, False: 3.74k]
  ------------------
  142|       |    /* free the transfer buffer when we have no more active transfers */
  143|      0|    multi_xfer_bufs_free(data->multi);
  144|      0|  }
  145|       |  /* Important: reset the conn pointer so that we do not point to memory
  146|       |     that could be freed anytime */
  147|  3.74k|  Curl_detach_connection(data);
  148|  3.74k|  Curl_expire_clear_all(data); /* stop all timers */
  149|  3.74k|}
multi.c:multi_warn_debug:
  380|  11.2k|{
  381|  11.2k|  if(!multi->warned) {
  ------------------
  |  Branch (381:6): [True: 3.74k, False: 7.48k]
  ------------------
  382|  3.74k|    infof(data, "!!! WARNING !!!");
  ------------------
  |  |  143|  3.74k|  do {                               \
  |  |  144|  3.74k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.74k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 3.74k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.74k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 3.74k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  3.74k|    ((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.74k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  383|  3.74k|    infof(data, "This is a debug build of libcurl, "
  ------------------
  |  |  143|  3.74k|  do {                               \
  |  |  144|  3.74k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.74k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 3.74k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.74k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 3.74k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  3.74k|    ((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.74k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  384|  3.74k|                "do not use in production.");
  385|       |    multi->warned = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  386|  3.74k|  }
  387|  11.2k|}
multi.c:multi_done:
  684|  3.04k|{
  685|  3.04k|  CURLcode result;
  686|  3.04k|  struct connectdata *conn = data->conn;
  687|       |
  688|  3.04k|  CURL_TRC_M(data, "multi_done: status: %d prem: %d done: %d",
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  689|  3.04k|             (int)status, (int)premature, data->state.done);
  690|       |
  691|  3.04k|  if(data->state.done)
  ------------------
  |  Branch (691:6): [True: 0, False: 3.04k]
  ------------------
  692|       |    /* Stop if multi_done() has already been called */
  693|      0|    return CURLE_OK;
  694|       |
  695|       |  /* Shut down any ongoing async resolver operation. */
  696|  3.04k|  Curl_resolv_shutdown_all(data);
  697|       |
  698|       |  /* Cleanup possible redirect junk */
  699|  3.04k|  curlx_safefree(data->req.newurl);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  700|  3.04k|  curlx_safefree(data->req.location);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  701|       |
  702|  3.04k|  switch(status) {
  703|      0|  case CURLE_ABORTED_BY_CALLBACK:
  ------------------
  |  Branch (703:3): [True: 0, False: 3.04k]
  ------------------
  704|      0|  case CURLE_READ_ERROR:
  ------------------
  |  Branch (704:3): [True: 0, False: 3.04k]
  ------------------
  705|      0|  case CURLE_WRITE_ERROR:
  ------------------
  |  Branch (705:3): [True: 0, False: 3.04k]
  ------------------
  706|       |    /* When we are aborted due to a callback return code it has to be counted
  707|       |       as premature as there is trouble ahead if we do not. We have many
  708|       |       callbacks and protocols work differently, we could potentially do this
  709|       |       more fine-grained in the future. */
  710|      0|    premature = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  711|      0|    FALLTHROUGH();
  ------------------
  |  |  767|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  712|  3.04k|  default:
  ------------------
  |  Branch (712:3): [True: 3.04k, False: 0]
  ------------------
  713|  3.04k|    break;
  714|  3.04k|  }
  715|       |
  716|       |  /* this calls the protocol-specific function pointer previously set */
  717|  3.04k|  if(conn && conn->scheme->run->done && (data->mstate >= MSTATE_PROTOCONNECT))
  ------------------
  |  Branch (717:6): [True: 3.04k, False: 0]
  |  Branch (717:14): [True: 3.04k, False: 0]
  |  Branch (717:41): [True: 3.04k, False: 0]
  ------------------
  718|  3.04k|    result = conn->scheme->run->done(data, status, premature);
  719|      0|  else
  720|      0|    result = status;
  721|       |
  722|  3.04k|  if(data->mstate > MSTATE_CONNECTING &&
  ------------------
  |  Branch (722:6): [True: 3.04k, False: 0]
  ------------------
  723|  3.04k|     (result != CURLE_ABORTED_BY_CALLBACK)) {
  ------------------
  |  Branch (723:6): [True: 3.04k, False: 0]
  ------------------
  724|       |    /* avoid this if
  725|       |     * - the transfer has not connected
  726|       |     * - we already aborted by callback to avoid this calling another callback
  727|       |     */
  728|  3.04k|    int rc = Curl_pgrsDone(data);
  729|  3.04k|    if(!result && rc)
  ------------------
  |  Branch (729:8): [True: 3.04k, False: 0]
  |  Branch (729:19): [True: 0, False: 3.04k]
  ------------------
  730|      0|      result = CURLE_ABORTED_BY_CALLBACK;
  731|  3.04k|  }
  732|       |
  733|       |  /* Make sure that transfer client writes are really done now. */
  734|  3.04k|  result = Curl_1st_fatal(result, Curl_xfer_write_done(data, premature));
  735|       |
  736|       |  /* Inform connection filters that this transfer is done */
  737|  3.04k|  if(conn)
  ------------------
  |  Branch (737:6): [True: 3.04k, False: 0]
  ------------------
  738|  3.04k|    Curl_conn_ev_data_done(data, premature);
  739|       |
  740|  3.04k|  multi_schedule_pending(data->multi); /* connection / multiplex */
  741|       |
  742|  3.04k|  if(!result)
  ------------------
  |  Branch (742:6): [True: 3.04k, False: 0]
  ------------------
  743|  3.04k|    result = Curl_req_done(&data->req, data, premature);
  744|       |
  745|  3.04k|  if(conn) {
  ------------------
  |  Branch (745:6): [True: 3.04k, False: 0]
  ------------------
  746|       |    /* Under the potential connection pool's share lock, decide what to
  747|       |     * do with the transfer's connection. */
  748|  3.04k|    struct multi_done_ctx mdctx;
  749|       |
  750|  3.04k|    memset(&mdctx, 0, sizeof(mdctx));
  751|  3.04k|    mdctx.premature = premature;
  752|  3.04k|    Curl_cpool_do_locked(data, data->conn, multi_done_locked, &mdctx);
  753|  3.04k|  }
  754|       |
  755|       |  /* flush the netrc cache */
  756|  3.04k|  Curl_netrc_cleanup(&data->state.netrc);
  757|  3.04k|  return result;
  758|  3.04k|}
multi.c:multi_done_locked:
  630|  3.04k|{
  631|  3.04k|  struct multi_done_ctx *mdctx = userdata;
  632|  3.04k|  const struct curltime *pnow = Curl_pgrs_now(data);
  633|       |
  634|  3.04k|  Curl_detach_connection(data);
  635|       |
  636|  3.04k|  CURL_TRC_M(data, "multi_done_locked, in use=%u", conn->attached_xfers);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  637|  3.04k|  if(CONN_INUSE(conn)) {
  ------------------
  |  |  356|  3.04k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (356:23): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  638|       |    /* Stop if still used. */
  639|      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]
  |  |  ------------------
  ------------------
  640|      0|               conn->attached_xfers);
  641|      0|    return;
  642|      0|  }
  643|       |
  644|  3.04k|  data->state.done = TRUE; /* called now! */
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  645|       |
  646|  3.04k|  Curl_dnscache_prune(data, pnow);
  647|       |
  648|  3.04k|  if(multi_conn_should_close(conn, data, (bool)mdctx->premature)) {
  ------------------
  |  Branch (648:6): [True: 3.04k, False: 0]
  ------------------
  649|  3.04k|    CURL_TRC_M(data, "multi_done, terminating conn #%" FMT_OFF_T " to %s:%u, "
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  650|  3.04k|               "forbid=%d, close=%d, premature=%d, conn_multiplex=%d",
  651|  3.04k|               conn->connection_id, conn->origin->user_hostname,
  652|  3.04k|               conn->origin->port,
  653|  3.04k|               data->set.reuse_forbid, conn->bits.close, mdctx->premature,
  654|  3.04k|               Curl_conn_is_multiplex(conn, FIRSTSOCKET));
  655|  3.04k|    connclose(conn);
  ------------------
  |  |   69|  3.04k|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   63|  3.04k|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  656|  3.04k|    Curl_conn_close(data, conn, (bool)mdctx->premature);
  657|  3.04k|  }
  658|      0|  else if(!Curl_conn_get_max_concurrent(data, conn, FIRSTSOCKET)) {
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (658:11): [True: 0, False: 0]
  ------------------
  659|      0|    CURL_TRC_M(data, "multi_done, conn #%" FMT_OFF_T " to %s:%u was shutdown"
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  660|      0|               " by server, not reusing", conn->connection_id,
  661|      0|               conn->origin->user_hostname, conn->origin->port);
  662|      0|    connclose(conn);
  ------------------
  |  |   69|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   63|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  663|      0|    Curl_conn_close(data, conn, (bool)mdctx->premature);
  664|      0|  }
  665|      0|  else {
  666|       |    /* the connection is no longer in use by any transfer */
  667|      0|    if(Curl_cpool_conn_now_idle(data, conn, pnow)) {
  ------------------
  |  Branch (667:8): [True: 0, False: 0]
  ------------------
  668|       |      /* connection kept in the cpool */
  669|      0|      infof(data, "Connection #%" FMT_OFF_T " to host %s:%u left intact",
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  670|      0|            conn->connection_id, conn->origin->user_hostname,
  671|      0|            conn->origin->port);
  672|      0|    }
  673|      0|    else {
  674|       |      /* connection was removed from the cpool and destroyed. */
  675|      0|      data->state.lastconnect_id = -1;
  676|      0|    }
  677|      0|  }
  678|  3.04k|}
multi.c:multi_conn_should_close:
  589|  3.04k|{
  590|       |  /* if conn->bits.close is TRUE, it means that the connection should be
  591|       |     closed in spite of everything else. */
  592|  3.04k|  if(conn->bits.close)
  ------------------
  |  Branch (592:6): [True: 0, False: 3.04k]
  ------------------
  593|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  594|       |
  595|       |  /* if data->set.reuse_forbid is TRUE, it means the libcurl client has
  596|       |     forced us to close this connection. This is ignored for requests taking
  597|       |     place in a NTLM/NEGOTIATE authentication handshake. */
  598|  3.04k|  if(data->set.reuse_forbid
  ------------------
  |  Branch (598:6): [True: 0, False: 3.04k]
  ------------------
  599|       |#ifdef USE_NTLM
  600|       |     && !(conn->http_ntlm_state == NTLMSTATE_TYPE2 ||
  601|       |          conn->proxy_ntlm_state == NTLMSTATE_TYPE2)
  602|       |#endif
  603|       |#ifdef USE_SPNEGO
  604|       |     && !(conn->http_negotiate_state == GSS_AUTHRECV ||
  605|       |          conn->proxy_negotiate_state == GSS_AUTHRECV)
  606|       |#endif
  607|  3.04k|    )
  608|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  609|       |
  610|       |  /* Unless this connection is for a "connect-only" transfer, it
  611|       |   * needs to be closed if the protocol handler does not support reuse. */
  612|  3.04k|  if(!data->set.connect_only && conn->scheme &&
  ------------------
  |  Branch (612:6): [True: 3.04k, False: 0]
  |  Branch (612:33): [True: 3.04k, False: 0]
  ------------------
  613|  3.04k|     !(conn->scheme->flags & PROTOPT_CONN_REUSE))
  ------------------
  |  |  234|  3.04k|#define PROTOPT_CONN_REUSE (1 << 16)  /* this protocol can reuse connections */
  ------------------
  |  Branch (613:6): [True: 3.04k, False: 0]
  ------------------
  614|  3.04k|    return TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  615|       |
  616|       |  /* if premature is TRUE, it means this connection was said to be DONE before
  617|       |     the entire request operation is complete and thus we cannot know in what
  618|       |     state it is for reusing, so we are forced to close it. In a perfect world
  619|       |     we can add code that keep track of if we really must close it here or not,
  620|       |     but currently we have no such detail knowledge. */
  621|      0|  if(premature && !Curl_conn_is_multiplex(conn, FIRSTSOCKET))
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (621:6): [True: 0, False: 0]
  |  Branch (621:19): [True: 0, False: 0]
  ------------------
  622|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  623|       |
  624|      0|  return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  625|      0|}
multi.c:multi_assess_wakeup:
  398|  14.9k|{
  399|  14.9k|#ifdef ENABLE_INTERNAL_WAKEUP
  400|  14.9k|  if(multi->socket_cb)
  ------------------
  |  Branch (400:6): [True: 0, False: 14.9k]
  ------------------
  401|      0|    return Curl_multi_ev_assess_xfer(multi, multi->admin);
  402|       |#else
  403|       |  (void)multi;
  404|       |#endif
  405|  14.9k|  return CURLM_OK;
  406|  14.9k|}
multi.c:multi_perform:
 2894|  3.74k|{
 2895|  3.74k|  CURLMcode returncode = CURLM_OK;
 2896|  3.74k|  struct curltime start = *multi_now(multi);
 2897|  3.74k|  uint32_t mid;
 2898|  3.74k|  struct Curl_sigpipe_ctx sigpipe_ctx;
 2899|       |
 2900|  3.74k|  sigpipe_init(&sigpipe_ctx);
 2901|       |
 2902|  3.74k|  if(Curl_uint32_bset_first(&multi->process, &mid)) {
  ------------------
  |  Branch (2902:6): [True: 3.74k, False: 0]
  ------------------
 2903|  3.74k|    CURL_TRC_M(multi->admin, "multi_perform(running=%u)",
  ------------------
  |  |  148|  3.74k|  do {                                   \
  |  |  149|  3.74k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.74k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
 2904|  3.74k|               multi_xfers_running(multi));
 2905|  7.48k|    do {
 2906|  7.48k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 2907|  7.48k|      CURLMcode mresult;
 2908|  7.48k|      if(!data) {
  ------------------
  |  Branch (2908:10): [True: 0, False: 7.48k]
  ------------------
 2909|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2909:9): [Folded, False: 0]
  |  Branch (2909:9): [Folded, False: 0]
  ------------------
 2910|      0|        Curl_uint32_bset_remove(&multi->process, mid);
 2911|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 2912|      0|        continue;
 2913|      0|      }
 2914|  7.48k|      mresult = multi_runsingle(multi, data, &sigpipe_ctx);
 2915|  7.48k|      if(mresult)
  ------------------
  |  Branch (2915:10): [True: 0, False: 7.48k]
  ------------------
 2916|      0|        returncode = mresult;
 2917|  7.48k|    } while(Curl_uint32_bset_next(&multi->process, mid, &mid));
  ------------------
  |  Branch (2917:13): [True: 3.74k, False: 3.74k]
  ------------------
 2918|  3.74k|  }
 2919|  3.74k|  sigpipe_restore(&sigpipe_ctx);
 2920|       |
 2921|  3.74k|  if(multi_ischanged(multi, TRUE))
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  |  Branch (2921:6): [True: 3.04k, False: 699]
  ------------------
 2922|  3.04k|    multi_schedule_pending(multi);
 2923|       |
 2924|  3.74k|  if(!returncode && CURL_MNTFY_HAS_ENTRIES(multi))
  ------------------
  |  |   57|  3.74k|  ((m)->ntfy.flags & CURL_MNTFY_FLAG_HAS_ENTRIES)
  |  |  ------------------
  |  |  |  |   28|  3.74k|#define CURL_MNTFY_FLAG_HAS_ENTRIES  ((uint32_t)1 << 31)
  |  |  ------------------
  |  |  |  Branch (57:3): [True: 0, False: 3.74k]
  |  |  ------------------
  ------------------
  |  Branch (2924:6): [True: 3.74k, False: 0]
  ------------------
 2925|      0|    returncode = Curl_mntfy_dispatch_all(multi);
 2926|       |
 2927|       |  /*
 2928|       |   * Remove all expired timers from the splay since handles are dealt
 2929|       |   * with unconditionally by this function and curl_multi_timeout() requires
 2930|       |   * that already passed/handled expire times are removed from the splay.
 2931|       |   *
 2932|       |   * It is important that the 'now' value is set at the entry of this function
 2933|       |   * and not for the current time as it may have ticked a little while since
 2934|       |   * then and then we risk this loop to remove timers that actually have not
 2935|       |   * been handled!
 2936|       |   */
 2937|  3.74k|  while(Curl_timeouts_remove_expired(&multi->timeouts, &start, &mid)) {
  ------------------
  |  Branch (2937:9): [True: 0, False: 3.74k]
  ------------------
 2938|       |    /* the removed may have another timeout in queue */
 2939|      0|    struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 2940|      0|    if(!data) {
  ------------------
  |  Branch (2940:8): [True: 0, False: 0]
  ------------------
 2941|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2941:7): [Folded, False: 0]
  |  Branch (2941:7): [Folded, False: 0]
  ------------------
 2942|      0|      continue;
 2943|      0|    }
 2944|      0|    (void)add_next_timeout(&start, multi, data);
 2945|      0|    if(data->mstate == MSTATE_PENDING) {
  ------------------
  |  Branch (2945:8): [True: 0, False: 0]
  ------------------
 2946|      0|      bool stream_unused;
 2947|      0|      CURLcode result_unused;
 2948|      0|      if(multi_handle_timeout(data, multi_now(multi),
  ------------------
  |  Branch (2948:10): [True: 0, False: 0]
  ------------------
 2949|      0|                              &stream_unused, &result_unused)) {
 2950|      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]
  |  |  ------------------
  ------------------
 2951|      0|        move_pending_to_connect(multi, data);
 2952|      0|      }
 2953|      0|    }
 2954|      0|  }
 2955|       |
 2956|  3.74k|  if(running_handles) {
  ------------------
  |  Branch (2956:6): [True: 3.74k, False: 0]
  ------------------
 2957|  3.74k|    uint32_t running = multi_xfers_running(multi);
 2958|  3.74k|    *running_handles = (running < INT_MAX) ? (int)running : INT_MAX;
  ------------------
  |  Branch (2958:24): [True: 3.74k, False: 0]
  ------------------
 2959|  3.74k|  }
 2960|       |
 2961|  3.74k|  if(CURLM_OK >= returncode)
  ------------------
  |  Branch (2961:6): [True: 3.74k, False: 0]
  ------------------
 2962|  3.74k|    returncode = Curl_update_timer(multi);
 2963|       |
 2964|  3.74k|  return returncode;
 2965|  3.74k|}
multi.c:multi_now:
   90|  3.74k|{
   91|  3.74k|  curlx_pnow(&multi->now);
   92|  3.74k|  return &multi->now;
   93|  3.74k|}
multi.c:multi_runsingle:
 2716|  7.48k|{
 2717|  7.48k|  CURLMcode mresult = CURLM_OK;
 2718|  7.48k|  CURLcode result = CURLE_OK;
 2719|  7.48k|  const struct curltime *pnow = NULL;
 2720|       |
 2721|  7.48k|  if(multi->dead) {
  ------------------
  |  Branch (2721:6): [True: 0, False: 7.48k]
  ------------------
 2722|       |    /* a multi-level callback returned error before, meaning every individual
 2723|       |     transfer now has failed */
 2724|      0|    result = CURLE_ABORTED_BY_CALLBACK;
 2725|      0|    multi_posttransfer(data);
 2726|      0|    multi_done(data, result, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2727|      0|    multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2728|      0|  }
 2729|       |
 2730|  7.48k|  multi_warn_debug(multi, data);
 2731|       |
 2732|       |  /* transfer runs now, clear the dirty bit. This may be set
 2733|       |   * again during processing, triggering a re-run later. */
 2734|  7.48k|  Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2735|       |
 2736|  7.48k|  if(data == multi->admin) {
  ------------------
  |  Branch (2736:6): [True: 3.74k, False: 3.74k]
  ------------------
 2737|  3.74k|#ifdef ENABLE_INTERNAL_WAKEUP
 2738|       |    /* Consume any pending wakeup signals before processing.
 2739|       |     * This is necessary for event based processing. See #21547 */
 2740|  3.74k|    (void)Curl_wakeup_consume(multi->wakeup_internal, TRUE);
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 2741|  3.74k|#endif
 2742|  3.74k|#ifdef USE_RESOLV_THREADED
 2743|  3.74k|    Curl_async_thrdd_multi_process(multi);
 2744|  3.74k|#endif
 2745|  3.74k|    Curl_cshutdn_perform(&multi->cshutdn, multi->admin, sigpipe_ctx);
 2746|  3.74k|    goto out;
 2747|  3.74k|  }
 2748|       |
 2749|  3.74k|  sigpipe_apply(data, sigpipe_ctx);
 2750|  26.0k|  do {
 2751|       |    /* A "stream" here is a logical stream if the protocol can handle that
 2752|       |       (HTTP/2), or the full connection for older protocols */
 2753|  26.0k|    bool stream_error = FALSE;
  ------------------
  |  | 1000|  26.0k|#define FALSE false
  ------------------
 2754|  26.0k|    mresult = CURLM_OK;
 2755|  26.0k|    pnow = NULL;
 2756|       |
 2757|  26.0k|    if(multi_ischanged(multi, TRUE)) {
  ------------------
  |  |  997|  26.0k|#define TRUE true
  ------------------
  |  Branch (2757:8): [True: 0, False: 26.0k]
  ------------------
 2758|      0|      CURL_TRC_M(data, "multi changed, check CONNECT_PEND queue");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2759|      0|      multi_schedule_pending(multi); /* multiplexed */
 2760|      0|    }
 2761|       |
 2762|  26.0k|    if(data->mstate > MSTATE_CONNECT &&
  ------------------
  |  Branch (2762:8): [True: 14.8k, False: 11.2k]
  ------------------
 2763|  14.8k|       data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (2763:8): [True: 14.8k, False: 0]
  ------------------
 2764|       |      /* Make sure we set the connection's current owner */
 2765|  14.8k|      DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2765:7): [True: 0, False: 14.8k]
  |  Branch (2765:7): [True: 14.8k, False: 0]
  ------------------
 2766|  14.8k|      if(!data->conn) {
  ------------------
  |  Branch (2766:10): [True: 0, False: 14.8k]
  ------------------
 2767|      0|        mresult = CURLM_INTERNAL_ERROR;
 2768|      0|        goto out;
 2769|      0|      }
 2770|  14.8k|    }
 2771|       |
 2772|       |    /* Wait for the connect state as only then is the start time stored, but
 2773|       |       we must not check already completed handles */
 2774|  26.0k|    if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED)) {
  ------------------
  |  Branch (2774:8): [True: 18.6k, False: 7.48k]
  |  Branch (2774:44): [True: 18.6k, False: 0]
  ------------------
 2775|  18.6k|      pnow = Curl_pgrs_now(data);
 2776|  18.6k|      if(multi_handle_timeout(data, pnow, &stream_error, &result))
  ------------------
  |  Branch (2776:10): [True: 0, False: 18.6k]
  ------------------
 2777|       |        /* Skip the statemachine and go directly to error handling section. */
 2778|      0|        goto statemachine_end;
 2779|  18.6k|      pnow = NULL;
 2780|  18.6k|    }
 2781|       |
 2782|  26.0k|    switch(data->mstate) {
 2783|  3.74k|    case MSTATE_INIT:
  ------------------
  |  Branch (2783:5): [True: 3.74k, False: 22.3k]
  ------------------
 2784|       |      /* Transitional state. init this transfer. A handle never comes back to
 2785|       |         this state. */
 2786|  3.74k|      mresult = multistate_init(data, &result);
 2787|  3.74k|      break;
 2788|       |
 2789|  3.74k|    case MSTATE_SETUP:
  ------------------
  |  Branch (2789:5): [True: 3.74k, False: 22.3k]
  ------------------
 2790|       |      /* Transitional state. Setup things for a new transfer. The handle
 2791|       |         can come back to this state on a redirect. */
 2792|  3.74k|      mresult = multistate_setup(data);
 2793|  3.74k|      break;
 2794|       |
 2795|  3.74k|    case MSTATE_CONNECT:
  ------------------
  |  Branch (2795:5): [True: 3.74k, False: 22.3k]
  ------------------
 2796|  3.74k|      mresult = multistate_connect(multi, data, &result);
 2797|  3.74k|      break;
 2798|       |
 2799|  3.04k|    case MSTATE_CONNECTING:
  ------------------
  |  Branch (2799:5): [True: 3.04k, False: 23.0k]
  ------------------
 2800|       |      /* awaiting a completion of an asynch TCP connect */
 2801|  3.04k|      mresult = multistate_connecting(data, &stream_error, &result);
 2802|  3.04k|      break;
 2803|       |
 2804|  3.04k|    case MSTATE_PROTOCONNECT:
  ------------------
  |  Branch (2804:5): [True: 3.04k, False: 23.0k]
  ------------------
 2805|  3.04k|      mresult = multistate_protoconnect(data, &stream_error, &result);
 2806|  3.04k|      break;
 2807|       |
 2808|      0|    case MSTATE_PROTOCONNECTING:
  ------------------
  |  Branch (2808:5): [True: 0, False: 26.0k]
  ------------------
 2809|       |      /* protocol-specific connect phase */
 2810|      0|      mresult = multistate_protoconnecting(data, &stream_error, &result);
 2811|      0|      break;
 2812|       |
 2813|  3.04k|    case MSTATE_DO:
  ------------------
  |  Branch (2813:5): [True: 3.04k, False: 23.0k]
  ------------------
 2814|  3.04k|      mresult = multistate_do(data, &stream_error, &result);
 2815|  3.04k|      break;
 2816|       |
 2817|      0|    case MSTATE_DOING:
  ------------------
  |  Branch (2817:5): [True: 0, False: 26.0k]
  ------------------
 2818|       |      /* we continue DOING until the DO phase is complete */
 2819|      0|      mresult = multistate_doing(data, &stream_error, &result);
 2820|      0|      break;
 2821|       |
 2822|      0|    case MSTATE_DOING_MORE:
  ------------------
  |  Branch (2822:5): [True: 0, False: 26.0k]
  ------------------
 2823|       |      /*
 2824|       |       * When we are connected, DOING MORE and then go DID
 2825|       |       */
 2826|      0|      mresult = multistate_doing_more(data, &stream_error, &result);
 2827|      0|      break;
 2828|       |
 2829|  2.86k|    case MSTATE_DID:
  ------------------
  |  Branch (2829:5): [True: 2.86k, False: 23.2k]
  ------------------
 2830|  2.86k|      mresult = multistate_did(multi, data);
 2831|  2.86k|      break;
 2832|       |
 2833|      0|    case MSTATE_RATELIMITING: /* limit-rate exceeded in either direction */
  ------------------
  |  Branch (2833:5): [True: 0, False: 26.0k]
  ------------------
 2834|      0|      mresult = multistate_ratelimiting(data, &result);
 2835|      0|      break;
 2836|       |
 2837|      0|    case MSTATE_PERFORMING:
  ------------------
  |  Branch (2837:5): [True: 0, False: 26.0k]
  ------------------
 2838|      0|      mresult = multistate_performing(data, &stream_error, &result);
 2839|      0|      break;
 2840|       |
 2841|  2.86k|    case MSTATE_DONE:
  ------------------
  |  Branch (2841:5): [True: 2.86k, False: 23.2k]
  ------------------
 2842|  2.86k|      mresult = multistate_done(data, &result);
 2843|  2.86k|      break;
 2844|       |
 2845|      0|    case MSTATE_COMPLETED:
  ------------------
  |  Branch (2845:5): [True: 0, False: 26.0k]
  ------------------
 2846|      0|      break;
 2847|       |
 2848|      0|    case MSTATE_PENDING:
  ------------------
  |  Branch (2848:5): [True: 0, False: 26.0k]
  ------------------
 2849|      0|    case MSTATE_MSGSENT:
  ------------------
  |  Branch (2849:5): [True: 0, False: 26.0k]
  ------------------
 2850|       |      /* handles in these states should NOT be in this list */
 2851|      0|      break;
 2852|       |
 2853|      0|    default:
  ------------------
  |  Branch (2853:5): [True: 0, False: 26.0k]
  ------------------
 2854|      0|      mresult = CURLM_INTERNAL_ERROR;
 2855|      0|      goto out;
 2856|  26.0k|    }
 2857|       |
 2858|  26.0k|    if(data->mstate >= MSTATE_CONNECT &&
  ------------------
  |  Branch (2858:8): [True: 22.3k, False: 3.74k]
  ------------------
 2859|  22.3k|       data->mstate < MSTATE_DO &&
  ------------------
  |  Branch (2859:8): [True: 10.5k, False: 11.8k]
  ------------------
 2860|  10.5k|       mresult != CURLM_CALL_MULTI_PERFORM &&
  ------------------
  |  Branch (2860:8): [True: 699, False: 9.82k]
  ------------------
 2861|    699|       !multi_ischanged(multi, FALSE)) {
  ------------------
  |  | 1000|    699|#define FALSE false
  ------------------
  |  Branch (2861:8): [True: 699, False: 0]
  ------------------
 2862|       |      /* We now handle stream timeouts if and only if this will be the last
 2863|       |       * loop iteration. We only check this on the last iteration to ensure
 2864|       |       * that if we know we have additional work to do immediately
 2865|       |       * (i.e. CURLM_CALL_MULTI_PERFORM == TRUE) then we should do that before
 2866|       |       * declaring the connection timed out as we may almost have a completed
 2867|       |       * connection. */
 2868|    699|      pnow = Curl_pgrs_now(data);
 2869|    699|      multi_handle_timeout(data, pnow, &stream_error, &result);
 2870|    699|    }
 2871|       |
 2872|  26.0k|statemachine_end:
 2873|  26.0k|    if(!pnow)
  ------------------
  |  Branch (2873:8): [True: 25.3k, False: 699]
  ------------------
 2874|  25.3k|      pnow = Curl_pgrs_now(data);
 2875|  26.0k|    result = is_finished(multi, data, pnow, stream_error, result);
 2876|  26.0k|    if(result)
  ------------------
  |  Branch (2876:8): [True: 876, False: 25.2k]
  ------------------
 2877|    876|      mresult = CURLM_CALL_MULTI_PERFORM;
 2878|       |
 2879|  26.0k|    if(MSTATE_COMPLETED == data->mstate) {
  ------------------
  |  Branch (2879:8): [True: 3.74k, False: 22.3k]
  ------------------
 2880|  3.74k|      handle_completed(multi, data, result);
 2881|  3.74k|      mresult = CURLM_OK;
 2882|  3.74k|      goto out;
 2883|  3.74k|    }
 2884|  26.0k|  } while((mresult == CURLM_CALL_MULTI_PERFORM) ||
  ------------------
  |  Branch (2884:11): [True: 22.3k, False: 0]
  ------------------
 2885|      0|          multi_ischanged(multi, FALSE));
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  |  Branch (2885:11): [True: 0, False: 0]
  ------------------
 2886|       |
 2887|  7.48k|out:
 2888|  7.48k|  data->result = result;
 2889|  7.48k|  return mresult;
 2890|  3.74k|}
multi.c:multi_posttransfer:
 1934|    876|{
 1935|       |#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(MSG_NOSIGNAL)
 1936|       |  /* restore the signal handler for SIGPIPE before we get back */
 1937|       |  if(!data->set.no_signal)
 1938|       |    signal(SIGPIPE, data->state.prev_signal);
 1939|       |#else
 1940|    876|  (void)data;
 1941|    876|#endif
 1942|    876|}
multi.c:multistate_init:
 2464|  3.74k|{
 2465|  3.74k|  if(!data->state.really_alive) {
  ------------------
  |  Branch (2465:6): [True: 3.74k, False: 0]
  ------------------
 2466|  3.74k|    data->state.really_alive = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 2467|  3.74k|    ++data->multi->xfers_really_alive;
 2468|  3.74k|    if(data->multi->xfers_really_alive == 1) {
  ------------------
  |  Branch (2468:8): [True: 3.74k, False: 0]
  ------------------
 2469|  3.74k|      CURLMcode mresult = multi_assess_wakeup(data->multi);
 2470|  3.74k|      if(mresult) {
  ------------------
  |  Branch (2470:10): [True: 0, False: 3.74k]
  ------------------
 2471|      0|        failf(data, "error enabling wakeup listening: %d", mresult);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2472|      0|        return mresult;
 2473|      0|      }
 2474|  3.74k|    }
 2475|  3.74k|  }
 2476|       |
 2477|  3.74k|  *result = Curl_pretransfer(data);
 2478|  3.74k|  if(*result)
  ------------------
  |  Branch (2478:6): [True: 0, False: 3.74k]
  ------------------
 2479|      0|    return CURLM_OK;
 2480|       |
 2481|       |  /* after init, go SETUP */
 2482|  3.74k|  multistate(data, MSTATE_SETUP);
  ------------------
  |  |  198|  3.74k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2483|  3.74k|  Curl_pgrsTime(data, TIMER_STARTOP);
 2484|  3.74k|  return CURLM_CALL_MULTI_PERFORM;
 2485|  3.74k|}
multi.c:multistate_setup:
 2488|  3.74k|{
 2489|  3.74k|  const struct curltime *pnow = Curl_pgrs_now(data);
 2490|  3.74k|  Curl_pgrsTimeWas(data, TIMER_STARTSINGLE, *pnow);
 2491|  3.74k|  if(data->set.timeout)
  ------------------
  |  Branch (2491:6): [True: 3.74k, False: 0]
  ------------------
 2492|  3.74k|    Curl_expire_set(data, EXPIRE_TIMEOUT, data->set.timeout, pnow);
 2493|  3.74k|  if(data->set.connecttimeout)
  ------------------
  |  Branch (2493:6): [True: 3.74k, False: 0]
  ------------------
 2494|       |    /* Since a connection might go to pending and back to CONNECT several
 2495|       |       times before it actually takes off, we need to set the timeout once
 2496|       |       in SETUP before we enter CONNECT the first time. */
 2497|  3.74k|    Curl_expire_set(data, EXPIRE_CONNECTTIMEOUT,
 2498|  3.74k|                    data->set.connecttimeout, pnow);
 2499|       |
 2500|  3.74k|  multistate(data, MSTATE_CONNECT);
  ------------------
  |  |  198|  3.74k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2501|  3.74k|  return CURLM_CALL_MULTI_PERFORM;
 2502|  3.74k|}
multi.c:multistate_connect:
 2313|  3.74k|{
 2314|       |  /* Connect. We want to get a connection identifier filled in. This state can
 2315|       |     be entered from SETUP and from PENDING. */
 2316|  3.74k|  bool connected;
 2317|  3.74k|  CURLMcode mresult = CURLM_OK;
 2318|  3.74k|  CURLcode result = Curl_connect(data, &connected);
 2319|  3.74k|  if(result == CURLE_NO_CONNECTION_AVAILABLE) {
  ------------------
  |  Branch (2319:6): [True: 0, False: 3.74k]
  ------------------
 2320|       |    /* There was no connection available. We will go to the pending state and
 2321|       |       wait for an available connection. */
 2322|      0|    multistate(data, MSTATE_PENDING);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2323|       |    /* move from process to pending set */
 2324|      0|    Curl_uint32_bset_remove(&multi->process, data->mid);
 2325|      0|    Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2326|      0|    Curl_uint32_bset_add(&multi->pending, data->mid);
 2327|      0|    *resultp = CURLE_OK;
 2328|      0|    return mresult;
 2329|      0|  }
 2330|  3.74k|  else
 2331|  3.74k|    multi_schedule_pending(data->multi);
 2332|       |
 2333|  3.74k|  if(!result) {
  ------------------
  |  Branch (2333:6): [True: 3.04k, False: 699]
  ------------------
 2334|       |    /* after the connect has been sent off, go WAITCONNECT unless the
 2335|       |       protocol connect is already done and we can go directly to WAITDO or
 2336|       |       DO! */
 2337|  3.04k|    mresult = CURLM_CALL_MULTI_PERFORM;
 2338|       |
 2339|  3.04k|    if(connected) {
  ------------------
  |  Branch (2339:8): [True: 0, False: 3.04k]
  ------------------
 2340|      0|      if(!data->conn->bits.reuse &&
  ------------------
  |  Branch (2340:10): [True: 0, False: 0]
  ------------------
 2341|      0|         Curl_conn_is_multiplex(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  233|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2341:10): [True: 0, False: 0]
  ------------------
 2342|       |        /* new connection, can multiplex, wake pending handles */
 2343|      0|        multi_schedule_pending(data->multi);
 2344|      0|      }
 2345|      0|      multistate(data, MSTATE_PROTOCONNECT);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2346|      0|    }
 2347|  3.04k|    else {
 2348|  3.04k|      multistate(data, MSTATE_CONNECTING);
  ------------------
  |  |  198|  3.04k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2349|  3.04k|    }
 2350|  3.04k|  }
 2351|  3.74k|  *resultp = result;
 2352|  3.74k|  return mresult;
 2353|  3.74k|}
multi.c:multistate_connecting:
 2507|  3.04k|{
 2508|  3.04k|  bool connected;
 2509|       |
 2510|  3.04k|  if(!data->conn) {
  ------------------
  |  Branch (2510:6): [True: 0, False: 3.04k]
  ------------------
 2511|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2511:5): [Folded, False: 0]
  |  Branch (2511:5): [Folded, False: 0]
  ------------------
 2512|      0|    *result = CURLE_FAILED_INIT;
 2513|      0|    return CURLM_OK;
 2514|      0|  }
 2515|  3.04k|  if(!Curl_xfer_recv_is_paused(data)) {
  ------------------
  |  Branch (2515:6): [True: 3.04k, False: 0]
  ------------------
 2516|  3.04k|    *result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &connected);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
                  *result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &connected);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 2517|  3.04k|    if(connected && !*result) {
  ------------------
  |  Branch (2517:8): [True: 3.04k, False: 0]
  |  Branch (2517:21): [True: 3.04k, False: 0]
  ------------------
 2518|  3.04k|      if(!data->conn->bits.reuse &&
  ------------------
  |  Branch (2518:10): [True: 3.04k, False: 0]
  ------------------
 2519|  3.04k|         Curl_conn_is_multiplex(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2519:10): [True: 0, False: 3.04k]
  ------------------
 2520|       |        /* new connection, can multiplex, wake pending handles */
 2521|      0|        multi_schedule_pending(data->multi);
 2522|      0|      }
 2523|  3.04k|      multistate(data, MSTATE_PROTOCONNECT);
  ------------------
  |  |  198|  3.04k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2524|  3.04k|      return CURLM_CALL_MULTI_PERFORM;
 2525|  3.04k|    }
 2526|      0|    else if(*result) {
  ------------------
  |  Branch (2526:13): [True: 0, False: 0]
  ------------------
 2527|       |      /* failure detected */
 2528|      0|      CURL_TRC_M(data, "connect failed -> %d", (int)*result);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2529|      0|      multi_posttransfer(data);
 2530|      0|      multi_done(data, *result, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2531|      0|      *stream_error = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2532|      0|      return CURLM_OK;
 2533|      0|    }
 2534|  3.04k|  }
 2535|      0|  return CURLM_OK;
 2536|  3.04k|}
multi.c:multistate_protoconnect:
 2541|  3.04k|{
 2542|  3.04k|  bool protocol_connected = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 2543|       |
 2544|  3.04k|  if(!*result && data->conn->bits.reuse) {
  ------------------
  |  Branch (2544:6): [True: 3.04k, False: 0]
  |  Branch (2544:18): [True: 0, False: 3.04k]
  ------------------
 2545|       |    /* ftp seems to hang when protoconnect on reused connection since we
 2546|       |     * handle PROTOCONNECT in general inside the filters, it seems wrong to
 2547|       |     * restart this on a reused connection.
 2548|       |     */
 2549|      0|    multistate(data, MSTATE_DO);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2550|      0|    return CURLM_CALL_MULTI_PERFORM;
 2551|      0|  }
 2552|  3.04k|  if(!*result)
  ------------------
  |  Branch (2552:6): [True: 3.04k, False: 0]
  ------------------
 2553|  3.04k|    *result = protocol_connect(data, &protocol_connected);
 2554|  3.04k|  if(!*result && !protocol_connected) {
  ------------------
  |  Branch (2554:6): [True: 3.04k, False: 0]
  |  Branch (2554:18): [True: 0, False: 3.04k]
  ------------------
 2555|       |    /* switch to waiting state */
 2556|      0|    multistate(data, MSTATE_PROTOCONNECTING);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2557|      0|    return CURLM_CALL_MULTI_PERFORM;
 2558|      0|  }
 2559|  3.04k|  else if(!*result) {
  ------------------
  |  Branch (2559:11): [True: 3.04k, False: 0]
  ------------------
 2560|       |    /* protocol connect has completed, go WAITDO or DO */
 2561|  3.04k|    multistate(data, MSTATE_DO);
  ------------------
  |  |  198|  3.04k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2562|  3.04k|    return CURLM_CALL_MULTI_PERFORM;
 2563|  3.04k|  }
 2564|       |
 2565|       |  /* failure detected */
 2566|      0|  multi_posttransfer(data);
 2567|      0|  multi_done(data, *result, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2568|       |  *stream_error = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2569|      0|  return CURLM_OK;
 2570|  3.04k|}
multi.c:protocol_connect:
 1904|  3.04k|{
 1905|  3.04k|  struct connectdata *conn = data->conn;
 1906|  3.04k|  CURLcode result = CURLE_OK;
 1907|       |
 1908|  3.04k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1908:3): [True: 0, False: 3.04k]
  |  Branch (1908:3): [True: 3.04k, False: 0]
  ------------------
 1909|  3.04k|  DEBUGASSERT(protocol_done);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1909:3): [True: 0, False: 3.04k]
  |  Branch (1909:3): [True: 3.04k, False: 0]
  ------------------
 1910|  3.04k|  DEBUGASSERT(Curl_conn_is_connected(conn, FIRSTSOCKET));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1910:3): [True: 0, False: 3.04k]
  |  Branch (1910:3): [True: 3.04k, False: 0]
  ------------------
 1911|       |
 1912|  3.04k|  *protocol_done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1913|  3.04k|  if(!conn->bits.protoconnstart) {
  ------------------
  |  Branch (1913:6): [True: 3.04k, False: 0]
  ------------------
 1914|  3.04k|    if(conn->scheme->run->connect_it) {
  ------------------
  |  Branch (1914:8): [True: 0, False: 3.04k]
  ------------------
 1915|       |      /* Call the protocol-specific connect function */
 1916|      0|      result = conn->scheme->run->connect_it(data, protocol_done);
 1917|      0|      if(result)
  ------------------
  |  Branch (1917:10): [True: 0, False: 0]
  ------------------
 1918|      0|        return result;
 1919|      0|    }
 1920|  3.04k|    conn->bits.protoconnstart = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1921|  3.04k|  }
 1922|       |
 1923|       |  /* Unless this protocol does not have any protocol-connect callback, as
 1924|       |     then we know we are done. */
 1925|  3.04k|  if(!conn->scheme->run->connecting)
  ------------------
  |  Branch (1925:6): [True: 3.04k, False: 0]
  ------------------
 1926|  3.04k|    *protocol_done = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1927|  3.04k|  return CURLE_OK;
 1928|  3.04k|}
multi.c:multistate_do:
 2152|  3.04k|{
 2153|  3.04k|  CURLMcode mresult = CURLM_OK;
 2154|  3.04k|  CURLcode result = CURLE_OK;
 2155|  3.04k|  if(data->set.fprereq) {
  ------------------
  |  Branch (2155:6): [True: 0, False: 3.04k]
  ------------------
 2156|      0|    struct Curl_mapi_guard guard;
 2157|      0|    int prereq_rc;
 2158|       |
 2159|       |    /* call the prerequest callback function */
 2160|      0|    CURL_CBAPI_START(&guard, data, easy_fprereq);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
 2161|      0|    prereq_rc = data->set.fprereq(data->set.prereq_userp,
 2162|      0|                                  data->info.primary.remote_ip,
 2163|      0|                                  data->info.primary.local_ip,
 2164|      0|                                  data->info.primary.remote_port,
 2165|      0|                                  data->info.primary.local_port);
 2166|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
 2167|      0|    if(prereq_rc != CURL_PREREQFUNC_OK) {
  ------------------
  |  |  508|      0|#define CURL_PREREQFUNC_OK 0
  ------------------
  |  Branch (2167:8): [True: 0, False: 0]
  ------------------
 2168|      0|      failf(data, "operation aborted by pre-request callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2169|       |      /* failure in pre-request callback - do not do any other processing */
 2170|      0|      result = CURLE_ABORTED_BY_CALLBACK;
 2171|      0|      multi_posttransfer(data);
 2172|      0|      multi_done(data, result, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2173|      0|      *stream_errorp = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2174|      0|      goto end;
 2175|      0|    }
 2176|      0|  }
 2177|       |
 2178|  3.04k|  if(data->set.connect_only && !data->set.connect_only_ws) {
  ------------------
  |  Branch (2178:6): [True: 0, False: 3.04k]
  |  Branch (2178:32): [True: 0, False: 0]
  ------------------
 2179|      0|    multistate(data, MSTATE_DONE);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2180|      0|    mresult = CURLM_CALL_MULTI_PERFORM;
 2181|      0|  }
 2182|  3.04k|  else {
 2183|  3.04k|    bool dophase_done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 2184|       |    /* Perform the protocol's DO action */
 2185|  3.04k|    result = multi_do(data, &dophase_done);
 2186|       |
 2187|  3.04k|    if(!result) {
  ------------------
  |  Branch (2187:8): [True: 2.86k, False: 177]
  ------------------
 2188|  2.86k|      if(!dophase_done) {
  ------------------
  |  Branch (2188:10): [True: 0, False: 2.86k]
  ------------------
 2189|      0|#ifndef CURL_DISABLE_FTP
 2190|       |        /* some steps needed for wildcard matching */
 2191|      0|        if(data->state.wildcardmatch) {
  ------------------
  |  Branch (2191:12): [True: 0, False: 0]
  ------------------
 2192|      0|          struct WildcardData *wc = data->wildcard;
 2193|      0|          if(wc->state == CURLWC_DONE || wc->state == CURLWC_SKIP) {
  ------------------
  |  Branch (2193:14): [True: 0, False: 0]
  |  Branch (2193:42): [True: 0, False: 0]
  ------------------
 2194|       |            /* skip some states if it is important */
 2195|      0|            multi_done(data, CURLE_OK, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2196|       |
 2197|       |            /* if there is no connection left, skip the DONE state */
 2198|      0|            multistate(data, data->conn ? MSTATE_DONE : MSTATE_COMPLETED);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (198:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2199|      0|            mresult = CURLM_CALL_MULTI_PERFORM;
 2200|      0|            goto end;
 2201|      0|          }
 2202|      0|        }
 2203|      0|#endif
 2204|       |        /* DO was not completed in one function call, we must continue
 2205|       |           DOING... */
 2206|      0|        multistate(data, MSTATE_DOING);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2207|      0|        mresult = CURLM_CALL_MULTI_PERFORM;
 2208|      0|      }
 2209|       |
 2210|       |      /* after DO, go DO_DONE... or DO_MORE */
 2211|  2.86k|      else if(data->conn->bits.do_more) {
  ------------------
  |  Branch (2211:15): [True: 0, False: 2.86k]
  ------------------
 2212|       |        /* we are supposed to do more, but we need to sit down, relax and wait
 2213|       |           a little while first */
 2214|      0|        multistate(data, MSTATE_DOING_MORE);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2215|      0|        mresult = CURLM_CALL_MULTI_PERFORM;
 2216|      0|      }
 2217|  2.86k|      else {
 2218|       |        /* we are done with the DO, now DID */
 2219|  2.86k|        multistate(data, MSTATE_DID);
  ------------------
  |  |  198|  2.86k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2220|  2.86k|        mresult = CURLM_CALL_MULTI_PERFORM;
 2221|  2.86k|      }
 2222|  2.86k|    }
 2223|    177|    else if((result == CURLE_SEND_ERROR) &&
  ------------------
  |  Branch (2223:13): [True: 2, False: 175]
  ------------------
 2224|      2|            data->conn->bits.reuse) {
  ------------------
  |  Branch (2224:13): [True: 0, False: 2]
  ------------------
 2225|       |      /*
 2226|       |       * In this situation, a connection that we were trying to use may have
 2227|       |       * unexpectedly died. If possible, send the connection back to the
 2228|       |       * CONNECT phase so we can try again.
 2229|       |       */
 2230|      0|      const struct Curl_scheme *handler = data->conn->scheme;
 2231|      0|      char *newurl = NULL;
 2232|      0|      followtype follow = FOLLOW_NONE;
 2233|      0|      CURLcode drc;
 2234|       |
 2235|      0|      drc = Curl_retry_request(data, &newurl);
 2236|      0|      if(drc) {
  ------------------
  |  Branch (2236:10): [True: 0, False: 0]
  ------------------
 2237|       |        /* a failure here pretty much implies an out of memory */
 2238|      0|        result = drc;
 2239|      0|        *stream_errorp = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2240|      0|      }
 2241|       |
 2242|      0|      multi_posttransfer(data);
 2243|      0|      drc = multi_done(data, result, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2244|       |
 2245|       |      /* When set to retry the connection, we must go back to the CONNECT
 2246|       |       * state */
 2247|      0|      if(newurl) {
  ------------------
  |  Branch (2247:10): [True: 0, False: 0]
  ------------------
 2248|      0|        if(!drc || (drc == CURLE_SEND_ERROR)) {
  ------------------
  |  Branch (2248:12): [True: 0, False: 0]
  |  Branch (2248:20): [True: 0, False: 0]
  ------------------
 2249|      0|          follow = FOLLOW_RETRY;
 2250|      0|          drc = multi_follow(data, handler, newurl, follow);
 2251|      0|          if(!drc) {
  ------------------
  |  Branch (2251:14): [True: 0, False: 0]
  ------------------
 2252|      0|            multistate(data, MSTATE_SETUP);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2253|      0|            mresult = CURLM_CALL_MULTI_PERFORM;
 2254|      0|            result = CURLE_OK;
 2255|      0|          }
 2256|      0|          else {
 2257|       |            /* Follow failed */
 2258|      0|            result = drc;
 2259|      0|          }
 2260|      0|        }
 2261|      0|        else {
 2262|       |          /* done did not return OK or SEND_ERROR */
 2263|      0|          result = drc;
 2264|      0|        }
 2265|      0|      }
 2266|      0|      else {
 2267|       |        /* Have error handler disconnect conn if we cannot retry */
 2268|      0|        *stream_errorp = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2269|      0|      }
 2270|      0|      curlx_free(newurl);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2271|      0|    }
 2272|    177|    else {
 2273|       |      /* failure detected */
 2274|    177|      multi_posttransfer(data);
 2275|    177|      if(data->conn)
  ------------------
  |  Branch (2275:10): [True: 177, False: 0]
  ------------------
 2276|    177|        multi_done(data, result, FALSE);
  ------------------
  |  | 1000|    177|#define FALSE false
  ------------------
 2277|    177|      *stream_errorp = TRUE;
  ------------------
  |  |  997|    177|#define TRUE true
  ------------------
 2278|    177|    }
 2279|  3.04k|  }
 2280|  3.04k|end:
 2281|  3.04k|  *resultp = result;
 2282|  3.04k|  return mresult;
 2283|  3.04k|}
multi.c:multi_do:
 1773|  3.04k|{
 1774|  3.04k|  CURLcode result = CURLE_OK;
 1775|  3.04k|  struct connectdata *conn = data->conn;
 1776|       |
 1777|  3.04k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1777:3): [True: 0, False: 3.04k]
  |  Branch (1777:3): [True: 3.04k, False: 0]
  ------------------
 1778|  3.04k|  DEBUGASSERT(conn->scheme);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1778:3): [True: 0, False: 3.04k]
  |  Branch (1778:3): [True: 3.04k, False: 0]
  ------------------
 1779|       |
 1780|  3.04k|  if(conn->scheme->run->do_it)
  ------------------
  |  Branch (1780:6): [True: 3.04k, False: 0]
  ------------------
 1781|  3.04k|    result = conn->scheme->run->do_it(data, done);
 1782|       |
 1783|  3.04k|  return result;
 1784|  3.04k|}
multi.c:multistate_did:
 2653|  2.86k|{
 2654|  2.86k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  2.86k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2654:3): [True: 0, False: 2.86k]
  |  Branch (2654:3): [True: 2.86k, False: 0]
  ------------------
 2655|  2.86k|  if(data->conn->bits.multiplex)
  ------------------
  |  Branch (2655:6): [True: 0, False: 2.86k]
  ------------------
 2656|       |    /* Check if we can move pending requests to send pipe */
 2657|      0|    multi_schedule_pending(multi); /* multiplexed */
 2658|       |
 2659|       |  /* Only perform the transfer if there is a good socket to work with.
 2660|       |     Having both BAD is a signal to skip immediately to DONE */
 2661|  2.86k|  if(CONN_SOCK_IDX_VALID(data->conn->recv_idx) ||
  ------------------
  |  |  310|  5.73k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 0, False: 2.86k]
  |  |  |  Branch (310:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2662|  2.86k|     CONN_SOCK_IDX_VALID(data->conn->send_idx)) {
  ------------------
  |  |  310|  2.86k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (310:36): [True: 0, False: 2.86k]
  |  |  |  Branch (310:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2663|      0|    multistate(data, MSTATE_PERFORMING);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2664|       |    /* Do not return CURLM_CALL_MULTI_PERFORM to give other transfers
 2665|       |     * a chance to send off their requests.
 2666|       |     * Note: Some SFTP handlers do not seem to like this.
 2667|       |     *       Restrict it to HTTP families. */
 2668|      0|    return ((multi->xfers_alive > 1) &&
  ------------------
  |  Branch (2668:13): [True: 0, False: 0]
  ------------------
 2669|      0|            (data->conn->scheme->protocol & PROTO_FAMILY_HTTP)) ?
  ------------------
  |  |   82|      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 | \
  |  |  ------------------
  |  |  |  |   61|      0|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   83|      0|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (2669:13): [True: 0, False: 0]
  ------------------
 2670|      0|           CURLM_OK : CURLM_CALL_MULTI_PERFORM;
 2671|      0|  }
 2672|  2.86k|  else {
 2673|  2.86k|#ifndef CURL_DISABLE_FTP
 2674|  2.86k|    if(data->state.wildcardmatch &&
  ------------------
  |  Branch (2674:8): [True: 0, False: 2.86k]
  ------------------
 2675|      0|       ((data->conn->scheme->flags & PROTOPT_WILDCARD) == 0)) {
  ------------------
  |  |  227|      0|#define PROTOPT_WILDCARD (1 << 12)  /* protocol supports wildcard matching */
  ------------------
  |  Branch (2675:8): [True: 0, False: 0]
  ------------------
 2676|      0|      data->wildcard->state = CURLWC_DONE;
 2677|      0|    }
 2678|  2.86k|#endif
 2679|  2.86k|    multistate(data, MSTATE_DONE);
  ------------------
  |  |  198|  2.86k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2680|  2.86k|    return CURLM_CALL_MULTI_PERFORM;
 2681|  2.86k|  }
 2682|  2.86k|}
multi.c:multistate_done:
 2685|  2.86k|{
 2686|  2.86k|  if(data->conn) {
  ------------------
  |  Branch (2686:6): [True: 2.86k, False: 0]
  ------------------
 2687|  2.86k|    CURLcode result;
 2688|       |
 2689|       |    /* post-transfer command */
 2690|  2.86k|    result = multi_done(data, *presult, FALSE);
  ------------------
  |  | 1000|  2.86k|#define FALSE false
  ------------------
 2691|       |
 2692|       |    /* allow a previously set error code take precedence */
 2693|  2.86k|    if(!(*presult))
  ------------------
  |  Branch (2693:8): [True: 2.86k, False: 0]
  ------------------
 2694|  2.86k|      *presult = result;
 2695|  2.86k|  }
 2696|       |
 2697|  2.86k|#ifndef CURL_DISABLE_FTP
 2698|  2.86k|  if(data->state.wildcardmatch) {
  ------------------
  |  Branch (2698:6): [True: 0, False: 2.86k]
  ------------------
 2699|      0|    if(data->wildcard->state != CURLWC_DONE) {
  ------------------
  |  Branch (2699:8): [True: 0, False: 0]
  ------------------
 2700|       |      /* if a wildcard is set and we are not ending -> lets start again
 2701|       |         with MSTATE_INIT */
 2702|      0|      multistate(data, MSTATE_INIT);
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2703|      0|      return CURLM_CALL_MULTI_PERFORM;
 2704|      0|    }
 2705|      0|  }
 2706|  2.86k|#endif
 2707|       |  /* after we have DONE what we are supposed to do, go COMPLETED, and
 2708|       |     it does not matter what the multi_done() returned! */
 2709|  2.86k|  multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  198|  2.86k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2710|  2.86k|  return CURLM_CALL_MULTI_PERFORM;
 2711|  2.86k|}
multi.c:is_finished:
 2361|  26.0k|{
 2362|  26.0k|  if(data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (2362:6): [True: 23.2k, False: 2.86k]
  ------------------
 2363|  23.2k|    if(result) {
  ------------------
  |  Branch (2363:8): [True: 876, False: 22.3k]
  ------------------
 2364|       |      /*
 2365|       |       * If an error was returned, and we are not in completed state now,
 2366|       |       * then we go to completed and consider this transfer aborted.
 2367|       |       */
 2368|       |
 2369|       |      /* No attempt to disconnect connections must be made before this -
 2370|       |         connection detach and termination happens only here */
 2371|       |
 2372|       |      /* Check if we can move pending requests to send pipe */
 2373|    876|      multi_schedule_pending(multi); /* connection */
 2374|       |
 2375|    876|      if(data->conn) {
  ------------------
  |  Branch (2375:10): [True: 0, False: 876]
  ------------------
 2376|      0|        if(stream_error) {
  ------------------
  |  Branch (2376:12): [True: 0, False: 0]
  ------------------
 2377|       |          /* Do not attempt to send data over a connection that timed out */
 2378|      0|          bool dead_connection = result == CURLE_OPERATION_TIMEDOUT;
 2379|      0|          struct connectdata *conn = data->conn;
 2380|       |
 2381|       |          /* This is where we make sure that the conn pointer is reset.
 2382|       |             We do not have to do this in every case block above where a
 2383|       |             failure is detected */
 2384|      0|          Curl_detach_connection(data);
 2385|      0|          Curl_conn_close(data, conn, dead_connection);
 2386|      0|        }
 2387|      0|      }
 2388|    876|      else if(data->mstate == MSTATE_CONNECT) {
  ------------------
  |  Branch (2388:15): [True: 699, False: 177]
  ------------------
 2389|       |        /* Curl_connect() failed */
 2390|    699|        multi_posttransfer(data);
 2391|    699|        Curl_pgrsUpdate_nometer(data);
 2392|    699|      }
 2393|       |
 2394|    876|      multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  198|    876|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2395|    876|      return result;
 2396|    876|    }
 2397|       |    /* if there is still a connection to use, call the progress function */
 2398|  22.3k|    else if(data->conn && Curl_conn_is_connected(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  233|  14.8k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2398:13): [True: 14.8k, False: 7.48k]
  |  Branch (2398:27): [True: 11.8k, False: 3.04k]
  ------------------
 2399|  11.8k|      result = Curl_pgrsUpdateX(data, pnow);
 2400|  11.8k|      if(result) {
  ------------------
  |  Branch (2400:10): [True: 0, False: 11.8k]
  ------------------
 2401|       |        /* aborted due to progress callback return code must close the
 2402|       |           connection */
 2403|      0|        streamclose(data->conn);
  ------------------
  |  |   68|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   64|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 2404|       |
 2405|       |        /* if not yet in DONE state, go there, otherwise COMPLETED */
 2406|      0|        multistate(data, (data->mstate < MSTATE_DONE) ?
  ------------------
  |  |  198|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (198:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2407|      0|                   MSTATE_DONE : MSTATE_COMPLETED);
 2408|      0|        return result;
 2409|      0|      }
 2410|  11.8k|    }
 2411|  23.2k|  }
 2412|  25.2k|  return result;
 2413|  26.0k|}
multi.c:handle_completed:
 2418|  3.74k|{
 2419|  3.74k|  bool msg_to_app = data->master_mid == UINT32_MAX;
 2420|       |
 2421|  3.74k|  if(!msg_to_app) {
  ------------------
  |  Branch (2421:6): [True: 0, False: 3.74k]
  ------------------
 2422|       |    /* A sub transfer, not reported to the application. Is anyone still
 2423|       |     * interested in processing its results? */
 2424|      0|    if(data->sub_xfer_done) {
  ------------------
  |  Branch (2424:8): [True: 0, False: 0]
  ------------------
 2425|      0|      struct Curl_easy *master = Curl_multi_get_easy(multi, data->master_mid);
 2426|       |
 2427|      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]
  |  |  ------------------
  ------------------
 2428|      0|      if(master)
  ------------------
  |  Branch (2428:10): [True: 0, False: 0]
  ------------------
 2429|      0|        data->sub_xfer_done(data, master, result);
 2430|      0|      else
 2431|      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]
  |  |  ------------------
  ------------------
 2432|      0|    }
 2433|      0|  }
 2434|  3.74k|  else {
 2435|       |    /* now fill in the CURLMsg with this info */
 2436|  3.74k|    struct CURLMsg *msg = &data->msg;
 2437|       |
 2438|  3.74k|    msg->msg = CURLMSG_DONE;
 2439|  3.74k|    msg->easy_handle = data;
 2440|  3.74k|    msg->data.result = result;
 2441|       |
 2442|  3.74k|    DEBUGASSERT(!data->conn);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2442:5): [True: 0, False: 3.74k]
  |  Branch (2442:5): [True: 3.74k, False: 0]
  ------------------
 2443|  3.74k|  }
 2444|  3.74k|  multistate(data, MSTATE_MSGSENT);
  ------------------
  |  |  198|  3.74k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2445|       |
 2446|       |  /* remove from the other sets */
 2447|  3.74k|  Curl_uint32_bset_remove(&multi->process, data->mid);
 2448|  3.74k|  Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2449|  3.74k|  Curl_uint32_bset_remove(&multi->pending, data->mid);
 2450|  3.74k|  if(msg_to_app)
  ------------------
  |  Branch (2450:6): [True: 3.74k, False: 0]
  ------------------
 2451|  3.74k|    multi_addmsg(multi, data);
 2452|  3.74k|  if(data->state.really_alive) {
  ------------------
  |  Branch (2452:6): [True: 3.74k, False: 0]
  ------------------
 2453|  3.74k|    data->state.really_alive = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2454|  3.74k|    --multi->xfers_really_alive;
 2455|  3.74k|    if(!multi->xfers_really_alive)
  ------------------
  |  Branch (2455:8): [True: 3.74k, False: 0]
  ------------------
 2456|  3.74k|      (void)multi_assess_wakeup(multi);
 2457|  3.74k|  }
 2458|  3.74k|  --multi->xfers_alive;
 2459|  3.74k|  if(!multi->xfers_alive)
  ------------------
  |  Branch (2459:6): [True: 3.74k, False: 0]
  ------------------
 2460|  3.74k|    multi_assess_wakeup(multi);
 2461|  3.74k|}
multi.c:multi_addmsg:
  218|  3.74k|{
  219|  3.74k|  if(Curl_uint32_bset_empty(&multi->msgsent))
  ------------------
  |  Branch (219:6): [True: 3.74k, False: 0]
  ------------------
  220|  3.74k|    CURLM_NTFY(multi->admin, CURLMNOTIFY_INFO_READ);
  ------------------
  |  |   51|  3.74k|  do {                                                \
  |  |   52|  3.74k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 3.74k, False: 0]
  |  |  |  Branch (52:15): [True: 3.74k, False: 0]
  |  |  |  Branch (52:29): [True: 0, False: 3.74k]
  |  |  ------------------
  |  |   53|  3.74k|      Curl_mntfy_add((d), (t));                       \
  |  |   54|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (54:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  221|  3.74k|  Curl_uint32_bset_add(&multi->msgsent, data->mid);
  222|  3.74k|}
multi.c:multi_ischanged:
 1723|  30.5k|{
 1724|  30.5k|  bool retval = FALSE;
  ------------------
  |  | 1000|  30.5k|#define FALSE false
  ------------------
 1725|  30.5k|  DEBUGASSERT(multi);
  ------------------
  |  | 1027|  30.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1725:3): [True: 0, False: 30.5k]
  |  Branch (1725:3): [True: 30.5k, False: 0]
  ------------------
 1726|  30.5k|  if(multi) {
  ------------------
  |  Branch (1726:6): [True: 30.5k, False: 0]
  ------------------
 1727|  30.5k|    retval = (bool)multi->recheckstate;
 1728|  30.5k|    if(clear)
  ------------------
  |  Branch (1728:8): [True: 29.8k, False: 699]
  ------------------
 1729|  29.8k|      multi->recheckstate = FALSE;
  ------------------
  |  | 1000|  29.8k|#define FALSE false
  ------------------
 1730|  30.5k|  }
 1731|  30.5k|  return retval;
 1732|  30.5k|}
multi.c:multi_handle_timeout:
 1815|  19.3k|{
 1816|  19.3k|  timediff_t timeout_ms;
 1817|       |
 1818|  19.3k|  timeout_ms = Curl_timeleft_now_ms(data, pnow);
 1819|  19.3k|  if(timeout_ms < 0) {
  ------------------
  |  Branch (1819:6): [True: 0, False: 19.3k]
  ------------------
 1820|       |    /* Handle timed out */
 1821|      0|    timerid base_timer = Curl_is_connecting(data) ?
  ------------------
  |  Branch (1821:26): [True: 0, False: 0]
  ------------------
 1822|      0|                         TIMER_STARTSINGLE : TIMER_STARTOP;
 1823|      0|    timediff_t elapsed_ms = Curl_pgrs_since_ms(data, NULL, base_timer);
 1824|      0|    if(data->mstate == MSTATE_CONNECTING)
  ------------------
  |  Branch (1824:8): [True: 0, False: 0]
  ------------------
 1825|      0|      failf(data, "%s timed out after %" FMT_TIMEDIFF_T " milliseconds",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1826|      0|            data->conn->bits.dns_resolved ? "Connection" : "Resolving",
  ------------------
  |  Branch (1826:13): [True: 0, False: 0]
  ------------------
 1827|      0|            elapsed_ms);
 1828|      0|    else {
 1829|      0|      struct SingleRequest *k = &data->req;
 1830|      0|      if(k->size != -1) {
  ------------------
  |  Branch (1830:10): [True: 0, False: 0]
  ------------------
 1831|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1832|      0|              " milliseconds with %" FMT_OFF_T " out of %"
 1833|      0|              FMT_OFF_T " bytes received",
 1834|      0|              elapsed_ms, k->bytecount, k->size);
 1835|      0|      }
 1836|      0|      else {
 1837|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1838|      0|              " milliseconds with %" FMT_OFF_T " bytes received",
 1839|      0|              elapsed_ms, k->bytecount);
 1840|      0|      }
 1841|      0|    }
 1842|      0|    *result = CURLE_OPERATION_TIMEDOUT;
 1843|      0|    if(data->conn) {
  ------------------
  |  Branch (1843:8): [True: 0, False: 0]
  ------------------
 1844|       |      /* Force connection closed if the connection has indeed been used */
 1845|      0|      if(data->mstate > MSTATE_DO) {
  ------------------
  |  Branch (1845:10): [True: 0, False: 0]
  ------------------
 1846|      0|        streamclose(data->conn);
  ------------------
  |  |   68|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   64|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 1847|      0|        *stream_error = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1848|      0|      }
 1849|      0|      (void)multi_done(data, *result, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1850|      0|    }
 1851|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1852|      0|  }
 1853|       |
 1854|  19.3k|  return FALSE;
  ------------------
  |  | 1000|  19.3k|#define FALSE false
  ------------------
 1855|  19.3k|}
multi.c:multi_timeouts_init:
 3125|  11.2k|{
 3126|  11.2k|  data->state.timeouts.first = EXPIRE_LAST;
 3127|       |  data->state.timeouts.splaynode.registered = FALSE;
  ------------------
  |  | 1000|  11.2k|#define FALSE false
  ------------------
 3128|  11.2k|}
multi.c:multi_set_timeout:
 3694|  7.48k|{
 3695|  7.48k|  struct expire_timers *timeouts = &data->state.timeouts;
 3696|  7.48k|  uint8_t *anchor = &timeouts->first;
 3697|  7.48k|  uint8_t id = (uint8_t)eid;
 3698|       |
 3699|  7.48k|  if((unsigned)eid >= EXPIRE_LAST) {
  ------------------
  |  Branch (3699:6): [True: 0, False: 7.48k]
  ------------------
 3700|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3700:5): [Folded, False: 0]
  |  Branch (3700:5): [Folded, False: 0]
  ------------------
 3701|      0|    return CURLM_BAD_FUNCTION_ARGUMENT;
 3702|      0|  }
 3703|       |  /* remove from list, store time and re-insert */
 3704|  7.48k|  multi_clear_timeout(data, eid);
 3705|  7.48k|  timeouts->offset_us[id] =
 3706|  7.48k|    Curl_timeouts_offset_us(&data->multi->timeouts, stamp);
 3707|       |
 3708|  11.2k|  while(*anchor < EXPIRE_LAST) {
  ------------------
  |  Branch (3708:9): [True: 3.74k, False: 7.48k]
  ------------------
 3709|  3.74k|    if(timeouts->offset_us[*anchor] > timeouts->offset_us[id])
  ------------------
  |  Branch (3709:8): [True: 0, False: 3.74k]
  ------------------
 3710|      0|      break;
 3711|  3.74k|    anchor = &timeouts->next[*anchor];
 3712|  3.74k|  }
 3713|  7.48k|  timeouts->next[eid] = *anchor;
 3714|  7.48k|  timeouts->next[eid] = *anchor;
 3715|  7.48k|  *anchor = id;
 3716|  7.48k|  DEBUGASSERT(multi_timeouts_check(data));
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3716:3): [True: 0, False: 7.48k]
  |  Branch (3716:3): [True: 7.48k, False: 0]
  ------------------
 3717|  7.48k|  CURL_TRC_TIMER(data, eid, "set for %" FMT_TIMEDIFF_T "us",
  ------------------
  |  |  173|  7.48k|  do {                                        \
  |  |  174|  7.48k|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  7.48k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  7.48k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  14.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 7.48k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 7.48k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  14.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 7.48k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  7.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|  7.48k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  7.48k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 7.48k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  7.48k|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
 3718|  7.48k|                 curlx_ptimediff_us(stamp, Curl_pgrs_now(data)));
 3719|  7.48k|  return CURLM_OK;
 3720|  7.48k|}
multi.c:multi_timeouts_check:
 3622|  18.0k|{
 3623|  18.0k|  struct expire_timers *timeouts = &data->state.timeouts;
 3624|  18.0k|  uint8_t id;
 3625|  18.0k|  int i = 0;
 3626|  39.0k|  for(id = timeouts->first; id < EXPIRE_LAST; id = timeouts->next[id]) {
  ------------------
  |  Branch (3626:29): [True: 21.0k, False: 18.0k]
  ------------------
 3627|  21.0k|    if(++i >= EXPIRE_LAST) {
  ------------------
  |  Branch (3627:8): [True: 0, False: 21.0k]
  ------------------
 3628|      0|      failf(data, "expire timeouts looped: %d iterations and no end", i);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3629|      0|      return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 3630|      0|    }
 3631|  21.0k|    if(id == timeouts->next[id]) {
  ------------------
  |  Branch (3631:8): [True: 0, False: 21.0k]
  ------------------
 3632|      0|      failf(data, "expire timeouts wrong: %d points to itself", (int)id);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3633|      0|      return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 3634|      0|    }
 3635|  21.0k|    if((timeouts->next[id] < EXPIRE_LAST) &&
  ------------------
  |  Branch (3635:8): [True: 6.78k, False: 14.2k]
  ------------------
 3636|  6.78k|       (timeouts->offset_us[id] > timeouts->offset_us[timeouts->next[id]])) {
  ------------------
  |  Branch (3636:8): [True: 0, False: 6.78k]
  ------------------
 3637|      0|      failf(data, "expire timeouts not sorted: %d happens after %d but "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3638|      0|            "is listed before", (int)id, (int)timeouts->next[id]);
 3639|      0|      return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 3640|      0|    }
 3641|  21.0k|  }
 3642|  18.0k|  return TRUE;
  ------------------
  |  |  997|  18.0k|#define TRUE true
  ------------------
 3643|  18.0k|}
multi.c:multi_clear_timeout:
 3650|  10.5k|{
 3651|  10.5k|  struct expire_timers *timeouts = &data->state.timeouts;
 3652|  10.5k|  uint8_t orig_first = timeouts->first;
 3653|  10.5k|  uint8_t *anchor = &timeouts->first;
 3654|  10.5k|  uint8_t id = (uint8_t)eid;
 3655|       |
 3656|  10.5k|  if((unsigned)eid >= EXPIRE_LAST) {
  ------------------
  |  Branch (3656:6): [True: 0, False: 10.5k]
  ------------------
 3657|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3657:5): [Folded, False: 0]
  |  Branch (3657:5): [Folded, False: 0]
  ------------------
 3658|      0|    return;
 3659|      0|  }
 3660|       |
 3661|  20.3k|  while(*anchor < EXPIRE_LAST) {
  ------------------
  |  Branch (3661:9): [True: 9.82k, False: 10.5k]
  ------------------
 3662|  9.82k|    if(*anchor == id) {
  ------------------
  |  Branch (3662:8): [True: 0, False: 9.82k]
  ------------------
 3663|      0|      *anchor = timeouts->next[id];
 3664|      0|      break;
 3665|      0|    }
 3666|  9.82k|    anchor = &timeouts->next[*anchor];
 3667|  9.82k|  }
 3668|  10.5k|  DEBUGASSERT(multi_timeouts_check(data));
  ------------------
  |  | 1027|  10.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3668:3): [True: 0, False: 10.5k]
  |  Branch (3668:3): [True: 10.5k, False: 0]
  ------------------
 3669|  10.5k|  if(Curl_timeouts_has(data)) {
  ------------------
  |  Branch (3669:6): [True: 6.78k, False: 3.74k]
  ------------------
 3670|  6.78k|    struct Curl_multi *multi = data->multi;
 3671|       |
 3672|  6.78k|    if(!multi) {
  ------------------
  |  Branch (3672:8): [True: 0, False: 6.78k]
  ------------------
 3673|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3673:7): [Folded, False: 0]
  |  Branch (3673:7): [Folded, False: 0]
  ------------------
 3674|      0|      return;
 3675|      0|    }
 3676|  6.78k|    if((timeouts->first >= EXPIRE_LAST) || /* no more timeouts */
  ------------------
  |  Branch (3676:8): [True: 0, False: 6.78k]
  ------------------
 3677|  6.78k|       (timeouts->first != orig_first)) {  /* active timeout changed */
  ------------------
  |  Branch (3677:8): [True: 0, False: 6.78k]
  ------------------
 3678|      0|      Curl_timeouts_remove(&multi->timeouts, data);
 3679|      0|    }
 3680|  6.78k|    if((timeouts->first < EXPIRE_LAST) && !Curl_timeouts_has(data)) {
  ------------------
  |  Branch (3680:8): [True: 6.78k, False: 0]
  |  Branch (3680:43): [True: 0, False: 6.78k]
  ------------------
 3681|      0|      Curl_timeouts_add(&multi->timeouts, data,
 3682|      0|                        timeouts->offset_us[timeouts->first]);
 3683|      0|    }
 3684|  6.78k|  }
 3685|  10.5k|}
multi.c:multi_schedule_pending:
 3858|  14.4k|{
 3859|  14.4k|  uint32_t mid = multi->last_pending_mid;
 3860|       |
 3861|  14.4k|  if(mid) {
  ------------------
  |  Branch (3861:6): [True: 0, False: 14.4k]
  ------------------
 3862|      0|    while(Curl_uint32_bset_next(&multi->pending, mid, &mid)) {
  ------------------
  |  Branch (3862:11): [True: 0, False: 0]
  ------------------
 3863|      0|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3864|      0|      if(data) {
  ------------------
  |  Branch (3864:10): [True: 0, False: 0]
  ------------------
 3865|      0|        move_pending_to_connect(multi, data);
 3866|      0|        multi->last_pending_mid = mid;
 3867|      0|        return;
 3868|      0|      }
 3869|       |      /* transfer no longer known, should not happen */
 3870|      0|      Curl_uint32_bset_remove(&multi->pending, mid);
 3871|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3871:7): [Folded, False: 0]
  |  Branch (3871:7): [Folded, False: 0]
  ------------------
 3872|      0|    }
 3873|       |    /* found no pending transfers with `mid` larger than `last_pending_mid`.
 3874|       |     * Start at the beginning of the pending set again. */
 3875|      0|    multi->last_pending_mid = 0;
 3876|      0|  }
 3877|       |
 3878|  14.4k|  if(Curl_uint32_bset_first(&multi->pending, &mid)) {
  ------------------
  |  Branch (3878:6): [True: 0, False: 14.4k]
  ------------------
 3879|      0|    do {
 3880|      0|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3881|      0|      if(data) {
  ------------------
  |  Branch (3881:10): [True: 0, False: 0]
  ------------------
 3882|      0|        move_pending_to_connect(multi, data);
 3883|      0|        multi->last_pending_mid = mid;
 3884|      0|        return;
 3885|      0|      }
 3886|       |      /* transfer no longer known, should not happen */
 3887|      0|      Curl_uint32_bset_remove(&multi->pending, mid);
 3888|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3888:7): [Folded, False: 0]
  |  Branch (3888:7): [Folded, False: 0]
  ------------------
 3889|      0|    } while(Curl_uint32_bset_next(&multi->pending, mid, &mid));
  ------------------
  |  Branch (3889:13): [True: 0, False: 0]
  ------------------
 3890|      0|  }
 3891|  14.4k|}
multi.c:multi_xfer_bufs_free:
 4139|  3.74k|{
 4140|  3.74k|  DEBUGASSERT(multi);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4140:3): [True: 0, False: 3.74k]
  |  Branch (4140:3): [True: 3.74k, False: 0]
  ------------------
 4141|  3.74k|  curlx_safefree(multi->xfer_buf);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
 4142|  3.74k|  multi->xfer_buf_borrowed = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 4143|  3.74k|  curlx_safefree(multi->xfer_ulbuf);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
 4144|  3.74k|  multi->xfer_ulbuf_borrowed = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 4145|  3.74k|  curlx_safefree(multi->xfer_sockbuf);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
 4146|       |  multi->xfer_sockbuf_borrowed = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 4147|  3.74k|}
multi.c:multi_xfers_running:
 4167|  3.74k|{
 4168|  3.74k|  if(!multi) {
  ------------------
  |  Branch (4168:6): [True: 0, False: 3.74k]
  ------------------
 4169|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4169:5): [Folded, False: 0]
  |  Branch (4169:5): [Folded, False: 0]
  ------------------
 4170|      0|    return 0;
 4171|      0|  }
 4172|  3.74k|  return multi->xfers_alive;
 4173|  3.74k|}

Curl_multi_ev_socket_done:
  622|  3.04k|{
  623|  3.04k|  mev_forget_socket(multi, data, s, "socket done");
  624|  3.04k|}
Curl_multi_ev_xfer_done:
  628|  3.74k|{
  629|  3.74k|  DEBUGASSERT(!data->conn); /* transfer should have been detached */
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (629:3): [True: 0, False: 3.74k]
  |  Branch (629:3): [True: 3.74k, False: 0]
  ------------------
  630|  3.74k|  (void)mev_assess(multi, data, NULL);
  631|  3.74k|  Curl_meta_remove(data, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  3.74k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  632|  3.74k|}
Curl_multi_ev_conn_done:
  637|  3.04k|{
  638|  3.04k|  (void)mev_assess(multi, data, conn);
  639|  3.04k|  Curl_conn_meta_remove(conn, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  3.04k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  640|  3.04k|}
Curl_multi_ev_init:
  643|  3.74k|{
  644|  3.74k|  Curl_hash_init(&multi->ev.sh_entries, hashsize, CURL_HASH_TYPE_SOCKET,
  645|  3.74k|                 mev_sh_entry_dtor);
  646|  3.74k|}
Curl_multi_ev_cleanup:
  649|  3.74k|{
  650|  3.74k|  Curl_hash_destroy(&multi->ev.sh_entries);
  651|  3.74k|}
multi_ev.c:mev_assess:
  504|  6.78k|{
  505|  6.78k|  struct easy_pollset ps, *last_ps;
  506|  6.78k|  CURLMcode mresult = CURLM_OK;
  507|       |
  508|  6.78k|  if(!multi || !multi->socket_cb)
  ------------------
  |  Branch (508:6): [True: 0, False: 6.78k]
  |  Branch (508:16): [True: 6.78k, False: 0]
  ------------------
  509|  6.78k|    return CURLM_OK;
  510|       |
  511|      0|  Curl_pollset_init(&ps);
  512|      0|  if(conn) {
  ------------------
  |  Branch (512:6): [True: 0, False: 0]
  ------------------
  513|      0|    CURLcode result = Curl_conn_adjust_pollset(data, conn, &ps);
  514|      0|    if(result) {
  ------------------
  |  Branch (514:8): [True: 0, False: 0]
  ------------------
  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|      0|  }
  520|      0|  else
  521|      0|    Curl_multi_pollset(data, &ps);
  522|      0|  last_ps = mev_get_last_pollset(data, conn);
  523|       |
  524|      0|  if(!last_ps && ps.n) {
  ------------------
  |  Branch (524:6): [True: 0, False: 0]
  |  Branch (524:18): [True: 0, False: 0]
  ------------------
  525|      0|    if(conn)
  ------------------
  |  Branch (525:8): [True: 0, False: 0]
  ------------------
  526|      0|      last_ps = mev_add_new_conn_pollset(conn);
  527|      0|    else
  528|      0|      last_ps = mev_add_new_xfer_pollset(data);
  529|      0|    if(!last_ps) {
  ------------------
  |  Branch (529:8): [True: 0, False: 0]
  ------------------
  530|      0|      mresult = CURLM_OUT_OF_MEMORY;
  531|      0|      goto out;
  532|      0|    }
  533|      0|  }
  534|       |
  535|      0|  if(last_ps)
  ------------------
  |  Branch (535:6): [True: 0, False: 0]
  ------------------
  536|      0|    mresult = mev_pollset_diff(multi, data, conn, &ps, last_ps);
  537|      0|  else
  538|      0|    DEBUGASSERT(!ps.n);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (538:5): [True: 0, False: 0]
  |  Branch (538:5): [True: 0, False: 0]
  ------------------
  539|      0|out:
  540|      0|  Curl_pollset_cleanup(&ps);
  541|      0|  return mresult;
  542|      0|}
multi_ev.c:mev_sh_entry_get:
   73|  3.04k|{
   74|  3.04k|  if(s != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (74:6): [True: 3.04k, False: 0]
  ------------------
   75|       |    /* only look for proper sockets */
   76|  3.04k|    return Curl_hash_pick(sh, (const char *)&s, sizeof(curl_socket_t));
   77|  3.04k|  }
   78|      0|  return NULL;
   79|  3.04k|}
multi_ev.c:mev_forget_socket:
  226|  3.04k|{
  227|  3.04k|  struct mev_sh_entry *entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  228|  3.04k|  uint32_t mid;
  229|  3.04k|  int rc = 0;
  230|       |
  231|  3.04k|  if(!entry) /* we never knew or already forgot about this socket */
  ------------------
  |  Branch (231:6): [True: 3.04k, False: 0]
  ------------------
  232|  3.04k|    return CURLM_OK;
  233|       |
  234|       |  /* Remove the socket from any pollset that is still registered. */
  235|      0|  if(Curl_uint32_spbset_first(&entry->xfers, &mid)) {
  ------------------
  |  Branch (235:6): [True: 0, False: 0]
  ------------------
  236|      0|    do {
  237|      0|      struct Curl_easy *sdata = Curl_multi_get_easy(multi, mid);
  238|      0|      if(sdata) {
  ------------------
  |  Branch (238:10): [True: 0, False: 0]
  ------------------
  239|      0|        struct easy_pollset *ps = mev_get_last_pollset(sdata, NULL);
  240|      0|        if(ps)
  ------------------
  |  Branch (240:12): [True: 0, False: 0]
  ------------------
  241|      0|          Curl_pollset_remove(ps, s);
  242|      0|      }
  243|      0|    } while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid));
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|  }
  245|       |
  246|      0|  if(entry->conn) {
  ------------------
  |  Branch (246:6): [True: 0, False: 0]
  ------------------
  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|      0|  if(entry->announced && multi->socket_cb) {
  ------------------
  |  Branch (253:6): [True: 0, False: 0]
  |  Branch (253:26): [True: 0, False: 0]
  ------------------
  254|      0|    struct Curl_mapi_guard guard;
  255|       |
  256|      0|    NOVERBOSE((void)cause);
  ------------------
  |  | 1564|      0|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1135|      0|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1135:35): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|      0|    CURL_TRC_M(data, "ev %s, call(fd=%" FMT_SOCKET_T ", ev=REMOVE)", cause, 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]
  |  |  ------------------
  ------------------
  258|      0|    CURL_CBAPI_MULTI_START(&guard, multi, multi_socket_cb);
  ------------------
  |  |  203|      0|  Curl_cbapi_enter((g), NULL, (m), CURL_CBAPI_FN_##fn)
  ------------------
  259|      0|    rc = multi->socket_cb(data, s, CURL_POLL_REMOVE,
  ------------------
  |  |  286|      0|#define CURL_POLL_REMOVE 4
  ------------------
  260|      0|                          multi->socket_userp, entry->user_data);
  261|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  262|      0|    entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  263|      0|    if(entry)
  ------------------
  |  Branch (263:8): [True: 0, False: 0]
  ------------------
  264|      0|      entry->announced = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  265|      0|  }
  266|       |
  267|      0|  mev_sh_entry_kill(multi, s);
  268|      0|  if(rc == -1) {
  ------------------
  |  Branch (268:6): [True: 0, False: 0]
  ------------------
  269|      0|    multi->dead = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  270|      0|    return CURLM_ABORTED_BY_CALLBACK;
  271|      0|  }
  272|      0|  return CURLM_OK;
  273|      0|}

Curl_mntfy_init:
  130|  3.74k|{
  131|  3.74k|  memset(&multi->ntfy, 0, sizeof(multi->ntfy));
  132|  3.74k|}
Curl_mntfy_cleanup:
  135|  3.74k|{
  136|  3.74k|  while(multi->ntfy.head) {
  ------------------
  |  Branch (136:9): [True: 0, False: 3.74k]
  ------------------
  137|      0|    struct mntfy_chunk *chunk = multi->ntfy.head;
  138|      0|    multi->ntfy.head = chunk->next;
  139|      0|    mnfty_chunk_destroy(chunk);
  140|      0|  }
  141|       |  multi->ntfy.tail = NULL;
  142|  3.74k|}

Curl_netrc_init:
  669|  7.48k|{
  670|  7.48k|  curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE);
  ------------------
  |  |   77|  7.48k|#define MAX_NETRC_FILE  (128 * 1024)
  ------------------
  671|  7.48k|  store->loaded = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  672|       |  store->filename = NULL;
  673|  7.48k|}
Curl_netrc_cleanup:
  675|  10.5k|{
  676|  10.5k|  curlx_dyn_free(&store->filebuf);
  677|  10.5k|  curlx_safefree(store->filename);
  ------------------
  |  | 1284|  10.5k|  do {                      \
  |  | 1285|  10.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  10.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  10.5k|    (ptr) = NULL;           \
  |  | 1287|  10.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  678|       |  store->loaded = FALSE;
  ------------------
  |  | 1000|  10.5k|#define FALSE false
  ------------------
  679|  10.5k|}

Curl_peer_link:
  295|  33.4k|{
  296|  33.4k|  if(*pdest != src) {
  ------------------
  |  Branch (296:6): [True: 27.4k, False: 6.08k]
  ------------------
  297|  27.4k|    Curl_peer_unlink(pdest);
  298|  27.4k|    *pdest = src;
  299|  27.4k|    if(src) {
  ------------------
  |  Branch (299:8): [True: 27.4k, False: 0]
  ------------------
  300|  27.4k|      DEBUGASSERT(src->refcount < UINT32_MAX);
  ------------------
  |  | 1027|  27.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (300:7): [True: 0, False: 27.4k]
  |  Branch (300:7): [True: 27.4k, False: 0]
  ------------------
  301|  27.4k|      src->refcount++;
  302|  27.4k|    }
  303|  27.4k|  }
  304|  33.4k|}
Curl_peer_unlink:
  307|   141k|{
  308|   141k|  if(*ppeer) {
  ------------------
  |  Branch (308:6): [True: 33.5k, False: 108k]
  ------------------
  309|  33.5k|    struct Curl_peer *peer = *ppeer;
  310|       |
  311|  33.5k|    DEBUGASSERT(peer->refcount);
  ------------------
  |  | 1027|  33.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (311:5): [True: 0, False: 33.5k]
  |  Branch (311:5): [True: 33.5k, False: 0]
  ------------------
  312|  33.5k|    *ppeer = NULL;
  313|  33.5k|    if(peer->refcount)
  ------------------
  |  Branch (313:8): [True: 33.5k, False: 0]
  ------------------
  314|  33.5k|      peer->refcount--;
  315|  33.5k|    if(!peer->refcount) {
  ------------------
  |  Branch (315:8): [True: 6.11k, False: 27.4k]
  ------------------
  316|  6.11k|      curlx_free(peer);
  ------------------
  |  | 1428|  6.11k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  317|  6.11k|    }
  318|  33.5k|  }
  319|   141k|}
Curl_peer_equal:
  322|  12.3k|{
  323|  12.3k|  return (p1 == p2) ||
  ------------------
  |  Branch (323:10): [True: 9.30k, False: 3.04k]
  ------------------
  324|  3.04k|         (p1 && p2 &&
  ------------------
  |  Branch (324:11): [True: 3.04k, False: 0]
  |  Branch (324:17): [True: 3.04k, False: 0]
  ------------------
  325|  3.04k|          (p1->scheme == p2->scheme) &&
  ------------------
  |  Branch (325:11): [True: 3.04k, False: 0]
  ------------------
  326|  3.04k|          Curl_peer_same_destination(p1, p2));
  ------------------
  |  Branch (326:11): [True: 1, False: 3.04k]
  ------------------
  327|  12.3k|}
Curl_peer_same_destination:
  342|  12.1k|{
  343|  12.1k|  return (p1 == p2) ||
  ------------------
  |  Branch (343:10): [True: 9.12k, False: 3.04k]
  ------------------
  344|  3.04k|         (p1 && p2 &&
  ------------------
  |  Branch (344:11): [True: 3.04k, False: 0]
  |  Branch (344:17): [True: 3.04k, False: 0]
  ------------------
  345|  3.04k|          (p1->port == p2->port) &&
  ------------------
  |  Branch (345:11): [True: 3.04k, False: 0]
  ------------------
  346|  3.04k|          peer_same_hostname(p1, p2) &&
  ------------------
  |  Branch (346:11): [True: 1, False: 3.04k]
  ------------------
  347|      1|          (p1->scopeid == p2->scopeid) &&
  ------------------
  |  Branch (347:11): [True: 1, False: 0]
  ------------------
  348|      1|          (p1->scopeid || curl_strequal(p1->zoneid, p2->zoneid)));
  ------------------
  |  Branch (348:12): [True: 0, False: 1]
  |  Branch (348:27): [True: 1, False: 0]
  ------------------
  349|  12.1k|}
Curl_peer_from_url:
  355|  3.25k|{
  356|  3.25k|  struct peer_parse pp;
  357|  3.25k|  char *zoneid = NULL, *scheme = NULL, *hostname = NULL;
  358|  3.25k|  CURLUcode uc;
  359|  3.25k|  CURLcode result;
  360|       |
  361|  3.25k|  Curl_peer_unlink(ppeer);
  362|  3.25k|  memset(&pp, 0, sizeof(pp));
  363|       |
  364|  3.25k|  uc = curl_url_get(uh, CURLUPART_SCHEME, &scheme, 0);
  365|  3.25k|  if(uc)
  ------------------
  |  Branch (365:6): [True: 0, False: 3.25k]
  ------------------
  366|      0|    return Curl_uc_to_curlcode(uc);
  367|  3.25k|  pp.scheme = Curl_get_scheme(scheme);
  368|  3.25k|  if(!pp.scheme) {
  ------------------
  |  Branch (368:6): [True: 0, False: 3.25k]
  ------------------
  369|      0|    failf(data, "Protocol \"%s\" not supported%s", scheme,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  370|      0|          data->state.this_is_a_follow ? " (in redirect)" : "");
  ------------------
  |  Branch (370:11): [True: 0, False: 0]
  ------------------
  371|      0|    result = CURLE_UNSUPPORTED_PROTOCOL;
  372|      0|    goto out;
  373|      0|  }
  374|       |
  375|  3.25k|  uc = curl_url_get(uh, CURLUPART_HOST, &hostname, 0);
  376|  3.25k|  if(uc) {
  ------------------
  |  Branch (376:6): [True: 0, False: 3.25k]
  ------------------
  377|      0|    if((uc == CURLUE_NO_HOST) && (pp.scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  211|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (377:8): [True: 0, False: 0]
  |  Branch (377:34): [True: 0, False: 0]
  ------------------
  378|      0|      ; /* acceptable */
  379|      0|    else {
  380|      0|      result = CURLE_OUT_OF_MEMORY;
  381|      0|      goto out;
  382|      0|    }
  383|      0|  }
  384|  3.25k|  else if(strlen(hostname) > MAX_URL_LEN) {
  ------------------
  |  |   29|  3.25k|#define MAX_URL_LEN 0xffff
  ------------------
  |  Branch (384:11): [True: 0, False: 3.25k]
  ------------------
  385|      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
  ------------------
  386|      0|    result = CURLE_URL_MALFORMAT;
  387|      0|    goto out;
  388|      0|  }
  389|       |
  390|  3.25k|  pp.host_user.str = hostname ? hostname : "";
  ------------------
  |  Branch (390:22): [True: 3.25k, False: 0]
  ------------------
  391|  3.25k|  pp.host_user.len = strlen(pp.host_user.str);
  392|  3.25k|  if(pp.host_user.len) {
  ------------------
  |  Branch (392:6): [True: 3.25k, False: 0]
  ------------------
  393|  3.25k|    result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  | 1000|  3.25k|#define FALSE false
  ------------------
  394|  3.25k|    if(result)
  ------------------
  |  Branch (394:8): [True: 185, False: 3.06k]
  ------------------
  395|    185|      goto out;
  396|  3.25k|  }
  397|      0|  else
  398|      0|    pp.host = pp.host_user;
  399|       |
  400|  3.06k|  if(port_override) {
  ------------------
  |  Branch (400:6): [True: 0, False: 3.06k]
  ------------------
  401|       |    /* if set, we use this instead of the port possibly given in the URL */
  402|      0|    char portbuf[16];
  403|      0|    curl_msnprintf(portbuf, sizeof(portbuf), "%d", port_override);
  404|      0|    uc = curl_url_set(uh, CURLUPART_PORT, portbuf, 0);
  405|      0|    if(uc) {
  ------------------
  |  Branch (405:8): [True: 0, False: 0]
  ------------------
  406|      0|      result = CURLE_OUT_OF_MEMORY;
  407|      0|      goto out;
  408|      0|    }
  409|      0|    else
  410|      0|      pp.port = port_override;
  411|      0|  }
  412|  3.06k|  else {
  413|  3.06k|    uc = Curl_url_get_port(uh, &pp.port);
  414|  3.06k|    if(uc) {
  ------------------
  |  Branch (414:8): [True: 0, False: 3.06k]
  ------------------
  415|      0|      if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (415:10): [True: 0, False: 0]
  ------------------
  416|      0|        result = CURLE_OUT_OF_MEMORY;
  417|      0|        goto out;
  418|      0|      }
  419|      0|      else if(!(pp.scheme->flags & PROTOPT_NONETWORK)) {
  ------------------
  |  |  211|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (419:15): [True: 0, False: 0]
  ------------------
  420|      0|        result = CURLE_URL_MALFORMAT;
  421|      0|        goto out;
  422|      0|      }
  423|       |      /* no port ok when not a network scheme */
  424|      0|    }
  425|  3.06k|  }
  426|       |
  427|  3.06k|  if(scopeid_override)
  ------------------
  |  Branch (427:6): [True: 0, False: 3.06k]
  ------------------
  428|       |    /* Override any scope id from an URL zone. */
  429|      0|    pp.scopeid = scopeid_override;
  430|  3.06k|  else {
  431|  3.06k|    if(curl_url_get(uh, CURLUPART_ZONEID, &zoneid, 0) ==
  ------------------
  |  Branch (431:8): [True: 0, False: 3.06k]
  ------------------
  432|  3.06k|       CURLUE_OUT_OF_MEMORY) {
  433|      0|      result = CURLE_OUT_OF_MEMORY;
  434|      0|      goto out;
  435|      0|    }
  436|  3.06k|    if(zoneid) {
  ------------------
  |  Branch (436:8): [True: 14, False: 3.05k]
  ------------------
  437|     14|      pp.zoneid.str = zoneid;
  438|     14|      pp.zoneid.len = strlen(zoneid);
  439|     14|    }
  440|  3.06k|  }
  441|       |
  442|  3.06k|  result = peer_create(&pp, ppeer);
  443|  3.06k|  if(result)
  ------------------
  |  Branch (443:6): [True: 0, False: 3.06k]
  ------------------
  444|      0|    failf(data, "Error %d creating peer for %s:%u",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  445|      0|          (int)result, pp.host_user.str, pp.port);
  446|       |
  447|  3.25k|out:
  448|  3.25k|  peer_parse_clear(&pp);
  449|  3.25k|  curlx_free(scheme);
  ------------------
  |  | 1428|  3.25k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  450|  3.25k|  curlx_free(hostname);
  ------------------
  |  | 1428|  3.25k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  451|  3.25k|  curlx_free(zoneid);
  ------------------
  |  | 1428|  3.25k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  452|  3.25k|  return result;
  453|  3.06k|}
Curl_peer_from_connect_to:
  461|  3.04k|{
  462|  3.04k|  struct peer_parse pp;
  463|  3.04k|  const char *portstr = NULL;
  464|  3.04k|  CURLcode result;
  465|       |
  466|  3.04k|  Curl_peer_unlink(ppeer);
  467|  3.04k|  memset(&pp, 0, sizeof(pp));
  468|  3.04k|  if(!connect_to || !*connect_to)
  ------------------
  |  Branch (468:6): [True: 0, False: 3.04k]
  |  Branch (468:21): [True: 0, False: 3.04k]
  ------------------
  469|      0|    return CURLE_FAILED_INIT;
  470|       |
  471|  3.04k|  pp.scheme = dest->scheme;
  472|       |
  473|       |  /* detect and extract RFC6874-style IPv6-addresses */
  474|  3.04k|  if(connect_to[0] == '[') {
  ------------------
  |  Branch (474:6): [True: 0, False: 3.04k]
  ------------------
  475|      0|    const char *s = strchr(connect_to + 1, ']');
  476|      0|    if(!s) {
  ------------------
  |  Branch (476:8): [True: 0, False: 0]
  ------------------
  477|      0|      failf(data, "Invalid IPv6 address format in '%s'", connect_to);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  478|      0|      result = CURLE_SETOPT_OPTION_SYNTAX;
  479|      0|      goto out;
  480|      0|    }
  481|      0|    portstr = strchr(s, ':');
  482|      0|    pp.host_user.str = connect_to;
  483|      0|    pp.host_user.len = s - pp.host_user.str + 1;
  484|      0|    pp.ipv6 = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  485|      0|  }
  486|  3.04k|  else {
  487|  3.04k|    portstr = strchr(connect_to, ':');
  488|  3.04k|    pp.host_user.str = connect_to;
  489|  3.04k|    pp.host_user.len = portstr ?
  ------------------
  |  Branch (489:24): [True: 3.04k, False: 0]
  ------------------
  490|  3.04k|      (size_t)(portstr - connect_to) : strlen(connect_to);
  491|  3.04k|  }
  492|       |
  493|  3.04k|  if(!pp.host_user.len) { /* no hostname found, only port switch */
  ------------------
  |  Branch (493:6): [True: 0, False: 3.04k]
  ------------------
  494|      0|    pp.host_user.str = dest->user_hostname;
  495|      0|    pp.host_user.len = strlen(dest->user_hostname);
  496|      0|  }
  497|       |
  498|  3.04k|  result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  499|  3.04k|  if(result)
  ------------------
  |  Branch (499:6): [True: 0, False: 3.04k]
  ------------------
  500|      0|    goto out;
  501|       |
  502|  3.04k|  if(portstr && portstr[1]) {
  ------------------
  |  Branch (502:6): [True: 3.04k, False: 0]
  |  Branch (502:17): [True: 0, False: 3.04k]
  ------------------
  503|      0|    const char *p = portstr + 1;
  504|      0|    curl_off_t portparse;
  505|      0|    if(curlx_str_number(&p, &portparse, 0xffff)) {
  ------------------
  |  Branch (505:8): [True: 0, False: 0]
  ------------------
  506|      0|      failf(data, "No valid port number in '%s'", connect_to);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  507|      0|      result = CURLE_SETOPT_OPTION_SYNTAX;
  508|      0|      goto out;
  509|      0|    }
  510|      0|    pp.port = (uint16_t)portparse; /* we know it will fit */
  511|      0|  }
  512|  3.04k|  else
  513|  3.04k|    pp.port = dest->port;
  514|       |
  515|       |#ifndef USE_IPV6
  516|       |  if(pp.ipv6) {
  517|       |    failf(data, "Use of IPv6 in *_CONNECT_TO without IPv6 support built-in");
  518|       |    result = CURLE_NOT_BUILT_IN;
  519|       |    goto out;
  520|       |  }
  521|       |#endif
  522|       |
  523|  3.04k|  result = peer_create(&pp, ppeer);
  524|  3.04k|  CURL_TRC_M(data, "connect-to peer_create2 -> %d", (int)result);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  525|       |
  526|  3.04k|out:
  527|  3.04k|  CURL_TRC_M(data, "parse connect_to peer: %s -> %d", connect_to, (int)result);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  528|  3.04k|  peer_parse_clear(&pp);
  529|  3.04k|  return result;
  530|  3.04k|}
peer.c:peer_parse_host:
  186|  6.29k|{
  187|  6.29k|  if(!pp || !pp->host_user.str || !pp->host_user.len)
  ------------------
  |  Branch (187:6): [True: 0, False: 6.29k]
  |  Branch (187:13): [True: 0, False: 6.29k]
  |  Branch (187:35): [True: 0, False: 6.29k]
  ------------------
  188|      0|    return CURLE_FAILED_INIT;
  189|       |
  190|  6.29k|  if(pp->host_user.str[0] == '[') {
  ------------------
  |  Branch (190:6): [True: 110, False: 6.18k]
  ------------------
  191|    110|    const char *s = pp->host_user.str + 1;
  192|    110|    struct Curl_str tmp;
  193|    110|    if(curlx_str_until(&s, &tmp, pp->host_user.len - 1, ']'))
  ------------------
  |  Branch (193:8): [True: 0, False: 110]
  ------------------
  194|      0|      return CURLE_URL_MALFORMAT;
  195|       |
  196|    110|    if(!Curl_looks_like_ipv6(tmp.str, tmp.len, TRUE,
  ------------------
  |  |  997|    110|#define TRUE true
  ------------------
  |  Branch (196:8): [True: 0, False: 110]
  ------------------
  197|    110|                             &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|    110|    pp->ipv6 = TRUE;
  ------------------
  |  |  997|    110|#define TRUE true
  ------------------
  203|    110|  }
  204|  6.18k|  else {
  205|  6.18k|#ifdef USE_IDN
  206|  6.18k|    if(!Curl_is_ASCII_str(&pp->host_user)) {
  ------------------
  |  Branch (206:8): [True: 185, False: 6.00k]
  ------------------
  207|    185|      CURLcode result;
  208|    185|      if(!pp->tmp_host_user) {
  ------------------
  |  Branch (208:10): [True: 185, False: 0]
  ------------------
  209|       |        /* need a null-terminated string for IDN */
  210|    185|        pp->tmp_host_user = curlx_memdup0(pp->host_user.str,
  211|    185|                                          pp->host_user.len);
  212|    185|        if(!pp->tmp_host_user)
  ------------------
  |  Branch (212:12): [True: 0, False: 185]
  ------------------
  213|      0|          return CURLE_OUT_OF_MEMORY;
  214|    185|      }
  215|    185|      result = Curl_idn_decode(pp->tmp_host_user, &pp->tmp_host);
  216|    185|      if(result)
  ------------------
  |  Branch (216:10): [True: 185, False: 0]
  ------------------
  217|    185|        return result;
  218|      0|      pp->host.str = pp->tmp_host;
  219|      0|      pp->host.len = strlen(pp->host.str);
  220|      0|    }
  221|  6.00k|    else
  222|  6.00k|#endif
  223|  6.00k|    if(scan_for_ipv6 &&
  ------------------
  |  Branch (223:8): [True: 0, False: 6.00k]
  ------------------
  224|      0|       Curl_looks_like_ipv6(pp->host_user.str, pp->host_user.len, TRUE,
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  |  Branch (224:8): [True: 0, False: 0]
  ------------------
  225|      0|                            &pp->host, &pp->zoneid)) {
  226|      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 (226:10): [True: 0, False: 0]
  ------------------
  227|      0|        char tmp[MAX_IPADR_LEN];
  228|      0|        memcpy(tmp, pp->host_user.str, pp->host_user.len);
  229|      0|        tmp[pp->host_user.len] = 0;
  230|      0|        pp->ipv6 = !Curl_is_ipv4addr(tmp);
  231|      0|      }
  232|      0|      else
  233|      0|        pp->ipv6 = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  234|      0|    }
  235|  6.00k|    else
  236|  6.00k|      pp->host = pp->host_user;
  237|  6.18k|  }
  238|  6.11k|  return CURLE_OK;
  239|  6.29k|}
peer.c:peer_create:
  105|  6.11k|{
  106|  6.11k|  struct Curl_peer *peer = NULL;
  107|  6.11k|  CURLcode result = CURLE_OK;
  108|  6.11k|  size_t zone_alen = 0, host_alen = 0;
  109|       |
  110|  6.11k|  if(!pp || !pp->scheme)
  ------------------
  |  Branch (110:6): [True: 0, False: 6.11k]
  |  Branch (110:13): [True: 0, False: 6.11k]
  ------------------
  111|      0|    return CURLE_FAILED_INIT;
  112|  6.11k|  if(!pp->host.len && !(pp->scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  211|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (112:6): [True: 0, False: 6.11k]
  |  Branch (112:23): [True: 0, False: 0]
  ------------------
  113|      0|    return CURLE_FAILED_INIT;
  114|       |
  115|  6.11k|  if((pp->host.str != pp->host_user.str) ||
  ------------------
  |  Branch (115:6): [True: 110, False: 6.00k]
  ------------------
  116|  6.00k|     (pp->host.len != pp->host_user.len)) {
  ------------------
  |  Branch (116:6): [True: 0, False: 6.00k]
  ------------------
  117|    110|    host_alen = pp->host.len + 1;
  118|    110|  }
  119|  6.11k|  zone_alen = pp->zoneid.len ? (pp->zoneid.len + 1) : 0;
  ------------------
  |  Branch (119:15): [True: 14, False: 6.09k]
  ------------------
  120|       |
  121|       |  /* null-terminator already part of struct */
  122|  6.11k|  peer = curlx_calloc(1, sizeof(*peer) +
  ------------------
  |  | 1425|  6.11k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  123|  6.11k|                         pp->host_user.len + host_alen + zone_alen);
  124|  6.11k|  if(!peer) {
  ------------------
  |  Branch (124:6): [True: 0, False: 6.11k]
  ------------------
  125|      0|    result = CURLE_OUT_OF_MEMORY;
  126|      0|    goto out;
  127|      0|  }
  128|       |
  129|  6.11k|  peer->refcount = 1;
  130|  6.11k|  peer->scheme = pp->scheme;
  131|  6.11k|  peer->hostname = peer->user_hostname;
  132|  6.11k|  peer->port = pp->port;
  133|  6.11k|  peer->scopeid = pp->scopeid;
  134|  6.11k|  peer->ipv6 = pp->ipv6;
  135|  6.11k|  peer->unix_socket = pp->unix_socket;
  136|  6.11k|  peer->abstract_uds = pp->abstract_uds;
  137|       |
  138|  6.11k|  if(pp->host_user.len)
  ------------------
  |  Branch (138:6): [True: 6.11k, False: 0]
  ------------------
  139|  6.11k|    memcpy(peer->user_hostname, pp->host_user.str, pp->host_user.len);
  140|       |
  141|  6.11k|  if(host_alen) {
  ------------------
  |  Branch (141:6): [True: 110, False: 6.00k]
  ------------------
  142|    110|    peer->hostname = peer->user_hostname + pp->host_user.len + 1;
  143|    110|    memcpy(peer->hostname, pp->host.str, pp->host.len);
  144|    110|  }
  145|       |
  146|  6.11k|  if(zone_alen) {
  ------------------
  |  Branch (146:6): [True: 14, False: 6.09k]
  ------------------
  147|     14|    peer->zoneid = peer->user_hostname + pp->host_user.len + 1 + host_alen;
  148|     14|    memcpy(peer->zoneid, pp->zoneid.str, pp->zoneid.len);
  149|     14|#ifdef USE_IPV6
  150|       |    /* Determine scope_id if not already provided */
  151|     14|    if(!peer->scopeid) {
  ------------------
  |  Branch (151:8): [True: 14, False: 0]
  ------------------
  152|     14|      const char *p = peer->zoneid;
  153|     14|      curl_off_t scope;
  154|     14|      if(!curlx_str_number(&p, &scope, UINT_MAX)) {
  ------------------
  |  Branch (154:10): [True: 2, False: 12]
  ------------------
  155|       |        /* A plain number, use it directly as a scope id. */
  156|      2|        peer->scopeid = (uint32_t)scope;
  157|      2|      }
  158|     12|#ifdef HAVE_IF_NAMETOINDEX
  159|     12|      else {
  160|       |        /* Zone identifier is not numeric */
  161|     12|        unsigned int idx = 0;
  162|     12|        idx = if_nametoindex(peer->zoneid);
  163|     12|        if(idx) {
  ------------------
  |  Branch (163:12): [True: 0, False: 12]
  ------------------
  164|      0|          peer->scopeid = (uint32_t)idx;
  165|      0|        }
  166|     12|        else {
  167|       |          /* Do we want to return an error here? */
  168|     12|        }
  169|     12|      }
  170|     14|#endif /* HAVE_IF_NAMETOINDEX */
  171|     14|    }
  172|     14|#endif /* USE_IPV6 */
  173|     14|  }
  174|       |
  175|  6.11k|out:
  176|  6.11k|  if(!result)
  ------------------
  |  Branch (176:6): [True: 6.11k, False: 0]
  ------------------
  177|  6.11k|    *ppeer = peer;
  178|      0|  else
  179|      0|    Curl_peer_unlink(&peer);
  180|  6.11k|  return result;
  181|  6.11k|}
peer.c:peer_parse_clear:
   96|  6.29k|{
   97|  6.29k|  curlx_free(pp->tmp_host_user);
  ------------------
  |  | 1428|  6.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|  6.29k|  curlx_free(pp->tmp_host);
  ------------------
  |  | 1428|  6.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   99|  6.29k|  curlx_free(pp->tmp_zoneid);
  ------------------
  |  | 1428|  6.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  100|  6.29k|  memset(pp, 0, sizeof(*pp));
  101|  6.29k|}
peer.c:peer_same_hostname:
  330|  3.04k|{
  331|       |  /* UNIX domain socket paths must be compared case-sensitive,
  332|       |   * as many filesystem are like that. */
  333|  3.04k|  return (p1->unix_socket == p2->unix_socket) &&
  ------------------
  |  Branch (333:10): [True: 3.04k, False: 0]
  ------------------
  334|  3.04k|         (p1->abstract_uds == p2->abstract_uds) &&
  ------------------
  |  Branch (334:10): [True: 3.04k, False: 0]
  ------------------
  335|  3.04k|         (p1->ipv6 == p2->ipv6) &&
  ------------------
  |  Branch (335:10): [True: 2.93k, False: 107]
  ------------------
  336|  2.93k|         (p1->unix_socket ?
  ------------------
  |  Branch (336:10): [True: 1, False: 2.93k]
  |  Branch (336:11): [True: 0, False: 2.93k]
  ------------------
  337|      0|          !strcmp(p1->hostname, p2->hostname) :
  338|  2.93k|          curl_strequal(p1->hostname, p2->hostname));
  339|  3.04k|}

Curl_pgrs_now:
  172|   142k|{
  173|   142k|  curlx_pnow(&data->progress.now);
  174|   142k|  return &data->progress.now;
  175|   142k|}
Curl_pgrsDone:
  189|  3.04k|{
  190|  3.04k|  int rc;
  191|  3.04k|  data->progress.delta.lastshow_us = -1;
  192|  3.04k|  rc = Curl_pgrsUpdate(data); /* the final (forced) update */
  193|  3.04k|  if(rc)
  ------------------
  |  Branch (193:6): [True: 0, False: 3.04k]
  ------------------
  194|      0|    return rc;
  195|       |
  196|  3.04k|  if(!data->progress.hide && !data->progress.callback)
  ------------------
  |  Branch (196:6): [True: 0, False: 3.04k]
  |  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|  3.04k|  return 0;
  202|  3.04k|}
Curl_pgrsReset:
  205|  3.04k|{
  206|  3.04k|  Curl_pgrsSetUploadCounter(data, 0);
  207|  3.04k|  data->progress.dl.cur_size = 0;
  208|  3.04k|  Curl_pgrsSetUploadSize(data, -1);
  209|  3.04k|  Curl_pgrsSetDownloadSize(data, -1);
  210|  3.04k|  data->progress.speeder_c = 0; /* reset speed records */
  211|  3.04k|  data->progress.deliver = 0;
  212|  3.04k|  pgrs_speedinit(data);
  213|  3.04k|}
Curl_pgrsResetTransferSizes:
  217|  3.74k|{
  218|  3.74k|  Curl_pgrsSetDownloadSize(data, -1);
  219|  3.74k|  Curl_pgrsSetUploadSize(data, -1);
  220|  3.74k|}
Curl_pgrsTimeWas:
  266|  25.5k|{
  267|  25.5k|  timediff_t *delta = NULL;
  268|       |
  269|  25.5k|  switch(timer) {
  270|      0|  default:
  ------------------
  |  Branch (270:3): [True: 0, False: 25.5k]
  ------------------
  271|      0|  case TIMER_NONE:
  ------------------
  |  Branch (271:3): [True: 0, False: 25.5k]
  ------------------
  272|       |    /* mistake filter */
  273|      0|    break;
  274|  3.74k|  case TIMER_STARTOP:
  ------------------
  |  Branch (274:3): [True: 3.74k, False: 21.7k]
  ------------------
  275|       |    /* This is set at the start of a transfer */
  276|  3.74k|    data->progress.delta.startop_us =
  277|  3.74k|      curlx_ptimediff_us(&timestamp, &data->progress.start);
  278|  3.74k|    data->progress.delta.startqueue_us = data->progress.delta.startop_us;
  279|  3.74k|    break;
  280|  3.74k|  case TIMER_STARTSINGLE:
  ------------------
  |  Branch (280:3): [True: 3.74k, False: 21.7k]
  ------------------
  281|       |    /* This is set at the start of each single transfer */
  282|  3.74k|    data->progress.delta.startsingle_us =
  283|  3.74k|      curlx_ptimediff_us(&timestamp, &data->progress.start);
  284|  3.74k|    data->progress.startransfer_added = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  285|  3.74k|    break;
  286|  3.04k|  case TIMER_POSTQUEUE:
  ------------------
  |  Branch (286:3): [True: 3.04k, False: 22.4k]
  ------------------
  287|       |    /* Queue time is accumulative from all involved redirects */
  288|  3.04k|    data->progress.total.queued_us +=
  289|  3.04k|      curlx_ptimediff_us(&timestamp, &data->progress.start) -
  290|  3.04k|      data->progress.delta.startqueue_us;
  291|  3.04k|    break;
  292|  3.04k|  case TIMER_NAMELOOKUP:
  ------------------
  |  Branch (292:3): [True: 3.04k, False: 22.4k]
  ------------------
  293|  3.04k|    delta = &data->progress.total.nslookup_us;
  294|  3.04k|    break;
  295|  3.04k|  case TIMER_CONNECT:
  ------------------
  |  Branch (295:3): [True: 3.04k, False: 22.4k]
  ------------------
  296|  3.04k|    delta = &data->progress.total.connect_us;
  297|  3.04k|    break;
  298|      0|  case TIMER_APPCONNECT:
  ------------------
  |  Branch (298:3): [True: 0, False: 25.5k]
  ------------------
  299|      0|    delta = &data->progress.total.appconnect_us;
  300|      0|    break;
  301|  3.74k|  case TIMER_PRETRANSFER:
  ------------------
  |  Branch (301:3): [True: 3.74k, False: 21.7k]
  ------------------
  302|  3.74k|    delta = &data->progress.total.pretransfer_us;
  303|  3.74k|    break;
  304|  1.43k|  case TIMER_STARTTRANSFER:
  ------------------
  |  Branch (304:3): [True: 1.43k, False: 24.0k]
  ------------------
  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|  1.43k|    if(data->progress.startransfer_added) {
  ------------------
  |  Branch (311:8): [True: 30, False: 1.40k]
  ------------------
  312|     30|      CURL_TRC_M(data, "[%s] ignored", pgrs_timer_name(timer));
  ------------------
  |  |  148|     30|  do {                                   \
  |  |  149|     30|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|     30|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|     30|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     60|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 30, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 30, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     60|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 30, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|     30|    ((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|     30|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|     30|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     30|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|     30|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 30]
  |  |  ------------------
  ------------------
  313|     30|      return;
  314|     30|    }
  315|  1.40k|    data->progress.startransfer_added = TRUE;
  ------------------
  |  |  997|  1.40k|#define TRUE true
  ------------------
  316|  1.40k|    delta = &data->progress.total.starttransfer_us;
  317|  1.40k|    break;
  318|  3.74k|  case TIMER_POSTRANSFER:
  ------------------
  |  Branch (318:3): [True: 3.74k, False: 21.7k]
  ------------------
  319|  3.74k|    delta = &data->progress.total.posttransfer_us;
  320|  3.74k|    break;
  321|      0|  case TIMER_REDIRECT:
  ------------------
  |  Branch (321:3): [True: 0, False: 25.5k]
  ------------------
  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|  25.5k|  }
  329|  25.5k|  if(delta) {
  ------------------
  |  Branch (329:6): [True: 14.9k, False: 10.5k]
  ------------------
  330|  14.9k|    timediff_t us = curlx_ptimediff_us(&timestamp, &data->progress.start) -
  331|  14.9k|                    data->progress.delta.startsingle_us;
  332|  14.9k|    if(us < 1)
  ------------------
  |  Branch (332:8): [True: 0, False: 14.9k]
  ------------------
  333|      0|      us = 1; /* make sure at least one microsecond passed */
  334|  14.9k|    *delta += us;
  335|  14.9k|    CURL_TRC_M(data, "[%s] added %" FMT_TIMEDIFF_T "us",
  ------------------
  |  |  148|  14.9k|  do {                                   \
  |  |  149|  14.9k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  14.9k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  14.9k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  29.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 14.9k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 14.9k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  29.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 14.9k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  14.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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  14.9k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  14.9k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 14.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  14.9k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  14.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 14.9k]
  |  |  ------------------
  ------------------
  336|  14.9k|               pgrs_timer_name(timer), us);
  337|  14.9k|  }
  338|  10.5k|  else
  339|  10.5k|    CURL_TRC_M(data, "[%s] set", pgrs_timer_name(timer));
  ------------------
  |  |  148|  10.5k|  do {                                   \
  |  |  149|  10.5k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  10.5k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  10.5k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  21.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 10.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 10.5k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  21.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 10.5k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  10.5k|    ((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.5k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  10.5k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 10.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  10.5k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  10.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  340|  25.5k|}
Curl_pgrsTime:
  349|  15.7k|{
  350|  15.7k|  Curl_pgrsTimeWas(data, timer, *Curl_pgrs_now(data));
  351|  15.7k|}
Curl_pgrsStart:
  354|  3.74k|{
  355|  3.74k|  struct Progress *p = &data->progress;
  356|       |
  357|  3.74k|  if(!pnow)
  ------------------
  |  Branch (357:6): [True: 3.74k, False: 0]
  ------------------
  358|  3.74k|    pnow = Curl_pgrs_now(data);
  359|  3.74k|  p->speeder_c = 0; /* reset the progress meter display */
  360|  3.74k|  p->start = *pnow;
  361|  3.74k|  memset(&p->delta, 0, sizeof(p->delta));
  362|  3.74k|  memset(&p->total, 0, sizeof(p->total));
  363|  3.74k|  p->startransfer_added = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  364|  3.74k|  p->dl.cur_size = 0;
  365|  3.74k|  p->ul.cur_size = 0;
  366|       |  /* the sizes are unknown at start */
  367|  3.74k|  p->dl_size_known = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  368|       |  p->ul_size_known = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  369|  3.74k|}
Curl_pgrs_deliver_check:
  374|  14.3k|{
  375|  14.3k|  if(data->set.max_filesize &&
  ------------------
  |  Branch (375:6): [True: 338, False: 14.0k]
  ------------------
  376|    338|     ((curl_off_t)delta > data->set.max_filesize - data->progress.deliver)) {
  ------------------
  |  Branch (376:6): [True: 0, False: 338]
  ------------------
  377|      0|    failf(data, "Would have exceeded max file size");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  378|      0|    return CURLE_FILESIZE_EXCEEDED;
  379|      0|  }
  380|  14.3k|  return CURLE_OK;
  381|  14.3k|}
Curl_pgrs_deliver_inc:
  386|  14.3k|{
  387|  14.3k|  data->progress.deliver += delta;
  388|  14.3k|}
Curl_pgrs_download_inc:
  391|  15.6k|{
  392|  15.6k|  if(delta) {
  ------------------
  |  Branch (392:6): [True: 15.6k, False: 0]
  ------------------
  393|  15.6k|    data->progress.dl.cur_size += delta;
  394|       |    Curl_rlimit_drain(&data->progress.dl.rlimit, delta, NULL);
  395|  15.6k|  }
  396|  15.6k|}
Curl_pgrs_upload_inc:
  399|    111|{
  400|    111|  if(delta) {
  ------------------
  |  Branch (400:6): [True: 111, False: 0]
  ------------------
  401|    111|    data->progress.ul.cur_size += delta;
  402|       |    Curl_rlimit_drain(&data->progress.ul.rlimit, delta, NULL);
  403|    111|  }
  404|    111|}
Curl_pgrsSetUploadCounter:
  410|  3.04k|{
  411|  3.04k|  data->progress.ul.cur_size = size;
  412|  3.04k|}
Curl_pgrsSetDownloadSize:
  415|  6.78k|{
  416|  6.78k|  if(size >= 0) {
  ------------------
  |  Branch (416:6): [True: 0, False: 6.78k]
  ------------------
  417|      0|    data->progress.dl.total_size = size;
  418|      0|    data->progress.dl_size_known = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  419|      0|  }
  420|  6.78k|  else {
  421|  6.78k|    data->progress.dl.total_size = 0;
  422|       |    data->progress.dl_size_known = FALSE;
  ------------------
  |  | 1000|  6.78k|#define FALSE false
  ------------------
  423|  6.78k|  }
  424|  6.78k|}
Curl_pgrsSetUploadSize:
  427|  6.78k|{
  428|  6.78k|  if(size >= 0) {
  ------------------
  |  Branch (428:6): [True: 0, False: 6.78k]
  ------------------
  429|      0|    data->progress.ul.total_size = size;
  430|      0|    data->progress.ul_size_known = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  431|      0|  }
  432|  6.78k|  else {
  433|  6.78k|    data->progress.ul.total_size = 0;
  434|       |    data->progress.ul_size_known = FALSE;
  ------------------
  |  | 1000|  6.78k|#define FALSE false
  ------------------
  435|  6.78k|  }
  436|  6.78k|}
Curl_pgrsUpdate:
  714|  7.10k|{
  715|  7.10k|  return pgrs_update(data, Curl_pgrs_now(data));
  716|  7.10k|}
Curl_pgrsUpdateX:
  720|  11.8k|{
  721|  11.8k|  return pgrs_update(data, pnow);
  722|  11.8k|}
Curl_pgrsUpdate_nometer:
  744|    699|{
  745|    699|  (void)progress_calc(data, Curl_pgrs_now(data));
  746|    699|}
Curl_pgrsCompleted:
  749|  3.74k|{
  750|  3.74k|  struct Progress * const p = &data->progress;
  751|  3.74k|  p->total.spent_us = curlx_ptimediff_us(Curl_pgrs_now(data), &p->start);
  752|  3.74k|}
Curl_pgrs_since_ms:
  757|  58.6k|{
  758|  58.6k|  if(!pnow)
  ------------------
  |  Branch (758:6): [True: 0, False: 58.6k]
  ------------------
  759|      0|    pnow = Curl_pgrs_now(data);
  760|  58.6k|  switch(timer) {
  761|  35.9k|  case TIMER_STARTOP:
  ------------------
  |  Branch (761:3): [True: 35.9k, False: 22.6k]
  ------------------
  762|  35.9k|    return (curlx_ptimediff_us(pnow, &data->progress.start) -
  763|  35.9k|            data->progress.delta.startop_us) / 1000;
  764|  22.6k|  case TIMER_STARTSINGLE:
  ------------------
  |  Branch (764:3): [True: 22.6k, False: 35.9k]
  ------------------
  765|  22.6k|    return (curlx_ptimediff_us(pnow, &data->progress.start) -
  766|  22.6k|            data->progress.delta.startsingle_us) / 1000;
  767|      0|  default:
  ------------------
  |  Branch (767:3): [True: 0, False: 58.6k]
  ------------------
  768|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (768:5): [Folded, False: 0]
  |  Branch (768:5): [Folded, False: 0]
  ------------------
  769|      0|    return 0;
  770|  58.6k|  }
  771|  58.6k|}
progress.c:pgrs_speedinit:
  123|  3.04k|{
  124|  3.04k|  memset(&data->state.keeps_speed, 0, sizeof(struct curltime));
  125|  3.04k|}
progress.c:pgrs_update:
  708|  18.9k|{
  709|       |  bool showprogress = progress_calc(data, pnow);
  710|  18.9k|  return pgrsupdate(data, showprogress);
  711|  18.9k|}
progress.c:pgrsupdate:
  659|  18.9k|{
  660|  18.9k|  if(!data->progress.hide) {
  ------------------
  |  Branch (660:6): [True: 0, False: 18.9k]
  ------------------
  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|  18.9k|  return CURLE_OK;
  704|  18.9k|}
progress.c:progress_calc:
  460|  19.6k|{
  461|  19.6k|  struct Progress * const p = &data->progress;
  462|  19.6k|  int i_next, i_oldest, i_latest;
  463|  19.6k|  timediff_t duration_us, elapsed_us;
  464|  19.6k|  curl_off_t amount;
  465|       |
  466|       |  /* The time spent so far (from the start) in microseconds */
  467|  19.6k|  elapsed_us = curlx_ptimediff_us(pnow, &p->start);
  468|  19.6k|  p->total.spent_us = elapsed_us;
  469|  19.6k|  p->dl.speed = trspeed(p->dl.cur_size, p->total.spent_us);
  470|  19.6k|  p->ul.speed = trspeed(p->ul.cur_size, p->total.spent_us);
  471|       |
  472|  19.6k|  if(!p->speeder_c) { /* no previous record exists */
  ------------------
  |  Branch (472:6): [True: 3.74k, False: 15.8k]
  ------------------
  473|  3.74k|    p->speed_amount[0] = p->dl.cur_size + p->ul.cur_size;
  474|  3.74k|    p->speed_time[0] = elapsed_us;
  475|  3.74k|    p->speeder_c++;
  476|       |    /* use the overall average at the start */
  477|  3.74k|    p->current_speed = p->ul.speed + p->dl.speed;
  478|  3.74k|    p->delta.lastshow_us = elapsed_us;
  479|  3.74k|    return TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  480|  3.74k|  }
  481|       |  /* We have at least one record now. Where to put the next and
  482|       |   * where is the latest one? */
  483|  15.8k|  i_next = p->speeder_c % CURL_SPEED_RECORDS;
  ------------------
  |  |  463|  15.8k|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  484|  15.8k|  i_latest = (i_next > 0) ? (i_next - 1) : (CURL_SPEED_RECORDS - 1);
  ------------------
  |  |  463|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  |  Branch (484:14): [True: 15.8k, False: 0]
  ------------------
  485|       |
  486|       |  /* Make a new record only when some time has passed.
  487|       |   * Too frequent calls otherwise ruin the history. */
  488|  15.8k|  if((elapsed_us - p->speed_time[i_latest]) >= (1000 * 1000)) {
  ------------------
  |  Branch (488:6): [True: 0, False: 15.8k]
  ------------------
  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|  15.8k|  else if(data->req.done) {
  ------------------
  |  Branch (494:11): [True: 0, False: 15.8k]
  ------------------
  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|      0|    if(!p->current_speed) {
  ------------------
  |  Branch (499:8): [True: 0, False: 0]
  ------------------
  500|      0|      p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size;
  501|      0|      p->speed_time[i_latest] = elapsed_us;
  502|      0|    }
  503|      0|  }
  504|  15.8k|  else {
  505|       |    /* transfer ongoing, wait for more time to pass. */
  506|  15.8k|    return FALSE;
  ------------------
  |  | 1000|  15.8k|#define FALSE false
  ------------------
  507|  15.8k|  }
  508|       |
  509|      0|  i_oldest = (p->speeder_c < CURL_SPEED_RECORDS) ? 0 :
  ------------------
  |  |  463|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  |  Branch (509:14): [True: 0, False: 0]
  ------------------
  510|      0|             ((i_latest + 1) % CURL_SPEED_RECORDS);
  ------------------
  |  |  463|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  511|       |
  512|       |  /* How much we transferred between oldest and current records */
  513|      0|  amount = p->speed_amount[i_latest] - p->speed_amount[i_oldest];
  514|       |  /* How long this took */
  515|      0|  duration_us = p->speed_time[i_latest] - p->speed_time[i_oldest];
  516|      0|  if(duration_us <= 0)
  ------------------
  |  Branch (516:6): [True: 0, False: 0]
  ------------------
  517|      0|    duration_us = 1;
  518|       |
  519|      0|  if(amount > (CURL_OFF_T_MAX / 1000000)) {
  ------------------
  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (519:6): [True: 0, False: 0]
  ------------------
  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|      0|  else {
  526|      0|    p->current_speed = amount * 1000000 / duration_us;
  527|      0|  }
  528|       |
  529|      0|  if((p->delta.lastshow_us >= 0) && !data->req.done &&
  ------------------
  |  Branch (529:6): [True: 0, False: 0]
  |  Branch (529:37): [True: 0, False: 0]
  ------------------
  530|      0|     ((elapsed_us - p->delta.lastshow_us) < (1000 * 1000)))
  ------------------
  |  Branch (530:6): [True: 0, False: 0]
  ------------------
  531|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  532|      0|  p->delta.lastshow_us = elapsed_us;
  533|       |  return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  534|      0|}
progress.c:trspeed:
  446|  39.2k|{
  447|  39.2k|  if(us < 1)
  ------------------
  |  Branch (447:6): [True: 0, False: 39.2k]
  ------------------
  448|      0|    return size * 1000000;
  449|  39.2k|  else if(size < CURL_OFF_T_MAX / 1000000)
  ------------------
  |  |  540|  39.2k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (449:11): [True: 39.2k, False: 0]
  ------------------
  450|  39.2k|    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;
  ------------------
  |  |  540|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  455|  39.2k|}

Curl_getn_scheme:
  609|  32.2k|{
  610|  32.2k|  typedef const struct Curl_scheme *(*letterfunc)(const char *ptr);
  611|  32.2k|  static const letterfunc parse[] = {
  612|  32.2k|    two_letter_scheme,
  613|  32.2k|    three_letter_scheme,
  614|  32.2k|    four_letter_scheme,
  615|  32.2k|    five_letter_scheme,
  616|  32.2k|    six_letter_scheme,
  617|  32.2k|    seven_letter_scheme
  618|  32.2k|  };
  619|       |
  620|  32.2k|  if(len < 2 || len > 7)
  ------------------
  |  Branch (620:6): [True: 0, False: 32.2k]
  |  Branch (620:17): [True: 0, False: 32.2k]
  ------------------
  621|      0|    return NULL;
  622|       |
  623|  32.2k|  return parse[len - 2](scheme);
  624|  32.2k|}
Curl_get_scheme:
  627|  9.77k|{
  628|  9.77k|  return Curl_getn_scheme(scheme, strlen(scheme));
  629|  9.77k|}
protocol.c:two_letter_scheme:
  439|  3.74k|{
  440|  3.74k|  if((Curl_raw_tolower(scheme[0]) == 'w') &&
  ------------------
  |  Branch (440:6): [True: 3.74k, False: 0]
  ------------------
  441|  3.74k|     (Curl_raw_tolower(scheme[1]) == 's'))
  ------------------
  |  Branch (441:6): [True: 3.74k, False: 0]
  ------------------
  442|  3.74k|    return &Curl_scheme_ws;
  443|      0|  return NULL;
  444|  3.74k|}
protocol.c:three_letter_scheme:
  447|  3.74k|{
  448|  3.74k|  char s0 = Curl_raw_tolower(scheme[0]);
  449|  3.74k|  char s1 = Curl_raw_tolower(scheme[1]);
  450|  3.74k|  char s2 = Curl_raw_tolower(scheme[2]);
  451|  3.74k|  if(s0 == 'f') {
  ------------------
  |  Branch (451:6): [True: 0, False: 3.74k]
  ------------------
  452|      0|    if(s1 == 't' && s2 == 'p')
  ------------------
  |  Branch (452:8): [True: 0, False: 0]
  |  Branch (452:21): [True: 0, False: 0]
  ------------------
  453|      0|      return &Curl_scheme_ftp;
  454|      0|  }
  455|  3.74k|  else if(s0 == 'w') {
  ------------------
  |  Branch (455:11): [True: 3.74k, False: 0]
  ------------------
  456|  3.74k|    if(s1 == 's' && s2 == 's')
  ------------------
  |  Branch (456:8): [True: 3.74k, False: 0]
  |  Branch (456:21): [True: 3.74k, False: 0]
  ------------------
  457|  3.74k|      return &Curl_scheme_wss;
  458|  3.74k|  }
  459|      0|  else if(s0 == 's') {
  ------------------
  |  Branch (459:11): [True: 0, False: 0]
  ------------------
  460|      0|    if(s1 == 'c' && s2 == 'p')
  ------------------
  |  Branch (460:8): [True: 0, False: 0]
  |  Branch (460:21): [True: 0, False: 0]
  ------------------
  461|      0|      return &Curl_scheme_scp;
  462|      0|  }
  463|      0|  return NULL;
  464|  3.74k|}
protocol.c:four_letter_scheme:
  467|  3.74k|{
  468|  3.74k|  char s0 = Curl_raw_tolower(scheme[0]);
  469|  3.74k|  char s1 = Curl_raw_tolower(scheme[1]);
  470|  3.74k|  char s2 = Curl_raw_tolower(scheme[2]);
  471|  3.74k|  char s3 = Curl_raw_tolower(scheme[3]);
  472|  3.74k|  if(s3 == 'p') {
  ------------------
  |  Branch (472:6): [True: 3.74k, False: 0]
  ------------------
  473|  3.74k|    if(s0 == 'h') {
  ------------------
  |  Branch (473:8): [True: 3.74k, False: 0]
  ------------------
  474|  3.74k|      if(s1 == 't' && s2 == 't')
  ------------------
  |  Branch (474:10): [True: 3.74k, False: 0]
  |  Branch (474:23): [True: 3.74k, False: 0]
  ------------------
  475|  3.74k|        return &Curl_scheme_http;
  476|  3.74k|    }
  477|      0|    else if(s0 == 'i') {
  ------------------
  |  Branch (477:13): [True: 0, False: 0]
  ------------------
  478|      0|      if(s1 == 'm' && s2 == 'a')
  ------------------
  |  Branch (478:10): [True: 0, False: 0]
  |  Branch (478:23): [True: 0, False: 0]
  ------------------
  479|      0|        return &Curl_scheme_imap;
  480|      0|    }
  481|      0|    else if(s0 == 'l') {
  ------------------
  |  Branch (481:13): [True: 0, False: 0]
  ------------------
  482|      0|      if(s1 == 'd' && s2 == 'a')
  ------------------
  |  Branch (482:10): [True: 0, False: 0]
  |  Branch (482:23): [True: 0, False: 0]
  ------------------
  483|      0|        return &Curl_scheme_ldap;
  484|      0|    }
  485|      0|    else if(s0 == 'r') {
  ------------------
  |  Branch (485:13): [True: 0, False: 0]
  ------------------
  486|      0|      if(s1 == 't' && s2 == 's')
  ------------------
  |  Branch (486:10): [True: 0, False: 0]
  |  Branch (486:23): [True: 0, False: 0]
  ------------------
  487|      0|        return &Curl_scheme_rtsp;
  488|      0|    }
  489|      0|    else if(s0 == 't') {
  ------------------
  |  Branch (489:13): [True: 0, False: 0]
  ------------------
  490|      0|      if(s1 == 'f' && s2 == 't')
  ------------------
  |  Branch (490:10): [True: 0, False: 0]
  |  Branch (490:23): [True: 0, False: 0]
  ------------------
  491|      0|        return &Curl_scheme_tftp;
  492|      0|    }
  493|      0|    else if(s0 == 's') {
  ------------------
  |  Branch (493:13): [True: 0, False: 0]
  ------------------
  494|      0|      if(s1 == 'f' && s2 == 't')
  ------------------
  |  Branch (494:10): [True: 0, False: 0]
  |  Branch (494:23): [True: 0, False: 0]
  ------------------
  495|      0|        return &Curl_scheme_sftp;
  496|      0|      if(s1 == 'm' && s2 == 't')
  ------------------
  |  Branch (496:10): [True: 0, False: 0]
  |  Branch (496:23): [True: 0, False: 0]
  ------------------
  497|      0|        return &Curl_scheme_smtp;
  498|      0|    }
  499|  3.74k|  }
  500|      0|  else if(s0 == 'f') {
  ------------------
  |  Branch (500:11): [True: 0, False: 0]
  ------------------
  501|      0|    if(s1 == 't' && s2 == 'p' && s3 == 's')
  ------------------
  |  Branch (501:8): [True: 0, False: 0]
  |  Branch (501:21): [True: 0, False: 0]
  |  Branch (501:34): [True: 0, False: 0]
  ------------------
  502|      0|      return &Curl_scheme_ftps;
  503|      0|    if(s1 == 'i' && s2 == 'l' && s3 == 'e')
  ------------------
  |  Branch (503:8): [True: 0, False: 0]
  |  Branch (503:21): [True: 0, False: 0]
  |  Branch (503:34): [True: 0, False: 0]
  ------------------
  504|      0|      return &Curl_scheme_file;
  505|      0|  }
  506|      0|  else if(s0 == 'm') {
  ------------------
  |  Branch (506:11): [True: 0, False: 0]
  ------------------
  507|      0|    if(s1 == 'q' && s2 == 't' && s3 == 't')
  ------------------
  |  Branch (507:8): [True: 0, False: 0]
  |  Branch (507:21): [True: 0, False: 0]
  |  Branch (507:34): [True: 0, False: 0]
  ------------------
  508|      0|      return &Curl_scheme_mqtt;
  509|      0|  }
  510|      0|  else if(s0 == 'p') {
  ------------------
  |  Branch (510:11): [True: 0, False: 0]
  ------------------
  511|      0|    if(s1 == 'o' && s2 == 'p' && s3 == '3')
  ------------------
  |  Branch (511:8): [True: 0, False: 0]
  |  Branch (511:21): [True: 0, False: 0]
  |  Branch (511:34): [True: 0, False: 0]
  ------------------
  512|      0|      return &Curl_scheme_pop3;
  513|      0|  }
  514|      0|  else if(s0 == 'd') {
  ------------------
  |  Branch (514:11): [True: 0, False: 0]
  ------------------
  515|      0|    if(s1 == 'i' && s2 == 'c' && s3 == 't')
  ------------------
  |  Branch (515:8): [True: 0, False: 0]
  |  Branch (515:21): [True: 0, False: 0]
  |  Branch (515:34): [True: 0, False: 0]
  ------------------
  516|      0|      return &Curl_scheme_dict;
  517|      0|  }
  518|      0|  return NULL;
  519|  3.74k|}
protocol.c:five_letter_scheme:
  522|  3.74k|{
  523|  3.74k|  char s4 = Curl_raw_tolower(scheme[4]);
  524|  3.74k|  if(s4 == 's') {
  ------------------
  |  Branch (524:6): [True: 3.74k, False: 0]
  ------------------
  525|  3.74k|    char s0 = Curl_raw_tolower(scheme[0]);
  526|  3.74k|    char s1 = Curl_raw_tolower(scheme[1]);
  527|  3.74k|    char s2 = Curl_raw_tolower(scheme[2]);
  528|  3.74k|    char s3 = Curl_raw_tolower(scheme[3]);
  529|  3.74k|    if(s3 == 'p') {
  ------------------
  |  Branch (529:8): [True: 3.74k, False: 0]
  ------------------
  530|  3.74k|      switch(s0) {
  531|  3.74k|      case 'h':
  ------------------
  |  Branch (531:7): [True: 3.74k, False: 0]
  ------------------
  532|  3.74k|        if(s1 == 't' && s2 == 't')
  ------------------
  |  Branch (532:12): [True: 3.74k, False: 0]
  |  Branch (532:25): [True: 3.74k, False: 0]
  ------------------
  533|  3.74k|          return &Curl_scheme_https;
  534|      0|        break;
  535|      0|      case 'l':
  ------------------
  |  Branch (535:7): [True: 0, False: 3.74k]
  ------------------
  536|      0|        if(s1 == 'd' && s2 == 'a')
  ------------------
  |  Branch (536:12): [True: 0, False: 0]
  |  Branch (536:25): [True: 0, False: 0]
  ------------------
  537|      0|          return &Curl_scheme_ldaps;
  538|      0|        break;
  539|      0|      case 'i':
  ------------------
  |  Branch (539:7): [True: 0, False: 3.74k]
  ------------------
  540|      0|        if(s1 == 'm' && s2 == 'a')
  ------------------
  |  Branch (540:12): [True: 0, False: 0]
  |  Branch (540:25): [True: 0, False: 0]
  ------------------
  541|      0|          return &Curl_scheme_imaps;
  542|      0|        break;
  543|      0|      case 's':
  ------------------
  |  Branch (543:7): [True: 0, False: 3.74k]
  ------------------
  544|      0|        if(s1 == 'm' && s2 == 't')
  ------------------
  |  Branch (544:12): [True: 0, False: 0]
  |  Branch (544:25): [True: 0, False: 0]
  ------------------
  545|      0|          return &Curl_scheme_smtps;
  546|      0|        break;
  547|      0|      default:
  ------------------
  |  Branch (547:7): [True: 0, False: 3.74k]
  ------------------
  548|      0|        break;
  549|  3.74k|      }
  550|  3.74k|    }
  551|      0|    else if(s0 == 'p') {
  ------------------
  |  Branch (551:13): [True: 0, False: 0]
  ------------------
  552|      0|      if(s1 == 'o' && s2 == 'p' && s3 == '3')
  ------------------
  |  Branch (552:10): [True: 0, False: 0]
  |  Branch (552:23): [True: 0, False: 0]
  |  Branch (552:36): [True: 0, False: 0]
  ------------------
  553|      0|        return &Curl_scheme_pop3s;
  554|      0|    }
  555|      0|    else if(s0 == 'm') {
  ------------------
  |  Branch (555:13): [True: 0, False: 0]
  ------------------
  556|      0|      if(s1 == 'q' && s2 == 't' && s3 == 't')
  ------------------
  |  Branch (556:10): [True: 0, False: 0]
  |  Branch (556:23): [True: 0, False: 0]
  |  Branch (556:36): [True: 0, False: 0]
  ------------------
  557|      0|        return &Curl_scheme_mqtts;
  558|      0|    }
  559|      0|    else if(s0 == 's') {
  ------------------
  |  Branch (559:13): [True: 0, False: 0]
  ------------------
  560|      0|      if(s1 == 'o' && s2 == 'c' && s3 == 'k')
  ------------------
  |  Branch (560:10): [True: 0, False: 0]
  |  Branch (560:23): [True: 0, False: 0]
  |  Branch (560:36): [True: 0, False: 0]
  ------------------
  561|      0|        return &Curl_scheme_socks;
  562|      0|    }
  563|  3.74k|  }
  564|      0|  return NULL;
  565|  3.74k|}
protocol.c:six_letter_scheme:
  568|  17.2k|{
  569|  17.2k|  char s0 = Curl_raw_tolower(scheme[0]);
  570|  17.2k|  switch(s0) {
  ------------------
  |  Branch (570:10): [True: 17.2k, False: 0]
  ------------------
  571|      0|  case 's':
  ------------------
  |  Branch (571:3): [True: 0, False: 17.2k]
  ------------------
  572|      0|    if(curl_strnequal("ocks4", &scheme[1], 5))
  ------------------
  |  Branch (572:8): [True: 0, False: 0]
  ------------------
  573|      0|      return &Curl_scheme_socks4;
  574|      0|    if(curl_strnequal("ocks5", &scheme[1], 5))
  ------------------
  |  Branch (574:8): [True: 0, False: 0]
  ------------------
  575|      0|      return &Curl_scheme_socks5;
  576|      0|    break;
  577|      0|  case 'g':
  ------------------
  |  Branch (577:3): [True: 0, False: 17.2k]
  ------------------
  578|      0|    if(curl_strnequal("opher", &scheme[1], 5))
  ------------------
  |  Branch (578:8): [True: 0, False: 0]
  ------------------
  579|      0|      return &Curl_scheme_gopher;
  580|      0|    break;
  581|  17.2k|  case 't':
  ------------------
  |  Branch (581:3): [True: 17.2k, False: 0]
  ------------------
  582|  17.2k|    if(curl_strnequal("elnet", &scheme[1], 5))
  ------------------
  |  Branch (582:8): [True: 17.2k, False: 0]
  ------------------
  583|  17.2k|      return &Curl_scheme_telnet;
  584|      0|    break;
  585|  17.2k|  }
  586|      0|  return NULL;
  587|  17.2k|}

proxy_check_noproxy:
  199|  3.04k|{
  200|       |  /*
  201|       |   * If we do not have a hostname at all, like for example with a FILE
  202|       |   * transfer, we have nothing to interrogate the noproxy list with.
  203|       |   */
  204|  3.04k|  if(!name || name[0] == '\0')
  ------------------
  |  Branch (204:6): [True: 0, False: 3.04k]
  |  Branch (204:15): [True: 0, False: 3.04k]
  ------------------
  205|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  206|       |
  207|       |  /* no_proxy=domain1.dom,host.domain2.dom
  208|       |   *   (a comma-separated list of hosts which should
  209|       |   *   not be proxied, or an asterisk to override
  210|       |   *   all proxy variables)
  211|       |   */
  212|  3.04k|  if(no_proxy && no_proxy[0]) {
  ------------------
  |  Branch (212:6): [True: 0, False: 3.04k]
  |  Branch (212:18): [True: 0, False: 0]
  ------------------
  213|      0|    const char *p = no_proxy;
  214|      0|    size_t namelen;
  215|      0|    char address[16];
  216|      0|    enum nametype type = TYPE_HOST;
  217|      0|    if(!strcmp("*", no_proxy))
  ------------------
  |  Branch (217:8): [True: 0, False: 0]
  ------------------
  218|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  219|       |
  220|       |    /* NO_PROXY was specified and it was not only an asterisk */
  221|       |
  222|       |    /* Check if name is an IP address; if not, assume it being a hostname. */
  223|      0|    namelen = strlen(name);
  224|      0|    if(curlx_inet_pton(AF_INET, name, &address) == 1)
  ------------------
  |  Branch (224:8): [True: 0, False: 0]
  ------------------
  225|      0|      type = TYPE_IPV4;
  226|      0|#ifdef USE_IPV6
  227|      0|    else if(curlx_inet_pton(AF_INET6, name, &address) == 1)
  ------------------
  |  Branch (227:13): [True: 0, False: 0]
  ------------------
  228|      0|      type = TYPE_IPV6;
  229|      0|#endif
  230|      0|    else {
  231|       |      /* ignore trailing dots in the hostname */
  232|      0|      if(name[namelen - 1] == '.')
  ------------------
  |  Branch (232:10): [True: 0, False: 0]
  ------------------
  233|      0|        namelen--;
  234|      0|    }
  235|       |
  236|      0|    while(*p) {
  ------------------
  |  Branch (236:11): [True: 0, False: 0]
  ------------------
  237|      0|      const char *token;
  238|      0|      size_t tokenlen = 0;
  239|       |
  240|       |      /* pass blanks */
  241|      0|      curlx_str_passblanks(&p);
  242|       |
  243|      0|      token = p;
  244|       |      /* pass over the pattern */
  245|      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 (245:13): [True: 0, False: 0]
  |  Branch (245:35): [True: 0, False: 0]
  ------------------
  246|      0|        p++;
  247|      0|        tokenlen++;
  248|      0|      }
  249|       |
  250|      0|      if(tokenlen) {
  ------------------
  |  Branch (250:10): [True: 0, False: 0]
  ------------------
  251|      0|        bool match = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  252|      0|        if(type == TYPE_HOST)
  ------------------
  |  Branch (252:12): [True: 0, False: 0]
  ------------------
  253|      0|          match = match_host(token, tokenlen, name, namelen);
  254|      0|        else
  255|      0|          match = match_ip(type, token, tokenlen, name);
  256|       |
  257|      0|        if(match)
  ------------------
  |  Branch (257:12): [True: 0, False: 0]
  ------------------
  258|      0|          return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  259|      0|      }
  260|       |
  261|       |      /* pass blanks after pattern */
  262|      0|      curlx_str_passblanks(&p);
  263|       |      /* if not a comma, this ends the loop */
  264|      0|      if(*p != ',')
  ------------------
  |  Branch (264:10): [True: 0, False: 0]
  ------------------
  265|      0|        break;
  266|       |      /* pass any number of commas */
  267|      0|      while(*p == ',')
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  ------------------
  268|      0|        p++;
  269|      0|    } /* while(*p) */
  270|      0|  } /* NO_PROXY was specified and it was not only an asterisk */
  271|       |
  272|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  273|  3.04k|}
Curl_proxy_init_conn:
  521|  3.04k|{
  522|  3.04k|  char *proxy = NULL;
  523|  3.04k|  char *pre_proxy = NULL;
  524|  3.04k|  const char *str = NULL;
  525|  3.04k|  bool do_env_detect = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  526|  3.04k|  CURLcode result = CURLE_OK;
  527|       |
  528|       |  /* Enforce no proxy use unless we decide to use one */
  529|  3.04k|  conn->bits.origin_is_proxy = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  530|  3.04k|  DEBUGASSERT(!conn->socks_proxy.peer);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (530:3): [True: 0, False: 3.04k]
  |  Branch (530:3): [True: 3.04k, False: 0]
  ------------------
  531|  3.04k|  DEBUGASSERT(!conn->http_proxy.peer);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (531:3): [True: 0, False: 3.04k]
  |  Branch (531:3): [True: 3.04k, False: 0]
  ------------------
  532|       |
  533|  3.04k|  if(proxy_do_not_proxy(data))
  ------------------
  |  Branch (533:6): [True: 0, False: 3.04k]
  ------------------
  534|      0|    goto out;
  535|       |
  536|       |  /*************************************************************
  537|       |   * Detect what (if any) proxy to use
  538|       |   *************************************************************/
  539|       |  /* the empty config strings disable proxy use and env detects */
  540|  3.04k|  str = CURL_EASY_STR(data, STRING_PROXY);
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  541|  3.04k|  if(str) {
  ------------------
  |  Branch (541:6): [True: 3.04k, False: 0]
  ------------------
  542|  3.04k|    if(*str) {
  ------------------
  |  Branch (542:8): [True: 0, False: 3.04k]
  ------------------
  543|      0|      proxy = curlx_strdup(str);
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  544|       |      /* if global proxy is set, this is it */
  545|      0|      if(!proxy) {
  ------------------
  |  Branch (545:10): [True: 0, False: 0]
  ------------------
  546|      0|        failf(data, "memory shortage");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  547|      0|        result = CURLE_OUT_OF_MEMORY;
  548|      0|        goto out;
  549|      0|      }
  550|      0|    }
  551|  3.04k|    else
  552|  3.04k|      do_env_detect = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  553|  3.04k|  }
  554|       |
  555|  3.04k|  str = CURL_EASY_STR(data, STRING_PRE_PROXY);
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  556|  3.04k|  if(str) {
  ------------------
  |  Branch (556:6): [True: 0, False: 3.04k]
  ------------------
  557|      0|    if(*str) {
  ------------------
  |  Branch (557:8): [True: 0, False: 0]
  ------------------
  558|      0|      pre_proxy = curlx_strdup(str);
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  559|       |      /* if global socks proxy is set, this is it */
  560|      0|      if(!pre_proxy) {
  ------------------
  |  Branch (560:10): [True: 0, False: 0]
  ------------------
  561|      0|        failf(data, "memory shortage");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  562|      0|        result = CURLE_OUT_OF_MEMORY;
  563|      0|        goto out;
  564|      0|      }
  565|      0|    }
  566|      0|    else
  567|      0|      do_env_detect = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  568|      0|  }
  569|       |
  570|  3.04k|#ifndef CURL_DISABLE_HTTP
  571|       |  /* None configured, detect possible proxy from environment. */
  572|  3.04k|  if(!proxy && !pre_proxy && do_env_detect)
  ------------------
  |  Branch (572:6): [True: 3.04k, False: 0]
  |  Branch (572:16): [True: 3.04k, False: 0]
  |  Branch (572:30): [True: 0, False: 3.04k]
  ------------------
  573|      0|    proxy = proxy_detect_proxy(data, conn->scheme);
  574|       |#else
  575|       |  (void)do_env_detect;
  576|       |#endif /* CURL_DISABLE_HTTP */
  577|       |
  578|  3.04k|  if(!proxy && !pre_proxy)
  ------------------
  |  Branch (578:6): [True: 3.04k, False: 0]
  |  Branch (578:16): [True: 3.04k, False: 0]
  ------------------
  579|  3.04k|    goto out;
  580|       |
  581|      0|  if(pre_proxy) {
  ------------------
  |  Branch (581:6): [True: 0, False: 0]
  ------------------
  582|      0|    result = parse_proxy(data, pre_proxy, TRUE, &conn->socks_proxy);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  583|      0|    if(result)
  ------------------
  |  Branch (583:8): [True: 0, False: 0]
  ------------------
  584|      0|      goto out;
  585|      0|  }
  586|       |
  587|      0|  if(proxy) {
  ------------------
  |  Branch (587:6): [True: 0, False: 0]
  ------------------
  588|      0|    result = parse_proxy(data, proxy, FALSE, &conn->http_proxy);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  589|      0|    if(result)
  ------------------
  |  Branch (589:8): [True: 0, False: 0]
  ------------------
  590|      0|      goto out;
  591|       |
  592|      0|    switch(conn->http_proxy.proxytype) {
  593|      0|    case CURLPROXY_SOCKS4:
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (593:5): [True: 0, False: 0]
  ------------------
  594|      0|    case CURLPROXY_SOCKS4A:
  ------------------
  |  |  803|      0|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (594:5): [True: 0, False: 0]
  ------------------
  595|      0|    case CURLPROXY_SOCKS5:
  ------------------
  |  |  802|      0|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (595:5): [True: 0, False: 0]
  ------------------
  596|      0|    case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  804|      0|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (596:5): [True: 0, False: 0]
  ------------------
  597|       |      /* Whoops, it is not an HTTP proxy */
  598|      0|      if(pre_proxy) {
  ------------------
  |  Branch (598:10): [True: 0, False: 0]
  ------------------
  599|       |        /* and we already have a SOCKS pre-proxy. Cannot have both */
  600|      0|        failf(data, "Having a SOCKS pre-proxy and proxy is not "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  601|      0|              "supported with \'%s\'", proxy);
  602|      0|        result = CURLE_COULDNT_RESOLVE_PROXY;
  603|      0|        goto out;
  604|      0|      }
  605|       |      /* switch */
  606|      0|      conn->socks_proxy = conn->http_proxy;
  607|      0|      memset(&conn->http_proxy, 0, sizeof(conn->http_proxy));
  608|      0|      break;
  609|      0|    default:
  ------------------
  |  Branch (609:5): [True: 0, False: 0]
  ------------------
  610|       |      /* all other types are HTTP */
  611|      0|      break;
  612|      0|    }
  613|      0|  }
  614|       |
  615|      0|  if(conn->socks_proxy.peer) {
  ------------------
  |  Branch (615:6): [True: 0, False: 0]
  ------------------
  616|      0|    DEBUGASSERT(!CURL_PROXY_IS_ANY_HTTP(conn->socks_proxy.proxytype));
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  |  Branch (616:5): [True: 0, False: 0]
  ------------------
  617|      0|  }
  618|       |
  619|       |#ifdef CURL_DISABLE_HTTP
  620|       |  if(conn->http_proxy.peer) {
  621|       |    /* asking for an HTTP proxy is a bit funny when HTTP is disabled... */
  622|       |    result = CURLE_UNSUPPORTED_PROTOCOL;
  623|       |    goto out;
  624|       |  }
  625|       |
  626|       |#else /* CURL_DISABLE_HTTP */
  627|      0|  if(conn->http_proxy.peer) {
  ------------------
  |  Branch (627:6): [True: 0, False: 0]
  ------------------
  628|      0|    const struct Curl_scheme *scheme = data->state.origin->scheme;
  629|      0|    bool tunnel_proxy = (bool)data->set.tunnel_thru_httpproxy;
  630|      0|    DEBUGASSERT(CURL_PROXY_IS_ANY_HTTP(conn->http_proxy.proxytype));
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  |  Branch (630:5): [True: 0, False: 0]
  ------------------
  631|       |
  632|      0|    if(!tunnel_proxy) {
  ------------------
  |  Branch (632:8): [True: 0, False: 0]
  ------------------
  633|       |      /* Decide if we tunnel through proxy automatically */
  634|      0|      if(conn->via_peer) {
  ------------------
  |  Branch (634:10): [True: 0, False: 0]
  ------------------
  635|       |        /* With connect-to, we always tunnel */
  636|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  637|      0|      }
  638|      0|      else if(scheme->flags & PROTOPT_SSL) {
  ------------------
  |  |  204|      0|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (638:15): [True: 0, False: 0]
  ------------------
  639|       |        /* If the transfer is supposed to be secure, we tunnel */
  640|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  641|      0|      }
  642|      0|      else if(scheme->flags & PROTOPT_HTTP_PROXY_TUNNEL) {
  ------------------
  |  |  236|      0|#define PROTOPT_HTTP_PROXY_TUNNEL (1 << 18) /* Using this protocol with a
  ------------------
  |  Branch (642:15): [True: 0, False: 0]
  ------------------
  643|       |        /* transfer scheme required tunneling */
  644|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  645|      0|      }
  646|      0|      else if(!(scheme->protocol & PROTO_FAMILY_HTTP) &&
  ------------------
  |  |   82|      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 | \
  |  |  ------------------
  |  |  |  |   61|      0|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   83|      0|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (646:15): [True: 0, False: 0]
  ------------------
  647|      0|              !(scheme->flags & PROTOPT_PROXY_AS_HTTP)) {
  ------------------
  |  |  223|      0|#define PROTOPT_PROXY_AS_HTTP (1 << 11) /* allow this non-HTTP scheme over a
  ------------------
  |  Branch (647:15): [True: 0, False: 0]
  ------------------
  648|       |        /* Cannot delegate transfer URL to HTTP proxy */
  649|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  650|      0|      }
  651|      0|    }
  652|       |
  653|      0|    if(!tunnel_proxy) {
  ------------------
  |  Branch (653:8): [True: 0, False: 0]
  ------------------
  654|       |      /* HTTP proxy used in forwarding mode. This means the connection
  655|       |       * is really to the proxy and NOT the origin of the transfer. */
  656|      0|      DEBUGASSERT(!conn->via_peer);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (656:7): [True: 0, False: 0]
  |  Branch (656:7): [True: 0, False: 0]
  ------------------
  657|      0|      Curl_peer_link(&conn->origin, conn->http_proxy.peer);
  658|      0|      conn->scheme = conn->http_proxy.peer->scheme;
  659|      0|      conn->bits.origin_is_proxy = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  660|      0|    }
  661|       |
  662|      0|#ifndef CURL_DISABLE_DIGEST_AUTH
  663|      0|    if(!Curl_safecmp(data->state.envproxy, proxy)) {
  ------------------
  |  Branch (663:8): [True: 0, False: 0]
  ------------------
  664|       |      /* proxy changed */
  665|      0|      Curl_auth_digest_cleanup(&data->state.proxydigest);
  666|      0|      curlx_free(data->state.envproxy);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  667|      0|      data->state.envproxy = curlx_strdup(proxy);
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  668|      0|    }
  669|      0|#endif
  670|      0|  }
  671|      0|#endif /* !CURL_DISABLE_HTTP */
  672|       |
  673|  3.04k|out:
  674|  3.04k|  curlx_free(pre_proxy);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  675|  3.04k|  curlx_free(proxy);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  676|  3.04k|  return result;
  677|      0|}
proxy.c:proxy_do_not_proxy:
  492|  3.04k|{
  493|  3.04k|  const char *no_proxy;
  494|  3.04k|  char *env_no_proxy = NULL;
  495|  3.04k|  bool do_not_proxy;
  496|       |
  497|       |  /* no proxying if the transfer does not use the network */
  498|  3.04k|  if(data->state.origin->scheme->flags & PROTOPT_NONETWORK)
  ------------------
  |  |  211|  3.04k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (498:6): [True: 0, False: 3.04k]
  ------------------
  499|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  500|       |
  501|  3.04k|  no_proxy = CURL_EASY_STR(data, STRING_NOPROXY);
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  502|  3.04k|  if(!no_proxy) {
  ------------------
  |  Branch (502:6): [True: 3.04k, False: 0]
  ------------------
  503|  3.04k|    const char *p = "no_proxy";
  504|  3.04k|    env_no_proxy = curl_getenv(p);
  505|  3.04k|    if(!env_no_proxy) {
  ------------------
  |  Branch (505:8): [True: 3.04k, False: 0]
  ------------------
  506|  3.04k|      p = "NO_PROXY";
  507|  3.04k|      env_no_proxy = curl_getenv(p);
  508|  3.04k|    }
  509|  3.04k|    if(env_no_proxy)
  ------------------
  |  Branch (509:8): [True: 0, False: 3.04k]
  ------------------
  510|      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]
  |  |  ------------------
  ------------------
  511|  3.04k|    no_proxy = env_no_proxy;
  512|  3.04k|  }
  513|       |
  514|  3.04k|  do_not_proxy = proxy_check_noproxy(data->state.origin->hostname, no_proxy);
  515|       |  curlx_safefree(env_no_proxy);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  516|  3.04k|  return do_not_proxy;
  517|  3.04k|}

Curl_rlimit_start:
  173|    561|{
  174|       |  /* A start always resets the values to initial defaults, then
  175|       |   * fine tunes the intervals for the total_tokens expected. */
  176|    561|  r->rate_per_step = r->rate_per_sec;
  177|    561|  r->burst_per_step = r->burst_per_sec;
  178|    561|  r->step_us = CURL_US_PER_SEC;
  ------------------
  |  |   29|    561|#define CURL_US_PER_SEC         1000000
  ------------------
  179|    561|  r->spare_us = 0;
  180|    561|  r->tokens = r->rate_per_step;
  181|    561|  r->ts = *pts;
  182|    561|  rlimit_tune_steps(r, total_tokens);
  183|    561|}
Curl_rlimit_is_blocked:
  196|  5.95k|{
  197|  5.95k|  return (bool)r->blocked;
  198|  5.95k|}
Curl_rlimit_drain:
  221|  15.7k|{
  222|  15.7k|  struct curltime ts;
  223|       |
  224|  15.7k|  if(r->blocked || !r->rate_per_step)
  ------------------
  |  Branch (224:6): [True: 0, False: 15.7k]
  |  Branch (224:20): [True: 15.7k, False: 0]
  ------------------
  225|  15.7k|    return;
  226|       |
  227|      0|  if(!pts) {
  ------------------
  |  Branch (227:6): [True: 0, False: 0]
  ------------------
  228|      0|    curlx_pnow(&ts);
  229|      0|    pts = &ts;
  230|      0|  }
  231|      0|  rlimit_update(r, pts);
  232|      0|#if 8 <= SIZEOF_SIZE_T
  233|      0|  if(tokens > INT64_MAX) {
  ------------------
  |  Branch (233:6): [True: 0, False: 0]
  ------------------
  234|      0|    r->tokens = INT64_MAX;
  235|      0|  }
  236|      0|  else
  237|      0|#endif
  238|      0|  {
  239|      0|    int64_t val = (int64_t)tokens;
  240|      0|    if((INT64_MIN + val) < r->tokens)
  ------------------
  |  Branch (240:8): [True: 0, False: 0]
  ------------------
  241|      0|      r->tokens -= val;
  242|      0|    else
  243|      0|      r->tokens = INT64_MIN;
  244|      0|  }
  245|      0|}
Curl_rlimit_block:
  292|  7.48k|{
  293|  7.48k|  if(!activate == !r->blocked)
  ------------------
  |  Branch (293:6): [True: 7.48k, False: 0]
  ------------------
  294|  7.48k|    return;
  295|       |
  296|      0|  r->ts = *pts;
  297|      0|  r->blocked = activate;
  298|      0|  if(!r->blocked) {
  ------------------
  |  Branch (298:6): [True: 0, False: 0]
  ------------------
  299|       |    /* Start rate limiting fresh. The amount of time this was blocked
  300|       |     * does not generate extra tokens. */
  301|      0|    Curl_rlimit_start(r, pts, -1);
  302|      0|  }
  303|      0|  else {
  304|      0|    r->tokens = 0;
  305|      0|  }
  306|      0|}
ratelimit.c:rlimit_tune_steps:
   79|    561|{
   80|    561|  int64_t tokens_last, tokens_main, msteps;
   81|       |
   82|       |  /* Tune the ratelimit at the start *if* we know how many tokens
   83|       |   * are expected to be consumed in total.
   84|       |   * The reason for tuning is that rlimit provides tokens to be consumed
   85|       |   * per "step" which starts out to be a second. The tokens may be consumed
   86|       |   * in full at the beginning of a step. The remainder of the second will
   87|       |   * have no tokens available, effectively blocking the consumption and
   88|       |   * so keeping the "step average" in line.
   89|       |   * This works will up to the last step. When no more tokens are needed,
   90|       |   * no wait will happen and the last step would be too fast. This is
   91|       |   * especially noticeable when only a few steps are needed.
   92|       |   *
   93|       |   * Example: downloading 1.5kb with a ratelimit of 1k could be done in
   94|       |   * roughly 1 second (1k in the first second and the 0.5 at the start of
   95|       |   * the second one).
   96|       |   *
   97|       |   * The tuning tries to make the last step small, using only
   98|       |   * 1 percent of the total tokens (at least 1). The rest of the tokens
   99|       |   * are to be consumed in the steps before by adjusting the duration of
  100|       |   * the step and the amount of tokens it provides. */
  101|    561|  if(!r->rate_per_step ||
  ------------------
  |  Branch (101:6): [True: 561, False: 0]
  ------------------
  102|      0|     (tokens_total <= 1) ||
  ------------------
  |  Branch (102:6): [True: 0, False: 0]
  ------------------
  103|      0|     (tokens_total > (INT64_MAX / 1000)))
  ------------------
  |  Branch (103:6): [True: 0, False: 0]
  ------------------
  104|    561|    return;
  105|       |
  106|       |  /* Calculate tokens for the last step and the ones before. */
  107|      0|  tokens_last = tokens_total / 100;
  108|      0|  if(!tokens_last) /* less than 100 total, use 1 */
  ------------------
  |  Branch (108:6): [True: 0, False: 0]
  ------------------
  109|      0|    tokens_last = 1;
  110|      0|  else if(tokens_last > CURL_RLIMIT_MIN_RATE)
  ------------------
  |  |   30|      0|#define CURL_RLIMIT_MIN_RATE    (4 * 1024)  /* minimum step rate */
  ------------------
  |  Branch (110:11): [True: 0, False: 0]
  ------------------
  111|      0|    tokens_last = CURL_RLIMIT_MIN_RATE;
  ------------------
  |  |   30|      0|#define CURL_RLIMIT_MIN_RATE    (4 * 1024)  /* minimum step rate */
  ------------------
  112|      0|  DEBUGASSERT(tokens_last);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (112:3): [True: 0, False: 0]
  |  Branch (112:3): [True: 0, False: 0]
  ------------------
  113|      0|  tokens_main = tokens_total - tokens_last;
  114|      0|  DEBUGASSERT(tokens_main);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (114:3): [True: 0, False: 0]
  |  Branch (114:3): [True: 0, False: 0]
  ------------------
  115|       |
  116|       |  /* how many milli-steps will it take to consume those, give the
  117|       |  * original rate limit per second? */
  118|      0|  DEBUGASSERT(r->step_us == CURL_US_PER_SEC);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (118:3): [True: 0, False: 0]
  |  Branch (118:3): [True: 0, False: 0]
  ------------------
  119|       |
  120|      0|  msteps = (tokens_main * 1000 / r->rate_per_step);
  121|      0|  if(msteps < CURL_RLIMIT_STEP_MIN_MS) {
  ------------------
  |  |   31|      0|#define CURL_RLIMIT_STEP_MIN_MS 2  /* minimum step duration */
  ------------------
  |  Branch (121:6): [True: 0, False: 0]
  ------------------
  122|       |    /* Steps this small will not work. Do not tune. */
  123|      0|    return;
  124|      0|  }
  125|      0|  else if(msteps < 1000) {
  ------------------
  |  Branch (125:11): [True: 0, False: 0]
  ------------------
  126|       |    /* It needs less than one step to provide the needed tokens.
  127|       |     * Make it exactly that long and with exactly those tokens. */
  128|      0|    r->step_us = (timediff_t)msteps * 1000;
  129|      0|    r->rate_per_step = tokens_main;
  130|      0|    r->tokens = r->rate_per_step;
  131|      0|  }
  132|      0|  else {
  133|       |    /* More than 1 step. Spread the remainder milli steps and
  134|       |     * the tokens they need to provide across all steps. If integer
  135|       |     * arithmetic can do it. */
  136|      0|    curl_off_t ms_unaccounted = (msteps % 1000);
  137|      0|    curl_off_t mstep_inc = (ms_unaccounted / (msteps / 1000));
  138|      0|    if(mstep_inc) {
  ------------------
  |  Branch (138:8): [True: 0, False: 0]
  ------------------
  139|      0|      curl_off_t rate_inc = ((r->rate_per_step * mstep_inc) / 1000);
  140|      0|      if(rate_inc) {
  ------------------
  |  Branch (140:10): [True: 0, False: 0]
  ------------------
  141|      0|        r->step_us = CURL_US_PER_SEC + ((timediff_t)mstep_inc * 1000);
  ------------------
  |  |   29|      0|#define CURL_US_PER_SEC         1000000
  ------------------
  142|      0|        r->rate_per_step += rate_inc;
  143|      0|        r->tokens = r->rate_per_step;
  144|      0|        if(r->burst_per_step) {
  ------------------
  |  Branch (144:12): [True: 0, False: 0]
  ------------------
  145|      0|          curl_off_t burst_inc = ((r->burst_per_step * mstep_inc) / 1000);
  146|      0|          if(burst_inc)
  ------------------
  |  Branch (146:14): [True: 0, False: 0]
  ------------------
  147|      0|            r->burst_per_step += burst_inc;
  148|      0|        }
  149|      0|      }
  150|      0|    }
  151|      0|  }
  152|      0|}

Curl_req_init:
   38|  7.48k|{
   39|  7.48k|  memset(req, 0, sizeof(*req));
   40|  7.48k|}
Curl_req_soft_reset:
   44|  3.04k|{
   45|  3.04k|  CURLcode result;
   46|       |
   47|  3.04k|  req->done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   48|  3.04k|  req->upload_done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   49|  3.04k|  req->upload_aborted = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   50|  3.04k|  req->download_done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   51|  3.04k|  req->eos_written = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   52|  3.04k|  req->eos_read = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   53|  3.04k|  req->eos_sent = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   54|  3.04k|  req->ignorebody = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   55|  3.04k|  req->shutdown = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   56|  3.04k|  req->bytecount = 0;
   57|  3.04k|  req->writebytecount = 0;
   58|  3.04k|  req->header = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
   59|  3.04k|  req->headerline = 0;
   60|  3.04k|  req->headerbytecount = 0;
   61|  3.04k|  req->allheadercount = 0;
   62|  3.04k|  req->deductheadercount = 0;
   63|  3.04k|  req->httpversion_sent = 0;
   64|  3.04k|  req->httpversion = 0;
   65|  3.04k|  req->sendbuf_hds_len = 0;
   66|       |
   67|  3.04k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
   68|  3.04k|#ifndef CURL_DISABLE_PROXY
   69|  3.04k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
   70|  3.04k|#endif
   71|       |
   72|  3.04k|  result = Curl_client_start(data);
   73|  3.04k|  if(result)
  ------------------
  |  Branch (73:6): [True: 0, False: 3.04k]
  ------------------
   74|      0|    return result;
   75|       |
   76|  3.04k|  if(!req->sendbuf_init) {
  ------------------
  |  Branch (76:6): [True: 3.04k, False: 0]
  ------------------
   77|  3.04k|    Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1,
   78|  3.04k|                    BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|  3.04k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
   79|  3.04k|    req->sendbuf_init = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
   80|  3.04k|  }
   81|      0|  else {
   82|      0|    Curl_bufq_reset(&req->sendbuf);
   83|      0|    if(data->set.upload_buffer_size != req->sendbuf.chunk_size) {
  ------------------
  |  Branch (83:8): [True: 0, False: 0]
  ------------------
   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|      0|  }
   89|       |
   90|  3.04k|  return CURLE_OK;
   91|  3.04k|}
Curl_req_start:
   95|  3.04k|{
   96|  3.04k|  req->start = *Curl_pgrs_now(data);
   97|  3.04k|  return Curl_req_soft_reset(req, data);
   98|  3.04k|}
Curl_req_done:
  104|  3.04k|{
  105|  3.04k|  (void)req;
  106|  3.04k|  if(!aborted)
  ------------------
  |  Branch (106:6): [True: 3.04k, False: 0]
  ------------------
  107|  3.04k|    (void)req_flush(data);
  108|  3.04k|  Curl_client_reset(data);
  109|  3.04k|  return CURLE_OK;
  110|  3.04k|}
Curl_req_hard_reset:
  113|  3.74k|{
  114|  3.74k|  struct curltime t0 = { 0, 0 };
  115|       |
  116|  3.74k|  curlx_safefree(req->newurl);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  117|  3.74k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  118|  3.74k|#ifndef CURL_DISABLE_PROXY
  119|  3.74k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  120|  3.74k|#endif
  121|  3.74k|#ifndef CURL_DISABLE_COOKIES
  122|  3.74k|  curlx_safefree(req->cookiehost);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  123|  3.74k|#endif
  124|  3.74k|  Curl_client_reset(data);
  125|  3.74k|  if(req->sendbuf_init)
  ------------------
  |  Branch (125:6): [True: 0, False: 3.74k]
  ------------------
  126|      0|    Curl_bufq_reset(&req->sendbuf);
  127|       |
  128|       |  /* clear any resolve data */
  129|  3.74k|  Curl_resolv_destroy_all(data);
  130|       |  /* Can no longer memset() this struct as we need to keep some state */
  131|  3.74k|  req->size = -1;
  132|  3.74k|  req->maxdownload = -1;
  133|  3.74k|  req->bytecount = 0;
  134|  3.74k|  req->writebytecount = 0;
  135|  3.74k|  req->start = t0;
  136|  3.74k|  req->headerbytecount = 0;
  137|  3.74k|  req->allheadercount = 0;
  138|  3.74k|  req->deductheadercount = 0;
  139|  3.74k|  req->headerline = 0;
  140|  3.74k|  req->offset = 0;
  141|  3.74k|  req->httpcode = 0;
  142|  3.74k|  req->io_flags = 0;
  143|  3.74k|  req->upgr101 = UPGR101_NONE;
  144|  3.74k|  req->sendbuf_hds_len = 0;
  145|  3.74k|  req->timeofdoc = 0;
  146|  3.74k|  req->location = NULL;
  147|  3.74k|  req->newurl = NULL;
  148|  3.74k|#ifndef CURL_DISABLE_COOKIES
  149|  3.74k|  req->setcookies = 0;
  150|  3.74k|#endif
  151|  3.74k|  req->header = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  152|  3.74k|  req->content_range = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  153|  3.74k|  req->download_done = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  154|  3.74k|  req->eos_written = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  155|  3.74k|  req->eos_read = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  156|  3.74k|  req->eos_sent = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  157|  3.74k|  req->rewind_read = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  158|  3.74k|  req->upload_done = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  159|  3.74k|  req->upload_aborted = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  160|  3.74k|  req->ignorebody = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  161|  3.74k|  req->http_bodyless = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  162|  3.74k|  req->chunk = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  163|  3.74k|  req->resp_trailer = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  164|  3.74k|  req->ignore_cl = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  165|  3.74k|  req->upload_chunky = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  166|  3.74k|  req->no_body = data->set.opt_no_body;
  167|  3.74k|  req->authneg = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  168|  3.74k|  req->shutdown = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  169|       |  /* Unpause all directions */
  170|  3.74k|  Curl_rlimit_block(&data->progress.dl.rlimit, FALSE, &t0);
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  171|       |  Curl_rlimit_block(&data->progress.ul.rlimit, FALSE, &t0);
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  172|  3.74k|}
Curl_req_free:
  175|  7.48k|{
  176|  7.48k|  curlx_safefree(req->newurl);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  177|  7.48k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  178|  7.48k|#ifndef CURL_DISABLE_PROXY
  179|  7.48k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  180|  7.48k|#endif
  181|  7.48k|  if(req->sendbuf_init)
  ------------------
  |  Branch (181:6): [True: 3.04k, False: 4.44k]
  ------------------
  182|  3.04k|    Curl_bufq_free(&req->sendbuf);
  183|  7.48k|  Curl_client_cleanup(data);
  184|  7.48k|}
Curl_req_sendbuf_empty:
  428|  2.91k|{
  429|  2.91k|  return !data->req.sendbuf_init || Curl_bufq_is_empty(&data->req.sendbuf);
  ------------------
  |  Branch (429:10): [True: 0, False: 2.91k]
  |  Branch (429:37): [True: 2.91k, False: 0]
  ------------------
  430|  2.91k|}
Curl_req_want_send:
  433|  2.91k|{
  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|  2.91k|  return !data->req.done &&
  ------------------
  |  Branch (438:10): [True: 2.91k, False: 0]
  ------------------
  439|  2.91k|         !Curl_rlimit_is_blocked(&data->progress.ul.rlimit) &&
  ------------------
  |  Branch (439:10): [True: 2.91k, False: 0]
  ------------------
  440|  2.91k|         (CURL_REQ_WANT_SEND(data) ||
  ------------------
  |  |   39|  5.83k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  2.91k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 0, False: 2.91k]
  |  |  ------------------
  ------------------
  441|  2.91k|          !Curl_req_sendbuf_empty(data) ||
  ------------------
  |  Branch (441:11): [True: 0, False: 2.91k]
  ------------------
  442|  2.91k|          Curl_xfer_needs_flush(data));
  ------------------
  |  Branch (442:11): [True: 0, False: 2.91k]
  ------------------
  443|  2.91k|}
request.c:req_flush:
  299|  3.04k|{
  300|  3.04k|  CURLcode result;
  301|       |
  302|  3.04k|  if(!data || !data->conn)
  ------------------
  |  Branch (302:6): [True: 0, False: 3.04k]
  |  Branch (302:15): [True: 0, False: 3.04k]
  ------------------
  303|      0|    return CURLE_FAILED_INIT;
  304|       |
  305|  3.04k|  if(!Curl_bufq_is_empty(&data->req.sendbuf)) {
  ------------------
  |  Branch (305:6): [True: 0, False: 3.04k]
  ------------------
  306|      0|    result = req_send_buffer_flush(data);
  307|      0|    if(result)
  ------------------
  |  Branch (307:8): [True: 0, False: 0]
  ------------------
  308|      0|      return result;
  309|      0|    if(!Curl_bufq_is_empty(&data->req.sendbuf)) {
  ------------------
  |  Branch (309:8): [True: 0, False: 0]
  ------------------
  310|      0|      DEBUGF(infof(data, "Curl_req_flush(len=%zu) -> EAGAIN",
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  311|      0|                   Curl_bufq_len(&data->req.sendbuf)));
  312|      0|      return CURLE_AGAIN;
  313|      0|    }
  314|      0|  }
  315|  3.04k|  else if(Curl_xfer_needs_flush(data)) {
  ------------------
  |  Branch (315:11): [True: 0, False: 3.04k]
  ------------------
  316|      0|    DEBUGF(infof(data, "Curl_req_flush(), xfer send_pending"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  317|      0|    return Curl_xfer_flush(data);
  318|      0|  }
  319|       |
  320|  3.04k|  if(data->req.eos_read && !data->req.eos_sent) {
  ------------------
  |  Branch (320:6): [True: 0, False: 3.04k]
  |  Branch (320:28): [True: 0, False: 0]
  ------------------
  321|      0|    char tmp = 0;
  322|      0|    size_t nwritten;
  323|      0|    result = xfer_send(data, &tmp, 0, 0, &nwritten);
  324|      0|    if(result)
  ------------------
  |  Branch (324:8): [True: 0, False: 0]
  ------------------
  325|      0|      return result;
  326|      0|    DEBUGASSERT(data->req.eos_sent);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (326:5): [True: 0, False: 0]
  |  Branch (326:5): [True: 0, False: 0]
  ------------------
  327|      0|  }
  328|       |
  329|  3.04k|  if(!data->req.upload_done && data->req.eos_read && data->req.eos_sent) {
  ------------------
  |  Branch (329:6): [True: 3.04k, False: 0]
  |  Branch (329:32): [True: 0, False: 3.04k]
  |  Branch (329:54): [True: 0, False: 0]
  ------------------
  330|      0|    DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (330:5): [True: 0, False: 0]
  |  Branch (330:5): [True: 0, False: 0]
  ------------------
  331|      0|    if(data->req.shutdown) {
  ------------------
  |  Branch (331:8): [True: 0, False: 0]
  ------------------
  332|      0|      bool done;
  333|      0|      result = Curl_xfer_send_shutdown(data, &done);
  334|      0|      if(result && data->req.shutdown_err_ignore) {
  ------------------
  |  Branch (334:10): [True: 0, False: 0]
  |  Branch (334:20): [True: 0, False: 0]
  ------------------
  335|      0|        infof(data, "Shutdown send direction error: %d. Broken server? "
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  336|      0|              "Proceeding as if everything is ok.", (int)result);
  337|      0|        result = CURLE_OK;
  338|      0|        done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  339|      0|      }
  340|       |
  341|      0|      if(result)
  ------------------
  |  Branch (341:10): [True: 0, False: 0]
  ------------------
  342|      0|        return result;
  343|      0|      if(!done)
  ------------------
  |  Branch (343:10): [True: 0, False: 0]
  ------------------
  344|      0|        return CURLE_AGAIN;
  345|      0|    }
  346|      0|    return req_set_upload_done(data);
  347|      0|  }
  348|  3.04k|  return CURLE_OK;
  349|  3.04k|}

Curl_poll:
  200|  4.48k|{
  201|  4.48k|#ifdef HAVE_POLL
  202|  4.48k|  int pending_ms;
  203|       |#else
  204|       |  fd_set fds_read;
  205|       |  fd_set fds_write;
  206|       |  fd_set fds_err;
  207|       |  curl_socket_t maxfd;
  208|       |#endif
  209|  4.48k|  bool fds_none = TRUE;
  ------------------
  |  |  997|  4.48k|#define TRUE true
  ------------------
  210|  4.48k|  unsigned int i;
  211|  4.48k|  int r;
  212|       |
  213|  4.48k|  if(ufds) {
  ------------------
  |  Branch (213:6): [True: 4.48k, False: 0]
  ------------------
  214|  4.48k|    for(i = 0; i < nfds; i++) {
  ------------------
  |  Branch (214:16): [True: 4.48k, False: 0]
  ------------------
  215|  4.48k|      if(ufds[i].fd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  4.48k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (215:10): [True: 4.48k, False: 0]
  ------------------
  216|  4.48k|        fds_none = FALSE;
  ------------------
  |  | 1000|  4.48k|#define FALSE false
  ------------------
  217|  4.48k|        break;
  218|  4.48k|      }
  219|  4.48k|    }
  220|  4.48k|  }
  221|  4.48k|  if(fds_none) {
  ------------------
  |  Branch (221:6): [True: 0, False: 4.48k]
  ------------------
  222|       |    /* no sockets, wait */
  223|      0|    return curlx_wait_ms(timeout_ms);
  224|      0|  }
  225|       |
  226|       |  /* Avoid initial timestamp, avoid curlx_now() call, when elapsed
  227|       |     time in this function does not need to be measured. This happens
  228|       |     when function is called with a zero timeout or a negative timeout
  229|       |     value indicating a blocking call should be performed. */
  230|       |
  231|  4.48k|#ifdef HAVE_POLL
  232|       |
  233|       |  /* prevent overflow, timeout_ms is typecast to int. */
  234|  4.48k|#if TIMEDIFF_T_MAX > INT_MAX
  235|  4.48k|  if(timeout_ms > INT_MAX)
  ------------------
  |  Branch (235:6): [True: 0, False: 4.48k]
  ------------------
  236|      0|    timeout_ms = INT_MAX;
  237|  4.48k|#endif
  238|  4.48k|  if(timeout_ms > 0)
  ------------------
  |  Branch (238:6): [True: 4.48k, False: 0]
  ------------------
  239|  4.48k|    pending_ms = (int)timeout_ms;
  240|      0|  else if(timeout_ms < 0)
  ------------------
  |  Branch (240:11): [True: 0, False: 0]
  ------------------
  241|      0|    pending_ms = -1;
  242|      0|  else
  243|      0|    pending_ms = 0;
  244|  4.48k|  r = poll(ufds, nfds, pending_ms);
  245|  4.48k|  if(r <= 0) {
  ------------------
  |  Branch (245:6): [True: 0, False: 4.48k]
  ------------------
  246|      0|    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
                  if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1075|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (246:8): [True: 0, False: 0]
  |  Branch (246:21): [True: 0, False: 0]
  ------------------
  247|       |      /* make EINTR from select or poll not a "lethal" error */
  248|      0|      r = 0;
  249|      0|    return r;
  250|      0|  }
  251|       |
  252|  8.97k|  for(i = 0; i < nfds; i++) {
  ------------------
  |  Branch (252:14): [True: 4.48k, False: 4.48k]
  ------------------
  253|  4.48k|    if(ufds[i].fd == CURL_SOCKET_BAD)
  ------------------
  |  |  147|  4.48k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (253:8): [True: 0, False: 4.48k]
  ------------------
  254|      0|      continue;
  255|  4.48k|    if(ufds[i].revents & POLLHUP)
  ------------------
  |  Branch (255:8): [True: 0, False: 4.48k]
  ------------------
  256|      0|      ufds[i].revents |= POLLIN;
  257|  4.48k|    if(ufds[i].revents & POLLERR)
  ------------------
  |  Branch (257:8): [True: 0, False: 4.48k]
  ------------------
  258|      0|      ufds[i].revents |= POLLIN | POLLOUT;
  259|  4.48k|  }
  260|       |
  261|       |#else /* !HAVE_POLL */
  262|       |
  263|       |  FD_ZERO(&fds_read);
  264|       |  FD_ZERO(&fds_write);
  265|       |  FD_ZERO(&fds_err);
  266|       |  maxfd = (curl_socket_t)-1;
  267|       |
  268|       |  for(i = 0; i < nfds; i++) {
  269|       |    ufds[i].revents = 0;
  270|       |    if(ufds[i].fd == CURL_SOCKET_BAD)
  271|       |      continue;
  272|       |    VERIFY_SOCK(ufds[i].fd);
  273|       |    if(ufds[i].events & (POLLIN | POLLOUT | POLLPRI |
  274|       |                         POLLRDNORM | POLLWRNORM | POLLRDBAND)) {
  275|       |      if(ufds[i].fd > maxfd)
  276|       |        maxfd = ufds[i].fd;
  277|       |      if(ufds[i].events & (POLLRDNORM | POLLIN))
  278|       |        FD_SET(ufds[i].fd, &fds_read);
  279|       |      if(ufds[i].events & (POLLWRNORM | POLLOUT))
  280|       |        FD_SET(ufds[i].fd, &fds_write);
  281|       |      if(ufds[i].events & (POLLRDBAND | POLLPRI))
  282|       |        FD_SET(ufds[i].fd, &fds_err);
  283|       |    }
  284|       |  }
  285|       |
  286|       |  /* Note also that Winsock ignores the first argument, so we do not worry
  287|       |     about the fact that maxfd is computed incorrectly with Winsock (since
  288|       |     curl_socket_t is unsigned in such cases and thus -1 is the largest
  289|       |     value). */
  290|       |  r = our_select(maxfd, &fds_read, &fds_write, &fds_err, timeout_ms);
  291|       |  if(r <= 0) {
  292|       |    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  293|       |      /* make EINTR from select or poll not a "lethal" error */
  294|       |      r = 0;
  295|       |    return r;
  296|       |  }
  297|       |
  298|       |  r = 0;
  299|       |  for(i = 0; i < nfds; i++) {
  300|       |    ufds[i].revents = 0;
  301|       |    if(ufds[i].fd == CURL_SOCKET_BAD)
  302|       |      continue;
  303|       |    if(FD_ISSET(ufds[i].fd, &fds_read)) {
  304|       |      if(ufds[i].events & POLLRDNORM)
  305|       |        ufds[i].revents |= POLLRDNORM;
  306|       |      if(ufds[i].events & POLLIN)
  307|       |        ufds[i].revents |= POLLIN;
  308|       |    }
  309|       |    if(FD_ISSET(ufds[i].fd, &fds_write)) {
  310|       |      if(ufds[i].events & POLLWRNORM)
  311|       |        ufds[i].revents |= POLLWRNORM;
  312|       |      if(ufds[i].events & POLLOUT)
  313|       |        ufds[i].revents |= POLLOUT;
  314|       |    }
  315|       |    if(FD_ISSET(ufds[i].fd, &fds_err)) {
  316|       |      if(ufds[i].events & POLLRDBAND)
  317|       |        ufds[i].revents |= POLLRDBAND;
  318|       |      if(ufds[i].events & POLLPRI)
  319|       |        ufds[i].revents |= POLLPRI;
  320|       |    }
  321|       |    if(ufds[i].revents)
  322|       |      r++;
  323|       |  }
  324|       |
  325|       |#endif /* HAVE_POLL */
  326|       |
  327|  4.48k|  return r;
  328|  4.48k|}
Curl_pollfds_init:
  333|  3.04k|{
  334|  3.04k|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (334:3): [True: 0, False: 3.04k]
  |  Branch (334:3): [True: 3.04k, False: 0]
  ------------------
  335|  3.04k|  memset(cpfds, 0, sizeof(*cpfds));
  336|  3.04k|  if(static_pfds && static_count) {
  ------------------
  |  Branch (336:6): [True: 3.04k, False: 0]
  |  Branch (336:21): [True: 3.04k, False: 0]
  ------------------
  337|  3.04k|    cpfds->pfds = static_pfds;
  338|  3.04k|    cpfds->count = static_count;
  339|  3.04k|  }
  340|  3.04k|}
Curl_pollfds_cleanup:
  348|  3.04k|{
  349|  3.04k|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (349:3): [True: 0, False: 3.04k]
  |  Branch (349:3): [True: 3.04k, False: 0]
  ------------------
  350|  3.04k|  if(cpfds->allocated_pfds) {
  ------------------
  |  Branch (350:6): [True: 0, False: 3.04k]
  ------------------
  351|      0|    curlx_free(cpfds->pfds);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  352|      0|  }
  353|  3.04k|  memset(cpfds, 0, sizeof(*cpfds));
  354|  3.04k|}
Curl_pollset_reset:
  478|  6.08k|{
  479|  6.08k|  unsigned int i;
  480|  6.08k|  ps->n = 0;
  481|  6.08k|#ifdef DEBUGBUILD
  482|  6.08k|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1027|  6.08k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (482:3): [True: 0, False: 6.08k]
  |  Branch (482:3): [True: 6.08k, False: 0]
  ------------------
  483|  6.08k|#endif
  484|  6.08k|  DEBUGASSERT(ps->count);
  ------------------
  |  | 1027|  6.08k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (484:3): [True: 0, False: 6.08k]
  |  Branch (484:3): [True: 6.08k, False: 0]
  ------------------
  485|  18.2k|  for(i = 0; i < ps->count; i++)
  ------------------
  |  Branch (485:14): [True: 12.1k, False: 6.08k]
  ------------------
  486|  12.1k|    ps->sockets[i] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  18.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  487|  6.08k|  memset(ps->actions, 0, ps->count * sizeof(ps->actions[0]));
  488|  6.08k|}
Curl_pollset_init:
  491|  3.04k|{
  492|  3.04k|#ifdef DEBUGBUILD
  493|  3.04k|  ps->init = CURL_EASY_POLLSET_MAGIC;
  ------------------
  |  |  129|  3.04k|#define CURL_EASY_POLLSET_MAGIC  0x7a657370
  ------------------
  494|  3.04k|#endif
  495|  3.04k|  ps->sockets = ps->def_sockets;
  496|  3.04k|  ps->actions = ps->def_actions;
  497|  3.04k|  ps->count = CURL_ARRAYSIZE(ps->def_sockets);
  ------------------
  |  | 1251|  3.04k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  498|  3.04k|  ps->n = 0;
  499|  3.04k|  Curl_pollset_reset(ps);
  500|  3.04k|}
Curl_pollset_cleanup:
  511|  3.04k|{
  512|  3.04k|#ifdef DEBUGBUILD
  513|  3.04k|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (513:3): [True: 0, False: 3.04k]
  |  Branch (513:3): [True: 3.04k, False: 0]
  ------------------
  514|  3.04k|#endif
  515|  3.04k|  if(ps->sockets != ps->def_sockets) {
  ------------------
  |  Branch (515:6): [True: 0, False: 3.04k]
  ------------------
  516|      0|    curlx_free(ps->sockets);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  517|      0|    ps->sockets = ps->def_sockets;
  518|      0|  }
  519|  3.04k|  if(ps->actions != ps->def_actions) {
  ------------------
  |  Branch (519:6): [True: 0, False: 3.04k]
  ------------------
  520|      0|    curlx_free(ps->actions);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  521|      0|    ps->actions = ps->def_actions;
  522|      0|  }
  523|  3.04k|  ps->count = CURL_ARRAYSIZE(ps->def_sockets);
  ------------------
  |  | 1251|  3.04k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  524|  3.04k|  Curl_pollset_reset(ps);
  525|  3.04k|}

Curl_client_cleanup:
   72|  7.48k|{
   73|  7.48k|  cl_reset_reader(data);
   74|  7.48k|  cl_reset_writer(data);
   75|       |
   76|  7.48k|  data->req.bytecount = 0;
   77|  7.48k|  data->req.headerline = 0;
   78|  7.48k|}
Curl_client_reset:
   81|  6.78k|{
   82|  6.78k|  if(data->req.rewind_read) {
  ------------------
  |  Branch (82:6): [True: 0, False: 6.78k]
  ------------------
   83|       |    /* already requested */
   84|      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]
  |  |  ------------------
  ------------------
   85|      0|  }
   86|  6.78k|  else {
   87|  6.78k|    CURL_TRC_READ(data, "client_reset, clear readers");
  ------------------
  |  |  163|  6.78k|  do {                                                    \
  |  |  164|  6.78k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|  6.78k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  13.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 6.78k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 6.78k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  13.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 6.78k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  6.78k|    ((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.78k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  6.78k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 6.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  6.78k|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|  6.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 6.78k]
  |  |  ------------------
  ------------------
   88|  6.78k|    cl_reset_reader(data);
   89|  6.78k|  }
   90|  6.78k|  cl_reset_writer(data);
   91|       |
   92|  6.78k|  data->req.bytecount = 0;
   93|  6.78k|  data->req.headerline = 0;
   94|  6.78k|}
Curl_client_start:
   97|  3.04k|{
   98|  3.04k|  if(data->req.rewind_read) {
  ------------------
  |  Branch (98:6): [True: 0, False: 3.04k]
  ------------------
   99|      0|    struct Curl_creader *r = data->req.reader.stack;
  100|      0|    CURLcode result = CURLE_OK;
  101|       |
  102|      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]
  |  |  ------------------
  ------------------
  103|      0|    while(r) {
  ------------------
  |  Branch (103:11): [True: 0, False: 0]
  ------------------
  104|      0|      result = r->crt->cntrl(data, r, CURL_CRCNTRL_REWIND);
  105|      0|      if(result) {
  ------------------
  |  Branch (105:10): [True: 0, False: 0]
  ------------------
  106|      0|        failf(data, "rewind of client reader '%s' failed: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  107|      0|              r->crt->name, (int)result);
  108|      0|        return result;
  109|      0|      }
  110|      0|      r = r->next;
  111|      0|    }
  112|      0|    data->req.rewind_read = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  113|      0|    cl_reset_reader(data);
  114|      0|  }
  115|  3.04k|  return CURLE_OK;
  116|  3.04k|}
Curl_cwriter_def_init:
  130|  1.12k|{
  131|  1.12k|  (void)data;
  132|  1.12k|  (void)writer;
  133|  1.12k|  return CURLE_OK;
  134|  1.12k|}
Curl_cwriter_def_flush:
  145|  1.12k|{
  146|  1.12k|  return Curl_cwriter_flush(data, writer->next);
  ------------------
  |  |  191|  1.12k|  ((w) ? (w)->cwt->do_flush((d), (w)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (191:4): [True: 1.12k, False: 0]
  |  |  ------------------
  ------------------
  147|  1.12k|}
Curl_cwriter_def_close:
  151|  1.12k|{
  152|  1.12k|  (void)data;
  153|  1.12k|  (void)writer;
  154|  1.12k|}
Curl_client_write:
  375|  14.3k|{
  376|  14.3k|  CURLcode result;
  377|       |
  378|       |  /* it is one of those, at least */
  379|  14.3k|  DEBUGASSERT(type &
  ------------------
  |  | 1027|  14.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (379:3): [True: 0, False: 14.3k]
  |  Branch (379:3): [True: 14.3k, False: 0]
  ------------------
  380|  14.3k|              (CLIENTWRITE_BODY | CLIENTWRITE_HEADER | CLIENTWRITE_INFO));
  381|       |  /* BODY is only BODY (with optional EOS) */
  382|  14.3k|  DEBUGASSERT(!(type & CLIENTWRITE_BODY) ||
  ------------------
  |  | 1027|  14.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (382:3): [True: 14.3k, False: 0]
  |  Branch (382:3): [True: 0, False: 0]
  |  Branch (382:3): [True: 0, False: 14.3k]
  |  Branch (382:3): [True: 14.3k, False: 0]
  ------------------
  383|  14.3k|              ((type & ~(CLIENTWRITE_BODY | CLIENTWRITE_EOS)) == 0));
  384|       |  /* INFO is only INFO (with optional EOS) */
  385|  14.3k|  DEBUGASSERT(!(type & CLIENTWRITE_INFO) ||
  ------------------
  |  | 1027|  14.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (385:3): [True: 14.3k, False: 0]
  |  Branch (385:3): [True: 0, False: 0]
  |  Branch (385:3): [True: 14.3k, False: 0]
  |  Branch (385:3): [True: 0, False: 0]
  ------------------
  386|  14.3k|              ((type & ~(CLIENTWRITE_INFO | CLIENTWRITE_EOS)) == 0));
  387|       |
  388|  14.3k|  if(!data->req.writer.stack) {
  ------------------
  |  Branch (388:6): [True: 561, False: 13.8k]
  ------------------
  389|    561|    result = do_init_writer_stack(data);
  390|    561|    if(result)
  ------------------
  |  Branch (390:8): [True: 0, False: 561]
  ------------------
  391|      0|      return result;
  392|    561|    DEBUGASSERT(data->req.writer.stack);
  ------------------
  |  | 1027|    561|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (392:5): [True: 0, False: 561]
  |  Branch (392:5): [True: 561, False: 0]
  ------------------
  393|    561|  }
  394|       |
  395|  14.3k|  result = Curl_cwriter_write(data, data->req.writer.stack, type, buf, len);
  ------------------
  |  |  188|  14.3k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (188:4): [True: 14.3k, False: 0]
  |  |  ------------------
  ------------------
  396|  14.3k|  CURL_TRC_WRITE(data, "client_write(type=%x, len=%zu) -> %d",
  ------------------
  |  |  158|  14.3k|  do {                                                     \
  |  |  159|  14.3k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  14.3k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  28.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 14.3k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 14.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  28.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 14.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  14.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|  14.3k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  14.3k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  14.3k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  14.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  397|  14.3k|                 (unsigned int)type, len, (int)result);
  398|  14.3k|  return result;
  399|  14.3k|}
Curl_client_flush:
  402|    561|{
  403|    561|  CURLcode result;
  404|       |
  405|    561|  if(!data->req.writer.stack) {
  ------------------
  |  Branch (405:6): [True: 0, False: 561]
  ------------------
  406|      0|    result = do_init_writer_stack(data);
  407|      0|    if(result)
  ------------------
  |  Branch (407:8): [True: 0, False: 0]
  ------------------
  408|      0|      return result;
  409|      0|    DEBUGASSERT(data->req.writer.stack);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (409:5): [True: 0, False: 0]
  |  Branch (409:5): [True: 0, False: 0]
  ------------------
  410|      0|  }
  411|       |
  412|    561|  result = Curl_cwriter_flush(data, data->req.writer.stack);
  ------------------
  |  |  191|    561|  ((w) ? (w)->cwt->do_flush((d), (w)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (191:4): [True: 561, False: 0]
  |  |  ------------------
  ------------------
  413|    561|  CURL_TRC_WRITE(data, "client_flush() -> %d", (int)result);
  ------------------
  |  |  158|    561|  do {                                                     \
  |  |  159|    561|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|    561|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.12k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 561, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 561, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.12k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 561, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    561|    ((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|    561|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    561|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 561]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    561|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|    561|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 561]
  |  |  ------------------
  ------------------
  414|    561|  return result;
  415|    561|}
Curl_cwriter_create:
  422|  1.68k|{
  423|  1.68k|  struct Curl_cwriter *writer = NULL;
  424|  1.68k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  425|  1.68k|  void *p;
  426|       |
  427|  1.68k|  DEBUGASSERT(cwt->cwriter_size >= sizeof(struct Curl_cwriter));
  ------------------
  |  | 1027|  1.68k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (427:3): [True: 0, False: 1.68k]
  |  Branch (427:3): [True: 1.68k, False: 0]
  ------------------
  428|  1.68k|  p = curlx_calloc(1, cwt->cwriter_size);
  ------------------
  |  | 1425|  1.68k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  429|  1.68k|  if(!p)
  ------------------
  |  Branch (429:6): [True: 0, False: 1.68k]
  ------------------
  430|      0|    goto out;
  431|       |
  432|  1.68k|  writer = (struct Curl_cwriter *)p;
  433|  1.68k|  writer->cwt = cwt;
  434|  1.68k|  writer->ctx = p;
  435|  1.68k|  writer->phase = phase;
  436|  1.68k|  result = cwt->do_init(data, writer);
  437|       |
  438|  1.68k|out:
  439|  1.68k|  *pwriter = result ? NULL : writer;
  ------------------
  |  Branch (439:14): [True: 0, False: 1.68k]
  ------------------
  440|  1.68k|  if(result)
  ------------------
  |  Branch (440:6): [True: 0, False: 1.68k]
  ------------------
  441|      0|    curlx_free(writer);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  442|  1.68k|  return result;
  443|  1.68k|}
Curl_cwriter_get_by_type:
  519|  3.04k|{
  520|  3.04k|  struct Curl_cwriter *writer;
  521|  4.16k|  for(writer = data->req.writer.stack; writer; writer = writer->next) {
  ------------------
  |  Branch (521:40): [True: 1.68k, False: 2.48k]
  ------------------
  522|  1.68k|    if(writer->cwt == cwt)
  ------------------
  |  Branch (522:8): [True: 561, False: 1.12k]
  ------------------
  523|    561|      return writer;
  524|  1.68k|  }
  525|  2.48k|  return NULL;
  526|  3.04k|}
sendf.c:cl_reset_reader:
   60|  14.2k|{
   61|  14.2k|  struct Curl_creader *reader = data->req.reader.stack;
   62|  14.2k|  data->req.reader_started = FALSE;
  ------------------
  |  | 1000|  14.2k|#define FALSE false
  ------------------
   63|  14.2k|  while(reader) {
  ------------------
  |  Branch (63:9): [True: 0, False: 14.2k]
  ------------------
   64|      0|    data->req.reader.stack = reader->next;
   65|      0|    reader->crt->do_close(data, reader);
   66|      0|    curlx_free(reader);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   67|      0|    reader = data->req.reader.stack;
   68|      0|  }
   69|  14.2k|}
sendf.c:cl_reset_writer:
   48|  14.2k|{
   49|  14.2k|  struct Curl_cwriter *writer = data->req.writer.stack;
   50|  15.9k|  while(writer) {
  ------------------
  |  Branch (50:9): [True: 1.68k, False: 14.2k]
  ------------------
   51|  1.68k|    data->req.writer.stack = writer->next;
   52|  1.68k|    writer->cwt->do_close(data, writer);
   53|  1.68k|    curlx_free(writer);
  ------------------
  |  | 1428|  1.68k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   54|  1.68k|    writer = data->req.writer.stack;
   55|  1.68k|  }
   56|       |  data->req.writer.paused = FALSE;
  ------------------
  |  | 1000|  14.2k|#define FALSE false
  ------------------
   57|  14.2k|}
sendf.c:do_init_writer_stack:
  345|    561|{
  346|    561|  struct Curl_cwriter *writer;
  347|    561|  CURLcode result;
  348|       |
  349|    561|  DEBUGASSERT(!data->req.writer.stack);
  ------------------
  |  | 1027|    561|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (349:3): [True: 0, False: 561]
  |  Branch (349:3): [True: 561, False: 0]
  ------------------
  350|    561|  result = Curl_cwriter_create(&data->req.writer.stack,
  351|    561|                               data, &Curl_cwt_out, CURL_CW_CLIENT);
  352|    561|  if(result)
  ------------------
  |  Branch (352:6): [True: 0, False: 561]
  ------------------
  353|      0|    return result;
  354|       |
  355|    561|  result = Curl_cwriter_create(&writer, data, &cw_download, CURL_CW_PROTOCOL);
  356|    561|  if(result)
  ------------------
  |  Branch (356:6): [True: 0, False: 561]
  ------------------
  357|      0|    return result;
  358|    561|  cwriter_add(data, writer);
  359|       |
  360|    561|  result = Curl_cwriter_create(&writer, data, &cw_raw, CURL_CW_RAW);
  361|    561|  if(result)
  ------------------
  |  Branch (361:6): [True: 0, False: 561]
  ------------------
  362|      0|    return result;
  363|    561|  cwriter_add(data, writer);
  364|       |
  365|    561|  return result;
  366|    561|}
sendf.c:cw_download_write:
  176|  14.3k|{
  177|  14.3k|  struct cw_download_ctx *ctx = writer->ctx;
  178|  14.3k|  CURLcode result;
  179|  14.3k|  size_t nwrite, excess_len = 0;
  180|  14.3k|  bool is_connect = !!(type & CLIENTWRITE_CONNECT);
  ------------------
  |  |   47|  14.3k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  181|       |
  182|  14.3k|  if(!ctx->started_response &&
  ------------------
  |  Branch (182:6): [True: 561, False: 13.8k]
  ------------------
  183|    561|     !(type & CLIENTWRITE_CONNECT) &&
  ------------------
  |  |   47|    561|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  |  Branch (183:6): [True: 561, False: 0]
  ------------------
  184|    561|     (!(type & CLIENTWRITE_INFO) || data->req.upload_done)) {
  ------------------
  |  |   44|    561|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
  |  Branch (184:7): [True: 561, False: 0]
  |  Branch (184:37): [True: 0, False: 0]
  ------------------
  185|    561|    Curl_pgrsTime(data, TIMER_STARTTRANSFER);
  186|    561|    ctx->started_response = TRUE;
  ------------------
  |  |  997|    561|#define TRUE true
  ------------------
  187|    561|  }
  188|       |
  189|  14.3k|  if(!(type & CLIENTWRITE_BODY)) {
  ------------------
  |  |   43|  14.3k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (189:6): [True: 0, False: 14.3k]
  ------------------
  190|      0|    if(is_connect && data->set.suppress_connect_headers)
  ------------------
  |  Branch (190:8): [True: 0, False: 0]
  |  Branch (190:22): [True: 0, False: 0]
  ------------------
  191|      0|      return CURLE_OK;
  192|      0|#ifdef DEBUGBUILD
  193|      0|    if(is_connect && getenv("CURL_DBG_SUPPRESS_CONNECT_HDS"))
  ------------------
  |  Branch (193:8): [True: 0, False: 0]
  |  Branch (193:22): [True: 0, False: 0]
  ------------------
  194|      0|      return CURLE_OK;
  195|      0|#endif
  196|      0|    result = Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  ------------------
  |  |  188|      0|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (188:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  197|      0|    CURL_TRC_WRITE(data, "download_write header(type=%x, blen=%zu) -> %d",
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  198|      0|                   (unsigned int)type, nbytes, (int)result);
  199|      0|    return result;
  200|      0|  }
  201|       |
  202|  14.3k|  if(!ctx->started_body &&
  ------------------
  |  Branch (202:6): [True: 561, False: 13.8k]
  ------------------
  203|    561|     !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   44|    561|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
                   !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   47|    561|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  |  Branch (203:6): [True: 561, False: 0]
  ------------------
  204|    561|    Curl_rlimit_start(&data->progress.dl.rlimit, Curl_pgrs_now(data),
  205|    561|                      data->req.size);
  206|    561|    ctx->started_body = TRUE;
  ------------------
  |  |  997|    561|#define TRUE true
  ------------------
  207|    561|  }
  208|       |
  209|       |  /* Here, we deal with REAL BODY bytes. All filtering and transfer
  210|       |   * encodings have been applied and only the true content, e.g. BODY,
  211|       |   * bytes are passed here.
  212|       |   * This allows us to check sizes, update stats, etc. independent
  213|       |   * from the protocol in play. */
  214|       |
  215|  14.3k|  if(data->req.no_body && nbytes > 0) {
  ------------------
  |  Branch (215:6): [True: 0, False: 14.3k]
  |  Branch (215:27): [True: 0, False: 0]
  ------------------
  216|       |    /* BODY arrives although we want none, bail out */
  217|      0|    streamclose(data->conn);
  ------------------
  |  |   68|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   64|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
  218|      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]
  |  |  ------------------
  ------------------
  219|      0|                   "did not want a BODY", (unsigned int)type, nbytes);
  220|      0|    data->req.download_done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  221|      0|    if(data->info.header_size)
  ------------------
  |  Branch (221:8): [True: 0, False: 0]
  ------------------
  222|       |      /* if headers have been received, this is fine */
  223|      0|      return CURLE_OK;
  224|      0|    return CURLE_WEIRD_SERVER_REPLY;
  225|      0|  }
  226|       |
  227|       |  /* Determine if we see any bytes in excess to what is allowed.
  228|       |   * We write the allowed bytes and handle excess further below.
  229|       |   * This gives deterministic BODY writes on varying buffer receive
  230|       |   * lengths. */
  231|  14.3k|  nwrite = nbytes;
  232|  14.3k|  if(data->req.maxdownload != -1) {
  ------------------
  |  Branch (232:6): [True: 0, False: 14.3k]
  ------------------
  233|      0|    size_t wmax = get_max_body_write_len(data, data->req.maxdownload);
  234|      0|    if(nwrite > wmax) {
  ------------------
  |  Branch (234:8): [True: 0, False: 0]
  ------------------
  235|      0|      excess_len = nbytes - wmax;
  236|      0|      nwrite = wmax;
  237|      0|    }
  238|       |
  239|      0|    if(nwrite == wmax) {
  ------------------
  |  Branch (239:8): [True: 0, False: 0]
  ------------------
  240|      0|      data->req.download_done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  241|      0|    }
  242|       |
  243|      0|    if((type & CLIENTWRITE_EOS) && !data->req.no_body &&
  ------------------
  |  |   50|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (243:8): [True: 0, False: 0]
  |  Branch (243:36): [True: 0, False: 0]
  ------------------
  244|      0|       (data->req.size > data->req.bytecount)) {
  ------------------
  |  Branch (244:8): [True: 0, False: 0]
  ------------------
  245|      0|      failf(data, "end of response with %" FMT_OFF_T " bytes missing",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  246|      0|            data->req.size - data->req.bytecount);
  247|      0|      return CURLE_PARTIAL_FILE;
  248|      0|    }
  249|      0|  }
  250|       |
  251|       |  /* Error on too large filesize is handled below, after writing
  252|       |   * the permitted bytes */
  253|  14.3k|  if(data->set.max_filesize && !data->req.ignorebody) {
  ------------------
  |  Branch (253:6): [True: 341, False: 14.0k]
  |  Branch (253:32): [True: 341, False: 0]
  ------------------
  254|    341|    size_t wmax = get_max_body_write_len(data, data->set.max_filesize);
  255|    341|    if(nwrite > wmax) {
  ------------------
  |  Branch (255:8): [True: 25, False: 316]
  ------------------
  256|     25|      nwrite = wmax;
  257|     25|    }
  258|    341|  }
  259|       |
  260|  14.3k|  if(!data->req.ignorebody && (nwrite || (type & CLIENTWRITE_EOS))) {
  ------------------
  |  |   50|      3|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (260:6): [True: 14.3k, False: 0]
  |  Branch (260:32): [True: 14.3k, False: 3]
  |  Branch (260:42): [True: 0, False: 3]
  ------------------
  261|  14.3k|    result = Curl_cwriter_write(data, writer->next, type, buf, nwrite);
  ------------------
  |  |  188|  14.3k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (188:4): [True: 14.3k, False: 0]
  |  |  ------------------
  ------------------
  262|  14.3k|    CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu) -> %d",
  ------------------
  |  |  158|  14.3k|  do {                                                     \
  |  |  159|  14.3k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  14.3k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  28.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 14.3k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 14.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  28.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 14.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  14.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|  14.3k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  14.3k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  14.3k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  14.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  263|  14.3k|                   (unsigned int)type, nbytes, (int)result);
  264|  14.3k|    if(result)
  ------------------
  |  Branch (264:8): [True: 0, False: 14.3k]
  ------------------
  265|      0|      return result;
  266|  14.3k|  }
  267|       |
  268|       |  /* Update stats, write and report progress */
  269|  14.3k|  if(nwrite) {
  ------------------
  |  Branch (269:6): [True: 14.3k, False: 3]
  ------------------
  270|  14.3k|    data->req.bytecount += nwrite;
  271|  14.3k|    Curl_pgrs_download_inc(data, nwrite);
  272|  14.3k|  }
  273|       |
  274|  14.3k|  if(excess_len) {
  ------------------
  |  Branch (274:6): [True: 0, False: 14.3k]
  ------------------
  275|      0|    if(!data->req.ignorebody) {
  ------------------
  |  Branch (275:8): [True: 0, False: 0]
  ------------------
  276|      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]
  |  |  ------------------
  ------------------
  277|      0|            "Excess found writing body:"
  278|      0|            " excess = %zu"
  279|      0|            ", size = %" FMT_OFF_T
  280|      0|            ", maxdownload = %" FMT_OFF_T
  281|      0|            ", bytecount = %" FMT_OFF_T,
  282|      0|            excess_len, data->req.size, data->req.maxdownload,
  283|      0|            data->req.bytecount);
  284|      0|      connclose(data->conn);
  ------------------
  |  |   69|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   63|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  285|      0|    }
  286|      0|  }
  287|  14.3k|  else if((nwrite < nbytes) && !data->req.ignorebody) {
  ------------------
  |  Branch (287:11): [True: 25, False: 14.3k]
  |  Branch (287:32): [True: 25, False: 0]
  ------------------
  288|     25|    failf(data, "Exceeded the maximum allowed file size "
  ------------------
  |  |   62|     25|#define failf Curl_failf
  ------------------
  289|     25|          "(%" FMT_OFF_T ") with %" FMT_OFF_T " bytes",
  290|     25|          data->set.max_filesize, data->req.bytecount);
  291|     25|    return CURLE_FILESIZE_EXCEEDED;
  292|     25|  }
  293|       |
  294|  14.3k|  return CURLE_OK;
  295|  14.3k|}
sendf.c:get_max_body_write_len:
  157|    341|{
  158|    341|  if(limit != -1) {
  ------------------
  |  Branch (158:6): [True: 341, False: 0]
  ------------------
  159|       |    /* How much more are we allowed to write? */
  160|    341|    return curlx_sotouz_range(limit - data->req.bytecount, 0, SIZE_MAX);
  161|    341|  }
  162|      0|  return SIZE_MAX;
  163|    341|}
sendf.c:cw_raw_write:
  313|  14.3k|{
  314|  14.3k|  if(type & CLIENTWRITE_BODY && data->set.verbose && !data->req.ignorebody) {
  ------------------
  |  |   43|  28.7k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (314:6): [True: 14.3k, False: 0]
  |  Branch (314:33): [True: 14.3k, False: 0]
  |  Branch (314:54): [True: 14.3k, False: 0]
  ------------------
  315|  14.3k|    Curl_debug(data, CURLINFO_DATA_IN, buf, nbytes);
  316|  14.3k|  }
  317|  14.3k|  return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  ------------------
  |  |  188|  14.3k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (188:4): [True: 14.3k, False: 0]
  |  |  ------------------
  ------------------
  318|  14.3k|}
sendf.c:cwriter_add:
  333|  1.12k|{
  334|  1.12k|  struct Curl_cwriter **anchor = &data->req.writer.stack;
  335|       |
  336|       |  /* Insert the writer as first in its phase.
  337|       |   * Skip existing writers of lower phases. */
  338|  1.12k|  while(*anchor && (*anchor)->phase < writer->phase)
  ------------------
  |  Branch (338:9): [True: 1.12k, False: 0]
  |  Branch (338:20): [True: 0, False: 1.12k]
  ------------------
  339|      0|    anchor = &(*anchor)->next;
  340|  1.12k|  writer->next = *anchor;
  341|  1.12k|  *anchor = writer;
  342|  1.12k|}

Curl_setstropt:
   83|  23.5k|{
   84|  23.5k|  size_t slen = s ? strlen(s) : 0;
  ------------------
  |  Branch (84:17): [True: 23.5k, False: 0]
  ------------------
   85|  23.5k|  DEBUGASSERT((unsigned)id <= UINT8_MAX);
  ------------------
  |  | 1027|  23.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 23.5k]
  |  Branch (85:3): [True: 23.5k, False: 0]
  ------------------
   86|  23.5k|  if(s && (slen > CURL_MAX_INPUT_LENGTH))
  ------------------
  |  |   45|  23.5k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (86:6): [True: 23.5k, False: 0]
  |  Branch (86:11): [True: 0, False: 23.5k]
  ------------------
   87|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   88|       |
   89|  23.5k|  return CURL_EASY_STR_SET(data, (uint8_t)id, s, slen);
  ------------------
  |  | 1236|  23.5k|  Curl_u8_strset_setx(&(d)->set.strings, (uint8_t)(id), (s), (slen))
  ------------------
   90|  23.5k|}
Curl_setopt_SSLVERSION:
  309|  14.9k|{
  310|       |  /*
  311|       |   * Set explicit SSL version to try to connect with, as some SSL
  312|       |   * implementations are lame.
  313|       |   */
  314|  14.9k|  {
  315|  14.9k|    long version, version_max;
  316|  14.9k|    struct ssl_easy_config *sslc = &data->set.ssl;
  317|  14.9k|#ifndef CURL_DISABLE_PROXY
  318|  14.9k|    if(option != CURLOPT_SSLVERSION)
  ------------------
  |  Branch (318:8): [True: 7.48k, False: 7.48k]
  ------------------
  319|  7.48k|      sslc = &data->set.proxy_ssl;
  320|       |#else
  321|       |    (void)option; /* unused */
  322|       |#endif
  323|  14.9k|    version = C_SSLVERSION_VALUE(arg);
  ------------------
  |  |  186|  14.9k|#define C_SSLVERSION_VALUE(x)     ((x) & 0xffff)
  ------------------
  324|  14.9k|    version_max = (long)C_SSLVERSION_MAX_VALUE(arg);
  ------------------
  |  |  187|  14.9k|#define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)(x) & 0xffff0000)
  ------------------
  325|       |
  326|  14.9k|    if(version < CURL_SSLVERSION_DEFAULT ||
  ------------------
  |  | 2394|  29.9k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (326:8): [True: 0, False: 14.9k]
  ------------------
  327|  14.9k|       version == CURL_SSLVERSION_SSLv2 ||
  ------------------
  |  | 2396|  29.9k|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (327:8): [True: 0, False: 14.9k]
  ------------------
  328|  14.9k|       version == CURL_SSLVERSION_SSLv3 ||
  ------------------
  |  | 2397|  29.9k|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (328:8): [True: 0, False: 14.9k]
  ------------------
  329|  14.9k|       version >= CURL_SSLVERSION_LAST ||
  ------------------
  |  | 2403|  29.9k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  ------------------
  |  Branch (329:8): [True: 0, False: 14.9k]
  ------------------
  330|  14.9k|       version_max < CURL_SSLVERSION_MAX_NONE ||
  ------------------
  |  | 2405|  29.9k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (330:8): [True: 0, False: 14.9k]
  ------------------
  331|  14.9k|       version_max >= CURL_SSLVERSION_MAX_LAST)
  ------------------
  |  | 2413|  14.9k|#define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
  |  |  ------------------
  |  |  |  | 2403|  14.9k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  |  |  ------------------
  ------------------
  |  Branch (331:8): [True: 0, False: 14.9k]
  ------------------
  332|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  333|  14.9k|    if(version == CURL_SSLVERSION_DEFAULT)
  ------------------
  |  | 2394|  14.9k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (333:8): [True: 14.9k, False: 0]
  ------------------
  334|  14.9k|      version = CURL_SSLVERSION_TLSv1_2;
  ------------------
  |  | 2400|  14.9k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  335|       |
  336|  14.9k|    sslc->version = (unsigned char)version;
  337|  14.9k|    sslc->version_max = (unsigned int)version_max;
  338|  14.9k|  }
  339|      0|  return CURLE_OK;
  340|  14.9k|}
Curl_vsetopt:
 2888|   114k|{
 2889|   114k|  if(option < CURLOPTTYPE_OBJECTPOINT)
  ------------------
  |  | 1124|   114k|#define CURLOPTTYPE_OBJECTPOINT   10000
  ------------------
  |  Branch (2889:6): [True: 16.5k, False: 98.3k]
  ------------------
 2890|  16.5k|    return setopt_long(data, option, va_arg(param, long));
 2891|  98.3k|  else if(option < CURLOPTTYPE_FUNCTIONPOINT) {
  ------------------
  |  | 1125|  98.3k|#define CURLOPTTYPE_FUNCTIONPOINT 20000
  ------------------
  |  Branch (2891:11): [True: 63.9k, False: 34.3k]
  ------------------
 2892|       |    /* unfortunately, different pointer types cannot be identified any other
 2893|       |       way than being listed explicitly */
 2894|  63.9k|    switch(option) {
 2895|      0|    case CURLOPT_HTTPHEADER:
  ------------------
  |  Branch (2895:5): [True: 0, False: 63.9k]
  ------------------
 2896|      0|    case CURLOPT_QUOTE:
  ------------------
  |  Branch (2896:5): [True: 0, False: 63.9k]
  ------------------
 2897|      0|    case CURLOPT_POSTQUOTE:
  ------------------
  |  Branch (2897:5): [True: 0, False: 63.9k]
  ------------------
 2898|    676|    case CURLOPT_TELNETOPTIONS:
  ------------------
  |  Branch (2898:5): [True: 676, False: 63.3k]
  ------------------
 2899|    676|    case CURLOPT_PREQUOTE:
  ------------------
  |  Branch (2899:5): [True: 0, False: 63.9k]
  ------------------
 2900|    676|    case CURLOPT_HTTP200ALIASES:
  ------------------
  |  Branch (2900:5): [True: 0, False: 63.9k]
  ------------------
 2901|    676|    case CURLOPT_MAIL_RCPT:
  ------------------
  |  Branch (2901:5): [True: 0, False: 63.9k]
  ------------------
 2902|    676|    case CURLOPT_RESOLVE:
  ------------------
  |  Branch (2902:5): [True: 0, False: 63.9k]
  ------------------
 2903|    676|    case CURLOPT_PROXYHEADER:
  ------------------
  |  Branch (2903:5): [True: 0, False: 63.9k]
  ------------------
 2904|  4.41k|    case CURLOPT_CONNECT_TO:
  ------------------
  |  Branch (2904:5): [True: 3.74k, False: 60.2k]
  ------------------
 2905|  4.41k|      return setopt_slist(data, option, va_arg(param, struct curl_slist *));
 2906|      0|    case CURLOPT_HTTPPOST:         /* curl_httppost * */
  ------------------
  |  Branch (2906:5): [True: 0, False: 63.9k]
  ------------------
 2907|      0|    case CURLOPT_MIMEPOST:         /* curl_mime * */
  ------------------
  |  Branch (2907:5): [True: 0, False: 63.9k]
  ------------------
 2908|      0|    case CURLOPT_STDERR:           /* FILE * */
  ------------------
  |  Branch (2908:5): [True: 0, False: 63.9k]
  ------------------
 2909|      0|    case CURLOPT_SHARE:            /* CURLSH * */
  ------------------
  |  Branch (2909:5): [True: 0, False: 63.9k]
  ------------------
 2910|      0|    case CURLOPT_CURLU:            /* CURLU * */
  ------------------
  |  Branch (2910:5): [True: 0, False: 63.9k]
  ------------------
 2911|      0|      return setopt_pointers(data, option, param);
 2912|      0|    case CURLOPT_STREAM_DEPENDS:   /* CURL * */
  ------------------
  |  Branch (2912:5): [True: 0, False: 63.9k]
  ------------------
 2913|      0|    case CURLOPT_STREAM_DEPENDS_E: /* CURL * */
  ------------------
  |  Branch (2913:5): [True: 0, False: 63.9k]
  ------------------
 2914|      0|      return CURLE_OK;
 2915|  59.5k|    default:
  ------------------
  |  Branch (2915:5): [True: 59.5k, False: 4.41k]
  ------------------
 2916|  59.5k|      break;
 2917|  63.9k|    }
 2918|       |    /* the char pointer options */
 2919|  59.5k|    return setopt_cptr(data, option, va_arg(param, char *));
 2920|  63.9k|  }
 2921|  34.3k|  else if(option < CURLOPTTYPE_OFF_T)
  ------------------
  |  | 1126|  34.3k|#define CURLOPTTYPE_OFF_T         30000
  ------------------
  |  Branch (2921:11): [True: 33.6k, False: 663]
  ------------------
 2922|  33.6k|    return setopt_func(data, option, param);
 2923|    663|  else if(option < CURLOPTTYPE_BLOB)
  ------------------
  |  | 1127|    663|#define CURLOPTTYPE_BLOB          40000
  ------------------
  |  Branch (2923:11): [True: 663, False: 0]
  ------------------
 2924|    663|    return setopt_offt(data, option, va_arg(param, curl_off_t));
 2925|      0|  return setopt_blob(data, option, va_arg(param, struct curl_blob *));
 2926|   114k|}
curl_easy_setopt:
 2937|   114k|{
 2938|   114k|  struct Curl_eapi_guard guard;
 2939|   114k|  CURLcode result;
 2940|       |
 2941|   114k|  if(CURL_EAPI_ENTER(&guard, curl, easy_setopt, &result)) {
  ------------------
  |  |  163|   114k|  Curl_eapi_enter((g), (curl), CURL_EAPI_FN_##fn, (r)) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 114k, False: 0]
  |  |  |  Branch (163:59): [True: 114k, False: 0]
  |  |  ------------------
  ------------------
 2942|   114k|    struct Curl_easy *data = curl;
 2943|   114k|    va_list arg;
 2944|       |
 2945|   114k|    va_start(arg, option);
 2946|       |
 2947|   114k|    result = Curl_vsetopt(data, option, arg);
 2948|       |
 2949|   114k|    va_end(arg);
 2950|   114k|    if(result == CURLE_BAD_FUNCTION_ARGUMENT)
  ------------------
  |  Branch (2950:8): [True: 180, False: 114k]
  ------------------
 2951|    180|      failf(data, "setopt 0x%x got bad argument", (unsigned int)option);
  ------------------
  |  |   62|    180|#define failf Curl_failf
  ------------------
 2952|   114k|  }
 2953|   114k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|   114k|  Curl_eapi_leave(g)
  ------------------
 2954|   114k|  return result;
 2955|   114k|}
setopt.c:setopt_long:
 1269|  16.5k|{
 1270|  16.5k|  typedef CURLcode (*setoptfunc)(struct Curl_easy *data,
 1271|  16.5k|                                 CURLoption option, long arg);
 1272|  16.5k|  static const setoptfunc setopt_call[] = {
 1273|  16.5k|    setopt_long_bool,
 1274|  16.5k|    setopt_long_net,
 1275|  16.5k|    setopt_long_http,
 1276|  16.5k|    setopt_long_proxy,
 1277|  16.5k|    setopt_long_ssl,
 1278|  16.5k|    setopt_long_proto,
 1279|  16.5k|    setopt_long_misc
 1280|  16.5k|  };
 1281|  16.5k|  size_t i;
 1282|       |
 1283|  24.0k|  for(i = 0; i < CURL_ARRAYSIZE(setopt_call); i++) {
  ------------------
  |  | 1251|  24.0k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (1283:14): [True: 24.0k, False: 0]
  ------------------
 1284|  24.0k|    CURLcode result = setopt_call[i](data, option, arg);
 1285|  24.0k|    if(result != CURLE_UNKNOWN_OPTION)
  ------------------
  |  Branch (1285:8): [True: 16.5k, False: 7.48k]
  ------------------
 1286|  16.5k|      return result;
 1287|  24.0k|  }
 1288|      0|  return CURLE_UNKNOWN_OPTION;
 1289|  16.5k|}
setopt.c:setopt_long_bool:
  360|  16.5k|{
  361|  16.5k|  bool enabled = !!arg;
  362|  16.5k|  int ok = 1;
  363|  16.5k|  struct UserDefined *s = &data->set;
  364|  16.5k|  switch(option) {
  365|      0|  case CURLOPT_FORBID_REUSE:
  ------------------
  |  Branch (365:3): [True: 0, False: 16.5k]
  ------------------
  366|       |    /*
  367|       |     * When this transfer is done, it must not be left to be reused by a
  368|       |     * subsequent transfer but shall be closed immediately.
  369|       |     */
  370|      0|    s->reuse_forbid = enabled;
  371|      0|    break;
  372|      0|  case CURLOPT_FRESH_CONNECT:
  ------------------
  |  Branch (372:3): [True: 0, False: 16.5k]
  ------------------
  373|       |    /*
  374|       |     * This transfer shall not use a previously cached connection but
  375|       |     * should be made with a fresh new connect!
  376|       |     */
  377|      0|    s->reuse_fresh = enabled;
  378|      0|    break;
  379|  3.74k|  case CURLOPT_VERBOSE:
  ------------------
  |  Branch (379:3): [True: 3.74k, False: 12.8k]
  ------------------
  380|       |    /*
  381|       |     * Verbose means infof() calls that give a lot of information about
  382|       |     * the connection and transfer procedures as well as internal choices.
  383|       |     */
  384|  3.74k|    s->verbose = enabled;
  385|  3.74k|    break;
  386|      0|  case CURLOPT_HEADER:
  ------------------
  |  Branch (386:3): [True: 0, False: 16.5k]
  ------------------
  387|       |    /*
  388|       |     * Set to include the header in the general data output stream.
  389|       |     */
  390|      0|    s->include_header = enabled;
  391|      0|    break;
  392|      0|  case CURLOPT_NOPROGRESS:
  ------------------
  |  Branch (392:3): [True: 0, False: 16.5k]
  ------------------
  393|       |    /*
  394|       |     * Shut off the internal supported progress meter
  395|       |     */
  396|      0|    data->progress.hide = enabled;
  397|      0|    break;
  398|      0|  case CURLOPT_NOBODY:
  ------------------
  |  Branch (398:3): [True: 0, False: 16.5k]
  ------------------
  399|       |    /*
  400|       |     * Do not include the body part in the output data stream.
  401|       |     */
  402|      0|    s->opt_no_body = enabled;
  403|      0|#ifndef CURL_DISABLE_HTTP
  404|      0|    if(s->opt_no_body)
  ------------------
  |  Branch (404:8): [True: 0, False: 0]
  ------------------
  405|       |      /* in HTTP lingo, no body means using the HEAD request... */
  406|      0|      s->method = HTTPREQ_HEAD;
  407|      0|    else if(s->method == HTTPREQ_HEAD)
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|      0|      s->method = HTTPREQ_GET;
  409|      0|#endif
  410|      0|    break;
  411|      0|  case CURLOPT_FAILONERROR:
  ------------------
  |  Branch (411:3): [True: 0, False: 16.5k]
  ------------------
  412|       |    /*
  413|       |     * Do not output the >=400 error code HTML-page, but instead only
  414|       |     * return error.
  415|       |     */
  416|      0|    s->http_fail_on_error = enabled;
  417|      0|    break;
  418|      0|  case CURLOPT_KEEP_SENDING_ON_ERROR:
  ------------------
  |  Branch (418:3): [True: 0, False: 16.5k]
  ------------------
  419|      0|    s->http_keep_sending_on_error = enabled;
  420|      0|    break;
  421|      0|  case CURLOPT_UPLOAD:
  ------------------
  |  Branch (421:3): [True: 0, False: 16.5k]
  ------------------
  422|      0|  case CURLOPT_PUT:
  ------------------
  |  Branch (422:3): [True: 0, False: 16.5k]
  ------------------
  423|       |    /*
  424|       |     * We want to send data to the remote host. If this is HTTP, that equals
  425|       |     * using the PUT request.
  426|       |     */
  427|      0|    if(enabled) {
  ------------------
  |  Branch (427:8): [True: 0, False: 0]
  ------------------
  428|       |      /* If this is HTTP, PUT is what's needed to "upload" */
  429|      0|      s->method = HTTPREQ_PUT;
  430|      0|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  431|      0|    }
  432|      0|    else
  433|       |      /* In HTTP, the opposite of upload is GET (unless NOBODY is true as
  434|       |         then this can be changed to HEAD later on) */
  435|      0|      s->method = HTTPREQ_GET;
  436|      0|    break;
  437|      0|  case CURLOPT_FILETIME:
  ------------------
  |  Branch (437:3): [True: 0, False: 16.5k]
  ------------------
  438|       |    /*
  439|       |     * Try to get the file time of the remote document. The time will
  440|       |     * later (possibly) become available using curl_easy_getinfo().
  441|       |     */
  442|      0|    s->get_filetime = enabled;
  443|      0|    break;
  444|      0|#ifndef CURL_DISABLE_HTTP
  445|      0|  case CURLOPT_HTTP09_ALLOWED:
  ------------------
  |  Branch (445:3): [True: 0, False: 16.5k]
  ------------------
  446|      0|    s->http09_allowed = enabled;
  447|      0|    break;
  448|      0|#ifndef CURL_DISABLE_COOKIES
  449|      0|  case CURLOPT_COOKIESESSION:
  ------------------
  |  Branch (449:3): [True: 0, False: 16.5k]
  ------------------
  450|       |    /*
  451|       |     * Set this option to TRUE to start a new "cookie session". It will
  452|       |     * prevent the forthcoming read-cookies-from-file actions to accept
  453|       |     * cookies that are marked as being session cookies, as they belong to a
  454|       |     * previous session.
  455|       |     */
  456|      0|    s->cookiesession = enabled;
  457|      0|    break;
  458|      0|#endif
  459|      0|  case CURLOPT_AUTOREFERER:
  ------------------
  |  Branch (459:3): [True: 0, False: 16.5k]
  ------------------
  460|       |    /*
  461|       |     * Switch on automatic referer that gets set if curl follows locations.
  462|       |     */
  463|      0|    s->http_auto_referer = enabled;
  464|      0|    break;
  465|      0|  case CURLOPT_TRANSFER_ENCODING:
  ------------------
  |  Branch (465:3): [True: 0, False: 16.5k]
  ------------------
  466|      0|    s->http_transfer_encoding = enabled;
  467|      0|    break;
  468|      0|  case CURLOPT_UNRESTRICTED_AUTH:
  ------------------
  |  Branch (468:3): [True: 0, False: 16.5k]
  ------------------
  469|       |    /*
  470|       |     * Send authentication (user+password) when following locations, even when
  471|       |     * hostname changed.
  472|       |     */
  473|      0|    s->allow_auth_to_other_hosts = enabled;
  474|      0|    break;
  475|      0|  case CURLOPT_HTTP_TRANSFER_DECODING:
  ------------------
  |  Branch (475:3): [True: 0, False: 16.5k]
  ------------------
  476|       |    /*
  477|       |     * disable libcurl transfer encoding is used
  478|       |     */
  479|      0|    s->http_te_skip = !enabled; /* reversed */
  480|      0|    break;
  481|      0|  case CURLOPT_HTTP_CONTENT_DECODING:
  ------------------
  |  Branch (481:3): [True: 0, False: 16.5k]
  ------------------
  482|       |    /*
  483|       |     * raw data passed to the application when content encoding is used
  484|       |     */
  485|      0|    s->http_ce_skip = !enabled; /* reversed */
  486|      0|    break;
  487|      0|  case CURLOPT_HTTPGET:
  ------------------
  |  Branch (487:3): [True: 0, False: 16.5k]
  ------------------
  488|       |    /*
  489|       |     * Set to force us do HTTP GET
  490|       |     */
  491|      0|    if(enabled) {
  ------------------
  |  Branch (491:8): [True: 0, False: 0]
  ------------------
  492|      0|      s->method = HTTPREQ_GET;
  493|      0|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  494|      0|    }
  495|      0|    break;
  496|      0|  case CURLOPT_POST:
  ------------------
  |  Branch (496:3): [True: 0, False: 16.5k]
  ------------------
  497|       |    /* Does this option serve a purpose anymore? Yes it does, when
  498|       |       CURLOPT_POSTFIELDS is not used and the POST data is read off the
  499|       |       callback! */
  500|      0|    if(enabled) {
  ------------------
  |  Branch (500:8): [True: 0, False: 0]
  ------------------
  501|      0|      s->method = HTTPREQ_POST;
  502|      0|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  503|      0|    }
  504|      0|    else
  505|      0|      s->method = HTTPREQ_GET;
  506|      0|    break;
  507|      0|#endif /* !CURL_DISABLE_HTTP */
  508|      0|#ifndef CURL_DISABLE_PROXY
  509|      0|  case CURLOPT_HTTPPROXYTUNNEL:
  ------------------
  |  Branch (509:3): [True: 0, False: 16.5k]
  ------------------
  510|       |    /*
  511|       |     * Tunnel operations through the proxy instead of normal proxy use
  512|       |     */
  513|      0|    s->tunnel_thru_httpproxy = enabled;
  514|      0|    break;
  515|      0|  case CURLOPT_HAPROXYPROTOCOL:
  ------------------
  |  Branch (515:3): [True: 0, False: 16.5k]
  ------------------
  516|       |    /*
  517|       |     * Set to send the HAProxy Proxy Protocol header
  518|       |     */
  519|      0|    s->haproxyprotocol = enabled;
  520|      0|    break;
  521|      0|  case CURLOPT_PROXY_SSL_VERIFYPEER:
  ------------------
  |  Branch (521:3): [True: 0, False: 16.5k]
  ------------------
  522|       |    /*
  523|       |     * Enable peer SSL verifying for proxy.
  524|       |     */
  525|      0|    s->proxy_ssl.verifypeer = enabled;
  526|       |
  527|       |    /* Update the current connection proxy_ssl_config. */
  528|      0|    Curl_ssl_conn_config_update(data, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  529|      0|    break;
  530|      0|  case CURLOPT_PROXY_SSL_VERIFYHOST:
  ------------------
  |  Branch (530:3): [True: 0, False: 16.5k]
  ------------------
  531|       |    /*
  532|       |     * Enable verification of the hostname in the peer certificate for proxy
  533|       |     */
  534|      0|    s->proxy_ssl.verifyhost = enabled;
  535|      0|    ok = 2;
  536|       |    /* Update the current connection proxy_ssl_config. */
  537|      0|    Curl_ssl_conn_config_update(data, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  538|      0|    break;
  539|      0|  case CURLOPT_PROXY_TRANSFER_MODE:
  ------------------
  |  Branch (539:3): [True: 0, False: 16.5k]
  ------------------
  540|       |    /*
  541|       |     * set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy
  542|       |     */
  543|      0|    s->proxy_transfer_mode = enabled;
  544|      0|    break;
  545|      0|#endif /* !CURL_DISABLE_PROXY */
  546|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  547|       |  case CURLOPT_SOCKS5_GSSAPI_NEC:
  548|       |    /*
  549|       |     * Set flag for NEC SOCKS5 support
  550|       |     */
  551|       |    s->socks5_gssapi_nec = enabled;
  552|       |    break;
  553|       |#endif
  554|      0|#ifdef CURL_LIST_ONLY_PROTOCOL
  555|      0|  case CURLOPT_DIRLISTONLY:
  ------------------
  |  Branch (555:3): [True: 0, False: 16.5k]
  ------------------
  556|       |    /*
  557|       |     * An option that changes the command to one that asks for a list only, no
  558|       |     * file info details. Used for FTP, POP3 and SFTP.
  559|       |     */
  560|      0|    s->list_only = enabled;
  561|      0|    break;
  562|      0|#endif
  563|      0|  case CURLOPT_APPEND:
  ------------------
  |  Branch (563:3): [True: 0, False: 16.5k]
  ------------------
  564|       |    /*
  565|       |     * We want to upload and append to an existing file. Used for FTP and
  566|       |     * SFTP.
  567|       |     */
  568|      0|    s->remote_append = enabled;
  569|      0|    break;
  570|      0|#ifndef CURL_DISABLE_FTP
  571|      0|  case CURLOPT_FTP_USE_EPRT:
  ------------------
  |  Branch (571:3): [True: 0, False: 16.5k]
  ------------------
  572|      0|    s->ftp_use_eprt = enabled;
  573|      0|    break;
  574|      0|  case CURLOPT_FTP_USE_EPSV:
  ------------------
  |  Branch (574:3): [True: 0, False: 16.5k]
  ------------------
  575|      0|    s->ftp_use_epsv = enabled;
  576|      0|    break;
  577|      0|  case CURLOPT_FTP_USE_PRET:
  ------------------
  |  Branch (577:3): [True: 0, False: 16.5k]
  ------------------
  578|      0|    s->ftp_use_pret = enabled;
  579|      0|    break;
  580|      0|  case CURLOPT_FTP_SKIP_PASV_IP:
  ------------------
  |  Branch (580:3): [True: 0, False: 16.5k]
  ------------------
  581|       |    /*
  582|       |     * Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the
  583|       |     * bypass of the IP address in PASV responses.
  584|       |     */
  585|      0|    s->ftp_skip_ip = enabled;
  586|      0|    break;
  587|      0|  case CURLOPT_WILDCARDMATCH:
  ------------------
  |  Branch (587:3): [True: 0, False: 16.5k]
  ------------------
  588|      0|    s->wildcard_enabled = enabled;
  589|      0|    break;
  590|      0|#endif
  591|  1.60k|  case CURLOPT_CRLF:
  ------------------
  |  Branch (591:3): [True: 1.60k, False: 14.9k]
  ------------------
  592|       |    /*
  593|       |     * Kludgy option to enable CRLF conversions. Subject for removal.
  594|       |     */
  595|  1.60k|    s->crlf = enabled;
  596|  1.60k|    break;
  597|      0|#ifndef CURL_DISABLE_TFTP
  598|      0|  case CURLOPT_TFTP_NO_OPTIONS:
  ------------------
  |  Branch (598:3): [True: 0, False: 16.5k]
  ------------------
  599|       |    /*
  600|       |     * Option that prevents libcurl from sending TFTP option requests to the
  601|       |     * server.
  602|       |     */
  603|      0|    s->tftp_no_options = enabled;
  604|      0|    break;
  605|      0|#endif /* !CURL_DISABLE_TFTP */
  606|      0|  case CURLOPT_TRANSFERTEXT:
  ------------------
  |  Branch (606:3): [True: 0, False: 16.5k]
  ------------------
  607|       |    /*
  608|       |     * This option was previously named 'FTPASCII'. Renamed to work with
  609|       |     * more protocols than merely FTP.
  610|       |     *
  611|       |     * Transfer using ASCII (instead of BINARY).
  612|       |     */
  613|      0|    s->prefer_ascii = enabled;
  614|      0|    break;
  615|  3.74k|  case CURLOPT_SSL_VERIFYPEER:
  ------------------
  |  Branch (615:3): [True: 3.74k, False: 12.8k]
  ------------------
  616|       |    /*
  617|       |     * Enable peer SSL verifying.
  618|       |     */
  619|  3.74k|    s->ssl.verifypeer = enabled;
  620|       |
  621|       |    /* Update the current connection ssl_config. */
  622|  3.74k|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  623|  3.74k|    break;
  624|      0|#ifndef CURL_DISABLE_DOH
  625|      0|  case CURLOPT_DOH_SSL_VERIFYPEER:
  ------------------
  |  Branch (625:3): [True: 0, False: 16.5k]
  ------------------
  626|       |    /*
  627|       |     * Enable peer SSL verifying for DoH.
  628|       |     */
  629|      0|    s->doh_verifypeer = enabled;
  630|      0|    break;
  631|      0|  case CURLOPT_DOH_SSL_VERIFYHOST:
  ------------------
  |  Branch (631:3): [True: 0, False: 16.5k]
  ------------------
  632|       |    /*
  633|       |     * Enable verification of the hostname in the peer certificate for DoH
  634|       |     */
  635|      0|    s->doh_verifyhost = enabled;
  636|      0|    ok = 2;
  637|      0|    break;
  638|      0|  case CURLOPT_DOH_SSL_VERIFYSTATUS:
  ------------------
  |  Branch (638:3): [True: 0, False: 16.5k]
  ------------------
  639|       |    /*
  640|       |     * Enable certificate status verifying for DoH.
  641|       |     */
  642|      0|    if(!Curl_ssl_cert_status_request())
  ------------------
  |  Branch (642:8): [True: 0, False: 0]
  ------------------
  643|      0|      return CURLE_NOT_BUILT_IN;
  644|       |
  645|      0|    s->doh_verifystatus = enabled;
  646|      0|    ok = 2;
  647|      0|    break;
  648|      0|#endif /* !CURL_DISABLE_DOH */
  649|      0|  case CURLOPT_SSL_VERIFYHOST:
  ------------------
  |  Branch (649:3): [True: 0, False: 16.5k]
  ------------------
  650|       |    /*
  651|       |     * Enable verification of the hostname in the peer certificate
  652|       |     */
  653|       |
  654|       |    /* Obviously people are not reading documentation and too many thought
  655|       |       this argument took a boolean when it was not and misused it.
  656|       |       Treat 1 and 2 the same */
  657|      0|    s->ssl.verifyhost = enabled;
  658|      0|    ok = 2;
  659|       |
  660|       |    /* Update the current connection ssl_config. */
  661|      0|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  662|      0|    break;
  663|      0|  case CURLOPT_SSL_VERIFYSTATUS:
  ------------------
  |  Branch (663:3): [True: 0, False: 16.5k]
  ------------------
  664|       |    /*
  665|       |     * Enable certificate status verifying.
  666|       |     */
  667|      0|    if(!Curl_ssl_cert_status_request())
  ------------------
  |  Branch (667:8): [True: 0, False: 0]
  ------------------
  668|      0|      return CURLE_NOT_BUILT_IN;
  669|       |
  670|      0|    s->ssl.verifystatus = enabled;
  671|       |
  672|       |    /* Update the current connection ssl_config. */
  673|      0|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  674|      0|    break;
  675|      0|  case CURLOPT_CERTINFO:
  ------------------
  |  Branch (675:3): [True: 0, False: 16.5k]
  ------------------
  676|      0|#ifdef USE_SSL
  677|      0|    if(Curl_ssl_supports(data, SSLSUPP_CERTINFO))
  ------------------
  |  |   36|      0|#define SSLSUPP_CERTINFO     (1 << 1) /* supports CURLOPT_CERTINFO */
  ------------------
  |  Branch (677:8): [True: 0, False: 0]
  ------------------
  678|      0|      s->ssl.certinfo = enabled;
  679|      0|    else
  680|      0|#endif
  681|      0|      return CURLE_NOT_BUILT_IN;
  682|      0|    break;
  683|      0|  case CURLOPT_NOSIGNAL:
  ------------------
  |  Branch (683:3): [True: 0, False: 16.5k]
  ------------------
  684|       |    /*
  685|       |     * The application asks not to set any signal() or alarm() handlers,
  686|       |     * even when using a timeout.
  687|       |     */
  688|      0|    s->no_signal = enabled;
  689|      0|    break;
  690|      0|  case CURLOPT_TCP_NODELAY:
  ------------------
  |  Branch (690:3): [True: 0, False: 16.5k]
  ------------------
  691|       |    /*
  692|       |     * Enable or disable TCP_NODELAY, which will disable/enable the Nagle
  693|       |     * algorithm
  694|       |     */
  695|      0|    s->tcp_nodelay = enabled;
  696|      0|    break;
  697|      0|  case CURLOPT_IGNORE_CONTENT_LENGTH:
  ------------------
  |  Branch (697:3): [True: 0, False: 16.5k]
  ------------------
  698|      0|    s->ignorecl = enabled;
  699|      0|    break;
  700|      0|  case CURLOPT_SSL_SESSIONID_CACHE:
  ------------------
  |  Branch (700:3): [True: 0, False: 16.5k]
  ------------------
  701|      0|    s->ssl.cache_session = enabled;
  702|      0|#ifndef CURL_DISABLE_PROXY
  703|      0|    s->proxy_ssl.cache_session = s->ssl.cache_session;
  704|      0|#endif
  705|      0|    break;
  706|       |#ifdef USE_SSH
  707|       |  case CURLOPT_SSH_COMPRESSION:
  708|       |    s->ssh_compression = enabled;
  709|       |    break;
  710|       |#endif /* !USE_SSH */
  711|      0|#ifndef CURL_DISABLE_SMTP
  712|      0|  case CURLOPT_MAIL_RCPT_ALLOWFAILS:
  ------------------
  |  Branch (712:3): [True: 0, False: 16.5k]
  ------------------
  713|       |    /* allow RCPT TO command to fail for some recipients */
  714|      0|    s->mail_rcpt_allowfails = enabled;
  715|      0|    break;
  716|      0|#endif /* !CURL_DISABLE_SMTP */
  717|      0|  case CURLOPT_SASL_IR:
  ------------------
  |  Branch (717:3): [True: 0, False: 16.5k]
  ------------------
  718|       |    /* Enable/disable SASL initial response */
  719|      0|    s->sasl_ir = enabled;
  720|      0|    break;
  721|      0|  case CURLOPT_TCP_KEEPALIVE:
  ------------------
  |  Branch (721:3): [True: 0, False: 16.5k]
  ------------------
  722|      0|    s->tcp_keepalive = enabled;
  723|      0|    break;
  724|      0|  case CURLOPT_TCP_FASTOPEN:
  ------------------
  |  Branch (724:3): [True: 0, False: 16.5k]
  ------------------
  725|      0|#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \
  726|      0|  defined(TCP_FASTOPEN_CONNECT)
  727|      0|    s->tcp_fastopen = enabled;
  728|      0|    break;
  729|       |#else
  730|       |    return CURLE_NOT_BUILT_IN;
  731|       |#endif
  732|      0|  case CURLOPT_SSL_ENABLE_ALPN:
  ------------------
  |  Branch (732:3): [True: 0, False: 16.5k]
  ------------------
  733|      0|    s->ssl_enable_alpn = enabled;
  734|      0|    break;
  735|      0|  case CURLOPT_PATH_AS_IS:
  ------------------
  |  Branch (735:3): [True: 0, False: 16.5k]
  ------------------
  736|      0|    s->path_as_is = enabled;
  737|      0|    break;
  738|      0|  case CURLOPT_PIPEWAIT:
  ------------------
  |  Branch (738:3): [True: 0, False: 16.5k]
  ------------------
  739|      0|    s->pipewait = enabled;
  740|      0|    break;
  741|      0|  case CURLOPT_SUPPRESS_CONNECT_HEADERS:
  ------------------
  |  Branch (741:3): [True: 0, False: 16.5k]
  ------------------
  742|      0|    s->suppress_connect_headers = enabled;
  743|      0|    break;
  744|      0|#ifndef CURL_DISABLE_SHUFFLE_DNS
  745|      0|  case CURLOPT_DNS_SHUFFLE_ADDRESSES:
  ------------------
  |  Branch (745:3): [True: 0, False: 16.5k]
  ------------------
  746|      0|    s->dns_shuffle_addresses = enabled;
  747|      0|    break;
  748|      0|#endif
  749|      0|  case CURLOPT_DISALLOW_USERNAME_IN_URL:
  ------------------
  |  Branch (749:3): [True: 0, False: 16.5k]
  ------------------
  750|      0|    s->disallow_username_in_url = enabled;
  751|      0|    break;
  752|      0|  case CURLOPT_QUICK_EXIT:
  ------------------
  |  Branch (752:3): [True: 0, False: 16.5k]
  ------------------
  753|      0|    s->quick_exit = enabled;
  754|      0|    break;
  755|  7.48k|  default:
  ------------------
  |  Branch (755:3): [True: 7.48k, False: 9.09k]
  ------------------
  756|  7.48k|    return CURLE_UNKNOWN_OPTION;
  757|  16.5k|  }
  758|  9.09k|  if((arg > ok) || (arg < 0))
  ------------------
  |  Branch (758:6): [True: 0, False: 9.09k]
  |  Branch (758:20): [True: 0, False: 9.09k]
  ------------------
  759|       |    /* reserve other values for future use */
  760|      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]
  |  |  ------------------
  ------------------
  761|  9.09k|          " treated as %d", (int)option, arg, enabled);
  762|       |
  763|  9.09k|  return CURLE_OK;
  764|  16.5k|}
setopt.c:setopt_long_net:
  779|  7.48k|{
  780|  7.48k|  CURLcode result = CURLE_OK;
  781|  7.48k|  struct UserDefined *s = &data->set;
  782|       |
  783|  7.48k|  switch(option) {
  784|      0|  case CURLOPT_DNS_CACHE_TIMEOUT:
  ------------------
  |  Branch (784:3): [True: 0, False: 7.48k]
  ------------------
  785|      0|    if(arg != -1)
  ------------------
  |  Branch (785:8): [True: 0, False: 0]
  ------------------
  786|      0|      return setopt_set_timeout_sec(&s->dns_cache_timeout_ms, arg);
  787|      0|    s->dns_cache_timeout_ms = -1;
  788|      0|    break;
  789|      0|  case CURLOPT_MAXCONNECTS:
  ------------------
  |  Branch (789:3): [True: 0, False: 7.48k]
  ------------------
  790|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  791|      0|    if(!result)
  ------------------
  |  Branch (791:8): [True: 0, False: 0]
  ------------------
  792|      0|      s->maxconnects = arg ? (uint32_t)arg : DEFAULT_CONNCACHE_SIZE;
  ------------------
  |  |   38|      0|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  |  Branch (792:24): [True: 0, False: 0]
  ------------------
  793|      0|    break;
  794|      0|  case CURLOPT_SERVER_RESPONSE_TIMEOUT:
  ------------------
  |  Branch (794:3): [True: 0, False: 7.48k]
  ------------------
  795|      0|    return setopt_set_timeout_sec(&s->server_response_timeout, arg);
  796|      0|  case CURLOPT_SERVER_RESPONSE_TIMEOUT_MS:
  ------------------
  |  Branch (796:3): [True: 0, False: 7.48k]
  ------------------
  797|      0|    return setopt_set_timeout_ms(&s->server_response_timeout, arg);
  798|      0|  case CURLOPT_LOW_SPEED_LIMIT:
  ------------------
  |  Branch (798:3): [True: 0, False: 7.48k]
  ------------------
  799|      0|    if(arg < 0)
  ------------------
  |  Branch (799:8): [True: 0, False: 0]
  ------------------
  800|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  801|      0|    else
  802|      0|      s->low_speed_limit = arg;
  803|      0|    break;
  804|      0|  case CURLOPT_LOW_SPEED_TIME:
  ------------------
  |  Branch (804:3): [True: 0, False: 7.48k]
  ------------------
  805|      0|    result = value_range(&arg, 0, 0, USHRT_MAX);
  806|      0|    if(!result)
  ------------------
  |  Branch (806:8): [True: 0, False: 0]
  ------------------
  807|      0|      s->low_speed_time = (uint16_t)arg;
  808|      0|    break;
  809|      0|  case CURLOPT_PORT:
  ------------------
  |  Branch (809:3): [True: 0, False: 7.48k]
  ------------------
  810|      0|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (810:8): [True: 0, False: 0]
  |  Branch (810:21): [True: 0, False: 0]
  ------------------
  811|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  812|      0|    s->use_port = (unsigned short)arg;
  813|      0|    break;
  814|      0|  case CURLOPT_TIMEOUT:
  ------------------
  |  Branch (814:3): [True: 0, False: 7.48k]
  ------------------
  815|      0|    return setopt_set_timeout_sec(&s->timeout, arg);
  816|  3.74k|  case CURLOPT_TIMEOUT_MS:
  ------------------
  |  Branch (816:3): [True: 3.74k, False: 3.74k]
  ------------------
  817|  3.74k|    return setopt_set_timeout_ms(&s->timeout, arg);
  818|      0|  case CURLOPT_CONNECTTIMEOUT:
  ------------------
  |  Branch (818:3): [True: 0, False: 7.48k]
  ------------------
  819|      0|    return setopt_set_timeout_sec(&s->connecttimeout, arg);
  820|  3.74k|  case CURLOPT_CONNECTTIMEOUT_MS:
  ------------------
  |  Branch (820:3): [True: 3.74k, False: 3.74k]
  ------------------
  821|  3.74k|    return setopt_set_timeout_ms(&s->connecttimeout, arg);
  822|      0|#ifndef CURL_DISABLE_BINDLOCAL
  823|      0|  case CURLOPT_LOCALPORT:
  ------------------
  |  Branch (823:3): [True: 0, False: 7.48k]
  ------------------
  824|      0|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (824:8): [True: 0, False: 0]
  |  Branch (824:21): [True: 0, False: 0]
  ------------------
  825|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  826|      0|    s->localport = curlx_sltous(arg);
  827|      0|    break;
  828|      0|  case CURLOPT_LOCALPORTRANGE:
  ------------------
  |  Branch (828:3): [True: 0, False: 7.48k]
  ------------------
  829|      0|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (829:8): [True: 0, False: 0]
  |  Branch (829:21): [True: 0, False: 0]
  ------------------
  830|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  831|      0|    s->localportrange = curlx_sltous(arg);
  832|      0|    break;
  833|      0|#endif
  834|      0|  case CURLOPT_BUFFERSIZE:
  ------------------
  |  Branch (834:3): [True: 0, False: 7.48k]
  ------------------
  835|      0|    result = value_range(&arg, 0, READBUFFER_MIN, READBUFFER_MAX);
  ------------------
  |  |  122|      0|#define READBUFFER_MIN  1024
  ------------------
                  result = value_range(&arg, 0, READBUFFER_MIN, READBUFFER_MAX);
  ------------------
  |  |  121|      0|#define READBUFFER_MAX  CURL_MAX_READ_SIZE
  |  |  ------------------
  |  |  |  |  257|      0|#define CURL_MAX_READ_SIZE (10 * 1024 * 1024)
  |  |  ------------------
  ------------------
  836|      0|    if(!result)
  ------------------
  |  Branch (836:8): [True: 0, False: 0]
  ------------------
  837|      0|      s->buffer_size = (unsigned int)arg;
  838|      0|    break;
  839|      0|  case CURLOPT_UPLOAD_BUFFERSIZE:
  ------------------
  |  Branch (839:3): [True: 0, False: 7.48k]
  ------------------
  840|      0|    result = value_range(&arg, 0, UPLOADBUFFER_MIN, UPLOADBUFFER_MAX);
  ------------------
  |  |  134|      0|#define UPLOADBUFFER_MIN     CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  267|      0|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
                  result = value_range(&arg, 0, UPLOADBUFFER_MIN, UPLOADBUFFER_MAX);
  ------------------
  |  |  133|      0|#define UPLOADBUFFER_MAX     (2 * 1024 * 1024)
  ------------------
  841|      0|    if(!result)
  ------------------
  |  Branch (841:8): [True: 0, False: 0]
  ------------------
  842|      0|      s->upload_buffer_size = (unsigned int)arg;
  843|      0|    break;
  844|      0|  case CURLOPT_MAXFILESIZE:
  ------------------
  |  Branch (844:3): [True: 0, False: 7.48k]
  ------------------
  845|      0|    if(arg < 0)
  ------------------
  |  Branch (845:8): [True: 0, False: 0]
  ------------------
  846|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  847|      0|    else
  848|      0|      s->max_filesize = arg;
  849|      0|    break;
  850|      0|  case CURLOPT_IPRESOLVE:
  ------------------
  |  Branch (850:3): [True: 0, False: 7.48k]
  ------------------
  851|      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 (851:8): [True: 0, False: 0]
  |  Branch (851:43): [True: 0, False: 0]
  ------------------
  852|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  853|      0|    else
  854|      0|      s->ipver = (unsigned char)arg;
  855|      0|    break;
  856|      0|  case CURLOPT_CONNECT_ONLY:
  ------------------
  |  Branch (856:3): [True: 0, False: 7.48k]
  ------------------
  857|      0|    if(arg < 0 || arg > 2)
  ------------------
  |  Branch (857:8): [True: 0, False: 0]
  |  Branch (857:19): [True: 0, False: 0]
  ------------------
  858|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  859|      0|    else {
  860|      0|      s->connect_only = !!arg;
  861|      0|      s->connect_only_ws = (arg == 2);
  862|      0|    }
  863|      0|    break;
  864|      0|#ifdef USE_IPV6
  865|      0|  case CURLOPT_ADDRESS_SCOPE:
  ------------------
  |  Branch (865:3): [True: 0, False: 7.48k]
  ------------------
  866|      0|#if SIZEOF_LONG > 4
  867|      0|    if((unsigned long)arg > UINT_MAX)
  ------------------
  |  Branch (867:8): [True: 0, False: 0]
  ------------------
  868|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  869|      0|    else
  870|      0|#endif
  871|      0|    s->scope_id = (unsigned int)arg;
  872|      0|    break;
  873|      0|#endif
  874|      0|  case CURLOPT_TCP_KEEPIDLE:
  ------------------
  |  Branch (874:3): [True: 0, False: 7.48k]
  ------------------
  875|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  876|      0|    if(!result)
  ------------------
  |  Branch (876:8): [True: 0, False: 0]
  ------------------
  877|      0|      s->tcp_keepidle = (int)arg;
  878|      0|    break;
  879|      0|  case CURLOPT_TCP_KEEPINTVL:
  ------------------
  |  Branch (879:3): [True: 0, False: 7.48k]
  ------------------
  880|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  881|      0|    if(!result)
  ------------------
  |  Branch (881:8): [True: 0, False: 0]
  ------------------
  882|      0|      s->tcp_keepintvl = (int)arg;
  883|      0|    break;
  884|      0|  case CURLOPT_TCP_KEEPCNT:
  ------------------
  |  Branch (884:3): [True: 0, False: 7.48k]
  ------------------
  885|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  886|      0|    if(!result)
  ------------------
  |  Branch (886:8): [True: 0, False: 0]
  ------------------
  887|      0|      s->tcp_keepcnt = (int)arg;
  888|      0|    break;
  889|      0|  case CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS:
  ------------------
  |  Branch (889:3): [True: 0, False: 7.48k]
  ------------------
  890|      0|    return setopt_set_timeout_ms(&s->happy_eyeballs_timeout, arg);
  891|      0|  case CURLOPT_UPKEEP_INTERVAL_MS:
  ------------------
  |  Branch (891:3): [True: 0, False: 7.48k]
  ------------------
  892|      0|    return setopt_set_timeout_ms(&s->upkeep_interval_ms, arg);
  893|      0|  case CURLOPT_MAXAGE_CONN:
  ------------------
  |  Branch (893:3): [True: 0, False: 7.48k]
  ------------------
  894|      0|    return setopt_set_timeout_sec(&s->conn_max_idle_ms, arg);
  895|      0|  case CURLOPT_MAXLIFETIME_CONN:
  ------------------
  |  Branch (895:3): [True: 0, False: 7.48k]
  ------------------
  896|      0|    return setopt_set_timeout_sec(&s->conn_max_age_ms, arg);
  897|      0|  case CURLOPT_DNS_USE_GLOBAL_CACHE:
  ------------------
  |  Branch (897:3): [True: 0, False: 7.48k]
  ------------------
  898|       |    /* deprecated */
  899|      0|    break;
  900|      0|  default:
  ------------------
  |  Branch (900:3): [True: 0, False: 7.48k]
  ------------------
  901|      0|    return CURLE_UNKNOWN_OPTION;
  902|  7.48k|  }
  903|      0|  return result;
  904|  7.48k|}
setopt.c:setopt_set_timeout_ms:
   68|  7.48k|{
   69|  7.48k|  if(ms < 0)
  ------------------
  |  Branch (69:6): [True: 0, False: 7.48k]
  ------------------
   70|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   71|       |#if LONG_MAX > TIMEDIFF_T_MAX
   72|       |  if(ms > TIMEDIFF_T_MAX) {
   73|       |    *ptimeout_ms = TIMEDIFF_T_MAX;
   74|       |    return CURLE_OK;
   75|       |  }
   76|       |#endif
   77|  7.48k|  *ptimeout_ms = (timediff_t)ms;
   78|  7.48k|  return CURLE_OK;
   79|  7.48k|}
setopt.c:changeproxy:
  964|  3.74k|{
  965|  3.74k|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  966|  3.74k|  memset(&data->state.authproxy, 0, sizeof(data->state.authproxy));
  967|  3.74k|}
setopt.c:setopt_slist:
 1293|  4.41k|{
 1294|  4.41k|  CURLcode result = CURLE_OK;
 1295|  4.41k|  struct UserDefined *s = &data->set;
 1296|  4.41k|  switch(option) {
 1297|      0|#ifndef CURL_DISABLE_PROXY
 1298|      0|  case CURLOPT_PROXYHEADER:
  ------------------
  |  Branch (1298:3): [True: 0, False: 4.41k]
  ------------------
 1299|       |    /*
 1300|       |     * Set a list with proxy headers to use (or replace internals with)
 1301|       |     *
 1302|       |     * Since CURLOPT_HTTPHEADER was the only way to set HTTP headers for a
 1303|       |     * long time we remain doing it this way until CURLOPT_PROXYHEADER is
 1304|       |     * used. As soon as this option has been used, if set to anything but
 1305|       |     * NULL, custom headers for proxies are only picked from this list.
 1306|       |     *
 1307|       |     * Set this option to NULL to restore the previous behavior.
 1308|       |     */
 1309|      0|    s->proxyheaders = slist;
 1310|      0|    break;
 1311|      0|#endif
 1312|      0|#ifndef CURL_DISABLE_HTTP
 1313|      0|  case CURLOPT_HTTP200ALIASES:
  ------------------
  |  Branch (1313:3): [True: 0, False: 4.41k]
  ------------------
 1314|       |    /*
 1315|       |     * Set a list of aliases for HTTP 200 in response header
 1316|       |     */
 1317|      0|    s->http200aliases = slist;
 1318|      0|    break;
 1319|      0|#endif
 1320|      0|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
 1321|      0|  case CURLOPT_POSTQUOTE:
  ------------------
  |  Branch (1321:3): [True: 0, False: 4.41k]
  ------------------
 1322|       |    /*
 1323|       |     * List of RAW FTP commands to use after a transfer
 1324|       |     */
 1325|      0|    s->postquote = slist;
 1326|      0|    break;
 1327|      0|  case CURLOPT_PREQUOTE:
  ------------------
  |  Branch (1327:3): [True: 0, False: 4.41k]
  ------------------
 1328|       |    /*
 1329|       |     * List of RAW FTP commands to use prior to RETR (Wesley Laxton)
 1330|       |     */
 1331|      0|    s->prequote = slist;
 1332|      0|    break;
 1333|      0|  case CURLOPT_QUOTE:
  ------------------
  |  Branch (1333:3): [True: 0, False: 4.41k]
  ------------------
 1334|       |    /*
 1335|       |     * List of RAW FTP commands to use before a transfer
 1336|       |     */
 1337|      0|    s->quote = slist;
 1338|      0|    break;
 1339|      0|#endif
 1340|      0|  case CURLOPT_RESOLVE:
  ------------------
  |  Branch (1340:3): [True: 0, False: 4.41k]
  ------------------
 1341|       |    /*
 1342|       |     * List of HOST:PORT:[addresses] strings to populate the DNS cache with
 1343|       |     * Entries added this way will remain in the cache until explicitly
 1344|       |     * removed or the handle is cleaned up.
 1345|       |     *
 1346|       |     * Prefix the HOST with plus sign (+) to have the entry expire like
 1347|       |     * automatically added entries.
 1348|       |     *
 1349|       |     * Prefix the HOST with dash (-) to _remove_ the entry from the cache.
 1350|       |     *
 1351|       |     * This API can remove any entry from the DNS cache, but only entries
 1352|       |     * that are not actually in use right now will be pruned immediately.
 1353|       |     */
 1354|      0|    s->resolve = slist;
 1355|      0|    data->state.resolve = s->resolve;
 1356|      0|    break;
 1357|      0|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MIME)
 1358|      0|  case CURLOPT_HTTPHEADER:
  ------------------
  |  Branch (1358:3): [True: 0, False: 4.41k]
  ------------------
 1359|       |    /*
 1360|       |     * Set a list with HTTP headers to use (or replace internals with)
 1361|       |     */
 1362|      0|    s->headers = slist;
 1363|      0|    break;
 1364|      0|#endif
 1365|      0|#ifndef CURL_DISABLE_TELNET
 1366|    676|  case CURLOPT_TELNETOPTIONS:
  ------------------
  |  Branch (1366:3): [True: 676, False: 3.74k]
  ------------------
 1367|       |    /*
 1368|       |     * Set a linked list of telnet options
 1369|       |     */
 1370|    676|    s->telnet_options = slist;
 1371|    676|    break;
 1372|      0|#endif
 1373|      0|#ifndef CURL_DISABLE_SMTP
 1374|      0|  case CURLOPT_MAIL_RCPT:
  ------------------
  |  Branch (1374:3): [True: 0, False: 4.41k]
  ------------------
 1375|       |    /* Set the list of mail recipients */
 1376|      0|    s->mail_rcpt = slist;
 1377|      0|    break;
 1378|      0|#endif
 1379|  3.74k|  case CURLOPT_CONNECT_TO:
  ------------------
  |  Branch (1379:3): [True: 3.74k, False: 676]
  ------------------
 1380|  3.74k|    s->connect_to = slist;
 1381|  3.74k|    break;
 1382|      0|  default:
  ------------------
  |  Branch (1382:3): [True: 0, False: 4.41k]
  ------------------
 1383|      0|    return CURLE_UNKNOWN_OPTION;
 1384|  4.41k|  }
 1385|  4.41k|  return result;
 1386|  4.41k|}
setopt.c:setopt_cptr:
 2500|  59.5k|{
 2501|  59.5k|  typedef CURLcode (*ptrfunc)(struct Curl_easy *data, CURLoption option,
 2502|  59.5k|                              char *ptr);
 2503|       |  /* Order by likeliness */
 2504|  59.5k|  static const ptrfunc setopt_call[] = {
 2505|  59.5k|    setopt_cptr_misc,
 2506|  59.5k|#if defined(USE_SSL) || defined(USE_SSH)
 2507|  59.5k|    setopt_cptr_ssl,
 2508|  59.5k|#endif
 2509|  59.5k|#ifndef CURL_DISABLE_PROXY
 2510|  59.5k|    setopt_cptr_proxy,
 2511|  59.5k|#endif
 2512|  59.5k|    setopt_cptr_net,
 2513|  59.5k|#ifndef CURL_DISABLE_FTP
 2514|  59.5k|    setopt_cptr_ftp,
 2515|  59.5k|#endif
 2516|       |#ifdef USE_SSH
 2517|       |    setopt_cptr_ssh,
 2518|       |#endif
 2519|  59.5k|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT)
 2520|  59.5k|    setopt_cptr_http_mqtt,
 2521|  59.5k|#endif
 2522|  59.5k|  };
 2523|  59.5k|  size_t i;
 2524|       |
 2525|   104k|  for(i = 0; i < CURL_ARRAYSIZE(setopt_call); i++) {
  ------------------
  |  | 1251|   104k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (2525:14): [True: 104k, False: 0]
  ------------------
 2526|   104k|    CURLcode result = setopt_call[i](data, option, ptr);
 2527|   104k|    if(result != CURLE_UNKNOWN_OPTION)
  ------------------
  |  Branch (2527:8): [True: 59.5k, False: 44.9k]
  ------------------
 2528|  59.5k|      return result;
 2529|   104k|  }
 2530|      0|  return CURLE_UNKNOWN_OPTION;
 2531|  59.5k|}
setopt.c:setopt_cptr_misc:
 2285|  59.5k|{
 2286|  59.5k|  CURLcode result = CURLE_OK;
 2287|  59.5k|  struct UserDefined *s = &data->set;
 2288|       |
 2289|  59.5k|  switch(option) {
 2290|      0|  case CURLOPT_REQUEST_TARGET:
  ------------------
  |  Branch (2290:3): [True: 0, False: 59.5k]
  ------------------
 2291|      0|    return Curl_setstropt(data, STRING_TARGET, ptr);
 2292|      0|#ifndef CURL_DISABLE_NETRC
 2293|  3.74k|  case CURLOPT_NETRC_FILE:
  ------------------
  |  Branch (2293:3): [True: 3.74k, False: 55.8k]
  ------------------
 2294|  3.74k|    return Curl_setstropt(data, STRING_NETRC_FILE, ptr);
 2295|      0|#endif
 2296|      0|  case CURLOPT_CUSTOMREQUEST:
  ------------------
  |  Branch (2296:3): [True: 0, False: 59.5k]
  ------------------
 2297|      0|    return Curl_setstropt(data, STRING_CUSTOMREQUEST, ptr);
 2298|       |
 2299|       |    /* we do not set s->method = HTTPREQ_CUSTOM; here, we continue as if we
 2300|       |       were using the already set type and this changes the actual request
 2301|       |       keyword */
 2302|      0|  case CURLOPT_SERVICE_NAME:
  ------------------
  |  Branch (2302:3): [True: 0, False: 59.5k]
  ------------------
 2303|      0|    return Curl_setstropt(data, STRING_SERVICE_NAME, ptr);
 2304|       |
 2305|      0|  case CURLOPT_HEADERDATA:
  ------------------
  |  Branch (2305:3): [True: 0, False: 59.5k]
  ------------------
 2306|      0|    s->writeheader = ptr;
 2307|      0|    break;
 2308|  7.48k|  case CURLOPT_READDATA:
  ------------------
  |  Branch (2308:3): [True: 7.48k, False: 52.0k]
  ------------------
 2309|  7.48k|    s->in_set = ptr;
 2310|  7.48k|    break;
 2311|      0|  case CURLOPT_WRITEDATA:
  ------------------
  |  Branch (2311:3): [True: 0, False: 59.5k]
  ------------------
 2312|      0|    s->out = ptr;
 2313|      0|    break;
 2314|      0|  case CURLOPT_DEBUGDATA:
  ------------------
  |  Branch (2314:3): [True: 0, False: 59.5k]
  ------------------
 2315|      0|    s->debugdata = ptr;
 2316|      0|    break;
 2317|      0|  case CURLOPT_PROGRESSDATA:
  ------------------
  |  | 1353|      0|#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
  ------------------
  |  Branch (2317:3): [True: 0, False: 59.5k]
  ------------------
 2318|      0|    s->progress_client = ptr;
 2319|      0|    break;
 2320|  7.48k|  case CURLOPT_SEEKDATA:
  ------------------
  |  Branch (2320:3): [True: 7.48k, False: 52.0k]
  ------------------
 2321|  7.48k|    s->seek_client = ptr;
 2322|  7.48k|    break;
 2323|      0|  case CURLOPT_IOCTLDATA:
  ------------------
  |  Branch (2323:3): [True: 0, False: 59.5k]
  ------------------
 2324|      0|    s->ioctl_client = ptr;
 2325|      0|    break;
 2326|  3.74k|  case CURLOPT_SOCKOPTDATA:
  ------------------
  |  Branch (2326:3): [True: 3.74k, False: 55.8k]
  ------------------
 2327|  3.74k|    s->sockopt_client = ptr;
 2328|  3.74k|    break;
 2329|  3.74k|  case CURLOPT_OPENSOCKETDATA:
  ------------------
  |  Branch (2329:3): [True: 3.74k, False: 55.8k]
  ------------------
 2330|  3.74k|    s->opensocket_client = ptr;
 2331|  3.74k|    break;
 2332|      0|  case CURLOPT_RESOLVER_START_DATA:
  ------------------
  |  Branch (2332:3): [True: 0, False: 59.5k]
  ------------------
 2333|      0|    s->resolver_start_client = ptr;
 2334|      0|    break;
 2335|      0|  case CURLOPT_CLOSESOCKETDATA:
  ------------------
  |  Branch (2335:3): [True: 0, False: 59.5k]
  ------------------
 2336|      0|    s->closesocket_client = ptr;
 2337|      0|    break;
 2338|      0|  case CURLOPT_PREREQDATA:
  ------------------
  |  Branch (2338:3): [True: 0, False: 59.5k]
  ------------------
 2339|      0|    s->prereq_userp = ptr;
 2340|      0|    break;
 2341|      0|  case CURLOPT_ERRORBUFFER:
  ------------------
  |  Branch (2341:3): [True: 0, False: 59.5k]
  ------------------
 2342|      0|    s->errorbuffer = ptr;
 2343|      0|    break;
 2344|  3.74k|  case CURLOPT_URL:
  ------------------
  |  Branch (2344:3): [True: 3.74k, False: 55.8k]
  ------------------
 2345|  3.74k|    result = Curl_setstropt(data, STRING_SET_URL, ptr);
 2346|  3.74k|    Curl_bufref_set(&data->state.url,
 2347|  3.74k|                    CURL_EASY_STR(data, STRING_SET_URL), 0, NULL);
  ------------------
  |  | 1234|  3.74k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2348|  3.74k|    break;
 2349|       |
 2350|  2.31k|  case CURLOPT_USERPWD: {
  ------------------
  |  Branch (2350:3): [True: 2.31k, False: 57.2k]
  ------------------
 2351|  2.31k|    char *u = NULL, *p = NULL;
 2352|  2.31k|    result = setstropt_userpwd(ptr, &u, &p);
 2353|  2.31k|    if(!result) {
  ------------------
  |  Branch (2353:8): [True: 2.31k, False: 0]
  ------------------
 2354|  2.31k|      result = CURL_EASY_STR_SETN(data, STRING_USERNAME, u);
  ------------------
  |  | 1238|  2.31k|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), (s))
  ------------------
 2355|  2.31k|      u = NULL;
 2356|  2.31k|    }
 2357|  2.31k|    if(!result) {
  ------------------
  |  Branch (2357:8): [True: 2.31k, False: 0]
  ------------------
 2358|  2.31k|      result = CURL_EASY_STR_SETN(data, STRING_PASSWORD, p);
  ------------------
  |  | 1238|  2.31k|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), (s))
  ------------------
 2359|  2.31k|      p = NULL;
 2360|  2.31k|    }
 2361|  2.31k|    curlx_free(u);
  ------------------
  |  | 1428|  2.31k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2362|  2.31k|    curlx_free(p);
  ------------------
  |  | 1428|  2.31k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2363|  2.31k|    return result;
 2364|      0|  }
 2365|       |
 2366|    260|  case CURLOPT_USERNAME:
  ------------------
  |  Branch (2366:3): [True: 260, False: 59.3k]
  ------------------
 2367|    260|    return Curl_setstropt(data, STRING_USERNAME, ptr);
 2368|       |
 2369|    871|  case CURLOPT_PASSWORD:
  ------------------
  |  Branch (2369:3): [True: 871, False: 58.7k]
  ------------------
 2370|    871|    return Curl_setstropt(data, STRING_PASSWORD, ptr);
 2371|       |
 2372|      0|  case CURLOPT_LOGIN_OPTIONS:
  ------------------
  |  Branch (2372:3): [True: 0, False: 59.5k]
  ------------------
 2373|      0|    return Curl_setstropt(data, STRING_OPTIONS, ptr);
 2374|       |
 2375|      0|  case CURLOPT_XOAUTH2_BEARER:
  ------------------
  |  Branch (2375:3): [True: 0, False: 59.5k]
  ------------------
 2376|      0|    return Curl_setstropt(data, STRING_BEARER, ptr);
 2377|      0|  case CURLOPT_RANGE:
  ------------------
  |  Branch (2377:3): [True: 0, False: 59.5k]
  ------------------
 2378|      0|    return Curl_setstropt(data, STRING_SET_RANGE, ptr);
 2379|      0|  case CURLOPT_PRIVATE:
  ------------------
  |  Branch (2379:3): [True: 0, False: 59.5k]
  ------------------
 2380|      0|    s->private_data = ptr;
 2381|      0|    break;
 2382|  3.74k|  case CURLOPT_PROTOCOLS_STR:
  ------------------
  |  Branch (2382:3): [True: 3.74k, False: 55.8k]
  ------------------
 2383|  3.74k|    if(ptr) {
  ------------------
  |  Branch (2383:8): [True: 3.74k, False: 0]
  ------------------
 2384|  3.74k|      curl_prot_t protos;
 2385|  3.74k|      result = protocol2num(ptr, &protos);
 2386|  3.74k|      if(!result)
  ------------------
  |  Branch (2386:10): [True: 3.74k, False: 0]
  ------------------
 2387|  3.74k|        s->allowed_protocols = protos;
 2388|  3.74k|    }
 2389|      0|    else
 2390|       |      /* make a NULL argument reset to default */
 2391|      0|      s->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   66|      0|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
 2392|  3.74k|    break;
 2393|  3.74k|  case CURLOPT_REDIR_PROTOCOLS_STR:
  ------------------
  |  Branch (2393:3): [True: 3.74k, False: 55.8k]
  ------------------
 2394|  3.74k|    if(ptr) {
  ------------------
  |  Branch (2394:8): [True: 3.74k, False: 0]
  ------------------
 2395|  3.74k|      curl_prot_t protos;
 2396|  3.74k|      result = protocol2num(ptr, &protos);
 2397|  3.74k|      if(!result)
  ------------------
  |  Branch (2397:10): [True: 3.74k, False: 0]
  ------------------
 2398|  3.74k|        s->redir_protocols = protos;
 2399|  3.74k|    }
 2400|      0|    else
 2401|       |      /* make a NULL argument reset to default */
 2402|      0|      s->redir_protocols = (curl_prot_t)CURLPROTO_REDIR;
  ------------------
  |  |   69|      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)
  |  |  ------------------
  |  |   70|      0|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1091|      0|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
 2403|  3.74k|    break;
 2404|      0|  case CURLOPT_DEFAULT_PROTOCOL:
  ------------------
  |  Branch (2404:3): [True: 0, False: 59.5k]
  ------------------
 2405|       |    /* Set the protocol to use when the URL does not include any protocol */
 2406|      0|    return Curl_setstropt(data, STRING_DEFAULT_PROTOCOL, ptr);
 2407|      0|#ifndef CURL_DISABLE_SMTP
 2408|      0|  case CURLOPT_MAIL_FROM:
  ------------------
  |  Branch (2408:3): [True: 0, False: 59.5k]
  ------------------
 2409|       |    /* Set the SMTP mail originator */
 2410|      0|    return Curl_setstropt(data, STRING_MAIL_FROM, ptr);
 2411|      0|  case CURLOPT_MAIL_AUTH:
  ------------------
  |  Branch (2411:3): [True: 0, False: 59.5k]
  ------------------
 2412|       |    /* Set the SMTP auth originator */
 2413|      0|    return Curl_setstropt(data, STRING_MAIL_AUTH, ptr);
 2414|      0|#endif
 2415|      0|  case CURLOPT_SASL_AUTHZID:
  ------------------
  |  Branch (2415:3): [True: 0, False: 59.5k]
  ------------------
 2416|       |    /* Authorization identity (identity to act as) */
 2417|      0|    return Curl_setstropt(data, STRING_SASL_AUTHZID, ptr);
 2418|      0|#ifndef CURL_DISABLE_RTSP
 2419|      0|  case CURLOPT_RTSP_SESSION_ID:
  ------------------
  |  Branch (2419:3): [True: 0, False: 59.5k]
  ------------------
 2420|      0|    return Curl_setstropt(data, STRING_RTSP_SESSION_ID, ptr);
 2421|      0|  case CURLOPT_RTSP_STREAM_URI:
  ------------------
  |  Branch (2421:3): [True: 0, False: 59.5k]
  ------------------
 2422|      0|    return Curl_setstropt(data, STRING_RTSP_STREAM_URI, ptr);
 2423|      0|  case CURLOPT_RTSP_TRANSPORT:
  ------------------
  |  Branch (2423:3): [True: 0, False: 59.5k]
  ------------------
 2424|      0|    return Curl_setstropt(data, STRING_RTSP_TRANSPORT, ptr);
 2425|      0|  case CURLOPT_INTERLEAVEDATA:
  ------------------
  |  Branch (2425:3): [True: 0, False: 59.5k]
  ------------------
 2426|      0|    s->rtp_out = ptr;
 2427|      0|    break;
 2428|      0|#endif /* !CURL_DISABLE_RTSP */
 2429|      0|  case CURLOPT_TLSAUTH_USERNAME:
  ------------------
  |  Branch (2429:3): [True: 0, False: 59.5k]
  ------------------
 2430|      0|  case CURLOPT_TLSAUTH_PASSWORD:
  ------------------
  |  Branch (2430:3): [True: 0, False: 59.5k]
  ------------------
 2431|      0|  case CURLOPT_TLSAUTH_TYPE:
  ------------------
  |  Branch (2431:3): [True: 0, False: 59.5k]
  ------------------
 2432|      0|  case CURLOPT_PROXY_TLSAUTH_USERNAME:
  ------------------
  |  Branch (2432:3): [True: 0, False: 59.5k]
  ------------------
 2433|      0|  case CURLOPT_PROXY_TLSAUTH_PASSWORD:
  ------------------
  |  Branch (2433:3): [True: 0, False: 59.5k]
  ------------------
 2434|      0|  case CURLOPT_PROXY_TLSAUTH_TYPE:
  ------------------
  |  Branch (2434:3): [True: 0, False: 59.5k]
  ------------------
 2435|      0|    return CURLE_NOT_BUILT_IN;
 2436|      0|#ifndef CURL_DISABLE_HSTS
 2437|      0|  case CURLOPT_HSTSREADDATA:
  ------------------
  |  Branch (2437:3): [True: 0, False: 59.5k]
  ------------------
 2438|      0|    s->hsts_read_userp = ptr;
 2439|      0|    break;
 2440|      0|  case CURLOPT_HSTSWRITEDATA:
  ------------------
  |  Branch (2440:3): [True: 0, False: 59.5k]
  ------------------
 2441|      0|    s->hsts_write_userp = ptr;
 2442|      0|    break;
 2443|  3.74k|  case CURLOPT_HSTS: {
  ------------------
  |  Branch (2443:3): [True: 3.74k, False: 55.8k]
  ------------------
 2444|  3.74k|    struct curl_slist *h;
 2445|  3.74k|    if(!data->hsts) {
  ------------------
  |  Branch (2445:8): [True: 3.74k, False: 0]
  ------------------
 2446|  3.74k|      data->hsts = Curl_hsts_init();
 2447|  3.74k|      if(!data->hsts)
  ------------------
  |  Branch (2447:10): [True: 0, False: 3.74k]
  ------------------
 2448|      0|        return CURLE_OUT_OF_MEMORY;
 2449|  3.74k|    }
 2450|  3.74k|    if(ptr) {
  ------------------
  |  Branch (2450:8): [True: 3.74k, False: 0]
  ------------------
 2451|  3.74k|      result = Curl_setstropt(data, STRING_HSTS, ptr);
 2452|  3.74k|      if(result)
  ------------------
  |  Branch (2452:10): [True: 0, False: 3.74k]
  ------------------
 2453|      0|        return result;
 2454|       |      /* this needs to build a list of filenames to read from, so that it can
 2455|       |         read them later, as we might get a shared HSTS handle to load them
 2456|       |         into */
 2457|  3.74k|      h = curl_slist_append(data->state.hstslist, ptr);
 2458|  3.74k|      if(!h) {
  ------------------
  |  Branch (2458:10): [True: 0, False: 3.74k]
  ------------------
 2459|      0|        curl_slist_free_all(data->state.hstslist);
 2460|      0|        data->state.hstslist = NULL;
 2461|      0|        return CURLE_OUT_OF_MEMORY;
 2462|      0|      }
 2463|  3.74k|      data->state.hstslist = h; /* store the list for later use */
 2464|  3.74k|    }
 2465|      0|    else {
 2466|       |      /* clear the list of HSTS files */
 2467|      0|      curl_slist_free_all(data->state.hstslist);
 2468|      0|      data->state.hstslist = NULL;
 2469|      0|      if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (2469:10): [True: 0, False: 0]
  |  Branch (2469:26): [True: 0, False: 0]
  ------------------
 2470|       |        /* throw away the HSTS cache unless shared */
 2471|      0|        Curl_hsts_cleanup(&data->hsts);
 2472|      0|    }
 2473|  3.74k|    break;
 2474|  3.74k|  }
 2475|  3.74k|#endif /* !CURL_DISABLE_HSTS */
 2476|  3.74k|#ifndef CURL_DISABLE_ALTSVC
 2477|  3.74k|  case CURLOPT_ALTSVC:
  ------------------
  |  Branch (2477:3): [True: 3.74k, False: 55.8k]
  ------------------
 2478|  3.74k|    if(!data->asi) {
  ------------------
  |  Branch (2478:8): [True: 3.74k, False: 0]
  ------------------
 2479|  3.74k|      data->asi = Curl_altsvc_init();
 2480|  3.74k|      if(!data->asi)
  ------------------
  |  Branch (2480:10): [True: 0, False: 3.74k]
  ------------------
 2481|      0|        return CURLE_OUT_OF_MEMORY;
 2482|  3.74k|    }
 2483|  3.74k|    result = Curl_setstropt(data, STRING_ALTSVC, ptr);
 2484|  3.74k|    if(result)
  ------------------
  |  Branch (2484:8): [True: 0, False: 3.74k]
  ------------------
 2485|      0|      break;
 2486|  3.74k|    if(ptr)
  ------------------
  |  Branch (2486:8): [True: 3.74k, False: 0]
  ------------------
 2487|  3.74k|      return Curl_altsvc_load(data->asi, ptr);
 2488|      0|    break;
 2489|      0|#endif /* !CURL_DISABLE_ALTSVC */
 2490|      0|  case CURLOPT_ECH:
  ------------------
  |  Branch (2490:3): [True: 0, False: 59.5k]
  ------------------
 2491|      0|    return setopt_ech(data, ptr);
 2492|  11.2k|  default:
  ------------------
  |  Branch (2492:3): [True: 11.2k, False: 48.3k]
  ------------------
 2493|  11.2k|    return CURLE_UNKNOWN_OPTION;
 2494|  59.5k|  }
 2495|  37.4k|  return result;
 2496|  59.5k|}
setopt.c:setstropt_userpwd:
  125|  2.31k|{
  126|  2.31k|  char *user = NULL;
  127|  2.31k|  char *passwd = NULL;
  128|       |
  129|  2.31k|  DEBUGASSERT(userp);
  ------------------
  |  | 1027|  2.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 0, False: 2.31k]
  |  Branch (129:3): [True: 2.31k, False: 0]
  ------------------
  130|  2.31k|  DEBUGASSERT(passwdp);
  ------------------
  |  | 1027|  2.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (130:3): [True: 0, False: 2.31k]
  |  Branch (130:3): [True: 2.31k, False: 0]
  ------------------
  131|       |
  132|       |  /* Parse the login details if specified. If not, then we treat NULL as a
  133|       |     hint to clear the existing data */
  134|  2.31k|  if(option) {
  ------------------
  |  Branch (134:6): [True: 2.31k, False: 0]
  ------------------
  135|  2.31k|    size_t len = strlen(option);
  136|  2.31k|    CURLcode result;
  137|  2.31k|    if(len > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  2.31k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (137:8): [True: 0, False: 2.31k]
  ------------------
  138|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  139|       |
  140|  2.31k|    result = Curl_parse_login_details(option, len, &user, &passwd, NULL);
  141|  2.31k|    if(result)
  ------------------
  |  Branch (141:8): [True: 0, False: 2.31k]
  ------------------
  142|      0|      return result;
  143|  2.31k|  }
  144|       |
  145|  2.31k|  curlx_free(*userp);
  ------------------
  |  | 1428|  2.31k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  146|  2.31k|  *userp = user;
  147|       |
  148|  2.31k|  curlx_strzero(*passwdp);
  149|  2.31k|  curlx_free(*passwdp);
  ------------------
  |  | 1428|  2.31k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  150|  2.31k|  *passwdp = passwd;
  151|       |
  152|  2.31k|  return CURLE_OK;
  153|  2.31k|}
setopt.c:protocol2num:
  191|  7.48k|{
  192|       |  /*
  193|       |   * We are asked to cherry-pick protocols, so play it safe and disallow all
  194|       |   * protocols to start with, and re-add the wanted ones back in.
  195|       |   */
  196|  7.48k|  *val = 0;
  197|       |
  198|  7.48k|  if(!str)
  ------------------
  |  Branch (198:6): [True: 0, False: 7.48k]
  ------------------
  199|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  200|       |
  201|  7.48k|  if(curl_strequal(str, "all")) {
  ------------------
  |  Branch (201:6): [True: 0, False: 7.48k]
  ------------------
  202|      0|    *val = ~(curl_prot_t)0;
  203|      0|    return CURLE_OK;
  204|      0|  }
  205|       |
  206|  18.7k|  do {
  207|  18.7k|    const char *token = str;
  208|  18.7k|    size_t tlen;
  209|       |
  210|  18.7k|    str = strchr(str, ',');
  211|  18.7k|    tlen = str ? (size_t)(str - token) : strlen(token);
  ------------------
  |  Branch (211:12): [True: 11.2k, False: 7.48k]
  ------------------
  212|  18.7k|    if(tlen) {
  ------------------
  |  Branch (212:8): [True: 18.7k, False: 0]
  ------------------
  213|  18.7k|      const struct Curl_scheme *h = Curl_getn_scheme(token, tlen);
  214|       |
  215|  18.7k|      if(!h || !h->run)
  ------------------
  |  Branch (215:10): [True: 0, False: 18.7k]
  |  Branch (215:16): [True: 0, False: 18.7k]
  ------------------
  216|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
  217|       |
  218|  18.7k|      *val |= h->protocol;
  219|  18.7k|    }
  220|  18.7k|  } while(str && str++);
  ------------------
  |  Branch (220:11): [True: 11.2k, False: 7.48k]
  |  Branch (220:18): [True: 11.2k, False: 0]
  ------------------
  221|       |
  222|  7.48k|  if(!*val)
  ------------------
  |  Branch (222:6): [True: 0, False: 7.48k]
  ------------------
  223|       |    /* no protocol listed */
  224|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  225|  7.48k|  return CURLE_OK;
  226|  7.48k|}
setopt.c:setopt_cptr_ssl:
 1879|  11.2k|{
 1880|  11.2k|  CURLcode result = CURLE_OK;
 1881|       |
 1882|  11.2k|  switch(option) {
 1883|      0|  case CURLOPT_KEYPASSWD:
  ------------------
  |  Branch (1883:3): [True: 0, False: 11.2k]
  ------------------
 1884|       |    /*
 1885|       |     * String that holds the SSL or SSH private key password.
 1886|       |     */
 1887|      0|    result = Curl_setstropt(data, STRING_KEY_PASSWD, ptr);
 1888|      0|    break;
 1889|      0|#ifdef USE_SSL
 1890|      0|  case CURLOPT_CAINFO:
  ------------------
  |  Branch (1890:3): [True: 0, False: 11.2k]
  ------------------
 1891|       |    /*
 1892|       |     * Set CA info for SSL connection. Specify filename of the CA certificate
 1893|       |     */
 1894|      0|    result = Curl_setstropt(data, STRING_SSL_CAFILE, ptr);
 1895|      0|    data->set.ssl.custom_cafile = !!CURL_EASY_STR(data, STRING_SSL_CAFILE);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1896|      0|    return result;
 1897|      0|  case CURLOPT_CAPATH:
  ------------------
  |  Branch (1897:3): [True: 0, False: 11.2k]
  ------------------
 1898|       |    /*
 1899|       |     * Set CA path info for SSL connection. Specify directory name of the CA
 1900|       |     * certificates which have been prepared using openssl c_rehash utility.
 1901|       |     */
 1902|      0|    if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
  ------------------
  |  |   35|      0|#define SSLSUPP_CA_PATH      (1 << 0) /* supports CAPATH */
  ------------------
  |  Branch (1902:8): [True: 0, False: 0]
  ------------------
 1903|       |      /* This does not work on Windows. */
 1904|      0|      result = Curl_setstropt(data, STRING_SSL_CAPATH, ptr);
 1905|      0|      data->set.ssl.custom_capath = !!CURL_EASY_STR(data, STRING_SSL_CAPATH);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1906|      0|      return result;
 1907|      0|    }
 1908|      0|    return CURLE_NOT_BUILT_IN;
 1909|      0|  case CURLOPT_CRLFILE:
  ------------------
  |  Branch (1909:3): [True: 0, False: 11.2k]
  ------------------
 1910|       |    /*
 1911|       |     * Set CRL file info for SSL connection. Specify filename of the CRL
 1912|       |     * to check certificates revocation
 1913|       |     */
 1914|      0|    if(Curl_ssl_supports(data, SSLSUPP_CRLFILE))
  ------------------
  |  |   48|      0|#define SSLSUPP_CRLFILE      (1 << 13) /* supports CURLOPT_CRLFILE */
  ------------------
  |  Branch (1914:8): [True: 0, False: 0]
  ------------------
 1915|      0|      return Curl_setstropt(data, STRING_SSL_CRLFILE, ptr);
 1916|      0|    return CURLE_NOT_BUILT_IN;
 1917|      0|  case CURLOPT_SSL_CIPHER_LIST:
  ------------------
  |  Branch (1917:3): [True: 0, False: 11.2k]
  ------------------
 1918|      0|    if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST))
  ------------------
  |  |   44|      0|#define SSLSUPP_CIPHER_LIST  (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
  ------------------
  |  Branch (1918:8): [True: 0, False: 0]
  ------------------
 1919|       |      /* set a list of cipher we want to use in the SSL connection */
 1920|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER_LIST, ptr);
 1921|      0|    else
 1922|      0|      return CURLE_NOT_BUILT_IN;
 1923|      0|  case CURLOPT_TLS13_CIPHERS:
  ------------------
  |  Branch (1923:3): [True: 0, False: 11.2k]
  ------------------
 1924|      0|    if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES))
  ------------------
  |  |   40|      0|#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
  ------------------
  |  Branch (1924:8): [True: 0, False: 0]
  ------------------
 1925|       |      /* set preferred list of TLS 1.3 cipher suites */
 1926|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER13_LIST, ptr);
 1927|      0|    else
 1928|      0|      return CURLE_NOT_BUILT_IN;
 1929|      0|  case CURLOPT_RANDOM_FILE:
  ------------------
  |  Branch (1929:3): [True: 0, False: 11.2k]
  ------------------
 1930|      0|    break;
 1931|      0|  case CURLOPT_EGDSOCKET:
  ------------------
  |  Branch (1931:3): [True: 0, False: 11.2k]
  ------------------
 1932|      0|    break;
 1933|      0|  case CURLOPT_SSL_CTX_DATA:
  ------------------
  |  Branch (1933:3): [True: 0, False: 11.2k]
  ------------------
 1934|       |    /*
 1935|       |     * Set an SSL_CTX callback parameter pointer
 1936|       |     */
 1937|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) {
  ------------------
  |  |   38|      0|#define SSLSUPP_SSL_CTX      (1 << 3) /* supports CURLOPT_SSL_CTX */
  ------------------
  |  Branch (1937:8): [True: 0, False: 0]
  ------------------
 1938|      0|      data->set.ssl_fsslctxp = ptr;
 1939|      0|      break;
 1940|      0|    }
 1941|      0|    else
 1942|      0|      return CURLE_NOT_BUILT_IN;
 1943|      0|  case CURLOPT_SSLCERT:
  ------------------
  |  Branch (1943:3): [True: 0, False: 11.2k]
  ------------------
 1944|       |    /*
 1945|       |     * String that holds filename of the SSL certificate to use
 1946|       |     */
 1947|      0|    return Curl_setstropt(data, STRING_CERT, ptr);
 1948|      0|  case CURLOPT_SSLCERTTYPE:
  ------------------
  |  Branch (1948:3): [True: 0, False: 11.2k]
  ------------------
 1949|       |    /*
 1950|       |     * String that holds file type of the SSL certificate to use
 1951|       |     */
 1952|      0|    return Curl_setstropt(data, STRING_CERT_TYPE, ptr);
 1953|      0|  case CURLOPT_SSLKEY:
  ------------------
  |  Branch (1953:3): [True: 0, False: 11.2k]
  ------------------
 1954|       |    /*
 1955|       |     * String that holds filename of the SSL key to use
 1956|       |     */
 1957|      0|    return Curl_setstropt(data, STRING_KEY, ptr);
 1958|      0|  case CURLOPT_SSLKEYTYPE:
  ------------------
  |  Branch (1958:3): [True: 0, False: 11.2k]
  ------------------
 1959|       |    /*
 1960|       |     * String that holds file type of the SSL key to use
 1961|       |     */
 1962|      0|    return Curl_setstropt(data, STRING_KEY_TYPE, ptr);
 1963|      0|  case CURLOPT_SSLENGINE:
  ------------------
  |  Branch (1963:3): [True: 0, False: 11.2k]
  ------------------
 1964|       |    /*
 1965|       |     * String that holds the SSL crypto engine.
 1966|       |     */
 1967|      0|    if(ptr && ptr[0]) {
  ------------------
  |  Branch (1967:8): [True: 0, False: 0]
  |  Branch (1967:15): [True: 0, False: 0]
  ------------------
 1968|      0|      result = Curl_setstropt(data, STRING_SSL_ENGINE, ptr);
 1969|      0|      if(!result) {
  ------------------
  |  Branch (1969:10): [True: 0, False: 0]
  ------------------
 1970|      0|        result = Curl_ssl_set_engine(data, ptr);
 1971|      0|      }
 1972|      0|    }
 1973|      0|    break;
 1974|      0|  case CURLOPT_ISSUERCERT:
  ------------------
  |  Branch (1974:3): [True: 0, False: 11.2k]
  ------------------
 1975|       |    /*
 1976|       |     * Set Issuer certificate file
 1977|       |     * to check certificates issuer
 1978|       |     */
 1979|      0|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT))
  ------------------
  |  |   46|      0|#define SSLSUPP_ISSUERCERT   (1 << 11) /* supports CURLOPT_ISSUERCERT */
  ------------------
  |  Branch (1979:8): [True: 0, False: 0]
  ------------------
 1980|      0|      return Curl_setstropt(data, STRING_SSL_ISSUERCERT, ptr);
 1981|      0|    return CURLE_NOT_BUILT_IN;
 1982|      0|  case CURLOPT_SSL_EC_CURVES:
  ------------------
  |  Branch (1982:3): [True: 0, False: 11.2k]
  ------------------
 1983|       |    /*
 1984|       |     * Set accepted curves in SSL connection setup.
 1985|       |     * Specify colon-delimited list of curve algorithm names.
 1986|       |     */
 1987|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_EC_CURVES))
  ------------------
  |  |   47|      0|#define SSLSUPP_SSL_EC_CURVES (1 << 12) /* supports CURLOPT_SSL_EC_CURVES */
  ------------------
  |  Branch (1987:8): [True: 0, False: 0]
  ------------------
 1988|      0|      return Curl_setstropt(data, STRING_SSL_EC_CURVES, ptr);
 1989|      0|    return CURLE_NOT_BUILT_IN;
 1990|      0|  case CURLOPT_SSL_SIGNATURE_ALGORITHMS:
  ------------------
  |  Branch (1990:3): [True: 0, False: 11.2k]
  ------------------
 1991|       |    /*
 1992|       |     * Set accepted signature algorithms.
 1993|       |     * Specify colon-delimited list of signature scheme names.
 1994|       |     */
 1995|      0|    if(Curl_ssl_supports(data, SSLSUPP_SIGNATURE_ALGORITHMS))
  ------------------
  |  |   45|      0|#define SSLSUPP_SIGNATURE_ALGORITHMS (1 << 10) /* supports TLS sigalgs */
  ------------------
  |  Branch (1995:8): [True: 0, False: 0]
  ------------------
 1996|      0|      return Curl_setstropt(data, STRING_SSL_SIGNATURE_ALGORITHMS, ptr);
 1997|      0|    return CURLE_NOT_BUILT_IN;
 1998|      0|  case CURLOPT_PINNEDPUBLICKEY:
  ------------------
  |  Branch (1998:3): [True: 0, False: 11.2k]
  ------------------
 1999|       |    /*
 2000|       |     * Set pinned public key for SSL connection.
 2001|       |     * Specify filename of the public key in DER format.
 2002|       |     */
 2003|      0|    if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY))
  ------------------
  |  |   37|      0|#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
  ------------------
  |  Branch (2003:8): [True: 0, False: 0]
  ------------------
 2004|      0|      return Curl_setstropt(data, STRING_SSL_PINNEDPUBLICKEY, ptr);
 2005|      0|    return CURLE_NOT_BUILT_IN;
 2006|      0|  case CURLOPT_ECH:
  ------------------
  |  Branch (2006:3): [True: 0, False: 11.2k]
  ------------------
 2007|      0|    return setopt_ech(data, ptr);
 2008|      0|#endif
 2009|  11.2k|  default:
  ------------------
  |  Branch (2009:3): [True: 11.2k, False: 0]
  ------------------
 2010|  11.2k|    return CURLE_UNKNOWN_OPTION;
 2011|  11.2k|  }
 2012|      0|  return result;
 2013|  11.2k|}
setopt.c:setopt_cptr_proxy:
 1610|  11.2k|{
 1611|  11.2k|  CURLcode result = CURLE_OK;
 1612|  11.2k|  struct UserDefined *s = &data->set;
 1613|  11.2k|  switch(option) {
 1614|      0|  case CURLOPT_PROXYUSERPWD: {
  ------------------
  |  Branch (1614:3): [True: 0, False: 11.2k]
  ------------------
 1615|       |    /*
 1616|       |     * user:password needed to use the proxy
 1617|       |     */
 1618|      0|    char *u = NULL;
 1619|      0|    char *p = NULL;
 1620|      0|    result = setstropt_userpwd(ptr, &u, &p);
 1621|       |
 1622|       |    /* URL decode the components */
 1623|      0|    if(!result) {
  ------------------
  |  Branch (1623:8): [True: 0, False: 0]
  ------------------
 1624|      0|      char *str = NULL;
 1625|      0|      CURL_EASY_STR_CLEAR(data, STRING_PROXYUSERNAME);
  ------------------
  |  | 1240|      0|  Curl_u8_strset_unset(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1626|      0|      CURL_EASY_STR_CLEAR(data, STRING_PROXYPASSWORD);
  ------------------
  |  | 1240|      0|  Curl_u8_strset_unset(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1627|      0|      if(u) {
  ------------------
  |  Branch (1627:10): [True: 0, False: 0]
  ------------------
 1628|      0|        result = Curl_urldecode(u, 0, &str, NULL, REJECT_ZERO);
 1629|      0|        if(!result)
  ------------------
  |  Branch (1629:12): [True: 0, False: 0]
  ------------------
 1630|      0|          result = Curl_u8_strset_setn(&s->strings, STRING_PROXYUSERNAME, str);
 1631|      0|      }
 1632|      0|      if(!result && p) {
  ------------------
  |  Branch (1632:10): [True: 0, False: 0]
  |  Branch (1632:21): [True: 0, False: 0]
  ------------------
 1633|      0|        str = NULL;
 1634|      0|        result = Curl_urldecode(p, 0, &str, NULL, REJECT_ZERO);
 1635|      0|        if(!result)
  ------------------
  |  Branch (1635:12): [True: 0, False: 0]
  ------------------
 1636|      0|          result = Curl_u8_strset_setn(&s->strings, STRING_PROXYPASSWORD, str);
 1637|      0|      }
 1638|      0|    }
 1639|      0|    curlx_free(u);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1640|      0|    curlx_strzero(p);
 1641|      0|    curlx_free(p);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1642|      0|    break;
 1643|      0|  }
 1644|      0|  case CURLOPT_PROXYUSERNAME:
  ------------------
  |  Branch (1644:3): [True: 0, False: 11.2k]
  ------------------
 1645|       |    /*
 1646|       |     * authentication username to use in the operation
 1647|       |     */
 1648|      0|    return Curl_setstropt(data, STRING_PROXYUSERNAME, ptr);
 1649|       |
 1650|      0|  case CURLOPT_PROXYPASSWORD:
  ------------------
  |  Branch (1650:3): [True: 0, False: 11.2k]
  ------------------
 1651|       |    /*
 1652|       |     * authentication password to use in the operation
 1653|       |     */
 1654|      0|    return Curl_setstropt(data, STRING_PROXYPASSWORD, ptr);
 1655|       |
 1656|      0|  case CURLOPT_NOPROXY:
  ------------------
  |  Branch (1656:3): [True: 0, False: 11.2k]
  ------------------
 1657|       |    /*
 1658|       |     * proxy exception list
 1659|       |     */
 1660|      0|    return Curl_setstropt(data, STRING_NOPROXY, ptr);
 1661|      0|  case CURLOPT_PROXY_SSLCERT:
  ------------------
  |  Branch (1661:3): [True: 0, False: 11.2k]
  ------------------
 1662|       |    /*
 1663|       |     * String that holds filename of the SSL certificate to use for proxy
 1664|       |     */
 1665|      0|    return Curl_setstropt(data, STRING_CERT_PROXY, ptr);
 1666|      0|  case CURLOPT_PROXY_SSLCERTTYPE:
  ------------------
  |  Branch (1666:3): [True: 0, False: 11.2k]
  ------------------
 1667|       |    /*
 1668|       |     * String that holds file type of the SSL certificate to use for proxy
 1669|       |     */
 1670|      0|    return Curl_setstropt(data, STRING_CERT_TYPE_PROXY, ptr);
 1671|      0|  case CURLOPT_PROXY_SSLKEY:
  ------------------
  |  Branch (1671:3): [True: 0, False: 11.2k]
  ------------------
 1672|       |    /*
 1673|       |     * String that holds filename of the SSL key to use for proxy
 1674|       |     */
 1675|      0|    return Curl_setstropt(data, STRING_KEY_PROXY, ptr);
 1676|      0|  case CURLOPT_PROXY_KEYPASSWD:
  ------------------
  |  Branch (1676:3): [True: 0, False: 11.2k]
  ------------------
 1677|       |    /*
 1678|       |     * String that holds the SSL private key password for proxy.
 1679|       |     */
 1680|      0|    return Curl_setstropt(data, STRING_KEY_PASSWD_PROXY, ptr);
 1681|      0|  case CURLOPT_PROXY_SSLKEYTYPE:
  ------------------
  |  Branch (1681:3): [True: 0, False: 11.2k]
  ------------------
 1682|       |    /*
 1683|       |     * String that holds file type of the SSL key to use for proxy
 1684|       |     */
 1685|      0|    return Curl_setstropt(data, STRING_KEY_TYPE_PROXY, ptr);
 1686|      0|  case CURLOPT_PROXY_SSL_CIPHER_LIST:
  ------------------
  |  Branch (1686:3): [True: 0, False: 11.2k]
  ------------------
 1687|      0|    if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) {
  ------------------
  |  |   44|      0|#define SSLSUPP_CIPHER_LIST  (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
  ------------------
  |  Branch (1687:8): [True: 0, False: 0]
  ------------------
 1688|       |      /* set a list of cipher we want to use in the SSL connection for proxy */
 1689|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER_LIST_PROXY, ptr);
 1690|      0|    }
 1691|      0|    else
 1692|      0|      return CURLE_NOT_BUILT_IN;
 1693|      0|  case CURLOPT_PROXY_TLS13_CIPHERS:
  ------------------
  |  Branch (1693:3): [True: 0, False: 11.2k]
  ------------------
 1694|      0|    if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES))
  ------------------
  |  |   40|      0|#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
  ------------------
  |  Branch (1694:8): [True: 0, False: 0]
  ------------------
 1695|       |      /* set preferred list of TLS 1.3 cipher suites for proxy */
 1696|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER13_LIST_PROXY, ptr);
 1697|      0|    else
 1698|      0|      return CURLE_NOT_BUILT_IN;
 1699|  3.74k|  case CURLOPT_PROXY:
  ------------------
  |  Branch (1699:3): [True: 3.74k, False: 7.48k]
  ------------------
 1700|       |    /*
 1701|       |     * Set proxy server:port to use as proxy.
 1702|       |     *
 1703|       |     * If the proxy is set to "" (and CURLOPT_PRE_PROXY is set to "" or NULL)
 1704|       |     * we explicitly say that we do not want to use a proxy (even though there
 1705|       |     * might be environment variables saying so).
 1706|       |     *
 1707|       |     * Setting it to NULL, means no proxy but allows the environment variables
 1708|       |     * to decide for us (if CURLOPT_PRE_PROXY setting it to NULL).
 1709|       |     */
 1710|  3.74k|    return setproxy(data, ptr);
 1711|      0|  case CURLOPT_PRE_PROXY:
  ------------------
  |  Branch (1711:3): [True: 0, False: 11.2k]
  ------------------
 1712|       |    /*
 1713|       |     * Set proxy server:port to use as SOCKS proxy.
 1714|       |     *
 1715|       |     * If the proxy is set to "" or NULL we explicitly say that we do not want
 1716|       |     * to use the socks proxy.
 1717|       |     */
 1718|      0|    return Curl_setstropt(data, STRING_PRE_PROXY, ptr);
 1719|      0|  case CURLOPT_SOCKS5_GSSAPI_SERVICE:
  ------------------
  |  Branch (1719:3): [True: 0, False: 11.2k]
  ------------------
 1720|      0|  case CURLOPT_PROXY_SERVICE_NAME:
  ------------------
  |  Branch (1720:3): [True: 0, False: 11.2k]
  ------------------
 1721|       |    /*
 1722|       |     * Set proxy authentication service name for Kerberos 5 and SPNEGO
 1723|       |     */
 1724|      0|    return Curl_setstropt(data, STRING_PROXY_SERVICE_NAME, ptr);
 1725|      0|  case CURLOPT_PROXY_PINNEDPUBLICKEY:
  ------------------
  |  Branch (1725:3): [True: 0, False: 11.2k]
  ------------------
 1726|       |    /*
 1727|       |     * Set pinned public key for SSL connection.
 1728|       |     * Specify filename of the public key in DER format.
 1729|       |     */
 1730|      0|#ifdef USE_SSL
 1731|      0|    if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY))
  ------------------
  |  |   37|      0|#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
  ------------------
  |  Branch (1731:8): [True: 0, False: 0]
  ------------------
 1732|      0|      return Curl_setstropt(data, STRING_SSL_PINNEDPUBLICKEY_PROXY, ptr);
 1733|      0|#endif
 1734|      0|    return CURLE_NOT_BUILT_IN;
 1735|       |
 1736|      0|  case CURLOPT_HAPROXY_CLIENT_IP:
  ------------------
  |  Branch (1736:3): [True: 0, False: 11.2k]
  ------------------
 1737|       |    /*
 1738|       |     * Set the client IP to send through HAProxy PROXY protocol
 1739|       |     */
 1740|      0|    result = Curl_setstropt(data, STRING_HAPROXY_CLIENT_IP, ptr);
 1741|       |
 1742|       |    /* enable the HAProxy protocol if an IP is provided */
 1743|      0|    s->haproxyprotocol = !!CURL_EASY_STR(data, STRING_HAPROXY_CLIENT_IP);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1744|      0|    break;
 1745|      0|  case CURLOPT_PROXY_CAINFO:
  ------------------
  |  Branch (1745:3): [True: 0, False: 11.2k]
  ------------------
 1746|       |    /*
 1747|       |     * Set CA info SSL connection for proxy. Specify filename of the
 1748|       |     * CA certificate
 1749|       |     */
 1750|      0|    result = Curl_setstropt(data, STRING_SSL_CAFILE_PROXY, ptr);
 1751|      0|    s->proxy_ssl.custom_cafile =
 1752|      0|      !!CURL_EASY_STR(data, STRING_SSL_CAFILE_PROXY);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1753|      0|    return result;
 1754|      0|  case CURLOPT_PROXY_CRLFILE:
  ------------------
  |  Branch (1754:3): [True: 0, False: 11.2k]
  ------------------
 1755|       |    /*
 1756|       |     * Set CRL file info for SSL connection for proxy. Specify filename of the
 1757|       |     * CRL to check certificates revocation
 1758|       |     */
 1759|      0|    if(Curl_ssl_supports(data, SSLSUPP_CRLFILE))
  ------------------
  |  |   48|      0|#define SSLSUPP_CRLFILE      (1 << 13) /* supports CURLOPT_CRLFILE */
  ------------------
  |  Branch (1759:8): [True: 0, False: 0]
  ------------------
 1760|      0|      return Curl_setstropt(data, STRING_SSL_CRLFILE_PROXY, ptr);
 1761|      0|    return CURLE_NOT_BUILT_IN;
 1762|      0|  case CURLOPT_PROXY_ISSUERCERT:
  ------------------
  |  Branch (1762:3): [True: 0, False: 11.2k]
  ------------------
 1763|       |    /*
 1764|       |     * Set Issuer certificate file to check certificates issuer
 1765|       |     */
 1766|      0|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT))
  ------------------
  |  |   46|      0|#define SSLSUPP_ISSUERCERT   (1 << 11) /* supports CURLOPT_ISSUERCERT */
  ------------------
  |  Branch (1766:8): [True: 0, False: 0]
  ------------------
 1767|      0|      return Curl_setstropt(data, STRING_SSL_ISSUERCERT_PROXY, ptr);
 1768|      0|    return CURLE_NOT_BUILT_IN;
 1769|      0|  case CURLOPT_PROXY_CAPATH:
  ------------------
  |  Branch (1769:3): [True: 0, False: 11.2k]
  ------------------
 1770|       |    /*
 1771|       |     * Set CA path info for SSL connection proxy. Specify directory name of the
 1772|       |     * CA certificates which have been prepared using openssl c_rehash utility.
 1773|       |     */
 1774|      0|#ifdef USE_SSL
 1775|      0|    if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
  ------------------
  |  |   35|      0|#define SSLSUPP_CA_PATH      (1 << 0) /* supports CAPATH */
  ------------------
  |  Branch (1775:8): [True: 0, False: 0]
  ------------------
 1776|       |      /* This does not work on Windows. */
 1777|      0|      result = Curl_setstropt(data, STRING_SSL_CAPATH_PROXY, ptr);
 1778|      0|      s->proxy_ssl.custom_capath =
 1779|      0|        !!CURL_EASY_STR(data, STRING_SSL_CAPATH_PROXY);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1780|      0|      return result;
 1781|      0|    }
 1782|      0|#endif
 1783|      0|    return CURLE_NOT_BUILT_IN;
 1784|  7.48k|  default:
  ------------------
  |  Branch (1784:3): [True: 7.48k, False: 3.74k]
  ------------------
 1785|  7.48k|    return CURLE_UNKNOWN_OPTION;
 1786|  11.2k|  }
 1787|      0|  return result;
 1788|  11.2k|}
setopt.c:setproxy:
 1597|  3.74k|{
 1598|  3.74k|  const char *str = CURL_EASY_STR(data, STRING_PROXY);
  ------------------
  |  | 1234|  3.74k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1599|  3.74k|  if(str && proxy &&
  ------------------
  |  Branch (1599:6): [True: 0, False: 3.74k]
  |  Branch (1599:13): [True: 0, False: 0]
  ------------------
 1600|       |     /* there was one set, is this a new one? */
 1601|      0|     !strcmp(str, proxy))
  ------------------
  |  Branch (1601:6): [True: 0, False: 0]
  ------------------
 1602|      0|    return CURLE_OK; /* same one as before */
 1603|       |
 1604|  3.74k|  changeproxy(data);
 1605|  3.74k|  return Curl_setstropt(data, STRING_PROXY, proxy);
 1606|  3.74k|}
setopt.c:setopt_cptr_net:
 2239|  7.48k|{
 2240|  7.48k|  switch(option) {
 2241|      0|  case CURLOPT_INTERFACE:
  ------------------
  |  Branch (2241:3): [True: 0, False: 7.48k]
  ------------------
 2242|       |    /*
 2243|       |     * Set what interface or address/hostname to bind the socket to when
 2244|       |     * performing an operation and thus what from-IP your connection will use.
 2245|       |     */
 2246|      0|    return setstropt_interface(data, ptr);
 2247|       |
 2248|       |#ifdef USE_RESOLV_ARES
 2249|       |  case CURLOPT_DNS_SERVERS:
 2250|       |    return Curl_setstropt(data, STRING_DNS_SERVERS, ptr);
 2251|       |
 2252|       |  case CURLOPT_DNS_INTERFACE:
 2253|       |    return Curl_setstropt(data, STRING_DNS_INTERFACE, ptr);
 2254|       |
 2255|       |  case CURLOPT_DNS_LOCAL_IP4:
 2256|       |    return Curl_setstropt(data, STRING_DNS_LOCAL_IP4, ptr);
 2257|       |
 2258|       |  case CURLOPT_DNS_LOCAL_IP6:
 2259|       |    return Curl_setstropt(data, STRING_DNS_LOCAL_IP6, ptr);
 2260|       |#endif
 2261|      0|#ifdef USE_UNIX_SOCKETS
 2262|      0|  case CURLOPT_UNIX_SOCKET_PATH:
  ------------------
  |  Branch (2262:3): [True: 0, False: 7.48k]
  ------------------
 2263|      0|    data->set.abstract_unix_socket = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2264|      0|    return Curl_setstropt(data, STRING_UNIX_SOCKET_PATH, ptr);
 2265|       |
 2266|      0|  case CURLOPT_ABSTRACT_UNIX_SOCKET:
  ------------------
  |  Branch (2266:3): [True: 0, False: 7.48k]
  ------------------
 2267|      0|    data->set.abstract_unix_socket = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2268|      0|    return Curl_setstropt(data, STRING_UNIX_SOCKET_PATH, ptr);
 2269|      0|#endif
 2270|      0|#ifndef CURL_DISABLE_DOH
 2271|      0|  case CURLOPT_DOH_URL:
  ------------------
  |  Branch (2271:3): [True: 0, False: 7.48k]
  ------------------
 2272|      0|    {
 2273|      0|      CURLcode result = Curl_setstropt(data, STRING_DOH, ptr);
 2274|      0|      data->set.doh = !!CURL_EASY_STR(data, STRING_DOH);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2275|      0|      return result;
 2276|      0|    }
 2277|      0|#endif
 2278|  7.48k|  default:
  ------------------
  |  Branch (2278:3): [True: 7.48k, False: 0]
  ------------------
 2279|  7.48k|    return CURLE_UNKNOWN_OPTION;
 2280|  7.48k|  }
 2281|  7.48k|}
setopt.c:setopt_cptr_ftp:
 2204|  7.48k|{
 2205|  7.48k|  CURLcode result = CURLE_OK;
 2206|  7.48k|  struct UserDefined *s = &data->set;
 2207|  7.48k|  switch(option) {
 2208|      0|  case CURLOPT_FTPPORT:
  ------------------
  |  Branch (2208:3): [True: 0, False: 7.48k]
  ------------------
 2209|       |    /*
 2210|       |     * Use FTP PORT, this also specifies which IP address to use
 2211|       |     */
 2212|      0|    result = Curl_setstropt(data, STRING_FTPPORT, ptr);
 2213|      0|    s->ftp_use_port = !!CURL_EASY_STR(data, STRING_FTPPORT);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2214|      0|    break;
 2215|       |
 2216|      0|  case CURLOPT_FTP_ACCOUNT:
  ------------------
  |  Branch (2216:3): [True: 0, False: 7.48k]
  ------------------
 2217|      0|    return Curl_setstropt(data, STRING_FTP_ACCOUNT, ptr);
 2218|       |
 2219|      0|  case CURLOPT_FTP_ALTERNATIVE_TO_USER:
  ------------------
  |  Branch (2219:3): [True: 0, False: 7.48k]
  ------------------
 2220|      0|    return Curl_setstropt(data, STRING_FTP_ALTERNATIVE_TO_USER, ptr);
 2221|       |
 2222|      0|  case CURLOPT_KRBLEVEL:
  ------------------
  |  Branch (2222:3): [True: 0, False: 7.48k]
  ------------------
 2223|      0|    return CURLE_NOT_BUILT_IN; /* removed in 8.17.0 */
 2224|      0|  case CURLOPT_CHUNK_DATA:
  ------------------
  |  Branch (2224:3): [True: 0, False: 7.48k]
  ------------------
 2225|      0|    s->wildcardptr = ptr;
 2226|      0|    break;
 2227|      0|  case CURLOPT_FNMATCH_DATA:
  ------------------
  |  Branch (2227:3): [True: 0, False: 7.48k]
  ------------------
 2228|      0|    s->fnmatch_data = ptr;
 2229|      0|    break;
 2230|  7.48k|  default:
  ------------------
  |  Branch (2230:3): [True: 7.48k, False: 0]
  ------------------
 2231|  7.48k|    return CURLE_UNKNOWN_OPTION;
 2232|  7.48k|  }
 2233|      0|  return result;
 2234|  7.48k|}
setopt.c:setopt_cptr_http_mqtt:
 2019|  7.48k|{
 2020|  7.48k|  CURLcode result = CURLE_OK;
 2021|  7.48k|  struct UserDefined *s = &data->set;
 2022|       |
 2023|  7.48k|  switch(option) {
 2024|      0|  case CURLOPT_COPYPOSTFIELDS:
  ------------------
  |  Branch (2024:3): [True: 0, False: 7.48k]
  ------------------
 2025|      0|    return setopt_copypostfields(ptr, s);
 2026|       |
 2027|      0|  case CURLOPT_POSTFIELDS:
  ------------------
  |  Branch (2027:3): [True: 0, False: 7.48k]
  ------------------
 2028|       |    /*
 2029|       |     * Like above, but use static data instead of copying it.
 2030|       |     */
 2031|      0|    s->postfields = ptr;
 2032|       |    /* Release old copied data. */
 2033|      0|    curlx_safefree(s->str_copypostfields);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2034|      0|    s->method = HTTPREQ_POST;
 2035|      0|    break;
 2036|       |
 2037|      0|#ifndef CURL_DISABLE_HTTP
 2038|      0|  case CURLOPT_TRAILERDATA:
  ------------------
  |  Branch (2038:3): [True: 0, False: 7.48k]
  ------------------
 2039|      0|    s->trailer_data = ptr;
 2040|      0|    break;
 2041|      0|  case CURLOPT_ACCEPT_ENCODING:
  ------------------
  |  Branch (2041:3): [True: 0, False: 7.48k]
  ------------------
 2042|       |    /*
 2043|       |     * String to use at the value of Accept-Encoding header.
 2044|       |     *
 2045|       |     * If the encoding is set to "" we use an Accept-Encoding header that
 2046|       |     * encompasses all the encodings we support.
 2047|       |     * If the encoding is set to NULL we do not send an Accept-Encoding header
 2048|       |     * and ignore any received Content-Encoding header.
 2049|       |     *
 2050|       |     */
 2051|      0|    if(ptr && !*ptr) {
  ------------------
  |  Branch (2051:8): [True: 0, False: 0]
  |  Branch (2051:15): [True: 0, False: 0]
  ------------------
 2052|      0|      ptr = Curl_get_content_encodings();
 2053|      0|      if(ptr)
  ------------------
  |  Branch (2053:10): [True: 0, False: 0]
  ------------------
 2054|      0|        result = CURL_EASY_STR_SETN(data, STRING_ENCODING, ptr);
  ------------------
  |  | 1238|      0|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), (s))
  ------------------
 2055|      0|      else
 2056|      0|        result = CURLE_OUT_OF_MEMORY;
 2057|      0|      return result;
 2058|      0|    }
 2059|      0|    return Curl_setstropt(data, STRING_ENCODING, ptr);
 2060|       |
 2061|      0|#ifndef CURL_DISABLE_AWS
 2062|      0|  case CURLOPT_AWS_SIGV4:
  ------------------
  |  Branch (2062:3): [True: 0, False: 7.48k]
  ------------------
 2063|       |    /*
 2064|       |     * String that is merged to some authentication
 2065|       |     * parameters are used by the algorithm.
 2066|       |     */
 2067|      0|    result = Curl_setstropt(data, STRING_AWS_SIGV4, ptr);
 2068|       |    /*
 2069|       |     * Basic has been set by default; it needs to be unset here.
 2070|       |     */
 2071|      0|    if(CURL_EASY_STR(data, STRING_AWS_SIGV4))
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2072|      0|      s->httpauth = CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  847|      0|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
 2073|      0|    else
 2074|      0|      s->httpauth &= ~(uint32_t)CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  847|      0|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
 2075|      0|    break;
 2076|      0|#endif
 2077|      0|#ifndef CURL_DISABLE_HTTPSIG
 2078|      0|  case CURLOPT_HTTPSIG_KEY:
  ------------------
  |  Branch (2078:3): [True: 0, False: 7.48k]
  ------------------
 2079|      0|    result = Curl_setstropt(data, STRING_HTTPSIG_KEY, ptr);
 2080|      0|    break;
 2081|      0|  case CURLOPT_HTTPSIG_KEYID:
  ------------------
  |  Branch (2081:3): [True: 0, False: 7.48k]
  ------------------
 2082|      0|    result = Curl_setstropt(data, STRING_HTTPSIG_KEYID, ptr);
 2083|      0|    break;
 2084|      0|  case CURLOPT_HTTPSIG_HEADERS:
  ------------------
  |  Branch (2084:3): [True: 0, False: 7.48k]
  ------------------
 2085|      0|    result = Curl_setstropt(data, STRING_HTTPSIG_HEADERS, ptr);
 2086|      0|    break;
 2087|      0|#endif
 2088|      0|  case CURLOPT_REFERER: {
  ------------------
  |  Branch (2088:3): [True: 0, False: 7.48k]
  ------------------
 2089|       |    /*
 2090|       |     * String to set in the HTTP Referer: field.
 2091|       |     */
 2092|      0|    struct bufref *oldref = &data->state.referer;
 2093|       |    /* free the old after the storing the new in case the input is actually
 2094|       |       pointing back to this */
 2095|      0|    result = Curl_setstropt(data, STRING_SET_REFERER, ptr);
 2096|      0|    Curl_bufref_free(oldref);
 2097|      0|    break;
 2098|      0|  }
 2099|       |
 2100|      0|  case CURLOPT_USERAGENT:
  ------------------
  |  Branch (2100:3): [True: 0, False: 7.48k]
  ------------------
 2101|       |    /*
 2102|       |     * String to use in the HTTP User-Agent field
 2103|       |     */
 2104|      0|    return Curl_setstropt(data, STRING_USERAGENT, ptr);
 2105|       |
 2106|      0|#ifndef CURL_DISABLE_COOKIES
 2107|      0|  case CURLOPT_COOKIE:
  ------------------
  |  Branch (2107:3): [True: 0, False: 7.48k]
  ------------------
 2108|       |    /*
 2109|       |     * Cookie string to send to the remote server in the request.
 2110|       |     */
 2111|      0|    return Curl_setstropt(data, STRING_COOKIE, ptr);
 2112|       |
 2113|  3.74k|  case CURLOPT_COOKIEFILE:
  ------------------
  |  Branch (2113:3): [True: 3.74k, False: 3.74k]
  ------------------
 2114|  3.74k|    return cookiefile(data, ptr);
 2115|       |
 2116|  3.74k|  case CURLOPT_COOKIEJAR:
  ------------------
  |  Branch (2116:3): [True: 3.74k, False: 3.74k]
  ------------------
 2117|       |    /*
 2118|       |     * Set cookie filename to dump all cookies to when we are done.
 2119|       |     */
 2120|  3.74k|    result = Curl_setstropt(data, STRING_COOKIEJAR, ptr);
 2121|  3.74k|    if(!result) {
  ------------------
  |  Branch (2121:8): [True: 3.74k, False: 0]
  ------------------
 2122|       |      /*
 2123|       |       * Activate the cookie parser. This may or may not already
 2124|       |       * have been made.
 2125|       |       */
 2126|  3.74k|      if(!data->cookies)
  ------------------
  |  Branch (2126:10): [True: 3.74k, False: 0]
  ------------------
 2127|  3.74k|        data->cookies = Curl_cookie_init();
 2128|  3.74k|      if(!data->cookies)
  ------------------
  |  Branch (2128:10): [True: 0, False: 3.74k]
  ------------------
 2129|      0|        result = CURLE_OUT_OF_MEMORY;
 2130|  3.74k|      else
 2131|  3.74k|        data->state.cookie_engine = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
 2132|  3.74k|    }
 2133|  3.74k|    break;
 2134|       |
 2135|      0|  case CURLOPT_COOKIELIST:
  ------------------
  |  Branch (2135:3): [True: 0, False: 7.48k]
  ------------------
 2136|      0|    return cookielist(data, ptr);
 2137|      0|#endif /* !CURL_DISABLE_COOKIES */
 2138|       |
 2139|      0|#endif /* !CURL_DISABLE_HTTP */
 2140|      0|  default:
  ------------------
  |  Branch (2140:3): [True: 0, False: 7.48k]
  ------------------
 2141|      0|    return CURLE_UNKNOWN_OPTION;
 2142|  7.48k|  }
 2143|  3.74k|  return result;
 2144|  7.48k|}
setopt.c:cookiefile:
 1558|  3.74k|{
 1559|       |  /*
 1560|       |   * Set cookie file to read and parse. Can be used multiple times.
 1561|       |   */
 1562|  3.74k|  if(ptr) {
  ------------------
  |  Branch (1562:6): [True: 3.74k, False: 0]
  ------------------
 1563|  3.74k|    struct curl_slist *cl;
 1564|       |    /* general protection against mistakes and abuse */
 1565|  3.74k|    if(strlen(ptr) > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  3.74k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1565:8): [True: 0, False: 3.74k]
  ------------------
 1566|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1567|       |    /* append the cookie filename to the list of filenames, and deal with
 1568|       |       them later */
 1569|  3.74k|    cl = curl_slist_append(data->state.cookielist, ptr);
 1570|  3.74k|    if(!cl) {
  ------------------
  |  Branch (1570:8): [True: 0, False: 3.74k]
  ------------------
 1571|      0|      curl_slist_free_all(data->state.cookielist);
 1572|      0|      data->state.cookielist = NULL;
 1573|      0|      return CURLE_OUT_OF_MEMORY;
 1574|      0|    }
 1575|  3.74k|    data->state.cookielist = cl; /* store the list for later use */
 1576|  3.74k|  }
 1577|      0|  else {
 1578|       |    /* clear the list of cookie files */
 1579|      0|    curl_slist_free_all(data->state.cookielist);
 1580|      0|    data->state.cookielist = NULL;
 1581|       |
 1582|      0|    if(!data->share || !data->share->cookies) {
  ------------------
  |  Branch (1582:8): [True: 0, False: 0]
  |  Branch (1582:24): [True: 0, False: 0]
  ------------------
 1583|       |      /* throw away all existing cookies if this is not a shared cookie
 1584|       |         container */
 1585|      0|      Curl_cookie_clearall(data->cookies);
 1586|      0|      Curl_cookie_cleanup(data->cookies);
 1587|      0|    }
 1588|       |    /* disable the cookie engine */
 1589|      0|    data->cookies = NULL;
 1590|      0|  }
 1591|  3.74k|  return CURLE_OK;
 1592|  3.74k|}
setopt.c:setopt_func:
 2535|  33.6k|{
 2536|  33.6k|  struct UserDefined *s = &data->set;
 2537|  33.6k|  switch(option) {
 2538|      0|  case CURLOPT_PROGRESSFUNCTION:
  ------------------
  |  Branch (2538:3): [True: 0, False: 33.6k]
  ------------------
 2539|       |    /*
 2540|       |     * Progress callback function
 2541|       |     */
 2542|      0|    s->fprogress = va_arg(param, curl_progress_callback);
 2543|      0|    if(s->fprogress)
  ------------------
  |  Branch (2543:8): [True: 0, False: 0]
  ------------------
 2544|      0|      data->progress.callback = TRUE; /* no longer internal */
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2545|      0|    else
 2546|      0|      data->progress.callback = FALSE; /* NULL enforces internal */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2547|      0|    break;
 2548|       |
 2549|      0|  case CURLOPT_XFERINFOFUNCTION:
  ------------------
  |  Branch (2549:3): [True: 0, False: 33.6k]
  ------------------
 2550|       |    /*
 2551|       |     * Transfer info callback function
 2552|       |     */
 2553|      0|    s->fxferinfo = va_arg(param, curl_xferinfo_callback);
 2554|      0|    if(s->fxferinfo)
  ------------------
  |  Branch (2554:8): [True: 0, False: 0]
  ------------------
 2555|      0|      data->progress.callback = TRUE; /* no longer internal */
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2556|      0|    else
 2557|      0|      data->progress.callback = FALSE; /* NULL enforces internal */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2558|       |
 2559|      0|    break;
 2560|  3.74k|  case CURLOPT_DEBUGFUNCTION:
  ------------------
  |  Branch (2560:3): [True: 3.74k, False: 29.9k]
  ------------------
 2561|       |    /*
 2562|       |     * stderr write callback.
 2563|       |     */
 2564|  3.74k|    s->fdebug = va_arg(param, curl_debug_callback);
 2565|       |    /*
 2566|       |     * if the callback provided is NULL, it will use the default callback
 2567|       |     */
 2568|  3.74k|    break;
 2569|  3.74k|  case CURLOPT_HEADERFUNCTION:
  ------------------
  |  Branch (2569:3): [True: 3.74k, False: 29.9k]
  ------------------
 2570|       |    /*
 2571|       |     * Set header write callback
 2572|       |     */
 2573|  3.74k|    s->fwrite_header = va_arg(param, curl_write_callback);
 2574|  3.74k|    break;
 2575|  3.74k|  case CURLOPT_WRITEFUNCTION:
  ------------------
  |  Branch (2575:3): [True: 3.74k, False: 29.9k]
  ------------------
 2576|       |    /*
 2577|       |     * Set data write callback
 2578|       |     */
 2579|  3.74k|    s->fwrite_func = va_arg(param, curl_write_callback);
 2580|  3.74k|    if(!s->fwrite_func)
  ------------------
  |  Branch (2580:8): [True: 0, False: 3.74k]
  ------------------
 2581|      0|#if defined(__clang__) && __clang_major__ >= 16
 2582|      0|#pragma clang diagnostic push
 2583|      0|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2584|      0|#endif
 2585|       |      /* When set to NULL, reset to our internal default function */
 2586|      0|      s->fwrite_func = (curl_write_callback)fwrite;
 2587|  3.74k|#if defined(__clang__) && __clang_major__ >= 16
 2588|  3.74k|#pragma clang diagnostic pop
 2589|  3.74k|#endif
 2590|  3.74k|    break;
 2591|  7.48k|  case CURLOPT_READFUNCTION:
  ------------------
  |  Branch (2591:3): [True: 7.48k, False: 26.1k]
  ------------------
 2592|       |    /*
 2593|       |     * Read data callback
 2594|       |     */
 2595|  7.48k|    s->fread_func_set = va_arg(param, curl_read_callback);
 2596|  7.48k|    if(!s->fread_func_set) {
  ------------------
  |  Branch (2596:8): [True: 3.74k, False: 3.74k]
  ------------------
 2597|  3.74k|      s->is_fread_set = 0;
 2598|  3.74k|#if defined(__clang__) && __clang_major__ >= 16
 2599|  3.74k|#pragma clang diagnostic push
 2600|  3.74k|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2601|  3.74k|#endif
 2602|       |      /* When set to NULL, reset to our internal default function */
 2603|  3.74k|      s->fread_func_set = (curl_read_callback)fread;
 2604|  3.74k|#if defined(__clang__) && __clang_major__ >= 16
 2605|  3.74k|#pragma clang diagnostic pop
 2606|  3.74k|#endif
 2607|  3.74k|    }
 2608|  3.74k|    else
 2609|  3.74k|      s->is_fread_set = 1;
 2610|  7.48k|    break;
 2611|  7.48k|  case CURLOPT_SEEKFUNCTION:
  ------------------
  |  Branch (2611:3): [True: 7.48k, False: 26.1k]
  ------------------
 2612|       |    /*
 2613|       |     * Seek callback. Might be NULL.
 2614|       |     */
 2615|  7.48k|    s->seek_func = va_arg(param, curl_seek_callback);
 2616|  7.48k|    break;
 2617|      0|  case CURLOPT_IOCTLFUNCTION:
  ------------------
  |  Branch (2617:3): [True: 0, False: 33.6k]
  ------------------
 2618|       |    /*
 2619|       |     * I/O control callback. Might be NULL.
 2620|       |     */
 2621|      0|    s->ioctl_func = va_arg(param, curl_ioctl_callback);
 2622|      0|    break;
 2623|      0|  case CURLOPT_SSL_CTX_FUNCTION:
  ------------------
  |  Branch (2623:3): [True: 0, False: 33.6k]
  ------------------
 2624|       |    /*
 2625|       |     * Set an SSL_CTX callback
 2626|       |     */
 2627|      0|#ifdef USE_SSL
 2628|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) {
  ------------------
  |  |   38|      0|#define SSLSUPP_SSL_CTX      (1 << 3) /* supports CURLOPT_SSL_CTX */
  ------------------
  |  Branch (2628:8): [True: 0, False: 0]
  ------------------
 2629|      0|      s->ssl_fsslctx = va_arg(param, curl_ssl_ctx_callback);
 2630|      0|      break;
 2631|      0|    }
 2632|      0|    else
 2633|      0|#endif
 2634|      0|      return CURLE_NOT_BUILT_IN;
 2635|       |
 2636|  3.74k|  case CURLOPT_SOCKOPTFUNCTION:
  ------------------
  |  Branch (2636:3): [True: 3.74k, False: 29.9k]
  ------------------
 2637|       |    /*
 2638|       |     * socket callback function: called after socket() but before connect()
 2639|       |     */
 2640|  3.74k|    s->fsockopt = va_arg(param, curl_sockopt_callback);
 2641|  3.74k|    break;
 2642|       |
 2643|  3.74k|  case CURLOPT_OPENSOCKETFUNCTION:
  ------------------
  |  Branch (2643:3): [True: 3.74k, False: 29.9k]
  ------------------
 2644|       |    /*
 2645|       |     * open/create socket callback function: called instead of socket(),
 2646|       |     * before connect()
 2647|       |     */
 2648|  3.74k|    s->fopensocket = va_arg(param, curl_opensocket_callback);
 2649|  3.74k|    break;
 2650|       |
 2651|      0|  case CURLOPT_CLOSESOCKETFUNCTION:
  ------------------
  |  Branch (2651:3): [True: 0, False: 33.6k]
  ------------------
 2652|       |    /*
 2653|       |     * close socket callback function: called instead of close()
 2654|       |     * when shutting down a connection
 2655|       |     */
 2656|      0|    s->fclosesocket = va_arg(param, curl_closesocket_callback);
 2657|      0|    break;
 2658|       |
 2659|      0|  case CURLOPT_RESOLVER_START_FUNCTION:
  ------------------
  |  Branch (2659:3): [True: 0, False: 33.6k]
  ------------------
 2660|       |    /*
 2661|       |     * resolver start callback function: called before a new resolver request
 2662|       |     * is started
 2663|       |     */
 2664|      0|    s->resolver_start = va_arg(param, curl_resolver_start_callback);
 2665|      0|    break;
 2666|       |
 2667|       |#ifdef USE_SSH
 2668|       |#ifdef USE_LIBSSH2
 2669|       |  case CURLOPT_SSH_HOSTKEYFUNCTION:
 2670|       |    /* the callback to check the hostkey without the knownhost file */
 2671|       |    s->ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback);
 2672|       |    break;
 2673|       |#endif
 2674|       |
 2675|       |  case CURLOPT_SSH_KEYFUNCTION:
 2676|       |    /* setting to NULL is fine since the ssh.c functions themselves will
 2677|       |       then revert to use the internal default */
 2678|       |    s->ssh_keyfunc = va_arg(param, curl_sshkeycallback);
 2679|       |    break;
 2680|       |
 2681|       |#endif /* USE_SSH */
 2682|       |
 2683|      0|#ifndef CURL_DISABLE_RTSP
 2684|      0|  case CURLOPT_INTERLEAVEFUNCTION:
  ------------------
  |  Branch (2684:3): [True: 0, False: 33.6k]
  ------------------
 2685|       |    /* Set the user defined RTP write function */
 2686|      0|    s->fwrite_rtp = va_arg(param, curl_write_callback);
 2687|      0|    break;
 2688|      0|#endif
 2689|      0|#ifndef CURL_DISABLE_FTP
 2690|      0|  case CURLOPT_CHUNK_BGN_FUNCTION:
  ------------------
  |  Branch (2690:3): [True: 0, False: 33.6k]
  ------------------
 2691|      0|    s->chunk_bgn = va_arg(param, curl_chunk_bgn_callback);
 2692|      0|    break;
 2693|      0|  case CURLOPT_CHUNK_END_FUNCTION:
  ------------------
  |  Branch (2693:3): [True: 0, False: 33.6k]
  ------------------
 2694|      0|    s->chunk_end = va_arg(param, curl_chunk_end_callback);
 2695|      0|    break;
 2696|      0|  case CURLOPT_FNMATCH_FUNCTION:
  ------------------
  |  Branch (2696:3): [True: 0, False: 33.6k]
  ------------------
 2697|      0|    s->fnmatch = va_arg(param, curl_fnmatch_callback);
 2698|      0|    break;
 2699|      0|#endif
 2700|      0|#ifndef CURL_DISABLE_HTTP
 2701|      0|  case CURLOPT_TRAILERFUNCTION:
  ------------------
  |  Branch (2701:3): [True: 0, False: 33.6k]
  ------------------
 2702|      0|    s->trailer_callback = va_arg(param, curl_trailer_callback);
 2703|      0|    break;
 2704|      0|#endif
 2705|      0|#ifndef CURL_DISABLE_HSTS
 2706|      0|  case CURLOPT_HSTSREADFUNCTION:
  ------------------
  |  Branch (2706:3): [True: 0, False: 33.6k]
  ------------------
 2707|      0|    s->hsts_read = va_arg(param, curl_hstsread_callback);
 2708|      0|    break;
 2709|      0|  case CURLOPT_HSTSWRITEFUNCTION:
  ------------------
  |  Branch (2709:3): [True: 0, False: 33.6k]
  ------------------
 2710|      0|    s->hsts_write = va_arg(param, curl_hstswrite_callback);
 2711|      0|    break;
 2712|      0|#endif
 2713|      0|  case CURLOPT_PREREQFUNCTION:
  ------------------
  |  Branch (2713:3): [True: 0, False: 33.6k]
  ------------------
 2714|      0|    s->fprereq = va_arg(param, curl_prereq_callback);
 2715|      0|    break;
 2716|      0|  default:
  ------------------
  |  Branch (2716:3): [True: 0, False: 33.6k]
  ------------------
 2717|      0|    return CURLE_UNKNOWN_OPTION;
 2718|  33.6k|  }
 2719|  33.6k|  return CURLE_OK;
 2720|  33.6k|}
setopt.c:setopt_offt:
 2724|    663|{
 2725|    663|  struct UserDefined *s = &data->set;
 2726|    663|  switch(option) {
 2727|      0|  case CURLOPT_TIMEVALUE_LARGE:
  ------------------
  |  Branch (2727:3): [True: 0, False: 663]
  ------------------
 2728|       |    /*
 2729|       |     * This is the value to compare with the remote document with the
 2730|       |     * method set with CURLOPT_TIMECONDITION
 2731|       |     */
 2732|      0|    s->timevalue = (time_t)offt;
 2733|      0|    break;
 2734|       |
 2735|       |    /* MQTT "borrows" some of the HTTP options */
 2736|      0|  case CURLOPT_POSTFIELDSIZE_LARGE:
  ------------------
  |  Branch (2736:3): [True: 0, False: 663]
  ------------------
 2737|       |    /*
 2738|       |     * The size of the POSTFIELD data to prevent libcurl to do strlen() to
 2739|       |     * figure it out. Enables binary posts.
 2740|       |     */
 2741|      0|    if(offt < -1)
  ------------------
  |  Branch (2741:8): [True: 0, False: 0]
  ------------------
 2742|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2743|       |
 2744|      0|    if(s->postfieldsize < offt && s->str_copypostfields) {
  ------------------
  |  Branch (2744:8): [True: 0, False: 0]
  |  Branch (2744:35): [True: 0, False: 0]
  ------------------
 2745|       |      /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
 2746|      0|      curlx_safefree(s->str_copypostfields);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2747|      0|      s->postfields = NULL;
 2748|      0|    }
 2749|      0|    s->postfieldsize = offt;
 2750|      0|    break;
 2751|      0|  case CURLOPT_INFILESIZE_LARGE:
  ------------------
  |  Branch (2751:3): [True: 0, False: 663]
  ------------------
 2752|       |    /*
 2753|       |     * If known, this should inform curl about the file size of the
 2754|       |     * to-be-uploaded file.
 2755|       |     */
 2756|      0|    if(offt < -1)
  ------------------
  |  Branch (2756:8): [True: 0, False: 0]
  ------------------
 2757|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2758|      0|    s->filesize = offt;
 2759|      0|    break;
 2760|      0|  case CURLOPT_MAX_SEND_SPEED_LARGE:
  ------------------
  |  Branch (2760:3): [True: 0, False: 663]
  ------------------
 2761|       |    /*
 2762|       |     * When transfer uploads are faster than CURLOPT_MAX_SEND_SPEED_LARGE
 2763|       |     * bytes per second the transfer is throttled..
 2764|       |     */
 2765|      0|    if(offt < 0)
  ------------------
  |  Branch (2765:8): [True: 0, False: 0]
  ------------------
 2766|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2767|      0|    s->max_send_speed = offt;
 2768|       |    /* use minimal burst rate of 32k. some protocol batch IO */
 2769|      0|    Curl_rlimit_init(&data->progress.ul.rlimit, offt,
 2770|      0|                     CURLMAX(offt, (32 * 1024)),
  ------------------
  |  | 1239|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1239:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2771|      0|                     Curl_pgrs_now(data));
 2772|      0|    break;
 2773|      0|  case CURLOPT_MAX_RECV_SPEED_LARGE:
  ------------------
  |  Branch (2773:3): [True: 0, False: 663]
  ------------------
 2774|       |    /*
 2775|       |     * When receiving data faster than CURLOPT_MAX_RECV_SPEED_LARGE bytes per
 2776|       |     * 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_recv_speed = offt;
 2781|       |    /* use minimal burst rate of 32k. some protocol batch IO */
 2782|      0|    Curl_rlimit_init(&data->progress.dl.rlimit, offt,
 2783|      0|                     CURLMAX(offt, (32 * 1024)),
  ------------------
  |  | 1239|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1239:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2784|      0|                     Curl_pgrs_now(data));
 2785|      0|    break;
 2786|      0|  case CURLOPT_RESUME_FROM_LARGE:
  ------------------
  |  Branch (2786:3): [True: 0, False: 663]
  ------------------
 2787|       |    /*
 2788|       |     * Resume transfer at the given file position
 2789|       |     */
 2790|      0|    if(offt < -1)
  ------------------
  |  Branch (2790:8): [True: 0, False: 0]
  ------------------
 2791|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2792|      0|    s->set_resume_from = offt;
 2793|      0|    break;
 2794|    663|  case CURLOPT_MAXFILESIZE_LARGE:
  ------------------
  |  Branch (2794:3): [True: 663, False: 0]
  ------------------
 2795|       |    /*
 2796|       |     * Set the maximum size of a file to download.
 2797|       |     */
 2798|    663|    if(offt < 0)
  ------------------
  |  Branch (2798:8): [True: 180, False: 483]
  ------------------
 2799|    180|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2800|    483|    s->max_filesize = offt;
 2801|    483|    break;
 2802|       |
 2803|      0|  default:
  ------------------
  |  Branch (2803:3): [True: 0, False: 663]
  ------------------
 2804|      0|    return CURLE_UNKNOWN_OPTION;
 2805|    663|  }
 2806|    483|  return CURLE_OK;
 2807|    663|}

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

Curl_slist_append_nodup:
   56|  12.5k|{
   57|  12.5k|  struct curl_slist *last;
   58|  12.5k|  struct curl_slist *new_item;
   59|       |
   60|  12.5k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  12.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (60:3): [True: 0, False: 12.5k]
  |  Branch (60:3): [True: 12.5k, False: 0]
  ------------------
   61|       |
   62|  12.5k|  new_item = curlx_malloc(sizeof(struct curl_slist));
  ------------------
  |  | 1423|  12.5k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   63|  12.5k|  if(!new_item)
  ------------------
  |  Branch (63:6): [True: 0, False: 12.5k]
  ------------------
   64|      0|    return NULL;
   65|       |
   66|  12.5k|  new_item->next = NULL;
   67|  12.5k|  new_item->data = CURL_UNCONST(data);
  ------------------
  |  |  808|  12.5k|#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|  12.5k|  if(!list)
  ------------------
  |  Branch (70:6): [True: 11.9k, False: 590]
  ------------------
   71|  11.9k|    return new_item;
   72|       |
   73|    590|  last = slist_get_last(list);
   74|    590|  last->next = new_item;
   75|    590|  return list;
   76|  12.5k|}
curl_slist_append:
   86|  12.5k|{
   87|  12.5k|  char *dupdata = curlx_strdup(data);
  ------------------
  |  | 1422|  12.5k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
   88|       |
   89|  12.5k|  if(!dupdata)
  ------------------
  |  Branch (89:6): [True: 0, False: 12.5k]
  ------------------
   90|      0|    return NULL;
   91|       |
   92|  12.5k|  list = Curl_slist_append_nodup(list, dupdata);
   93|  12.5k|  if(!list)
  ------------------
  |  Branch (93:6): [True: 0, False: 12.5k]
  ------------------
   94|      0|    curlx_free(dupdata);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   95|       |
   96|  12.5k|  return list;
   97|  12.5k|}
curl_slist_free_all:
  125|  33.0k|{
  126|  33.0k|  struct curl_slist *next;
  127|  33.0k|  struct curl_slist *item;
  128|       |
  129|  33.0k|  if(!list)
  ------------------
  |  Branch (129:6): [True: 21.1k, False: 11.9k]
  ------------------
  130|  21.1k|    return;
  131|       |
  132|  11.9k|  item = list;
  133|  12.5k|  do {
  134|  12.5k|    next = item->next;
  135|  12.5k|    curlx_safefree(item->data);
  ------------------
  |  | 1284|  12.5k|  do {                      \
  |  | 1285|  12.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  12.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  12.5k|    (ptr) = NULL;           \
  |  | 1287|  12.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 12.5k]
  |  |  ------------------
  ------------------
  136|  12.5k|    curlx_free(item);
  ------------------
  |  | 1428|  12.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  137|  12.5k|    item = next;
  138|  12.5k|  } while(next);
  ------------------
  |  Branch (138:11): [True: 590, False: 11.9k]
  ------------------
  139|  11.9k|}
slist.c:slist_get_last:
   30|    590|{
   31|    590|  struct curl_slist *item;
   32|       |
   33|       |  /* if caller passed us a NULL, return now */
   34|    590|  if(!list)
  ------------------
  |  Branch (34:6): [True: 0, False: 590]
  ------------------
   35|      0|    return NULL;
   36|       |
   37|       |  /* loop through to find the last item */
   38|    590|  item = list;
   39|  1.57k|  while(item->next) {
  ------------------
  |  Branch (39:9): [True: 984, False: 590]
  ------------------
   40|    984|    item = item->next;
   41|    984|  }
   42|    590|  return item;
   43|    590|}

Curl_wakeup_init:
  277|  7.48k|{
  278|  7.48k|#ifdef USE_EVENTFD
  279|  7.48k|  return wakeup_eventfd(socks, nonblocking);
  280|       |#elif defined(HAVE_PIPE)
  281|       |  return wakeup_pipe(socks, nonblocking);
  282|       |#elif defined(HAVE_SOCKETPAIR)
  283|       |  return wakeup_socketpair(socks, nonblocking);
  284|       |#else
  285|       |  return wakeup_inet(socks, nonblocking);
  286|       |#endif
  287|  7.48k|}
Curl_wakeup_consume:
  329|  3.74k|{
  330|  3.74k|  char buf[64];
  331|  3.74k|  ssize_t rc;
  332|  3.74k|  CURLcode result = CURLE_OK;
  333|       |
  334|  3.74k|  do {
  335|  3.74k|    rc = wakeup_read(socks[0], buf, sizeof(buf));
  ------------------
  |  |  292|  3.74k|#define wakeup_read         read
  ------------------
  336|  3.74k|    if(!rc)
  ------------------
  |  Branch (336:8): [True: 0, False: 3.74k]
  ------------------
  337|      0|      break;
  338|  3.74k|    else if(rc < 0) {
  ------------------
  |  Branch (338:13): [True: 3.74k, False: 0]
  ------------------
  339|  3.74k|      int sockerr = SOCKERRNO;
  ------------------
  |  | 1041|  3.74k|#define SOCKERRNO         errno
  ------------------
  340|  3.74k|#ifndef USE_WINSOCK
  341|  3.74k|      if(sockerr == SOCKEINTR)
  ------------------
  |  | 1075|  3.74k|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (341:10): [True: 0, False: 3.74k]
  ------------------
  342|      0|        continue;
  343|  3.74k|#endif
  344|  3.74k|      if(SOCK_EAGAIN(sockerr))
  ------------------
  |  | 1092|  3.74k|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1083|  3.74k|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1092:24): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
  345|  3.74k|        break;
  346|      0|      result = CURLE_READ_ERROR;
  347|      0|      break;
  348|  3.74k|    }
  349|  3.74k|  } while(all);
  ------------------
  |  Branch (349:11): [True: 0, False: 0]
  ------------------
  350|  3.74k|  return result;
  351|  3.74k|}
Curl_wakeup_destroy:
  354|  7.48k|{
  355|       |#ifndef USE_EVENTFD
  356|       |  if(socks[1] != CURL_SOCKET_BAD)
  357|       |    wakeup_close(socks[1]);
  358|       |#endif
  359|  7.48k|  if(socks[0] != CURL_SOCKET_BAD)
  ------------------
  |  |  147|  7.48k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (359:6): [True: 7.48k, False: 0]
  ------------------
  360|  7.48k|    wakeup_close(socks[0]);
  ------------------
  |  |  293|  7.48k|#define wakeup_close        close
  ------------------
  361|  7.48k|  socks[0] = socks[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  7.48k|#define CURL_SOCKET_BAD (-1)
  ------------------
  362|  7.48k|}
socketpair.c:wakeup_eventfd:
   39|  7.48k|{
   40|  7.48k|  int efd = eventfd(0, nonblocking ? EFD_CLOEXEC | EFD_NONBLOCK : EFD_CLOEXEC);
  ------------------
  |  Branch (40:24): [True: 7.48k, False: 0]
  ------------------
   41|  7.48k|  if(efd == -1) {
  ------------------
  |  Branch (41:6): [True: 0, False: 7.48k]
  ------------------
   42|      0|    socks[0] = socks[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
   43|      0|    return -1;
   44|      0|  }
   45|  7.48k|  socks[0] = socks[1] = efd;
   46|  7.48k|  return 0;
   47|  7.48k|}

Curl_timeouts_init:
   43|  3.74k|{
   44|  3.74k|  struct curltime time_base = ptime_base ? *ptime_base : curlx_now();
  ------------------
  |  Branch (44:31): [True: 3.74k, False: 0]
  ------------------
   45|       |  timeouts->tree = NULL;
   46|  3.74k|  timeouts->time_base_sec = time_base.tv_sec;
   47|  3.74k|}
Curl_timeouts_has:
   50|  24.7k|{
   51|  24.7k|  struct Curl_tree *node = data ? &data->state.timeouts.splaynode : NULL;
  ------------------
  |  Branch (51:28): [True: 24.7k, False: 0]
  ------------------
   52|  24.7k|  return node && node->registered;
  ------------------
  |  Branch (52:10): [True: 24.7k, False: 0]
  |  Branch (52:18): [True: 17.3k, False: 7.48k]
  ------------------
   53|  24.7k|}
Curl_timeouts_offset_us:
   57|  7.48k|{
   58|  7.48k|  struct curltime time_base;
   59|  7.48k|  time_base.tv_sec = timeouts->time_base_sec;
   60|  7.48k|  time_base.tv_usec = 0;
   61|  7.48k|  return curlx_ptimediff_us(pts, &time_base);
   62|  7.48k|}
splayinsert:
  183|  3.74k|{
  184|  3.74k|  DEBUGASSERT(node);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (184:3): [True: 0, False: 3.74k]
  |  Branch (184:3): [True: 3.74k, False: 0]
  ------------------
  185|       |
  186|  3.74k|  node->key = key;
  187|  3.74k|  node->id = id;
  188|  3.74k|  node->same = NULL;
  189|  3.74k|  node->registered = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  190|  3.74k|  if(root) {
  ------------------
  |  Branch (190:6): [True: 0, False: 3.74k]
  ------------------
  191|      0|    root = splay(key, root);
  192|      0|    DEBUGASSERT(root);
  ------------------
  |  | 1027|      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|  3.74k|  if(!root) {
  ------------------
  |  Branch (205:6): [True: 3.74k, False: 0]
  ------------------
  206|  3.74k|    node->smaller = node->larger = NULL;
  207|  3.74k|  }
  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|  3.74k|  return node;
  220|  3.74k|}
Curl_timeouts_add:
  225|  3.74k|{
  226|  3.74k|  struct Curl_tree *node = &data->state.timeouts.splaynode;
  227|  3.74k|  DEBUGASSERT(!node->registered);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 0, False: 3.74k]
  |  Branch (227:3): [True: 3.74k, False: 0]
  ------------------
  228|  3.74k|  timeouts->tree = splayinsert(offset_us, timeouts->tree,
  229|  3.74k|                               node, data->mid);
  230|  3.74k|}
Curl_timeouts_remove_expired:
  285|  3.74k|{
  286|  3.74k|  if(timeouts->tree) {
  ------------------
  |  Branch (286:6): [True: 0, False: 3.74k]
  ------------------
  287|      0|    struct Curl_tree *t = NULL;
  288|      0|    timediff_t elapsed_us = Curl_timeouts_offset_us(timeouts, ts);
  289|      0|    timeouts->tree = splaygetbest(elapsed_us, timeouts->tree, &t);
  290|      0|    if(t) {
  ------------------
  |  Branch (290:8): [True: 0, False: 0]
  ------------------
  291|      0|      *pmid = t->id;
  292|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  293|      0|    }
  294|      0|  }
  295|  3.74k|  *pmid = UINT32_MAX;
  296|       |  return FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  297|  3.74k|}
splayremove:
  316|  3.74k|{
  317|  3.74k|  struct Curl_tree *x;
  318|       |
  319|  3.74k|  if(!root)
  ------------------
  |  Branch (319:6): [True: 0, False: 3.74k]
  ------------------
  320|      0|    return 1;
  321|       |
  322|  3.74k|  DEBUGASSERT(removenode);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (322:3): [True: 0, False: 3.74k]
  |  Branch (322:3): [True: 3.74k, False: 0]
  ------------------
  323|  3.74k|  if(!removenode->registered)
  ------------------
  |  Branch (323:6): [True: 0, False: 3.74k]
  ------------------
  324|      0|    return 2;
  325|       |
  326|  3.74k|  root = splay(removenode->key, root);
  327|  3.74k|  DEBUGASSERT(root);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (327:3): [True: 0, False: 3.74k]
  |  Branch (327:3): [True: 3.74k, 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|  3.74k|  if(root->key != removenode->key) {
  ------------------
  |  Branch (332:6): [True: 0, False: 3.74k]
  ------------------
  333|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      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|  3.74k|  if(root != removenode) {
  ------------------
  |  Branch (337:6): [True: 0, False: 3.74k]
  ------------------
  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;
  ------------------
  |  | 1000|      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);
  ------------------
  |  | 1027|      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|  3.74k|  if(root->same) {
  ------------------
  |  Branch (354:6): [True: 0, False: 3.74k]
  ------------------
  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|  3.74k|  else {
  363|       |    /* Remove the root node */
  364|  3.74k|    if(!root->smaller)
  ------------------
  |  Branch (364:8): [True: 3.74k, False: 0]
  ------------------
  365|  3.74k|      x = root->larger;
  366|      0|    else {
  367|      0|      x = splay(removenode->key, root->smaller);
  368|      0|      DEBUGASSERT(x);
  ------------------
  |  | 1027|      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|  3.74k|  }
  372|  3.74k|  removenode->registered = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  373|  3.74k|  *newroot = x; /* return new root */
  374|  3.74k|  return 0;
  375|  3.74k|}
Curl_timeouts_remove:
  379|  7.48k|{
  380|  7.48k|  struct Curl_tree *node = &data->state.timeouts.splaynode;
  381|  7.48k|  if(node->registered) {
  ------------------
  |  Branch (381:6): [True: 3.74k, False: 3.74k]
  ------------------
  382|  3.74k|    int rc = splayremove(timeouts->tree, node, &timeouts->tree);
  383|  3.74k|#ifdef DEBUGBUILD
  384|  3.74k|    if(rc)
  ------------------
  |  Branch (384:8): [True: 0, False: 3.74k]
  ------------------
  385|      0|      curl_mfprintf(stderr, "Internal error removing splay node = %d\n", rc);
  386|       |#else
  387|       |    (void)rc;
  388|       |#endif
  389|  3.74k|    return TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  390|  3.74k|  }
  391|  3.74k|  return FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  392|  7.48k|}
splay.c:splay:
  104|  3.74k|{
  105|  3.74k|  struct Curl_tree N, *l, *r, *y;
  106|       |
  107|  3.74k|  if(!root)
  ------------------
  |  Branch (107:6): [True: 0, False: 3.74k]
  ------------------
  108|      0|    return NULL;
  109|  3.74k|  N.smaller = N.larger = NULL;
  110|  3.74k|  l = r = &N;
  111|       |
  112|  3.74k|  for(;;) {
  113|  3.74k|    if(key < root->key) {
  ------------------
  |  Branch (113:8): [True: 0, False: 3.74k]
  ------------------
  114|       |      /* key is somewhere in root->smaller branch */
  115|      0|      if(!root->smaller)  /* which is empty, done */
  ------------------
  |  Branch (115:10): [True: 0, False: 0]
  ------------------
  116|      0|        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|  3.74k|    else if(key > root->key) {
  ------------------
  |  Branch (134:13): [True: 0, False: 3.74k]
  ------------------
  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|  3.74k|    else  /* exact match, root is key, done */
  156|  3.74k|      break;
  157|  3.74k|  }
  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|  3.74k|  l->larger = root->smaller;
  163|  3.74k|  r->smaller = root->larger;
  164|  3.74k|  root->smaller = N.larger;
  165|  3.74k|  root->larger = N.smaller;
  166|       |
  167|  3.74k|  return root;
  168|  3.74k|}

Curl_strntolower:
   93|  9.12k|{
   94|  9.12k|  if(n < 1)
  ------------------
  |  Branch (94:6): [True: 0, False: 9.12k]
  ------------------
   95|      0|    return;
   96|       |
   97|   109k|  do {
   98|   109k|    *dest++ = Curl_raw_tolower(*src);
   99|   109k|  } while(*src++ && --n);
  ------------------
  |  Branch (99:11): [True: 109k, False: 0]
  |  Branch (99:21): [True: 100k, False: 9.12k]
  ------------------
  100|  9.12k|}

protocol.c:Curl_raw_tolower:
   43|  69.6k|{
   44|  69.6k|  return (char)Curl_tolowermap[(unsigned char)in];
   45|  69.6k|}
strcase.c:Curl_raw_tolower:
   43|   109k|{
   44|   109k|  return (char)Curl_tolowermap[(unsigned char)in];
   45|   109k|}
strequal.c:Curl_raw_toupper:
   38|   232k|{
   39|   232k|  return (char)Curl_touppermap[(unsigned char)in];
   40|   232k|}
urlapi.c:Curl_raw_tolower:
   43|  22.4k|{
   44|  22.4k|  return (char)Curl_tolowermap[(unsigned char)in];
   45|  22.4k|}

curl_strequal:
   77|  19.7k|{
   78|  19.7k|  if(s1 && s2)
  ------------------
  |  Branch (78:6): [True: 19.7k, False: 1]
  |  Branch (78:12): [True: 19.7k, False: 0]
  ------------------
   79|       |    /* both pointers point to something then compare them */
   80|  19.7k|    return casecompare(s1, s2);
   81|       |
   82|       |  /* if both pointers are NULL then treat them as equal */
   83|      1|  return NULL == s1 && NULL == s2;
  ------------------
  |  Branch (83:10): [True: 1, False: 0]
  |  Branch (83:24): [True: 1, False: 0]
  ------------------
   84|  19.7k|}
curl_strnequal:
   88|  21.5k|{
   89|  21.5k|  if(s1 && s2)
  ------------------
  |  Branch (89:6): [True: 21.5k, False: 0]
  |  Branch (89:12): [True: 21.5k, False: 0]
  ------------------
   90|       |    /* both pointers point to something then compare them */
   91|  21.5k|    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|  21.5k|}
strequal.c:casecompare:
   36|  19.7k|{
   37|  23.0k|  while(*first) {
  ------------------
  |  Branch (37:9): [True: 23.0k, False: 2]
  ------------------
   38|  23.0k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (38:8): [True: 19.7k, False: 3.28k]
  ------------------
   39|       |      /* get out of the loop as soon as they do not match */
   40|  19.7k|      return 0;
   41|  3.28k|    first++;
   42|  3.28k|    second++;
   43|  3.28k|  }
   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|      2|  return !*first == !*second;
   49|  19.7k|}
strequal.c:ncasecompare:
   52|  21.5k|{
   53|   110k|  while(*first && max) {
  ------------------
  |  Branch (53:9): [True: 93.4k, False: 17.2k]
  |  Branch (53:19): [True: 92.9k, False: 515]
  ------------------
   54|  92.9k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (54:8): [True: 3.75k, False: 89.2k]
  ------------------
   55|  3.75k|      return 0;
   56|  89.2k|    max--;
   57|  89.2k|    first++;
   58|  89.2k|    second++;
   59|  89.2k|  }
   60|  17.7k|  if(max == 0)
  ------------------
  |  Branch (60:6): [True: 17.7k, False: 0]
  ------------------
   61|  17.7k|    return 1; /* they are equal this far */
   62|       |
   63|      0|  return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
   64|  17.7k|}

curl_url_strerror:
  421|    489|{
  422|    489|#ifdef CURLVERBOSE
  423|    489|  switch(error) {
  ------------------
  |  Branch (423:10): [True: 489, False: 0]
  ------------------
  424|      0|  case CURLUE_OK:
  ------------------
  |  Branch (424:3): [True: 0, False: 489]
  ------------------
  425|      0|    return "No error";
  426|       |
  427|      0|  case CURLUE_BAD_HANDLE:
  ------------------
  |  Branch (427:3): [True: 0, False: 489]
  ------------------
  428|      0|    return "An invalid CURLU pointer was passed as argument";
  429|       |
  430|      0|  case CURLUE_BAD_PARTPOINTER:
  ------------------
  |  Branch (430:3): [True: 0, False: 489]
  ------------------
  431|      0|    return "An invalid 'part' argument was passed as argument";
  432|       |
  433|      0|  case CURLUE_MALFORMED_INPUT:
  ------------------
  |  Branch (433:3): [True: 0, False: 489]
  ------------------
  434|      0|    return "Malformed input to a URL function";
  435|       |
  436|     15|  case CURLUE_BAD_PORT_NUMBER:
  ------------------
  |  Branch (436:3): [True: 15, False: 474]
  ------------------
  437|     15|    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: 489]
  ------------------
  440|      0|    return "Unsupported URL scheme";
  441|       |
  442|      0|  case CURLUE_URLDECODE:
  ------------------
  |  Branch (442:3): [True: 0, False: 489]
  ------------------
  443|      0|    return "URL decode error, most likely because of rubbish in the input";
  444|       |
  445|      0|  case CURLUE_OUT_OF_MEMORY:
  ------------------
  |  Branch (445:3): [True: 0, False: 489]
  ------------------
  446|      0|    return "A memory function failed";
  447|       |
  448|      0|  case CURLUE_USER_NOT_ALLOWED:
  ------------------
  |  Branch (448:3): [True: 0, False: 489]
  ------------------
  449|      0|    return "Credentials was passed in the URL when prohibited";
  450|       |
  451|      0|  case CURLUE_UNKNOWN_PART:
  ------------------
  |  Branch (451:3): [True: 0, False: 489]
  ------------------
  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: 489]
  ------------------
  455|      0|    return "No scheme present";
  456|       |
  457|      0|  case CURLUE_NO_USER:
  ------------------
  |  Branch (457:3): [True: 0, False: 489]
  ------------------
  458|      0|    return "No user present";
  459|       |
  460|      0|  case CURLUE_NO_PASSWORD:
  ------------------
  |  Branch (460:3): [True: 0, False: 489]
  ------------------
  461|      0|    return "No password present";
  462|       |
  463|      0|  case CURLUE_NO_OPTIONS:
  ------------------
  |  Branch (463:3): [True: 0, False: 489]
  ------------------
  464|      0|    return "No options present";
  465|       |
  466|    110|  case CURLUE_NO_HOST:
  ------------------
  |  Branch (466:3): [True: 110, False: 379]
  ------------------
  467|    110|    return "No host present";
  468|       |
  469|      0|  case CURLUE_NO_PORT:
  ------------------
  |  Branch (469:3): [True: 0, False: 489]
  ------------------
  470|      0|    return "No port number present";
  471|       |
  472|      0|  case CURLUE_NO_QUERY:
  ------------------
  |  Branch (472:3): [True: 0, False: 489]
  ------------------
  473|      0|    return "No query present";
  474|       |
  475|      0|  case CURLUE_NO_FRAGMENT:
  ------------------
  |  Branch (475:3): [True: 0, False: 489]
  ------------------
  476|      0|    return "No fragment present";
  477|       |
  478|      0|  case CURLUE_NO_ZONEID:
  ------------------
  |  Branch (478:3): [True: 0, False: 489]
  ------------------
  479|      0|    return "No zoneid present";
  480|       |
  481|      0|  case CURLUE_BAD_LOGIN:
  ------------------
  |  Branch (481:3): [True: 0, False: 489]
  ------------------
  482|      0|    return "Bad login";
  483|       |
  484|    153|  case CURLUE_BAD_IPV6:
  ------------------
  |  Branch (484:3): [True: 153, False: 336]
  ------------------
  485|    153|    return "Bad IPv6 address";
  486|       |
  487|    206|  case CURLUE_BAD_HOSTNAME:
  ------------------
  |  Branch (487:3): [True: 206, False: 283]
  ------------------
  488|    206|    return "Bad hostname";
  489|       |
  490|      0|  case CURLUE_BAD_FILE_URL:
  ------------------
  |  Branch (490:3): [True: 0, False: 489]
  ------------------
  491|      0|    return "Bad file:// URL";
  492|       |
  493|      1|  case CURLUE_BAD_SLASHES:
  ------------------
  |  Branch (493:3): [True: 1, False: 488]
  ------------------
  494|      1|    return "Unsupported number of slashes following scheme";
  495|       |
  496|      0|  case CURLUE_BAD_SCHEME:
  ------------------
  |  Branch (496:3): [True: 0, False: 489]
  ------------------
  497|      0|    return "Bad scheme";
  498|       |
  499|      1|  case CURLUE_BAD_PATH:
  ------------------
  |  Branch (499:3): [True: 1, False: 488]
  ------------------
  500|      1|    return "Bad path";
  501|       |
  502|      0|  case CURLUE_BAD_FRAGMENT:
  ------------------
  |  Branch (502:3): [True: 0, False: 489]
  ------------------
  503|      0|    return "Bad fragment";
  504|       |
  505|      0|  case CURLUE_BAD_QUERY:
  ------------------
  |  Branch (505:3): [True: 0, False: 489]
  ------------------
  506|      0|    return "Bad query";
  507|       |
  508|      0|  case CURLUE_BAD_PASSWORD:
  ------------------
  |  Branch (508:3): [True: 0, False: 489]
  ------------------
  509|      0|    return "Bad password";
  510|       |
  511|      2|  case CURLUE_BAD_USER:
  ------------------
  |  Branch (511:3): [True: 2, False: 487]
  ------------------
  512|      2|    return "Bad user";
  513|       |
  514|      0|  case CURLUE_LACKS_IDN:
  ------------------
  |  Branch (514:3): [True: 0, False: 489]
  ------------------
  515|      0|    return "libcurl lacks IDN support";
  516|       |
  517|      0|  case CURLUE_TOO_LARGE:
  ------------------
  |  Branch (517:3): [True: 0, False: 489]
  ------------------
  518|      0|    return "A value or data field is larger than allowed";
  519|       |
  520|      1|  case CURLUE_BACKSLASH:
  ------------------
  |  Branch (520:3): [True: 1, False: 488]
  ------------------
  521|      1|    return "Found a backslash where a forward slash was expected";
  522|       |
  523|      0|  case CURLUE_LAST:
  ------------------
  |  Branch (523:3): [True: 0, False: 489]
  ------------------
  524|      0|    break;
  525|    489|  }
  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|    489|}

telnet.c:telnet_do:
 1220|  3.04k|{
 1221|  3.04k|  CURLcode result;
 1222|  3.04k|  struct connectdata *conn = data->conn;
 1223|  3.04k|  curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
 1224|       |#ifdef USE_WINSOCK
 1225|       |  WSAEVENT event_handle;
 1226|       |  WSANETWORKEVENTS events;
 1227|       |  HANDLE stdin_handle;
 1228|       |  HANDLE objs[2];
 1229|       |  DWORD obj_count;
 1230|       |  DWORD wait_timeout;
 1231|       |  DWORD readfile_read;
 1232|       |#else
 1233|  3.04k|  timediff_t interval_ms;
 1234|  3.04k|  struct pollfd pfd[2];
 1235|  3.04k|  int poll_cnt;
 1236|  3.04k|  ssize_t snread;
 1237|  3.04k|#endif
 1238|  3.04k|  bool keepon = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1239|  3.04k|  char buffer[4 * 1024];
 1240|  3.04k|  struct TELNET *tn;
 1241|       |
 1242|  3.04k|  *done = TRUE; /* unconditionally */
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1243|       |
 1244|  3.04k|  result = init_telnet(data);
 1245|  3.04k|  if(result)
  ------------------
  |  Branch (1245:6): [True: 0, False: 3.04k]
  ------------------
 1246|      0|    return result;
 1247|       |
 1248|  3.04k|  tn = Curl_meta_get(data, CURL_META_TELNET_EASY);
  ------------------
  |  |   91|  3.04k|#define CURL_META_TELNET_EASY   "meta:proto:telnet:easy"
  ------------------
 1249|  3.04k|  if(!tn)
  ------------------
  |  Branch (1249:6): [True: 0, False: 3.04k]
  ------------------
 1250|      0|    return CURLE_FAILED_INIT;
 1251|       |
 1252|  3.04k|  result = check_telnet_options(data, tn);
 1253|  3.04k|  if(result)
  ------------------
  |  Branch (1253:6): [True: 127, False: 2.91k]
  ------------------
 1254|    127|    return result;
 1255|       |
 1256|       |#ifdef USE_WINSOCK
 1257|       |  /* We want to wait for both stdin and the socket. Since
 1258|       |   * the select() function in Winsock only works on sockets
 1259|       |   * we have to use the WaitForMultipleObjects() call.
 1260|       |   */
 1261|       |
 1262|       |  /* First, create a sockets event object */
 1263|       |  event_handle = WSACreateEvent();
 1264|       |  if(event_handle == WSA_INVALID_EVENT) {
 1265|       |    failf(data, "WSACreateEvent failed (%d)", SOCKERRNO);
 1266|       |    return CURLE_FAILED_INIT;
 1267|       |  }
 1268|       |
 1269|       |  /* Tell Winsock what events we want to listen to */
 1270|       |  if(WSAEventSelect(sockfd, event_handle, FD_READ | FD_CLOSE)) {
 1271|       |    WSACloseEvent(event_handle);
 1272|       |    return CURLE_RECV_ERROR;
 1273|       |  }
 1274|       |
 1275|       |  /* Then get the Windows file handle for stdin */
 1276|       |  stdin_handle = GetStdHandle(STD_INPUT_HANDLE);
 1277|       |
 1278|       |  /* Create the list of objects to wait for */
 1279|       |  objs[0] = event_handle;
 1280|       |  objs[1] = stdin_handle;
 1281|       |
 1282|       |  /* If stdin_handle is a pipe, use PeekNamedPipe() method to check it,
 1283|       |     else use the old WaitForMultipleObjects() way */
 1284|       |  if(GetFileType(stdin_handle) == FILE_TYPE_PIPE || data->set.is_fread_set) {
 1285|       |    /* Do not wait for stdin_handle, wait for event_handle */
 1286|       |    obj_count = 1;
 1287|       |    /* Check stdin_handle per 100 milliseconds */
 1288|       |    wait_timeout = 100;
 1289|       |  }
 1290|       |  else {
 1291|       |    obj_count = 2;
 1292|       |    wait_timeout = 1000;
 1293|       |  }
 1294|       |
 1295|       |  /* Keep on listening and act on events */
 1296|       |  while(keepon) {
 1297|       |    const DWORD buf_size = (DWORD)sizeof(buffer);
 1298|       |    DWORD waitret = WaitForMultipleObjects(obj_count, objs,
 1299|       |                                           FALSE, wait_timeout);
 1300|       |    switch(waitret) {
 1301|       |
 1302|       |    case WAIT_TIMEOUT: {
 1303|       |      for(;;) {
 1304|       |        if(data->set.is_fread_set) {
 1305|       |          size_t n;
 1306|       |          /* read from user-supplied method */
 1307|       |          n = data->state.fread_func(buffer, 1, buf_size, data->state.in);
 1308|       |          if(n == CURL_READFUNC_ABORT) {
 1309|       |            keepon = FALSE;
 1310|       |            result = CURLE_READ_ERROR;
 1311|       |            break;
 1312|       |          }
 1313|       |
 1314|       |          if(n == CURL_READFUNC_PAUSE)
 1315|       |            break;
 1316|       |
 1317|       |          if(n == 0)                        /* no bytes */
 1318|       |            break;
 1319|       |
 1320|       |          /* fall through with number of bytes read */
 1321|       |          readfile_read = (DWORD)n;
 1322|       |        }
 1323|       |        else {
 1324|       |          /* read from stdin */
 1325|       |          if(!PeekNamedPipe(stdin_handle, NULL, 0, NULL,
 1326|       |                            &readfile_read, NULL)) {
 1327|       |            keepon = FALSE;
 1328|       |            result = CURLE_READ_ERROR;
 1329|       |            break;
 1330|       |          }
 1331|       |
 1332|       |          if(!readfile_read)
 1333|       |            break;
 1334|       |
 1335|       |          if(!ReadFile(stdin_handle, buffer, buf_size, &readfile_read, NULL)) {
 1336|       |            keepon = FALSE;
 1337|       |            result = CURLE_READ_ERROR;
 1338|       |            break;
 1339|       |          }
 1340|       |        }
 1341|       |
 1342|       |        result = send_telnet_data(data, tn, buffer, readfile_read);
 1343|       |        if(result) {
 1344|       |          keepon = FALSE;
 1345|       |          break;
 1346|       |        }
 1347|       |      }
 1348|       |    }
 1349|       |    break;
 1350|       |
 1351|       |    case WAIT_OBJECT_0 + 1: {
 1352|       |      if(!ReadFile(stdin_handle, buffer, buf_size, &readfile_read, NULL)) {
 1353|       |        keepon = FALSE;
 1354|       |        result = CURLE_READ_ERROR;
 1355|       |        break;
 1356|       |      }
 1357|       |
 1358|       |      result = send_telnet_data(data, tn, buffer, readfile_read);
 1359|       |      if(result) {
 1360|       |        keepon = FALSE;
 1361|       |        break;
 1362|       |      }
 1363|       |    }
 1364|       |    break;
 1365|       |
 1366|       |    case WAIT_OBJECT_0: {
 1367|       |      events.lNetworkEvents = 0;
 1368|       |      if(WSAEnumNetworkEvents(sockfd, event_handle, &events) != 0) {
 1369|       |        int sockerr = SOCKERRNO;
 1370|       |        if(sockerr != SOCKEINPROGRESS) {
 1371|       |          infof(data, "WSAEnumNetworkEvents failed (%d)", sockerr);
 1372|       |          keepon = FALSE;
 1373|       |          result = CURLE_READ_ERROR;
 1374|       |        }
 1375|       |        break;
 1376|       |      }
 1377|       |      if(events.lNetworkEvents & FD_READ) {
 1378|       |        /* read data from network */
 1379|       |        size_t nread;
 1380|       |        result = Curl_xfer_recv(data, buffer, sizeof(buffer), &nread);
 1381|       |        /* read would have blocked. Loop again */
 1382|       |        if(result == CURLE_AGAIN)
 1383|       |          break;
 1384|       |        /* returned not-zero, this an error */
 1385|       |        else if(result) {
 1386|       |          keepon = FALSE;
 1387|       |          break;
 1388|       |        }
 1389|       |        /* returned zero but actually received 0 or less here,
 1390|       |           the server closed the connection and we bail out */
 1391|       |        else if(!nread) {
 1392|       |          keepon = FALSE;
 1393|       |          break;
 1394|       |        }
 1395|       |
 1396|       |        result = telrcv(data, tn, (unsigned char *)buffer, nread);
 1397|       |        if(result) {
 1398|       |          keepon = FALSE;
 1399|       |          break;
 1400|       |        }
 1401|       |
 1402|       |        /* Negotiate if the peer has started negotiating,
 1403|       |           otherwise do not. We do not want to speak telnet with
 1404|       |           non-telnet servers, like POP or SMTP. */
 1405|       |        if(tn->please_negotiate && !tn->already_negotiated) {
 1406|       |          telnet_negotiate(data, tn);
 1407|       |          tn->already_negotiated = 1;
 1408|       |        }
 1409|       |      }
 1410|       |      if(events.lNetworkEvents & FD_CLOSE) {
 1411|       |        keepon = FALSE;
 1412|       |      }
 1413|       |      break;
 1414|       |    }
 1415|       |    } /* switch */
 1416|       |
 1417|       |    if(Curl_timeleft_ms(data) < 0) {
 1418|       |      failf(data, "Time-out");
 1419|       |      result = CURLE_OPERATION_TIMEDOUT;
 1420|       |      keepon = FALSE;
 1421|       |    }
 1422|       |  }
 1423|       |
 1424|       |  /* We called WSACreateEvent, so call WSACloseEvent */
 1425|       |  if(!WSACloseEvent(event_handle)) {
 1426|       |    infof(data, "WSACloseEvent failed (%d)", SOCKERRNO);
 1427|       |  }
 1428|       |#else
 1429|  2.91k|  pfd[0].fd = sockfd;
 1430|  2.91k|  pfd[0].events = POLLIN;
 1431|       |
 1432|  2.91k|  if(data->set.is_fread_set) {
  ------------------
  |  Branch (1432:6): [True: 2.91k, False: 0]
  ------------------
 1433|  2.91k|    poll_cnt = 1;
 1434|  2.91k|    interval_ms = 100; /* poll user-supplied read function */
 1435|  2.91k|  }
 1436|      0|  else {
 1437|       |    /* really using fread, so infile is a FILE* */
 1438|      0|    pfd[1].fd = fileno((FILE *)data->state.in);
 1439|      0|    pfd[1].events = POLLIN;
 1440|      0|    poll_cnt = 2;
 1441|      0|    interval_ms = 1 * 1000;
 1442|      0|    if(pfd[1].fd < 0) {
  ------------------
  |  Branch (1442:8): [True: 0, False: 0]
  ------------------
 1443|      0|      failf(data, "cannot read input");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1444|      0|      result = CURLE_RECV_ERROR;
 1445|      0|      keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1446|      0|    }
 1447|      0|  }
 1448|       |
 1449|  7.02k|  while(keepon) {
  ------------------
  |  Branch (1449:9): [True: 4.11k, False: 2.91k]
  ------------------
 1450|  4.11k|    DEBUGF(infof(data, "telnet_do, poll %d fds", poll_cnt));
  ------------------
  |  | 1013|  41.1k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 4.11k, False: 0]
  |  |  |  Branch (1013:19): [True: 4.11k, False: 0]
  |  |  |  Branch (1013:19): [True: 4.11k, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 4.11k]
  |  |  ------------------
  ------------------
 1451|  4.11k|    switch(Curl_poll(pfd, (unsigned int)poll_cnt, interval_ms)) {
 1452|      0|    case -1:                    /* error, stop reading */
  ------------------
  |  Branch (1452:5): [True: 0, False: 4.11k]
  ------------------
 1453|      0|      keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1454|      0|      continue;
 1455|      0|    case 0:                     /* timeout */
  ------------------
  |  Branch (1455:5): [True: 0, False: 4.11k]
  ------------------
 1456|      0|      pfd[0].revents = 0;
 1457|      0|      pfd[1].revents = 0;
 1458|      0|      FALLTHROUGH();
  ------------------
  |  |  767|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1459|  4.11k|    default:                    /* read! */
  ------------------
  |  Branch (1459:5): [True: 4.11k, False: 0]
  ------------------
 1460|  4.11k|      if(pfd[0].revents & POLLIN) {
  ------------------
  |  Branch (1460:10): [True: 4.11k, False: 0]
  ------------------
 1461|       |        /* read data from network */
 1462|  4.11k|        size_t nread;
 1463|  4.11k|        result = Curl_xfer_recv(data, buffer, sizeof(buffer), &nread);
 1464|       |        /* read would have blocked. Loop again */
 1465|  4.11k|        if(result == CURLE_AGAIN)
  ------------------
  |  Branch (1465:12): [True: 0, False: 4.11k]
  ------------------
 1466|      0|          break;
 1467|       |        /* returned not-zero, this an error */
 1468|  4.11k|        if(result) {
  ------------------
  |  Branch (1468:12): [True: 0, False: 4.11k]
  ------------------
 1469|      0|          keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1470|       |          /* In test 1452, macOS sees a ECONNRESET sometimes? Is this the
 1471|       |           * telnet test server not shutting down the socket in a clean way?
 1472|       |           * Seems to be timing related, happens more on slow debug build */
 1473|      0|          if(data->state.os_errno == SOCKECONNRESET) {
  ------------------
  |  | 1073|      0|#define SOCKECONNRESET    ECONNRESET
  ------------------
  |  Branch (1473:14): [True: 0, False: 0]
  ------------------
 1474|      0|            DEBUGF(infof(data, "telnet_do, unexpected ECONNRESET on recv"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1475|      0|          }
 1476|      0|          break;
 1477|      0|        }
 1478|       |        /* returned zero but actually received 0 or less here,
 1479|       |           the server closed the connection and we bail out */
 1480|  4.11k|        else if(!nread) {
  ------------------
  |  Branch (1480:17): [True: 2.86k, False: 1.25k]
  ------------------
 1481|  2.86k|          keepon = FALSE;
  ------------------
  |  | 1000|  2.86k|#define FALSE false
  ------------------
 1482|  2.86k|          break;
 1483|  2.86k|        }
 1484|       |
 1485|  1.25k|        Curl_pgrs_download_inc(data, nread);
 1486|  1.25k|        result = telrcv(data, tn, (unsigned char *)buffer, nread);
 1487|  1.25k|        if(result) {
  ------------------
  |  Branch (1487:12): [True: 50, False: 1.20k]
  ------------------
 1488|     50|          keepon = FALSE;
  ------------------
  |  | 1000|     50|#define FALSE false
  ------------------
 1489|     50|          break;
 1490|     50|        }
 1491|       |
 1492|       |        /* Negotiate if the peer has started negotiating,
 1493|       |           otherwise do not. We do not want to speak telnet with
 1494|       |           non-telnet servers, like POP or SMTP. */
 1495|  1.20k|        if(tn->please_negotiate && !tn->already_negotiated) {
  ------------------
  |  Branch (1495:12): [True: 302, False: 899]
  |  Branch (1495:36): [True: 275, False: 27]
  ------------------
 1496|    275|          telnet_negotiate(data, tn);
 1497|    275|          tn->already_negotiated = 1;
 1498|    275|        }
 1499|  1.20k|      }
 1500|       |
 1501|  1.20k|      snread = 0;
 1502|  1.20k|      if(poll_cnt == 2) {
  ------------------
  |  Branch (1502:10): [True: 0, False: 1.20k]
  ------------------
 1503|      0|        if(pfd[1].revents & POLLIN) { /* read from in file */
  ------------------
  |  Branch (1503:12): [True: 0, False: 0]
  ------------------
 1504|      0|          snread = read(pfd[1].fd, buffer, sizeof(buffer));
 1505|      0|        }
 1506|      0|      }
 1507|  1.20k|      else {
 1508|       |        /* read from user-supplied method */
 1509|  1.20k|        snread = (int)data->state.fread_func(buffer, 1, sizeof(buffer),
 1510|  1.20k|                                             data->state.in);
 1511|  1.20k|        if(snread == CURL_READFUNC_ABORT) {
  ------------------
  |  |  392|  1.20k|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (1511:12): [True: 6, False: 1.19k]
  ------------------
 1512|      6|          keepon = FALSE;
  ------------------
  |  | 1000|      6|#define FALSE false
  ------------------
 1513|      6|          break;
 1514|      6|        }
 1515|  1.19k|        if(snread == CURL_READFUNC_PAUSE)
  ------------------
  |  |  395|  1.19k|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (1515:12): [True: 4, False: 1.19k]
  ------------------
 1516|      4|          break;
 1517|  1.19k|      }
 1518|       |
 1519|  1.19k|      if(snread > 0) {
  ------------------
  |  Branch (1519:10): [True: 111, False: 1.08k]
  ------------------
 1520|    111|        result = send_telnet_data(data, tn, buffer, snread);
 1521|    111|        if(result) {
  ------------------
  |  Branch (1521:12): [True: 0, False: 111]
  ------------------
 1522|      0|          keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1523|      0|          break;
 1524|      0|        }
 1525|    111|        Curl_pgrs_upload_inc(data, (size_t)snread);
 1526|    111|      }
 1527|  1.08k|      else if(snread < 0)
  ------------------
  |  Branch (1527:15): [True: 0, False: 1.08k]
  ------------------
 1528|      0|        keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1529|       |
 1530|  1.19k|      break;
 1531|  4.11k|    } /* poll switch statement */
 1532|       |
 1533|  4.11k|    if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (1533:8): [True: 0, False: 4.11k]
  ------------------
 1534|      0|      failf(data, "Time-out");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1535|      0|      result = CURLE_OPERATION_TIMEDOUT;
 1536|      0|      keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1537|      0|    }
 1538|       |
 1539|  4.11k|    if(!result) {
  ------------------
  |  Branch (1539:8): [True: 4.06k, False: 50]
  ------------------
 1540|  4.06k|      result = Curl_pgrsUpdate(data);
 1541|  4.06k|      if(result)
  ------------------
  |  Branch (1541:10): [True: 0, False: 4.06k]
  ------------------
 1542|      0|        keepon = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1543|  4.06k|    }
 1544|  4.11k|  }
 1545|  2.91k|#endif
 1546|       |  /* mark this as "no further transfer wanted" */
 1547|  2.91k|  Curl_xfer_setup_nop(data);
 1548|       |
 1549|  2.91k|  return result;
 1550|  2.91k|}
telnet.c:init_telnet:
  181|  3.04k|{
  182|  3.04k|  struct TELNET *tn;
  183|       |
  184|  3.04k|  tn = curlx_calloc(1, sizeof(struct TELNET));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  185|  3.04k|  if(!tn)
  ------------------
  |  Branch (185:6): [True: 0, False: 3.04k]
  ------------------
  186|      0|    return CURLE_OUT_OF_MEMORY;
  187|       |
  188|  3.04k|  curlx_dyn_init(&tn->out, 0xffff);
  189|       |
  190|  3.04k|  tn->telrcv_state = CURL_TS_DATA;
  191|       |
  192|       |  /* Init suboptions */
  193|  3.04k|  CURL_SB_CLEAR(tn);
  ------------------
  |  |   62|  3.04k|#define CURL_SB_CLEAR(x) (x)->subpointer = (x)->subbuffer
  ------------------
  194|       |
  195|       |  /* Set the options we want by default */
  196|  3.04k|  tn->us_preferred[CURL_TELOPT_SGA] = CURL_YES;
  ------------------
  |  |   32|  3.04k|#define CURL_TELOPT_SGA         3   /* Suppress Go Ahead */
  ------------------
                tn->us_preferred[CURL_TELOPT_SGA] = CURL_YES;
  ------------------
  |  |   83|  3.04k|#define CURL_YES         1
  ------------------
  197|  3.04k|  tn->him_preferred[CURL_TELOPT_SGA] = CURL_YES;
  ------------------
  |  |   32|  3.04k|#define CURL_TELOPT_SGA         3   /* Suppress Go Ahead */
  ------------------
                tn->him_preferred[CURL_TELOPT_SGA] = CURL_YES;
  ------------------
  |  |   83|  3.04k|#define CURL_YES         1
  ------------------
  198|       |
  199|       |  /* To be compliant with previous releases of libcurl we enable this option
  200|       |     by default. This behavior can be changed with the "BINARY" option in
  201|       |     CURLOPT_TELNETOPTIONS */
  202|  3.04k|  tn->us_preferred[CURL_TELOPT_BINARY] = CURL_YES;
  ------------------
  |  |   30|  3.04k|#define CURL_TELOPT_BINARY      0   /* binary 8-bit data */
  ------------------
                tn->us_preferred[CURL_TELOPT_BINARY] = CURL_YES;
  ------------------
  |  |   83|  3.04k|#define CURL_YES         1
  ------------------
  203|  3.04k|  tn->him_preferred[CURL_TELOPT_BINARY] = CURL_YES;
  ------------------
  |  |   30|  3.04k|#define CURL_TELOPT_BINARY      0   /* binary 8-bit data */
  ------------------
                tn->him_preferred[CURL_TELOPT_BINARY] = CURL_YES;
  ------------------
  |  |   83|  3.04k|#define CURL_YES         1
  ------------------
  204|       |
  205|       |  /* We must allow the server to echo what we sent but it is not necessary
  206|       |     to request the server to do so (it might force the server to close
  207|       |     the connection). Hence, we ignore ECHO in the negotiate function */
  208|  3.04k|  tn->him_preferred[CURL_TELOPT_ECHO] = CURL_YES;
  ------------------
  |  |   31|  3.04k|#define CURL_TELOPT_ECHO        1   /* echo */
  ------------------
                tn->him_preferred[CURL_TELOPT_ECHO] = CURL_YES;
  ------------------
  |  |   83|  3.04k|#define CURL_YES         1
  ------------------
  209|       |
  210|       |  /* Set the subnegotiation fields to send information after negotiation
  211|       |     passed (do/will)
  212|       |
  213|       |     Default values are (0,0) initialized by calloc.
  214|       |     According to the RFC1013 it is valid:
  215|       |     A value equal to zero is acceptable for the width (or height), and means
  216|       |     that no character width (or height) is being sent. In this case, the width
  217|       |     (or height) that will be assumed by the Telnet server is operating system
  218|       |     specific (it will probably be based upon the terminal type information
  219|       |     that may have been sent using the TERMINAL TYPE Telnet option). */
  220|  3.04k|  tn->subnegotiation[CURL_TELOPT_NAWS] = CURL_YES;
  ------------------
  |  |   35|  3.04k|#define CURL_TELOPT_NAWS        31  /* Negotiate About Window Size */
  ------------------
                tn->subnegotiation[CURL_TELOPT_NAWS] = CURL_YES;
  ------------------
  |  |   83|  3.04k|#define CURL_YES         1
  ------------------
  221|       |
  222|  3.04k|  return Curl_meta_set(data, CURL_META_TELNET_EASY, tn, telnet_easy_dtor);
  ------------------
  |  |   91|  3.04k|#define CURL_META_TELNET_EASY   "meta:proto:telnet:easy"
  ------------------
  223|  3.04k|}
telnet.c:telnet_easy_dtor:
  171|  3.04k|{
  172|  3.04k|  struct TELNET *tn = entry;
  173|  3.04k|  (void)key;
  174|  3.04k|  (void)klen;
  175|  3.04k|  curl_slist_free_all(tn->telnet_vars);
  176|  3.04k|  curlx_dyn_free(&tn->out);
  177|  3.04k|  curlx_free(tn);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  178|  3.04k|}
telnet.c:check_telnet_options:
  830|  3.04k|{
  831|  3.04k|  struct curl_slist *head;
  832|  3.04k|  struct curl_slist *beg;
  833|  3.04k|  CURLcode result = CURLE_OK;
  834|       |
  835|       |  /* Add the username as an environment variable if it
  836|       |     was given on the command line */
  837|  3.04k|  if(data->state.creds) {
  ------------------
  |  Branch (837:6): [True: 331, False: 2.71k]
  ------------------
  838|    331|    char buffer[256];
  839|    331|    if(str_is_nonascii(Curl_creds_user(data->conn->creds))) {
  ------------------
  |  |   81|    331|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (81:43): [True: 331, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (839:8): [True: 30, False: 301]
  ------------------
  840|     30|      DEBUGF(infof(data, "set a non ASCII username in telnet"));
  ------------------
  |  | 1013|    300|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 30, False: 0]
  |  |  |  Branch (1013:19): [True: 30, False: 0]
  |  |  |  Branch (1013:19): [True: 30, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 30]
  |  |  ------------------
  ------------------
  841|     30|      return CURLE_BAD_FUNCTION_ARGUMENT;
  842|     30|    }
  843|    301|    curl_msnprintf(buffer, sizeof(buffer), "USER,%s",
  844|    301|                   Curl_creds_user(data->conn->creds));
  ------------------
  |  |   81|    301|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (81:43): [True: 301, False: 0]
  |  |  ------------------
  ------------------
  845|    301|    beg = curl_slist_append(tn->telnet_vars, buffer);
  846|    301|    if(!beg) {
  ------------------
  |  Branch (846:8): [True: 0, False: 301]
  ------------------
  847|      0|      curl_slist_free_all(tn->telnet_vars);
  848|      0|      tn->telnet_vars = NULL;
  849|      0|      return CURLE_OUT_OF_MEMORY;
  850|      0|    }
  851|    301|    tn->telnet_vars = beg;
  852|    301|    tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;
  ------------------
  |  |   37|    301|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  ------------------
                  tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;
  ------------------
  |  |   83|    301|#define CURL_YES         1
  ------------------
  853|    301|  }
  854|       |
  855|  3.63k|  for(head = data->set.telnet_options; head && !result; head = head->next) {
  ------------------
  |  Branch (855:40): [True: 651, False: 2.98k]
  |  Branch (855:48): [True: 622, False: 29]
  ------------------
  856|    622|    size_t olen;
  857|    622|    const char *option = head->data;
  858|    622|    const char *arg;
  859|    622|    const char *sep = strchr(option, '=');
  860|    622|    if(sep) {
  ------------------
  |  Branch (860:8): [True: 571, False: 51]
  ------------------
  861|    571|      olen = sep - option;
  862|    571|      arg = ++sep;
  863|    571|      if(str_is_nonascii(arg))
  ------------------
  |  Branch (863:10): [True: 34, False: 537]
  ------------------
  864|     34|        continue;
  865|    537|      switch(olen) {
  866|     48|      case 5:
  ------------------
  |  Branch (866:7): [True: 48, False: 489]
  ------------------
  867|       |        /* Terminal type */
  868|     48|        if(curl_strnequal(option, "TTYPE", 5)) {
  ------------------
  |  Branch (868:12): [True: 47, False: 1]
  ------------------
  869|     47|          tn->subopt_ttype = arg;
  870|     47|          tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES;
  ------------------
  |  |   34|     47|#define CURL_TELOPT_TTYPE       24  /* Terminal TYPE */
  ------------------
                        tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES;
  ------------------
  |  |   83|     47|#define CURL_YES         1
  ------------------
  871|     47|          break;
  872|     47|        }
  873|      1|        result = CURLE_UNKNOWN_OPTION;
  874|      1|        break;
  875|       |
  876|     50|      case 8:
  ------------------
  |  Branch (876:7): [True: 50, False: 487]
  ------------------
  877|       |        /* Display variable */
  878|     50|        if(curl_strnequal(option, "XDISPLOC", 8)) {
  ------------------
  |  Branch (878:12): [True: 49, False: 1]
  ------------------
  879|     49|          tn->subopt_xdisploc = arg;
  880|     49|          tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES;
  ------------------
  |  |   36|     49|#define CURL_TELOPT_XDISPLOC    35  /* X DISPlay LOCation */
  ------------------
                        tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES;
  ------------------
  |  |   83|     49|#define CURL_YES         1
  ------------------
  881|     49|          break;
  882|     49|        }
  883|      1|        result = CURLE_UNKNOWN_OPTION;
  884|      1|        break;
  885|       |
  886|    204|      case 7:
  ------------------
  |  Branch (886:7): [True: 204, False: 333]
  ------------------
  887|       |        /* Environment variable */
  888|    204|        if(curl_strnequal(option, "NEW_ENV", 7)) {
  ------------------
  |  Branch (888:12): [True: 202, False: 2]
  ------------------
  889|    202|          beg = curl_slist_append(tn->telnet_vars, arg);
  890|    202|          if(!beg) {
  ------------------
  |  Branch (890:14): [True: 0, False: 202]
  ------------------
  891|      0|            result = CURLE_OUT_OF_MEMORY;
  892|      0|            break;
  893|      0|          }
  894|    202|          tn->telnet_vars = beg;
  895|    202|          tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;
  ------------------
  |  |   37|    202|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  ------------------
                        tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;
  ------------------
  |  |   83|    202|#define CURL_YES         1
  ------------------
  896|    202|        }
  897|      2|        else
  898|      2|          result = CURLE_UNKNOWN_OPTION;
  899|    204|        break;
  900|       |
  901|    204|      case 2:
  ------------------
  |  Branch (901:7): [True: 106, False: 431]
  ------------------
  902|       |        /* Window Size */
  903|    106|        if(curl_strnequal(option, "WS", 2)) {
  ------------------
  |  Branch (903:12): [True: 103, False: 3]
  ------------------
  904|    103|          const char *p = arg;
  905|    103|          curl_off_t x = 0;
  906|    103|          curl_off_t y = 0;
  907|    103|          if(curlx_str_number(&p, &x, 0xffff) ||
  ------------------
  |  Branch (907:14): [True: 5, False: 98]
  ------------------
  908|     98|             curlx_str_single(&p, 'x') ||
  ------------------
  |  Branch (908:14): [True: 12, False: 86]
  ------------------
  909|     86|             curlx_str_number(&p, &y, 0xffff)) {
  ------------------
  |  Branch (909:14): [True: 7, False: 79]
  ------------------
  910|     24|            failf(data, "Syntax error in telnet option: %s", head->data);
  ------------------
  |  |   62|     24|#define failf Curl_failf
  ------------------
  911|     24|            result = CURLE_SETOPT_OPTION_SYNTAX;
  912|     24|          }
  913|     79|          else {
  914|     79|            tn->subopt_wsx = (unsigned short)x;
  915|     79|            tn->subopt_wsy = (unsigned short)y;
  916|     79|            tn->us_preferred[CURL_TELOPT_NAWS] = CURL_YES;
  ------------------
  |  |   35|     79|#define CURL_TELOPT_NAWS        31  /* Negotiate About Window Size */
  ------------------
                          tn->us_preferred[CURL_TELOPT_NAWS] = CURL_YES;
  ------------------
  |  |   83|     79|#define CURL_YES         1
  ------------------
  917|     79|          }
  918|    103|        }
  919|      3|        else
  920|      3|          result = CURLE_UNKNOWN_OPTION;
  921|    106|        break;
  922|       |
  923|    115|      case 6:
  ------------------
  |  Branch (923:7): [True: 115, False: 422]
  ------------------
  924|       |        /* To take care or not of the 8th bit in data exchange */
  925|    115|        if(curl_strnequal(option, "BINARY", 6)) {
  ------------------
  |  Branch (925:12): [True: 114, False: 1]
  ------------------
  926|    114|          const char *p = arg;
  927|    114|          curl_off_t binary_option;
  928|    114|          if(!curlx_str_number(&p, &binary_option, 1) &&
  ------------------
  |  Branch (928:14): [True: 71, False: 43]
  ------------------
  929|     71|             (binary_option != 1)) {
  ------------------
  |  Branch (929:14): [True: 43, False: 28]
  ------------------
  930|     43|            tn->us_preferred[CURL_TELOPT_BINARY] = CURL_NO;
  ------------------
  |  |   30|     43|#define CURL_TELOPT_BINARY      0   /* binary 8-bit data */
  ------------------
                          tn->us_preferred[CURL_TELOPT_BINARY] = CURL_NO;
  ------------------
  |  |   82|     43|#define CURL_NO          0
  ------------------
  931|     43|            tn->him_preferred[CURL_TELOPT_BINARY] = CURL_NO;
  ------------------
  |  |   30|     43|#define CURL_TELOPT_BINARY      0   /* binary 8-bit data */
  ------------------
                          tn->him_preferred[CURL_TELOPT_BINARY] = CURL_NO;
  ------------------
  |  |   82|     43|#define CURL_NO          0
  ------------------
  932|     43|          }
  933|    114|        }
  934|      1|        else
  935|      1|          result = CURLE_UNKNOWN_OPTION;
  936|    115|        break;
  937|     14|      default:
  ------------------
  |  Branch (937:7): [True: 14, False: 523]
  ------------------
  938|     14|        failf(data, "Unknown telnet option %s", head->data);
  ------------------
  |  |   62|     14|#define failf Curl_failf
  ------------------
  939|     14|        result = CURLE_UNKNOWN_OPTION;
  940|     14|        break;
  941|    537|      }
  942|    537|    }
  943|     51|    else {
  944|     51|      failf(data, "Syntax error in telnet option: %s", head->data);
  ------------------
  |  |   62|     51|#define failf Curl_failf
  ------------------
  945|     51|      result = CURLE_SETOPT_OPTION_SYNTAX;
  946|     51|    }
  947|    622|  }
  948|       |
  949|  3.01k|  if(result) {
  ------------------
  |  Branch (949:6): [True: 97, False: 2.91k]
  ------------------
  950|     97|    curl_slist_free_all(tn->telnet_vars);
  951|     97|    tn->telnet_vars = NULL;
  952|     97|  }
  953|       |
  954|  3.01k|  return result;
  955|  3.01k|}
telnet.c:str_is_nonascii:
  819|    902|{
  820|    902|  char c;
  821|   176k|  while((c = *str++) != 0)
  ------------------
  |  Branch (821:9): [True: 175k, False: 838]
  ------------------
  822|   175k|    if(c & 0x80)
  ------------------
  |  Branch (822:8): [True: 64, False: 175k]
  ------------------
  823|     64|      return TRUE;
  ------------------
  |  |  997|    966|#define TRUE true
  ------------------
  824|       |
  825|    838|  return FALSE;
  ------------------
  |  | 1000|    838|#define FALSE false
  ------------------
  826|    902|}
telnet.c:telrcv:
 1062|  1.25k|{
 1063|  1.25k|  unsigned char c;
 1064|  1.25k|  CURLcode result;
 1065|  1.25k|  int in = 0;
 1066|  1.25k|  int startwrite = -1;
 1067|       |
 1068|  1.25k|#define startskipping()                                          \
 1069|  1.25k|  if(startwrite >= 0) {                                          \
 1070|  1.25k|    result = Curl_client_write(data,                             \
 1071|  1.25k|                               CLIENTWRITE_BODY,                 \
 1072|  1.25k|                               (const char *)&inbuf[startwrite], \
 1073|  1.25k|                               in-startwrite);                   \
 1074|  1.25k|    if(result)                                                   \
 1075|  1.25k|      return result;                                             \
 1076|  1.25k|  }                                                              \
 1077|  1.25k|  startwrite = -1
 1078|       |
 1079|  1.25k|#define writebyte()  \
 1080|  1.25k|  if(startwrite < 0) \
 1081|  1.25k|    startwrite = in
 1082|       |
 1083|  1.25k|#define bufferflush() startskipping()
 1084|       |
 1085|   480k|  while(count--) {
  ------------------
  |  Branch (1085:9): [True: 479k, False: 1.22k]
  ------------------
 1086|   479k|    c = inbuf[in];
 1087|       |
 1088|   479k|    switch(tn->telrcv_state) {
  ------------------
  |  Branch (1088:12): [True: 479k, False: 0]
  ------------------
 1089|  15.0k|    case CURL_TS_CR:
  ------------------
  |  Branch (1089:5): [True: 15.0k, False: 464k]
  ------------------
 1090|  15.0k|      tn->telrcv_state = CURL_TS_DATA;
 1091|  15.0k|      if(c == '\0') {
  ------------------
  |  Branch (1091:10): [True: 13.3k, False: 1.67k]
  ------------------
 1092|  13.3k|        startskipping();
  ------------------
  |  | 1069|  13.3k|  if(startwrite >= 0) {                                          \
  |  |  ------------------
  |  |  |  Branch (1069:6): [True: 13.3k, False: 2]
  |  |  ------------------
  |  | 1070|  13.3k|    result = Curl_client_write(data,                             \
  |  | 1071|  13.3k|                               CLIENTWRITE_BODY,                 \
  |  |  ------------------
  |  |  |  |   43|  13.3k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  |  |  ------------------
  |  | 1072|  13.3k|                               (const char *)&inbuf[startwrite], \
  |  | 1073|  13.3k|                               in-startwrite);                   \
  |  | 1074|  13.3k|    if(result)                                                   \
  |  |  ------------------
  |  |  |  Branch (1074:8): [True: 1, False: 13.3k]
  |  |  ------------------
  |  | 1075|  13.3k|      return result;                                             \
  |  | 1076|  13.3k|  }                                                              \
  |  | 1077|  13.3k|  startwrite = -1
  ------------------
 1093|  13.3k|        break;   /* Ignore \0 after CR */
 1094|  13.3k|      }
 1095|  1.67k|      writebyte();
  ------------------
  |  | 1080|  1.67k|  if(startwrite < 0) \
  |  |  ------------------
  |  |  |  Branch (1080:6): [True: 2, False: 1.67k]
  |  |  ------------------
  |  | 1081|  1.67k|    startwrite = in
  ------------------
 1096|  1.67k|      break;
 1097|       |
 1098|   351k|    case CURL_TS_DATA:
  ------------------
  |  Branch (1098:5): [True: 351k, False: 128k]
  ------------------
 1099|   351k|      if(c == CURL_IAC) {
  ------------------
  |  |   82|   351k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (1099:10): [True: 3.17k, False: 347k]
  ------------------
 1100|  3.17k|        tn->telrcv_state = CURL_TS_IAC;
 1101|  3.17k|        startskipping();
  ------------------
  |  | 1069|  3.17k|  if(startwrite >= 0) {                                          \
  |  |  ------------------
  |  |  |  Branch (1069:6): [True: 495, False: 2.68k]
  |  |  ------------------
  |  | 1070|    495|    result = Curl_client_write(data,                             \
  |  | 1071|    495|                               CLIENTWRITE_BODY,                 \
  |  |  ------------------
  |  |  |  |   43|    495|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  |  |  ------------------
  |  | 1072|    495|                               (const char *)&inbuf[startwrite], \
  |  | 1073|    495|                               in-startwrite);                   \
  |  | 1074|    495|    if(result)                                                   \
  |  |  ------------------
  |  |  |  Branch (1074:8): [True: 2, False: 493]
  |  |  ------------------
  |  | 1075|    495|      return result;                                             \
  |  | 1076|    495|  }                                                              \
  |  | 1077|  3.17k|  startwrite = -1
  ------------------
 1102|  3.17k|        break;
 1103|  3.17k|      }
 1104|   347k|      else if(c == '\r')
  ------------------
  |  Branch (1104:15): [True: 15.0k, False: 332k]
  ------------------
 1105|  15.0k|        tn->telrcv_state = CURL_TS_CR;
 1106|   347k|      writebyte();
  ------------------
  |  | 1080|   347k|  if(startwrite < 0) \
  |  |  ------------------
  |  |  |  Branch (1080:6): [True: 14.1k, False: 333k]
  |  |  ------------------
  |  | 1081|   347k|    startwrite = in
  ------------------
 1107|   347k|      break;
 1108|       |
 1109|  3.14k|    case CURL_TS_IAC:
  ------------------
  |  Branch (1109:5): [True: 3.14k, False: 476k]
  ------------------
 1110|  3.14k|      DEBUGASSERT(startwrite < 0);
  ------------------
  |  | 1027|  3.14k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1110:7): [True: 0, False: 3.14k]
  |  Branch (1110:7): [True: 3.14k, False: 0]
  ------------------
 1111|  3.14k|      switch(c) {
 1112|    316|      case CURL_WILL:
  ------------------
  |  |   78|    316|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
  |  Branch (1112:7): [True: 316, False: 2.83k]
  ------------------
 1113|    316|        tn->telrcv_state = CURL_TS_WILL;
 1114|    316|        break;
 1115|    155|      case CURL_WONT:
  ------------------
  |  |   79|    155|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
  |  Branch (1115:7): [True: 155, False: 2.99k]
  ------------------
 1116|    155|        tn->telrcv_state = CURL_TS_WONT;
 1117|    155|        break;
 1118|    506|      case CURL_DO:
  ------------------
  |  |   80|    506|#define CURL_DO   253 /* DO use this option! */
  ------------------
  |  Branch (1118:7): [True: 506, False: 2.64k]
  ------------------
 1119|    506|        tn->telrcv_state = CURL_TS_DO;
 1120|    506|        break;
 1121|    358|      case CURL_DONT:
  ------------------
  |  |   81|    358|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
  |  Branch (1121:7): [True: 358, False: 2.79k]
  ------------------
 1122|    358|        tn->telrcv_state = CURL_TS_DONT;
 1123|    358|        break;
 1124|  1.33k|      case CURL_SB:
  ------------------
  |  |   77|  1.33k|#define CURL_SB   250 /* SuBnegotiation */
  ------------------
  |  Branch (1124:7): [True: 1.33k, False: 1.81k]
  ------------------
 1125|  1.33k|        CURL_SB_CLEAR(tn);
  ------------------
  |  |   62|  1.33k|#define CURL_SB_CLEAR(x) (x)->subpointer = (x)->subbuffer
  ------------------
 1126|  1.33k|        tn->telrcv_state = CURL_TS_SB;
 1127|  1.33k|        break;
 1128|    258|      case CURL_IAC:
  ------------------
  |  |   82|    258|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (1128:7): [True: 258, False: 2.89k]
  ------------------
 1129|    258|        tn->telrcv_state = CURL_TS_DATA;
 1130|    258|        writebyte();
  ------------------
  |  | 1080|    258|  if(startwrite < 0) \
  |  |  ------------------
  |  |  |  Branch (1080:6): [True: 258, False: 0]
  |  |  ------------------
  |  | 1081|    258|    startwrite = in
  ------------------
 1131|    258|        break;
 1132|      9|      case CURL_DM:
  ------------------
  |  |   75|      9|#define CURL_DM   242 /* Data Mark */
  ------------------
  |  Branch (1132:7): [True: 9, False: 3.13k]
  ------------------
 1133|     11|      case CURL_NOP:
  ------------------
  |  |   74|     11|#define CURL_NOP  241 /* No OPeration */
  ------------------
  |  Branch (1133:7): [True: 2, False: 3.14k]
  ------------------
 1134|     14|      case CURL_GA:
  ------------------
  |  |   76|     14|#define CURL_GA   249 /* Go Ahead, reverse the line */
  ------------------
  |  Branch (1134:7): [True: 3, False: 3.14k]
  ------------------
 1135|    218|      default:
  ------------------
  |  Branch (1135:7): [True: 204, False: 2.94k]
  ------------------
 1136|    218|        tn->telrcv_state = CURL_TS_DATA;
 1137|    218|        printoption(data, "RCVD", CURL_IAC, c);
  ------------------
  |  |   82|    218|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
 1138|    218|        break;
 1139|  3.14k|      }
 1140|  3.14k|      break;
 1141|       |
 1142|  3.14k|    case CURL_TS_WILL:
  ------------------
  |  Branch (1142:5): [True: 310, False: 479k]
  ------------------
 1143|    310|      printoption(data, "RCVD", CURL_WILL, c);
  ------------------
  |  |   78|    310|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
 1144|    310|      tn->please_negotiate = 1;
 1145|    310|      rec_will(data, tn, c);
 1146|    310|      tn->telrcv_state = CURL_TS_DATA;
 1147|    310|      break;
 1148|       |
 1149|    152|    case CURL_TS_WONT:
  ------------------
  |  Branch (1149:5): [True: 152, False: 479k]
  ------------------
 1150|    152|      printoption(data, "RCVD", CURL_WONT, c);
  ------------------
  |  |   79|    152|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
 1151|    152|      tn->please_negotiate = 1;
 1152|    152|      rec_wont(data, tn, c);
 1153|    152|      tn->telrcv_state = CURL_TS_DATA;
 1154|    152|      break;
 1155|       |
 1156|    503|    case CURL_TS_DO:
  ------------------
  |  Branch (1156:5): [True: 503, False: 478k]
  ------------------
 1157|    503|      printoption(data, "RCVD", CURL_DO, c);
  ------------------
  |  |   80|    503|#define CURL_DO   253 /* DO use this option! */
  ------------------
 1158|    503|      tn->please_negotiate = 1;
 1159|    503|      rec_do(data, tn, c);
 1160|    503|      tn->telrcv_state = CURL_TS_DATA;
 1161|    503|      break;
 1162|       |
 1163|    356|    case CURL_TS_DONT:
  ------------------
  |  Branch (1163:5): [True: 356, False: 479k]
  ------------------
 1164|    356|      printoption(data, "RCVD", CURL_DONT, c);
  ------------------
  |  |   81|    356|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
 1165|    356|      tn->please_negotiate = 1;
 1166|    356|      rec_dont(data, tn, c);
 1167|    356|      tn->telrcv_state = CURL_TS_DATA;
 1168|    356|      break;
 1169|       |
 1170|   107k|    case CURL_TS_SB:
  ------------------
  |  Branch (1170:5): [True: 107k, False: 372k]
  ------------------
 1171|   107k|      if(c == CURL_IAC)
  ------------------
  |  |   82|   107k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (1171:10): [True: 1.39k, False: 106k]
  ------------------
 1172|  1.39k|        tn->telrcv_state = CURL_TS_SE;
 1173|   106k|      else
 1174|   106k|        CURL_SB_ACCUM(tn, c);
  ------------------
  |  |   69|   106k|  do {                                                              \
  |  |   70|   106k|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 92.0k, False: 14.0k]
  |  |  ------------------
  |  |   71|   106k|      *(x)->subpointer++ = (c);                                     \
  |  |   72|   106k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 106k]
  |  |  ------------------
  ------------------
 1175|   107k|      break;
 1176|       |
 1177|  1.38k|    case CURL_TS_SE:
  ------------------
  |  Branch (1177:5): [True: 1.38k, False: 478k]
  ------------------
 1178|  1.38k|      if(c != CURL_SE) {
  ------------------
  |  |   73|  1.38k|#define CURL_SE   240 /* Sub negotiation End */
  ------------------
  |  Branch (1178:10): [True: 102, False: 1.28k]
  ------------------
 1179|    102|        if(c != CURL_IAC) {
  ------------------
  |  |   82|    102|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (1179:12): [True: 16, False: 86]
  ------------------
 1180|       |          /*
 1181|       |           * This is an error. We only expect to get "IAC IAC" or "IAC SE".
 1182|       |           * Several things may have happened. An IAC was not doubled, the IAC
 1183|       |           * SE was left off, or another option got inserted into the
 1184|       |           * suboption are all possibilities.
 1185|       |           */
 1186|     16|          failf(data, "telnet: suboption error");
  ------------------
  |  |   62|     16|#define failf Curl_failf
  ------------------
 1187|     16|          return CURLE_RECV_ERROR;
 1188|     16|        }
 1189|     86|        CURL_SB_ACCUM(tn, c);
  ------------------
  |  |   69|     86|  do {                                                              \
  |  |   70|     86|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 64, False: 22]
  |  |  ------------------
  |  |   71|     86|      *(x)->subpointer++ = (c);                                     \
  |  |   72|     86|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 86]
  |  |  ------------------
  ------------------
 1190|     86|        tn->telrcv_state = CURL_TS_SB;
 1191|     86|      }
 1192|  1.28k|      else {
 1193|  1.28k|        CURL_SB_ACCUM(tn, CURL_IAC);
  ------------------
  |  |   69|  1.28k|  do {                                                              \
  |  |   70|  1.28k|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 1.20k, False: 77]
  |  |  ------------------
  |  |   71|  1.28k|      *(x)->subpointer++ = (c);                                     \
  |  |   72|  1.28k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 1194|  1.28k|        CURL_SB_ACCUM(tn, CURL_SE);
  ------------------
  |  |   69|  1.28k|  do {                                                              \
  |  |   70|  1.28k|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 1.13k, False: 145]
  |  |  ------------------
  |  |   71|  1.28k|      *(x)->subpointer++ = (c);                                     \
  |  |   72|  1.28k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 1195|  1.28k|        tn->subpointer -= 2;
 1196|  1.28k|        CURL_SB_TERM(tn);
  ------------------
  |  |   64|  1.28k|  do {                             \
  |  |   65|  1.28k|    (x)->subend = (x)->subpointer; \
  |  |   66|  1.28k|    CURL_SB_CLEAR(x);              \
  |  |  ------------------
  |  |  |  |   62|  1.28k|#define CURL_SB_CLEAR(x) (x)->subpointer = (x)->subbuffer
  |  |  ------------------
  |  |   67|  1.28k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (67:11): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 1197|  1.28k|        result = suboption(data, tn);   /* handle sub-option */
 1198|  1.28k|        if(result)
  ------------------
  |  Branch (1198:12): [True: 9, False: 1.27k]
  ------------------
 1199|      9|          return result;
 1200|  1.27k|        tn->telrcv_state = CURL_TS_DATA;
 1201|  1.27k|      }
 1202|  1.36k|      break;
 1203|   479k|    }
 1204|   479k|    ++in;
 1205|   479k|  }
 1206|  1.22k|  bufferflush();
  ------------------
  |  | 1083|  1.22k|#define bufferflush() startskipping()
  |  |  ------------------
  |  |  |  | 1069|  1.22k|  if(startwrite >= 0) {                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1069:6): [True: 502, False: 721]
  |  |  |  |  ------------------
  |  |  |  | 1070|    502|    result = Curl_client_write(data,                             \
  |  |  |  | 1071|    502|                               CLIENTWRITE_BODY,                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    502|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  |  |  |  |  ------------------
  |  |  |  | 1072|    502|                               (const char *)&inbuf[startwrite], \
  |  |  |  | 1073|    502|                               in-startwrite);                   \
  |  |  |  | 1074|    502|    if(result)                                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1074:8): [True: 22, False: 480]
  |  |  |  |  ------------------
  |  |  |  | 1075|    502|      return result;                                             \
  |  |  |  | 1076|    502|  }                                                              \
  |  |  |  | 1077|  1.22k|  startwrite = -1
  |  |  ------------------
  ------------------
 1207|  1.20k|  return CURLE_OK;
 1208|  1.22k|}
telnet.c:printoption:
  136|  3.62k|{
  137|  3.62k|  if(data->set.verbose) {
  ------------------
  |  Branch (137:6): [True: 3.62k, False: 0]
  ------------------
  138|  3.62k|    if(cmd == CURL_IAC) {
  ------------------
  |  |   82|  3.62k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (138:8): [True: 218, False: 3.40k]
  ------------------
  139|    218|      if(CURL_TELCMD_OK(option))
  ------------------
  |  |  105|    218|  (((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \
  |  |  ------------------
  |  |  |  |   96|    218|#define CURL_TELCMD_MINIMUM CURL_xEOF /* the first one */
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|    218|#define CURL_xEOF 236 /* End Of File */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 74, False: 144]
  |  |  ------------------
  |  |  106|    218|   ((unsigned int)(x) <= CURL_TELCMD_MAXIMUM))
  |  |  ------------------
  |  |  |  |   97|     74|#define CURL_TELCMD_MAXIMUM CURL_IAC  /* surprise, 255 is the last one! ;-) */
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|     74|#define CURL_IAC  255 /* Interpret As Command */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:4): [True: 74, False: 0]
  |  |  ------------------
  ------------------
  140|     74|        infof(data, "%s IAC %s", direction, CURL_TELCMD(option));
  ------------------
  |  |  143|     74|  do {                               \
  |  |  144|     74|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     74|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 74, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 74, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     74|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 74, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     74|    ((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|     74|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     74|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 74]
  |  |  ------------------
  ------------------
  141|    144|      else
  142|    144|        infof(data, "%s IAC %d", direction, option);
  ------------------
  |  |  143|    144|  do {                               \
  |  |  144|    144|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    144|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 144, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 144, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    144|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 144, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    144|    ((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|    144|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    144|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 144]
  |  |  ------------------
  ------------------
  143|    218|    }
  144|  3.40k|    else {
  145|  3.40k|      const char *fmt = (cmd == CURL_WILL) ? "WILL" :
  ------------------
  |  |   78|  3.40k|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
  |  Branch (145:25): [True: 1.17k, False: 2.22k]
  ------------------
  146|  3.40k|                        (cmd == CURL_WONT) ? "WONT" :
  ------------------
  |  |   79|  2.22k|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
  |  Branch (146:25): [True: 537, False: 1.69k]
  ------------------
  147|  2.22k|                        (cmd == CURL_DO) ? "DO" :
  ------------------
  |  |   80|  1.69k|#define CURL_DO   253 /* DO use this option! */
  ------------------
  |  Branch (147:25): [True: 1.09k, False: 593]
  ------------------
  148|  1.69k|                        (cmd == CURL_DONT) ? "DONT" : 0;
  ------------------
  |  |   81|    593|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
  |  Branch (148:25): [True: 593, False: 0]
  ------------------
  149|  3.40k|      if(fmt) {
  ------------------
  |  Branch (149:10): [True: 3.40k, False: 0]
  ------------------
  150|  3.40k|        const char *opt;
  151|  3.40k|        if(CURL_TELOPT_OK(option))
  ------------------
  |  |   65|  3.40k|#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM)
  |  |  ------------------
  |  |  |  |   63|  3.40k|#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  3.40k|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (65:27): [True: 2.85k, False: 549]
  |  |  ------------------
  ------------------
  152|  2.85k|          opt = CURL_TELOPT(option);
  ------------------
  |  |   58|  2.85k|#define CURL_TELOPT(x) telnetoptions[x]
  ------------------
  153|    549|        else if(option == CURL_TELOPT_EXOPL)
  ------------------
  |  |   33|    549|#define CURL_TELOPT_EXOPL       255 /* EXtended OPtions List */
  ------------------
  |  Branch (153:17): [True: 121, False: 428]
  ------------------
  154|    121|          opt = "EXOPL";
  155|    428|        else
  156|    428|          opt = NULL;
  157|       |
  158|  3.40k|        if(opt)
  ------------------
  |  Branch (158:12): [True: 2.97k, False: 428]
  ------------------
  159|  2.97k|          infof(data, "%s %s %s", direction, fmt, opt);
  ------------------
  |  |  143|  2.97k|  do {                               \
  |  |  144|  2.97k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  2.97k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 2.97k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 2.97k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  2.97k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 2.97k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  2.97k|    ((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.97k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
  160|    428|        else
  161|    428|          infof(data, "%s %s %d", direction, fmt, option);
  ------------------
  |  |  143|    428|  do {                               \
  |  |  144|    428|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    428|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 428, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 428, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    428|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 428, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    428|    ((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|    428|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    428|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 428]
  |  |  ------------------
  ------------------
  162|  3.40k|      }
  163|      0|      else
  164|      0|        infof(data, "%s %d %d", direction, cmd, option);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  165|  3.40k|    }
  166|  3.62k|  }
  167|  3.62k|}
telnet.c:rec_will:
  405|    310|{
  406|    310|  switch(tn->him[option]) {
  ------------------
  |  Branch (406:10): [True: 310, False: 0]
  ------------------
  407|    260|  case CURL_NO:
  ------------------
  |  |   82|    260|#define CURL_NO          0
  ------------------
  |  Branch (407:3): [True: 260, False: 50]
  ------------------
  408|    260|    if(tn->him_preferred[option] == CURL_YES) {
  ------------------
  |  |   83|    260|#define CURL_YES         1
  ------------------
  |  Branch (408:8): [True: 64, False: 196]
  ------------------
  409|     64|      tn->him[option] = CURL_YES;
  ------------------
  |  |   83|     64|#define CURL_YES         1
  ------------------
  410|     64|      send_negotiation(data, CURL_DO, option);
  ------------------
  |  |   80|     64|#define CURL_DO   253 /* DO use this option! */
  ------------------
  411|     64|    }
  412|    196|    else
  413|    196|      send_negotiation(data, CURL_DONT, option);
  ------------------
  |  |   81|    196|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
  414|       |
  415|    260|    break;
  416|       |
  417|     47|  case CURL_YES:
  ------------------
  |  |   83|     47|#define CURL_YES         1
  ------------------
  |  Branch (417:3): [True: 47, False: 263]
  ------------------
  418|       |    /* Already enabled */
  419|     47|    break;
  420|       |
  421|      0|  case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (421:3): [True: 0, False: 310]
  ------------------
  422|      0|    switch(tn->himq[option]) {
  ------------------
  |  Branch (422:12): [True: 0, False: 0]
  ------------------
  423|      0|    case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (423:5): [True: 0, False: 0]
  ------------------
  424|       |      /* Error: DONT answered by WILL */
  425|      0|      tn->him[option] = CURL_NO;
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  426|      0|      break;
  427|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (427:5): [True: 0, False: 0]
  ------------------
  428|       |      /* Error: DONT answered by WILL */
  429|      0|      tn->him[option] = CURL_YES;
  ------------------
  |  |   83|      0|#define CURL_YES         1
  ------------------
  430|      0|      tn->himq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  431|      0|      break;
  432|      0|    }
  433|      0|    break;
  434|       |
  435|      3|  case CURL_WANTYES:
  ------------------
  |  |   84|      3|#define CURL_WANTYES     2
  ------------------
  |  Branch (435:3): [True: 3, False: 307]
  ------------------
  436|      3|    switch(tn->himq[option]) {
  ------------------
  |  Branch (436:12): [True: 3, False: 0]
  ------------------
  437|      3|    case CURL_EMPTY:
  ------------------
  |  |   87|      3|#define CURL_EMPTY       0
  ------------------
  |  Branch (437:5): [True: 3, False: 0]
  ------------------
  438|      3|      tn->him[option] = CURL_YES;
  ------------------
  |  |   83|      3|#define CURL_YES         1
  ------------------
  439|      3|      break;
  440|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (440:5): [True: 0, False: 3]
  ------------------
  441|      0|      tn->him[option] = CURL_WANTNO;
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  442|      0|      tn->himq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  443|      0|      send_negotiation(data, CURL_DONT, option);
  ------------------
  |  |   81|      0|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
  444|      0|      break;
  445|      3|    }
  446|      3|    break;
  447|    310|  }
  448|    310|}
telnet.c:send_negotiation:
  226|  2.08k|{
  227|  2.08k|  unsigned char buf[3];
  228|  2.08k|  ssize_t bytes_written;
  229|  2.08k|  struct connectdata *conn = data->conn;
  230|       |
  231|  2.08k|  buf[0] = CURL_IAC;
  ------------------
  |  |   82|  2.08k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  232|  2.08k|  buf[1] = (unsigned char)cmd;
  233|  2.08k|  buf[2] = (unsigned char)option;
  234|       |
  235|  2.08k|  bytes_written = swrite(conn->sock[FIRSTSOCKET], buf, 3);
  ------------------
  |  |  918|  2.08k|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|  2.08k|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|  2.08k|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|  2.08k|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|  2.08k|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
  236|  2.08k|  if(bytes_written < 0)
  ------------------
  |  Branch (236:6): [True: 0, False: 2.08k]
  ------------------
  237|      0|    failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                  failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  238|       |
  239|  2.08k|  printoption(data, "SENT", cmd, option);
  240|  2.08k|}
telnet.c:rec_wont:
  451|    152|{
  452|    152|  switch(tn->him[option]) {
  ------------------
  |  Branch (452:10): [True: 152, False: 0]
  ------------------
  453|    108|  case CURL_NO:
  ------------------
  |  |   82|    108|#define CURL_NO          0
  ------------------
  |  Branch (453:3): [True: 108, False: 44]
  ------------------
  454|       |    /* Already disabled */
  455|    108|    break;
  456|       |
  457|     41|  case CURL_YES:
  ------------------
  |  |   83|     41|#define CURL_YES         1
  ------------------
  |  Branch (457:3): [True: 41, False: 111]
  ------------------
  458|     41|    tn->him[option] = CURL_NO;
  ------------------
  |  |   82|     41|#define CURL_NO          0
  ------------------
  459|     41|    send_negotiation(data, CURL_DONT, option);
  ------------------
  |  |   81|     41|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
  460|     41|    break;
  461|       |
  462|      0|  case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (462:3): [True: 0, False: 152]
  ------------------
  463|      0|    switch(tn->himq[option]) {
  ------------------
  |  Branch (463:12): [True: 0, False: 0]
  ------------------
  464|      0|    case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (464:5): [True: 0, False: 0]
  ------------------
  465|      0|      tn->him[option] = CURL_NO;
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  466|      0|      break;
  467|       |
  468|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (468:5): [True: 0, False: 0]
  ------------------
  469|      0|      tn->him[option] = CURL_WANTYES;
  ------------------
  |  |   84|      0|#define CURL_WANTYES     2
  ------------------
  470|      0|      tn->himq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  471|      0|      send_negotiation(data, CURL_DO, option);
  ------------------
  |  |   80|      0|#define CURL_DO   253 /* DO use this option! */
  ------------------
  472|      0|      break;
  473|      0|    }
  474|      0|    break;
  475|       |
  476|      3|  case CURL_WANTYES:
  ------------------
  |  |   84|      3|#define CURL_WANTYES     2
  ------------------
  |  Branch (476:3): [True: 3, False: 149]
  ------------------
  477|      3|    switch(tn->himq[option]) {
  ------------------
  |  Branch (477:12): [True: 3, False: 0]
  ------------------
  478|      3|    case CURL_EMPTY:
  ------------------
  |  |   87|      3|#define CURL_EMPTY       0
  ------------------
  |  Branch (478:5): [True: 3, False: 0]
  ------------------
  479|      3|      tn->him[option] = CURL_NO;
  ------------------
  |  |   82|      3|#define CURL_NO          0
  ------------------
  480|      3|      break;
  481|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (481:5): [True: 0, False: 3]
  ------------------
  482|      0|      tn->him[option] = CURL_NO;
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  483|      0|      tn->himq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  484|      0|      break;
  485|      3|    }
  486|      3|    break;
  487|    152|  }
  488|    152|}
telnet.c:rec_do:
  721|    503|{
  722|    503|  switch(tn->us[option]) {
  ------------------
  |  Branch (722:10): [True: 503, False: 0]
  ------------------
  723|    450|  case CURL_NO:
  ------------------
  |  |   82|    450|#define CURL_NO          0
  ------------------
  |  Branch (723:3): [True: 450, False: 53]
  ------------------
  724|    450|    if(tn->us_preferred[option] == CURL_YES) {
  ------------------
  |  |   83|    450|#define CURL_YES         1
  ------------------
  |  Branch (724:8): [True: 90, False: 360]
  ------------------
  725|     90|      tn->us[option] = CURL_YES;
  ------------------
  |  |   83|     90|#define CURL_YES         1
  ------------------
  726|     90|      send_negotiation(data, CURL_WILL, option);
  ------------------
  |  |   78|     90|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
  727|     90|      if(tn->subnegotiation[option] == CURL_YES)
  ------------------
  |  |   83|     90|#define CURL_YES         1
  ------------------
  |  Branch (727:10): [True: 52, False: 38]
  ------------------
  728|       |        /* transmission of data option */
  729|     52|        sendsuboption(data, tn, option);
  730|     90|    }
  731|    360|    else if(tn->subnegotiation[option] == CURL_YES) {
  ------------------
  |  |   83|    360|#define CURL_YES         1
  ------------------
  |  Branch (731:13): [True: 212, False: 148]
  ------------------
  732|       |      /* send information to achieve this option */
  733|    212|      tn->us[option] = CURL_YES;
  ------------------
  |  |   83|    212|#define CURL_YES         1
  ------------------
  734|    212|      send_negotiation(data, CURL_WILL, option);
  ------------------
  |  |   78|    212|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
  735|    212|      sendsuboption(data, tn, option);
  736|    212|    }
  737|    148|    else
  738|    148|      send_negotiation(data, CURL_WONT, option);
  ------------------
  |  |   79|    148|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
  739|    450|    break;
  740|       |
  741|     42|  case CURL_YES:
  ------------------
  |  |   83|     42|#define CURL_YES         1
  ------------------
  |  Branch (741:3): [True: 42, False: 461]
  ------------------
  742|       |    /* Already enabled */
  743|     42|    break;
  744|       |
  745|      0|  case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (745:3): [True: 0, False: 503]
  ------------------
  746|      0|    switch(tn->usq[option]) {
  ------------------
  |  Branch (746:12): [True: 0, False: 0]
  ------------------
  747|      0|    case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (747:5): [True: 0, False: 0]
  ------------------
  748|       |      /* Error: DONT answered by WILL */
  749|      0|      tn->us[option] = CURL_NO;
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  750|      0|      break;
  751|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (751:5): [True: 0, False: 0]
  ------------------
  752|       |      /* Error: DONT answered by WILL */
  753|      0|      tn->us[option] = CURL_YES;
  ------------------
  |  |   83|      0|#define CURL_YES         1
  ------------------
  754|      0|      tn->usq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  755|      0|      break;
  756|      0|    }
  757|      0|    break;
  758|       |
  759|     11|  case CURL_WANTYES:
  ------------------
  |  |   84|     11|#define CURL_WANTYES     2
  ------------------
  |  Branch (759:3): [True: 11, False: 492]
  ------------------
  760|     11|    switch(tn->usq[option]) {
  ------------------
  |  Branch (760:12): [True: 11, False: 0]
  ------------------
  761|     11|    case CURL_EMPTY:
  ------------------
  |  |   87|     11|#define CURL_EMPTY       0
  ------------------
  |  Branch (761:5): [True: 11, False: 0]
  ------------------
  762|     11|      tn->us[option] = CURL_YES;
  ------------------
  |  |   83|     11|#define CURL_YES         1
  ------------------
  763|     11|      if(tn->subnegotiation[option] == CURL_YES) {
  ------------------
  |  |   83|     11|#define CURL_YES         1
  ------------------
  |  Branch (763:10): [True: 1, False: 10]
  ------------------
  764|       |        /* transmission of data option */
  765|      1|        sendsuboption(data, tn, option);
  766|      1|      }
  767|     11|      break;
  768|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (768:5): [True: 0, False: 11]
  ------------------
  769|      0|      tn->us[option] = CURL_WANTNO;
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  770|      0|      tn->usq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  771|      0|      send_negotiation(data, CURL_WONT, option);
  ------------------
  |  |   79|      0|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
  772|      0|      break;
  773|     11|    }
  774|     11|    break;
  775|    503|  }
  776|    503|}
telnet.c:sendsuboption:
  673|    265|{
  674|    265|  ssize_t bytes_written;
  675|    265|  unsigned short x, y;
  676|    265|  const unsigned char *uc1, *uc2;
  677|    265|  struct connectdata *conn = data->conn;
  678|       |
  679|    265|  switch(option) {
  ------------------
  |  Branch (679:10): [True: 265, False: 0]
  ------------------
  680|    265|  case CURL_TELOPT_NAWS:
  ------------------
  |  |   35|    265|#define CURL_TELOPT_NAWS        31  /* Negotiate About Window Size */
  ------------------
  |  Branch (680:3): [True: 265, False: 0]
  ------------------
  681|       |    /* We prepare data to be sent */
  682|    265|    CURL_SB_CLEAR(tn);
  ------------------
  |  |   62|    265|#define CURL_SB_CLEAR(x) (x)->subpointer = (x)->subbuffer
  ------------------
  683|    265|    CURL_SB_ACCUM(tn, CURL_IAC);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  684|    265|    CURL_SB_ACCUM(tn, CURL_SB);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  685|    265|    CURL_SB_ACCUM(tn, CURL_TELOPT_NAWS);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  686|       |    /* We must deal either with little or big endian processors */
  687|       |    /* Window size must be sent according to the 'network order' */
  688|    265|    x = htons(tn->subopt_wsx);
  689|    265|    y = htons(tn->subopt_wsy);
  690|    265|    uc1 = (const unsigned char *)&x;
  691|    265|    uc2 = (const unsigned char *)&y;
  692|    265|    CURL_SB_ACCUM(tn, uc1[0]);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  693|    265|    CURL_SB_ACCUM(tn, uc1[1]);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  694|    265|    CURL_SB_ACCUM(tn, uc2[0]);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  695|    265|    CURL_SB_ACCUM(tn, uc2[1]);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  696|       |
  697|    265|    CURL_SB_ACCUM(tn, CURL_IAC);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  698|    265|    CURL_SB_ACCUM(tn, CURL_SE);
  ------------------
  |  |   69|    265|  do {                                                              \
  |  |   70|    265|    if((x)->subpointer < ((x)->subbuffer + sizeof((x)->subbuffer))) \
  |  |  ------------------
  |  |  |  Branch (70:8): [True: 265, False: 0]
  |  |  ------------------
  |  |   71|    265|      *(x)->subpointer++ = (c);                                     \
  |  |   72|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (72:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  699|    265|    CURL_SB_TERM(tn);
  ------------------
  |  |   64|    265|  do {                             \
  |  |   65|    265|    (x)->subend = (x)->subpointer; \
  |  |   66|    265|    CURL_SB_CLEAR(x);              \
  |  |  ------------------
  |  |  |  |   62|    265|#define CURL_SB_CLEAR(x) (x)->subpointer = (x)->subbuffer
  |  |  ------------------
  |  |   67|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (67:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  700|       |    /* data suboption is now ready */
  701|       |
  702|    265|    printsub(data, '>', (const unsigned char *)tn->subbuffer + 2,
  703|    265|             CURL_SB_LEN(tn) - 2);
  ------------------
  |  |   75|    265|#define CURL_SB_LEN(x) ((x)->subend - (x)->subpointer)
  ------------------
  704|       |
  705|       |    /* we send the header of the suboption... */
  706|    265|    bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer, 3);
  ------------------
  |  |  918|    265|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|    265|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|    265|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|    265|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|    265|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
  707|    265|    if(bytes_written < 0)
  ------------------
  |  Branch (707:8): [True: 0, False: 265]
  ------------------
  708|      0|      failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                    failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  709|       |    /* ... then the window size with the send_telnet_data() function
  710|       |       to deal with 0xFF cases ... */
  711|    265|    send_telnet_data(data, tn, (const char *)tn->subbuffer + 3, 4);
  712|       |    /* ... and the footer */
  713|    265|    bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer + 7, 2);
  ------------------
  |  |  918|    265|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|    265|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|    265|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|    265|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|    265|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
  714|    265|    if(bytes_written < 0)
  ------------------
  |  Branch (714:8): [True: 0, False: 265]
  ------------------
  715|      0|      failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                    failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
  716|    265|    break;
  717|    265|  }
  718|    265|}
telnet.c:printsub:
  494|  2.46k|{
  495|  2.46k|  if(data->set.verbose) {
  ------------------
  |  Branch (495:6): [True: 2.46k, False: 0]
  ------------------
  496|  2.46k|    unsigned int i = 0;
  497|  2.46k|    if(direction) {
  ------------------
  |  Branch (497:8): [True: 2.46k, False: 0]
  ------------------
  498|  2.46k|      infof(data, "%s IAC SB ", (direction == '<') ? "RCVD" : "SENT");
  ------------------
  |  |  143|  2.46k|  do {                               \
  |  |  144|  2.46k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  2.46k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 2.46k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 2.46k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  2.46k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 2.46k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  2.46k|    ((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|  4.93k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 1.26k, False: 1.20k]
  |  |  ------------------
  |  |  146|  2.46k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.46k]
  |  |  ------------------
  ------------------
  499|  2.46k|      if(length >= 3) {
  ------------------
  |  Branch (499:10): [True: 2.46k, False: 0]
  ------------------
  500|  2.46k|        int j;
  501|       |
  502|  2.46k|        i = pointer[length - 2];
  503|  2.46k|        j = pointer[length - 1];
  504|       |
  505|  2.46k|        if(i != CURL_IAC || j != CURL_SE) {
  ------------------
  |  |   82|  4.93k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
                      if(i != CURL_IAC || j != CURL_SE) {
  ------------------
  |  |   73|  2.33k|#define CURL_SE   240 /* Sub negotiation End */
  ------------------
  |  Branch (505:12): [True: 127, False: 2.33k]
  |  Branch (505:29): [True: 18, False: 2.32k]
  ------------------
  506|    145|          infof(data, "(terminated by ");
  ------------------
  |  |  143|    145|  do {                               \
  |  |  144|    145|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    145|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 145, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 145, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    145|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    145|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    145|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 145]
  |  |  ------------------
  ------------------
  507|    145|          if(CURL_TELOPT_OK(i))
  ------------------
  |  |   65|    145|#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM)
  |  |  ------------------
  |  |  |  |   63|    145|#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    145|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (65:27): [True: 61, False: 84]
  |  |  ------------------
  ------------------
  508|     61|            infof(data, "%s ", CURL_TELOPT(i));
  ------------------
  |  |  143|     61|  do {                               \
  |  |  144|     61|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     61|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 61, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 61, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     61|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 61, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     61|    ((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|     61|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     61|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 61]
  |  |  ------------------
  ------------------
  509|     84|          else if(CURL_TELCMD_OK(i))
  ------------------
  |  |  105|     84|  (((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \
  |  |  ------------------
  |  |  |  |   96|     84|#define CURL_TELCMD_MINIMUM CURL_xEOF /* the first one */
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     84|#define CURL_xEOF 236 /* End Of File */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 40, False: 44]
  |  |  ------------------
  |  |  106|     84|   ((unsigned int)(x) <= CURL_TELCMD_MAXIMUM))
  |  |  ------------------
  |  |  |  |   97|     40|#define CURL_TELCMD_MAXIMUM CURL_IAC  /* surprise, 255 is the last one! ;-) */
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|     40|#define CURL_IAC  255 /* Interpret As Command */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:4): [True: 40, False: 0]
  |  |  ------------------
  ------------------
  510|     40|            infof(data, "%s ", CURL_TELCMD(i));
  ------------------
  |  |  143|     40|  do {                               \
  |  |  144|     40|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     40|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 40, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     40|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     40|    ((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|     40|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     40|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 40]
  |  |  ------------------
  ------------------
  511|     44|          else
  512|     44|            infof(data, "%u ", i);
  ------------------
  |  |  143|     44|  do {                               \
  |  |  144|     44|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     44|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 44, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     44|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     44|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     44|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 44]
  |  |  ------------------
  ------------------
  513|    145|          if(CURL_TELOPT_OK(j))
  ------------------
  |  |   65|    145|#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM)
  |  |  ------------------
  |  |  |  |   63|    145|#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    145|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (65:27): [True: 29, False: 116]
  |  |  ------------------
  ------------------
  514|     29|            infof(data, "%s", CURL_TELOPT(j));
  ------------------
  |  |  143|     29|  do {                               \
  |  |  144|     29|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     29|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 29, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     29|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     29|    ((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|     29|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     29|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 29]
  |  |  ------------------
  ------------------
  515|    116|          else if(CURL_TELCMD_OK(j))
  ------------------
  |  |  105|    116|  (((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \
  |  |  ------------------
  |  |  |  |   96|    116|#define CURL_TELCMD_MINIMUM CURL_xEOF /* the first one */
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|    116|#define CURL_xEOF 236 /* End Of File */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 72, False: 44]
  |  |  ------------------
  |  |  106|    116|   ((unsigned int)(x) <= CURL_TELCMD_MAXIMUM))
  |  |  ------------------
  |  |  |  |   97|     72|#define CURL_TELCMD_MAXIMUM CURL_IAC  /* surprise, 255 is the last one! ;-) */
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|     72|#define CURL_IAC  255 /* Interpret As Command */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:4): [True: 72, False: 0]
  |  |  ------------------
  ------------------
  516|     72|            infof(data, "%s", CURL_TELCMD(j));
  ------------------
  |  |  143|     72|  do {                               \
  |  |  144|     72|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     72|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 72, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 72, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     72|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 72, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     72|    ((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|     72|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     72|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 72]
  |  |  ------------------
  ------------------
  517|     44|          else
  518|     44|            infof(data, "%d", j);
  ------------------
  |  |  143|     44|  do {                               \
  |  |  144|     44|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     44|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 44, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     44|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     44|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     44|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 44]
  |  |  ------------------
  ------------------
  519|    145|          infof(data, ", not IAC SE) ");
  ------------------
  |  |  143|    145|  do {                               \
  |  |  144|    145|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    145|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 145, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 145, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    145|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    145|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    145|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 145]
  |  |  ------------------
  ------------------
  520|    145|        }
  521|  2.46k|      }
  522|  2.46k|      if(length >= 2)
  ------------------
  |  Branch (522:10): [True: 2.46k, False: 0]
  ------------------
  523|  2.46k|        length -= 2;
  524|      0|      else /* bad input */
  525|      0|        return;
  526|  2.46k|    }
  527|  2.46k|    if(length <= 1) {
  ------------------
  |  Branch (527:8): [True: 776, False: 1.68k]
  ------------------
  528|    776|      infof(data, "(Empty suboption?)");
  ------------------
  |  |  143|    776|  do {                               \
  |  |  144|    776|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    776|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 776, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 776, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    776|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 776, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    776|    ((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|    776|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    776|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 776]
  |  |  ------------------
  ------------------
  529|    776|      return;
  530|    776|    }
  531|       |
  532|  1.68k|    if(CURL_TELOPT_OK(pointer[0])) {
  ------------------
  |  |   65|  1.68k|#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM)
  |  |  ------------------
  |  |  |  |   63|  1.68k|#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.68k|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (65:27): [True: 1.57k, False: 118]
  |  |  ------------------
  ------------------
  533|  1.57k|      switch(pointer[0]) {
  534|     97|      case CURL_TELOPT_TTYPE:
  ------------------
  |  |   34|     97|#define CURL_TELOPT_TTYPE       24  /* Terminal TYPE */
  ------------------
  |  Branch (534:7): [True: 97, False: 1.47k]
  ------------------
  535|    174|      case CURL_TELOPT_XDISPLOC:
  ------------------
  |  |   36|    174|#define CURL_TELOPT_XDISPLOC    35  /* X DISPlay LOCation */
  ------------------
  |  Branch (535:7): [True: 77, False: 1.49k]
  ------------------
  536|  1.12k|      case CURL_TELOPT_NEW_ENVIRON:
  ------------------
  |  |   37|  1.12k|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  ------------------
  |  Branch (536:7): [True: 954, False: 617]
  ------------------
  537|  1.41k|      case CURL_TELOPT_NAWS:
  ------------------
  |  |   35|  1.41k|#define CURL_TELOPT_NAWS        31  /* Negotiate About Window Size */
  ------------------
  |  Branch (537:7): [True: 286, False: 1.28k]
  ------------------
  538|  1.41k|        infof(data, "%s", CURL_TELOPT(pointer[0]));
  ------------------
  |  |  143|  1.41k|  do {                               \
  |  |  144|  1.41k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.41k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1.41k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.41k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1.41k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  1.41k|    ((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.41k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.41k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
  539|  1.41k|        break;
  540|    157|      default:
  ------------------
  |  Branch (540:7): [True: 157, False: 1.41k]
  ------------------
  541|    157|        infof(data, "%s (unsupported)", CURL_TELOPT(pointer[0]));
  ------------------
  |  |  143|    157|  do {                               \
  |  |  144|    157|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    157|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 157, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 157, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    157|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    157|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    157|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 157]
  |  |  ------------------
  ------------------
  542|    157|        break;
  543|  1.57k|      }
  544|  1.57k|    }
  545|    118|    else
  546|    118|      infof(data, "%d (unknown)", pointer[0]);
  ------------------
  |  |  143|    118|  do {                               \
  |  |  144|    118|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    118|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 118, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 118, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    118|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 118, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    118|    ((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|    118|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    118|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 118]
  |  |  ------------------
  ------------------
  547|       |
  548|  1.68k|    switch(pointer[0]) {
  549|    286|    case CURL_TELOPT_NAWS:
  ------------------
  |  |   35|    286|#define CURL_TELOPT_NAWS        31  /* Negotiate About Window Size */
  ------------------
  |  Branch (549:5): [True: 286, False: 1.40k]
  ------------------
  550|    286|      if(length > 4)
  ------------------
  |  Branch (550:10): [True: 267, False: 19]
  ------------------
  551|    267|        infof(data, "Width: %d ; Height: %d", (pointer[1] << 8) | pointer[2],
  ------------------
  |  |  143|    267|  do {                               \
  |  |  144|    267|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    267|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 267, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 267, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    267|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 267, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    267|    ((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|    267|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    267|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 267]
  |  |  ------------------
  ------------------
  552|    286|              (pointer[3] << 8) | pointer[4]);
  553|    286|      break;
  554|  1.40k|    default:
  ------------------
  |  Branch (554:5): [True: 1.40k, False: 286]
  ------------------
  555|  1.40k|      switch(pointer[1]) {
  ------------------
  |  Branch (555:14): [True: 1.20k, False: 194]
  ------------------
  556|  1.09k|      case CURL_TELQUAL_IS:
  ------------------
  |  |   99|  1.09k|#define CURL_TELQUAL_IS   0
  ------------------
  |  Branch (556:7): [True: 1.09k, False: 307]
  ------------------
  557|  1.09k|        infof(data, " IS");
  ------------------
  |  |  143|  1.09k|  do {                               \
  |  |  144|  1.09k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.09k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.09k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1.09k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.09k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1.09k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  1.09k|    ((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.09k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.09k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
  558|  1.09k|        break;
  559|     40|      case CURL_TELQUAL_SEND:
  ------------------
  |  |  100|     40|#define CURL_TELQUAL_SEND 1
  ------------------
  |  Branch (559:7): [True: 40, False: 1.36k]
  ------------------
  560|     40|        infof(data, " SEND");
  ------------------
  |  |  143|     40|  do {                               \
  |  |  144|     40|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     40|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 40, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     40|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     40|    ((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|     40|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     40|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 40]
  |  |  ------------------
  ------------------
  561|     40|        break;
  562|     50|      case CURL_TELQUAL_INFO:
  ------------------
  |  |  101|     50|#define CURL_TELQUAL_INFO 2
  ------------------
  |  Branch (562:7): [True: 50, False: 1.35k]
  ------------------
  563|     50|        infof(data, " INFO/REPLY");
  ------------------
  |  |  143|     50|  do {                               \
  |  |  144|     50|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     50|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 50, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 50, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     50|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 50, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     50|    ((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|     50|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     50|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 50]
  |  |  ------------------
  ------------------
  564|     50|        break;
  565|     23|      case CURL_TELQUAL_NAME:
  ------------------
  |  |  102|     23|#define CURL_TELQUAL_NAME 3
  ------------------
  |  Branch (565:7): [True: 23, False: 1.38k]
  ------------------
  566|     23|        infof(data, " NAME");
  ------------------
  |  |  143|     23|  do {                               \
  |  |  144|     23|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     23|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 23, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|     23|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     23|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     23|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 23]
  |  |  ------------------
  ------------------
  567|     23|        break;
  568|  1.40k|      }
  569|       |
  570|  1.40k|      switch(pointer[0]) {
  571|     97|      case CURL_TELOPT_TTYPE:
  ------------------
  |  |   34|     97|#define CURL_TELOPT_TTYPE       24  /* Terminal TYPE */
  ------------------
  |  Branch (571:7): [True: 97, False: 1.30k]
  ------------------
  572|    174|      case CURL_TELOPT_XDISPLOC:
  ------------------
  |  |   36|    174|#define CURL_TELOPT_XDISPLOC    35  /* X DISPlay LOCation */
  ------------------
  |  Branch (572:7): [True: 77, False: 1.32k]
  ------------------
  573|    174|        infof(data, " \"%.*s\"",
  ------------------
  |  |  143|    174|  do {                               \
  |  |  144|    174|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    174|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 174, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 174, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    174|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 174, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    174|    ((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|    348|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 63, False: 111]
  |  |  ------------------
  |  |  146|    174|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 174]
  |  |  ------------------
  ------------------
  574|    174|              (int)((length > 2) ? (length - 2) : 0), &pointer[2]);
  575|    174|        break;
  576|    954|      case CURL_TELOPT_NEW_ENVIRON:
  ------------------
  |  |   37|    954|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  ------------------
  |  Branch (576:7): [True: 954, False: 449]
  ------------------
  577|    954|        if(pointer[1] == CURL_TELQUAL_IS) {
  ------------------
  |  |   99|    954|#define CURL_TELQUAL_IS   0
  ------------------
  |  Branch (577:12): [True: 892, False: 62]
  ------------------
  578|    892|          infof(data, " ");
  ------------------
  |  |  143|    892|  do {                               \
  |  |  144|    892|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    892|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 892, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 892, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    892|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 892, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    892|    ((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|    892|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    892|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 892]
  |  |  ------------------
  ------------------
  579|   211k|          for(i = 3; i < length; i++) {
  ------------------
  |  Branch (579:22): [True: 210k, False: 892]
  ------------------
  580|   210k|            switch(pointer[i]) {
  581|  1.35k|            case CURL_NEW_ENV_VAR:
  ------------------
  |  |   39|  1.35k|#define CURL_NEW_ENV_VAR   0
  ------------------
  |  Branch (581:13): [True: 1.35k, False: 209k]
  ------------------
  582|  1.35k|              infof(data, ", ");
  ------------------
  |  |  143|  1.35k|  do {                               \
  |  |  144|  1.35k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.35k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.35k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1.35k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.35k|   (!(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.35k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.35k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.35k]
  |  |  ------------------
  ------------------
  583|  1.35k|              break;
  584|  2.05k|            case CURL_NEW_ENV_VALUE:
  ------------------
  |  |   40|  2.05k|#define CURL_NEW_ENV_VALUE 1
  ------------------
  |  Branch (584:13): [True: 2.05k, False: 208k]
  ------------------
  585|  2.05k|              infof(data, " = ");
  ------------------
  |  |  143|  2.05k|  do {                               \
  |  |  144|  2.05k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  2.05k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 2.05k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 2.05k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  2.05k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 2.05k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  2.05k|    ((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.05k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.05k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.05k]
  |  |  ------------------
  ------------------
  586|  2.05k|              break;
  587|   207k|            default:
  ------------------
  |  Branch (587:13): [True: 207k, False: 3.40k]
  ------------------
  588|   207k|              infof(data, "%c", pointer[i]);
  ------------------
  |  |  143|   207k|  do {                               \
  |  |  144|   207k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|   207k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 207k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 207k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|   207k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 207k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|   207k|    ((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|   207k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|   207k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 207k]
  |  |  ------------------
  ------------------
  589|   207k|              break;
  590|   210k|            }
  591|   210k|          }
  592|    892|        }
  593|    954|        break;
  594|    954|      default:
  ------------------
  |  Branch (594:7): [True: 275, False: 1.12k]
  ------------------
  595|  70.0k|        for(i = 2; i < length; i++)
  ------------------
  |  Branch (595:20): [True: 69.8k, False: 275]
  ------------------
  596|  69.8k|          infof(data, " %.2x", pointer[i]);
  ------------------
  |  |  143|  70.0k|  do {                               \
  |  |  144|  69.8k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  69.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 69.8k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 69.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  69.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 69.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  69.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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  69.8k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  69.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 69.8k]
  |  |  ------------------
  ------------------
  597|    275|        break;
  598|  1.40k|      }
  599|  1.68k|    }
  600|  1.68k|  }
  601|  2.46k|}
telnet.c:rec_dont:
  779|    356|{
  780|    356|  switch(tn->us[option]) {
  ------------------
  |  Branch (780:10): [True: 356, False: 0]
  ------------------
  781|    113|  case CURL_NO:
  ------------------
  |  |   82|    113|#define CURL_NO          0
  ------------------
  |  Branch (781:3): [True: 113, False: 243]
  ------------------
  782|       |    /* Already disabled */
  783|    113|    break;
  784|       |
  785|    237|  case CURL_YES:
  ------------------
  |  |   83|    237|#define CURL_YES         1
  ------------------
  |  Branch (785:3): [True: 237, False: 119]
  ------------------
  786|    237|    tn->us[option] = CURL_NO;
  ------------------
  |  |   82|    237|#define CURL_NO          0
  ------------------
  787|    237|    send_negotiation(data, CURL_WONT, option);
  ------------------
  |  |   79|    237|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
  788|    237|    break;
  789|       |
  790|      0|  case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (790:3): [True: 0, False: 356]
  ------------------
  791|      0|    switch(tn->usq[option]) {
  ------------------
  |  Branch (791:12): [True: 0, False: 0]
  ------------------
  792|      0|    case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (792:5): [True: 0, False: 0]
  ------------------
  793|      0|      tn->us[option] = CURL_NO;
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  794|      0|      break;
  795|       |
  796|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (796:5): [True: 0, False: 0]
  ------------------
  797|      0|      tn->us[option] = CURL_WANTYES;
  ------------------
  |  |   84|      0|#define CURL_WANTYES     2
  ------------------
  798|      0|      tn->usq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  799|      0|      send_negotiation(data, CURL_WILL, option);
  ------------------
  |  |   78|      0|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
  800|      0|      break;
  801|      0|    }
  802|      0|    break;
  803|       |
  804|      6|  case CURL_WANTYES:
  ------------------
  |  |   84|      6|#define CURL_WANTYES     2
  ------------------
  |  Branch (804:3): [True: 6, False: 350]
  ------------------
  805|      6|    switch(tn->usq[option]) {
  ------------------
  |  Branch (805:12): [True: 6, False: 0]
  ------------------
  806|      6|    case CURL_EMPTY:
  ------------------
  |  |   87|      6|#define CURL_EMPTY       0
  ------------------
  |  Branch (806:5): [True: 6, False: 0]
  ------------------
  807|      6|      tn->us[option] = CURL_NO;
  ------------------
  |  |   82|      6|#define CURL_NO          0
  ------------------
  808|      6|      break;
  809|      0|    case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (809:5): [True: 0, False: 6]
  ------------------
  810|      0|      tn->us[option] = CURL_NO;
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  811|      0|      tn->usq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  812|      0|      break;
  813|      6|    }
  814|      6|    break;
  815|    356|  }
  816|    356|}
telnet.c:suboption:
  972|  1.28k|{
  973|  1.28k|  struct curl_slist *v;
  974|  1.28k|  unsigned char temp[2048];
  975|  1.28k|  ssize_t bytes_written;
  976|  1.28k|  size_t len;
  977|  1.28k|  struct connectdata *conn = data->conn;
  978|       |
  979|  1.28k|  if(!CURL_SB_LEN(tn)) /* ignore empty suboption */
  ------------------
  |  |   75|  1.28k|#define CURL_SB_LEN(x) ((x)->subend - (x)->subpointer)
  ------------------
  |  Branch (979:6): [True: 21, False: 1.26k]
  ------------------
  980|     21|    return CURLE_OK;
  981|       |
  982|  1.26k|  printsub(data, '<', (const unsigned char *)tn->subbuffer,
  983|  1.26k|           CURL_SB_LEN(tn) + 2);
  ------------------
  |  |   75|  1.26k|#define CURL_SB_LEN(x) ((x)->subend - (x)->subpointer)
  ------------------
  984|  1.26k|  switch(CURL_SB_GET(tn)) {
  ------------------
  |  |   74|  1.26k|#define CURL_SB_GET(x) ((*(x)->subpointer++) & 0xff)
  |  |  ------------------
  |  |  |  Branch (74:24): [True: 947, False: 315]
  |  |  ------------------
  ------------------
  985|     67|  case CURL_TELOPT_TTYPE:
  ------------------
  |  |   34|     67|#define CURL_TELOPT_TTYPE       24  /* Terminal TYPE */
  ------------------
  |  Branch (985:3): [True: 67, False: 1.19k]
  ------------------
  986|     67|    if(bad_option(tn->subopt_ttype))
  ------------------
  |  Branch (986:8): [True: 3, False: 64]
  ------------------
  987|      3|      return CURLE_BAD_FUNCTION_ARGUMENT;
  988|     64|    if(strlen(tn->subopt_ttype) > 1000) {
  ------------------
  |  Branch (988:8): [True: 1, False: 63]
  ------------------
  989|      1|      failf(data, "Too long telnet TTYPE");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  990|      1|      return CURLE_SEND_ERROR;
  991|      1|    }
  992|     63|    len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c",
  993|     63|                         CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE,
  ------------------
  |  |   82|     63|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
                                       CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE,
  ------------------
  |  |   77|     63|#define CURL_SB   250 /* SuBnegotiation */
  ------------------
                                       CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE,
  ------------------
  |  |   34|     63|#define CURL_TELOPT_TTYPE       24  /* Terminal TYPE */
  ------------------
  994|     63|                         CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC,
  ------------------
  |  |   99|     63|#define CURL_TELQUAL_IS   0
  ------------------
                                       CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC,
  ------------------
  |  |   82|     63|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  995|     63|                         CURL_SE);
  ------------------
  |  |   73|     63|#define CURL_SE   240 /* Sub negotiation End */
  ------------------
  996|     63|    bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len);
  ------------------
  |  |  918|     63|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|     63|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|     63|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|     63|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|     63|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
  997|       |
  998|     63|    if(bytes_written < 0) {
  ------------------
  |  Branch (998:8): [True: 0, False: 63]
  ------------------
  999|      0|      failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                    failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1000|      0|      return CURLE_SEND_ERROR;
 1001|      0|    }
 1002|     63|    printsub(data, '>', &temp[2], len-2);
 1003|     63|    break;
 1004|     59|  case CURL_TELOPT_XDISPLOC:
  ------------------
  |  |   36|     59|#define CURL_TELOPT_XDISPLOC    35  /* X DISPlay LOCation */
  ------------------
  |  Branch (1004:3): [True: 59, False: 1.20k]
  ------------------
 1005|     59|    if(bad_option(tn->subopt_xdisploc))
  ------------------
  |  Branch (1005:8): [True: 4, False: 55]
  ------------------
 1006|      4|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1007|     55|    if(strlen(tn->subopt_xdisploc) > 1000) {
  ------------------
  |  Branch (1007:8): [True: 1, False: 54]
  ------------------
 1008|      1|      failf(data, "Too long telnet XDISPLOC");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1009|      1|      return CURLE_SEND_ERROR;
 1010|      1|    }
 1011|     54|    len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c",
 1012|     54|                         CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC,
  ------------------
  |  |   82|     54|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
                                       CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC,
  ------------------
  |  |   77|     54|#define CURL_SB   250 /* SuBnegotiation */
  ------------------
                                       CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC,
  ------------------
  |  |   36|     54|#define CURL_TELOPT_XDISPLOC    35  /* X DISPlay LOCation */
  ------------------
 1013|     54|                         CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC,
  ------------------
  |  |   99|     54|#define CURL_TELQUAL_IS   0
  ------------------
                                       CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC,
  ------------------
  |  |   82|     54|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
 1014|     54|                         CURL_SE);
  ------------------
  |  |   73|     54|#define CURL_SE   240 /* Sub negotiation End */
  ------------------
 1015|     54|    bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len);
  ------------------
  |  |  918|     54|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|     54|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|     54|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|     54|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|     54|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
 1016|     54|    if(bytes_written < 0) {
  ------------------
  |  Branch (1016:8): [True: 0, False: 54]
  ------------------
 1017|      0|      failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                    failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1018|      0|      return CURLE_SEND_ERROR;
 1019|      0|    }
 1020|     54|    printsub(data, '>', &temp[2], len - 2);
 1021|     54|    break;
 1022|    821|  case CURL_TELOPT_NEW_ENVIRON:
  ------------------
  |  |   37|    821|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  ------------------
  |  Branch (1022:3): [True: 821, False: 441]
  ------------------
 1023|    821|    len = curl_msnprintf((char *)temp, sizeof(temp), "%c%c%c%c",
 1024|    821|                         CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON,
  ------------------
  |  |   82|    821|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
                                       CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON,
  ------------------
  |  |   77|    821|#define CURL_SB   250 /* SuBnegotiation */
  ------------------
                                       CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON,
  ------------------
  |  |   37|    821|#define CURL_TELOPT_NEW_ENVIRON 39  /* NEW ENVIRONment variables */
  ------------------
 1025|    821|                         CURL_TELQUAL_IS);
  ------------------
  |  |   99|    821|#define CURL_TELQUAL_IS   0
  ------------------
 1026|  2.14k|    for(v = tn->telnet_vars; v; v = v->next) {
  ------------------
  |  Branch (1026:30): [True: 1.32k, False: 821]
  ------------------
 1027|  1.32k|      size_t tmplen = (strlen(v->data) + 1);
 1028|  1.32k|      if(bad_option(v->data))
  ------------------
  |  Branch (1028:10): [True: 0, False: 1.32k]
  ------------------
 1029|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
 1030|       |      /* Add the variable if it fits */
 1031|  1.32k|      if(len + tmplen < sizeof(temp) - 6) {
  ------------------
  |  Branch (1031:10): [True: 1.24k, False: 83]
  ------------------
 1032|  1.24k|        const char *s = strchr(v->data, ',');
 1033|  1.24k|        if(!s)
  ------------------
  |  Branch (1033:12): [True: 212, False: 1.03k]
  ------------------
 1034|    212|          len += curl_msnprintf((char *)&temp[len], sizeof(temp) - len,
 1035|    212|                                "%c%s", CURL_NEW_ENV_VAR, v->data);
  ------------------
  |  |   39|    212|#define CURL_NEW_ENV_VAR   0
  ------------------
 1036|  1.03k|        else {
 1037|  1.03k|          size_t vlen = s - v->data;
 1038|  1.03k|          len += curl_msnprintf((char *)&temp[len], sizeof(temp) - len,
 1039|  1.03k|                                "%c%.*s%c%s", CURL_NEW_ENV_VAR,
  ------------------
  |  |   39|  1.03k|#define CURL_NEW_ENV_VAR   0
  ------------------
 1040|  1.03k|                                (int)vlen, v->data, CURL_NEW_ENV_VALUE, ++s);
  ------------------
  |  |   40|  1.03k|#define CURL_NEW_ENV_VALUE 1
  ------------------
 1041|  1.03k|        }
 1042|  1.24k|      }
 1043|  1.32k|    }
 1044|    821|    curl_msnprintf((char *)&temp[len], sizeof(temp) - len,
 1045|    821|                   "%c%c", CURL_IAC, CURL_SE);
  ------------------
  |  |   82|    821|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
                                 "%c%c", CURL_IAC, CURL_SE);
  ------------------
  |  |   73|    821|#define CURL_SE   240 /* Sub negotiation End */
  ------------------
 1046|    821|    len += 2;
 1047|    821|    bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len);
  ------------------
  |  |  918|    821|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  919|    821|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  920|    821|                                      (SEND_TYPE_ARG3)(z), \
  |  |  921|    821|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  861|    821|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
 1048|    821|    if(bytes_written < 0)
  ------------------
  |  Branch (1048:8): [True: 0, False: 821]
  ------------------
 1049|      0|      failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                    failf(data, "Sending data failed (%d)", SOCKERRNO);
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
 1050|    821|    printsub(data, '>', &temp[2], len - 2);
 1051|    821|    break;
 1052|  1.26k|  }
 1053|  1.25k|  return CURLE_OK;
 1054|  1.26k|}
telnet.c:bad_option:
  961|  1.45k|{
  962|  1.45k|  return !data || !!strchr(data, CURL_IAC);
  ------------------
  |  |   82|  1.44k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (962:10): [True: 7, False: 1.44k]
  |  Branch (962:19): [True: 0, False: 1.44k]
  ------------------
  963|  1.45k|}
telnet.c:telnet_negotiate:
  389|    275|{
  390|    275|  int i;
  391|       |
  392|  11.2k|  for(i = 0; i < CURL_NTELOPTS; i++) {
  ------------------
  |  |   67|  11.2k|#define CURL_NTELOPTS 40
  ------------------
  |  Branch (392:14): [True: 11.0k, False: 275]
  ------------------
  393|  11.0k|    if(i == CURL_TELOPT_ECHO)
  ------------------
  |  |   31|  11.0k|#define CURL_TELOPT_ECHO        1   /* echo */
  ------------------
  |  Branch (393:8): [True: 275, False: 10.7k]
  ------------------
  394|    275|      continue;
  395|       |
  396|  10.7k|    if(tn->us_preferred[i] == CURL_YES)
  ------------------
  |  |   83|  10.7k|#define CURL_YES         1
  ------------------
  |  Branch (396:8): [True: 597, False: 10.1k]
  ------------------
  397|    597|      set_local_option(data, tn, i, CURL_YES);
  ------------------
  |  |   83|    597|#define CURL_YES         1
  ------------------
  398|       |
  399|  10.7k|    if(tn->him_preferred[i] == CURL_YES)
  ------------------
  |  |   83|  10.7k|#define CURL_YES         1
  ------------------
  |  Branch (399:8): [True: 550, False: 10.1k]
  ------------------
  400|    550|      set_remote_option(data, tn, i, CURL_YES);
  ------------------
  |  |   83|    550|#define CURL_YES         1
  ------------------
  401|  10.7k|  }
  402|    275|}
telnet.c:set_local_option:
  317|    597|{
  318|    597|  if(newstate == CURL_YES) {
  ------------------
  |  |   83|    597|#define CURL_YES         1
  ------------------
  |  Branch (318:6): [True: 597, False: 0]
  ------------------
  319|    597|    switch(tn->us[option]) {
  ------------------
  |  Branch (319:12): [True: 597, False: 0]
  ------------------
  320|    566|    case CURL_NO:
  ------------------
  |  |   82|    566|#define CURL_NO          0
  ------------------
  |  Branch (320:5): [True: 566, False: 31]
  ------------------
  321|    566|      tn->us[option] = CURL_WANTYES;
  ------------------
  |  |   84|    566|#define CURL_WANTYES     2
  ------------------
  322|    566|      send_negotiation(data, CURL_WILL, option);
  ------------------
  |  |   78|    566|#define CURL_WILL 251 /* Our side WILL use this option */
  ------------------
  323|    566|      break;
  324|       |
  325|     31|    case CURL_YES:
  ------------------
  |  |   83|     31|#define CURL_YES         1
  ------------------
  |  Branch (325:5): [True: 31, False: 566]
  ------------------
  326|       |      /* Already enabled */
  327|     31|      break;
  328|       |
  329|      0|    case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (329:5): [True: 0, False: 597]
  ------------------
  330|      0|      switch(tn->usq[option]) {
  ------------------
  |  Branch (330:14): [True: 0, False: 0]
  ------------------
  331|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (331:7): [True: 0, False: 0]
  ------------------
  332|       |        /* Already negotiating for CURL_YES, queue the request */
  333|      0|        tn->usq[option] = CURL_OPPOSITE;
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  334|      0|        break;
  335|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (335:7): [True: 0, False: 0]
  ------------------
  336|       |        /* Error: already queued an enable request */
  337|      0|        break;
  338|      0|      }
  339|      0|      break;
  340|       |
  341|      0|    case CURL_WANTYES:
  ------------------
  |  |   84|      0|#define CURL_WANTYES     2
  ------------------
  |  Branch (341:5): [True: 0, False: 597]
  ------------------
  342|      0|      switch(tn->usq[option]) {
  ------------------
  |  Branch (342:14): [True: 0, False: 0]
  ------------------
  343|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (343:7): [True: 0, False: 0]
  ------------------
  344|       |        /* Error: already negotiating for enable */
  345|      0|        break;
  346|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (346:7): [True: 0, False: 0]
  ------------------
  347|      0|        tn->usq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  348|      0|        break;
  349|      0|      }
  350|      0|      break;
  351|    597|    }
  352|    597|  }
  353|      0|  else { /* NO */
  354|      0|    switch(tn->us[option]) {
  ------------------
  |  Branch (354:12): [True: 0, False: 0]
  ------------------
  355|      0|    case CURL_NO:
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  |  Branch (355:5): [True: 0, False: 0]
  ------------------
  356|       |      /* Already disabled */
  357|      0|      break;
  358|       |
  359|      0|    case CURL_YES:
  ------------------
  |  |   83|      0|#define CURL_YES         1
  ------------------
  |  Branch (359:5): [True: 0, False: 0]
  ------------------
  360|      0|      tn->us[option] = CURL_WANTNO;
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  361|      0|      send_negotiation(data, CURL_WONT, option);
  ------------------
  |  |   79|      0|#define CURL_WONT 252 /* Our side will not use this option */
  ------------------
  362|      0|      break;
  363|       |
  364|      0|    case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (364:5): [True: 0, False: 0]
  ------------------
  365|      0|      switch(tn->usq[option]) {
  ------------------
  |  Branch (365:14): [True: 0, False: 0]
  ------------------
  366|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (366:7): [True: 0, False: 0]
  ------------------
  367|       |        /* Already negotiating for NO */
  368|      0|        break;
  369|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (369:7): [True: 0, False: 0]
  ------------------
  370|      0|        tn->usq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  371|      0|        break;
  372|      0|      }
  373|      0|      break;
  374|       |
  375|      0|    case CURL_WANTYES:
  ------------------
  |  |   84|      0|#define CURL_WANTYES     2
  ------------------
  |  Branch (375:5): [True: 0, False: 0]
  ------------------
  376|      0|      switch(tn->usq[option]) {
  ------------------
  |  Branch (376:14): [True: 0, False: 0]
  ------------------
  377|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (377:7): [True: 0, False: 0]
  ------------------
  378|      0|        tn->usq[option] = CURL_OPPOSITE;
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  379|      0|        break;
  380|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (380:7): [True: 0, False: 0]
  ------------------
  381|      0|        break;
  382|      0|      }
  383|      0|      break;
  384|      0|    }
  385|      0|  }
  386|    597|}
telnet.c:set_remote_option:
  244|    550|{
  245|    550|  if(newstate == CURL_YES) {
  ------------------
  |  |   83|    550|#define CURL_YES         1
  ------------------
  |  Branch (245:6): [True: 550, False: 0]
  ------------------
  246|    550|    switch(tn->him[option]) {
  ------------------
  |  Branch (246:12): [True: 550, False: 0]
  ------------------
  247|    530|    case CURL_NO:
  ------------------
  |  |   82|    530|#define CURL_NO          0
  ------------------
  |  Branch (247:5): [True: 530, False: 20]
  ------------------
  248|    530|      tn->him[option] = CURL_WANTYES;
  ------------------
  |  |   84|    530|#define CURL_WANTYES     2
  ------------------
  249|    530|      send_negotiation(data, CURL_DO, option);
  ------------------
  |  |   80|    530|#define CURL_DO   253 /* DO use this option! */
  ------------------
  250|    530|      break;
  251|       |
  252|     20|    case CURL_YES:
  ------------------
  |  |   83|     20|#define CURL_YES         1
  ------------------
  |  Branch (252:5): [True: 20, False: 530]
  ------------------
  253|       |      /* Already enabled */
  254|     20|      break;
  255|       |
  256|      0|    case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (256:5): [True: 0, False: 550]
  ------------------
  257|      0|      switch(tn->himq[option]) {
  ------------------
  |  Branch (257:14): [True: 0, False: 0]
  ------------------
  258|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (258:7): [True: 0, False: 0]
  ------------------
  259|       |        /* Already negotiating for CURL_YES, queue the request */
  260|      0|        tn->himq[option] = CURL_OPPOSITE;
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  261|      0|        break;
  262|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (262:7): [True: 0, False: 0]
  ------------------
  263|       |        /* Error: already queued an enable request */
  264|      0|        break;
  265|      0|      }
  266|      0|      break;
  267|       |
  268|      0|    case CURL_WANTYES:
  ------------------
  |  |   84|      0|#define CURL_WANTYES     2
  ------------------
  |  Branch (268:5): [True: 0, False: 550]
  ------------------
  269|      0|      switch(tn->himq[option]) {
  ------------------
  |  Branch (269:14): [True: 0, False: 0]
  ------------------
  270|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (270:7): [True: 0, False: 0]
  ------------------
  271|       |        /* Error: already negotiating for enable */
  272|      0|        break;
  273|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (273:7): [True: 0, False: 0]
  ------------------
  274|      0|        tn->himq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  275|      0|        break;
  276|      0|      }
  277|      0|      break;
  278|    550|    }
  279|    550|  }
  280|      0|  else { /* NO */
  281|      0|    switch(tn->him[option]) {
  ------------------
  |  Branch (281:12): [True: 0, False: 0]
  ------------------
  282|      0|    case CURL_NO:
  ------------------
  |  |   82|      0|#define CURL_NO          0
  ------------------
  |  Branch (282:5): [True: 0, False: 0]
  ------------------
  283|       |      /* Already disabled */
  284|      0|      break;
  285|       |
  286|      0|    case CURL_YES:
  ------------------
  |  |   83|      0|#define CURL_YES         1
  ------------------
  |  Branch (286:5): [True: 0, False: 0]
  ------------------
  287|      0|      tn->him[option] = CURL_WANTNO;
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  288|      0|      send_negotiation(data, CURL_DONT, option);
  ------------------
  |  |   81|      0|#define CURL_DONT 254 /* DO NOT use this option! */
  ------------------
  289|      0|      break;
  290|       |
  291|      0|    case CURL_WANTNO:
  ------------------
  |  |   85|      0|#define CURL_WANTNO      3
  ------------------
  |  Branch (291:5): [True: 0, False: 0]
  ------------------
  292|      0|      switch(tn->himq[option]) {
  ------------------
  |  Branch (292:14): [True: 0, False: 0]
  ------------------
  293|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (293:7): [True: 0, False: 0]
  ------------------
  294|       |        /* Already negotiating for NO */
  295|      0|        break;
  296|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (296:7): [True: 0, False: 0]
  ------------------
  297|      0|        tn->himq[option] = CURL_EMPTY;
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  298|      0|        break;
  299|      0|      }
  300|      0|      break;
  301|       |
  302|      0|    case CURL_WANTYES:
  ------------------
  |  |   84|      0|#define CURL_WANTYES     2
  ------------------
  |  Branch (302:5): [True: 0, False: 0]
  ------------------
  303|      0|      switch(tn->himq[option]) {
  ------------------
  |  Branch (303:14): [True: 0, False: 0]
  ------------------
  304|      0|      case CURL_EMPTY:
  ------------------
  |  |   87|      0|#define CURL_EMPTY       0
  ------------------
  |  Branch (304:7): [True: 0, False: 0]
  ------------------
  305|      0|        tn->himq[option] = CURL_OPPOSITE;
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  306|      0|        break;
  307|      0|      case CURL_OPPOSITE:
  ------------------
  |  |   88|      0|#define CURL_OPPOSITE    1
  ------------------
  |  Branch (307:7): [True: 0, False: 0]
  ------------------
  308|      0|        break;
  309|      0|      }
  310|      0|      break;
  311|      0|    }
  312|      0|  }
  313|    550|}
telnet.c:send_telnet_data:
  607|    376|{
  608|    376|  size_t i, outlen;
  609|    376|  const unsigned char *outbuf;
  610|    376|  CURLcode result = CURLE_OK;
  611|    376|  size_t bytes_written;
  612|    376|  size_t total_written = 0;
  613|    376|  struct connectdata *conn = data->conn;
  614|       |
  615|    376|  DEBUGASSERT(tn);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (615:3): [True: 0, False: 376]
  |  Branch (615:3): [True: 376, False: 0]
  ------------------
  616|    376|  DEBUGASSERT(nread > 0);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (616:3): [True: 0, False: 376]
  |  Branch (616:3): [True: 376, False: 0]
  ------------------
  617|    376|  if(nread < 0)
  ------------------
  |  Branch (617:6): [True: 0, False: 376]
  ------------------
  618|      0|    return CURLE_TOO_LARGE;
  619|       |
  620|    376|  if(memchr(buffer, CURL_IAC, nread)) {
  ------------------
  |  |   82|    376|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (620:6): [True: 80, False: 296]
  ------------------
  621|       |    /* only use the escape buffer when necessary */
  622|     80|    curlx_dyn_reset(&tn->out);
  623|       |
  624|  7.30k|    for(i = 0; i < (size_t)nread && !result; i++) {
  ------------------
  |  Branch (624:16): [True: 7.22k, False: 80]
  |  Branch (624:37): [True: 7.22k, False: 0]
  ------------------
  625|  7.22k|      result = curlx_dyn_addn(&tn->out, &buffer[i], 1);
  626|  7.22k|      if(!result && ((unsigned char)buffer[i] == CURL_IAC))
  ------------------
  |  |   82|  7.22k|#define CURL_IAC  255 /* Interpret As Command */
  ------------------
  |  Branch (626:10): [True: 7.22k, False: 0]
  |  Branch (626:21): [True: 2.17k, False: 5.05k]
  ------------------
  627|       |        /* IAC is FF in hex */
  628|  2.17k|        result = curlx_dyn_addn(&tn->out, "\xff", 1);
  629|  7.22k|    }
  630|       |
  631|     80|    outlen = curlx_dyn_len(&tn->out);
  632|     80|    outbuf = curlx_dyn_uptr(&tn->out);
  633|     80|  }
  634|    296|  else {
  635|    296|    outlen = (size_t)nread;
  636|    296|    outbuf = (const unsigned char *)buffer;
  637|    296|  }
  638|    752|  while(!result && total_written < outlen) {
  ------------------
  |  Branch (638:9): [True: 752, False: 0]
  |  Branch (638:20): [True: 376, False: 376]
  ------------------
  639|       |    /* Make sure socket is writable to avoid EWOULDBLOCK condition */
  640|    376|    struct pollfd pfd[1];
  641|    376|    timediff_t timeout_ms = Curl_timeleft_ms(data);
  642|    376|    pfd[0].fd = conn->sock[FIRSTSOCKET];
  ------------------
  |  |  233|    376|#define FIRSTSOCKET     0
  ------------------
  643|    376|    pfd[0].events = POLLOUT;
  644|    376|    if(timeout_ms < 0)
  ------------------
  |  Branch (644:8): [True: 0, False: 376]
  ------------------
  645|      0|      return CURLE_OPERATION_TIMEDOUT;
  646|       |    /* 0 means no timeout configured; pass -1 to poll for infinite wait */
  647|    376|    switch(Curl_poll(pfd, 1, timeout_ms ? timeout_ms : -1)) {
  ------------------
  |  Branch (647:30): [True: 376, False: 0]
  ------------------
  648|      0|    case -1:                    /* error, abort writing */
  ------------------
  |  Branch (648:5): [True: 0, False: 376]
  ------------------
  649|      0|      result = CURLE_SEND_ERROR;
  650|      0|      break;
  651|      0|    case 0:                     /* timeout */
  ------------------
  |  Branch (651:5): [True: 0, False: 376]
  ------------------
  652|      0|      result = CURLE_OPERATION_TIMEDOUT;
  653|      0|      break;
  654|    376|    default:                    /* write! */
  ------------------
  |  Branch (654:5): [True: 376, False: 0]
  ------------------
  655|    376|      bytes_written = 0;
  656|    376|      result = Curl_xfer_send(data, outbuf + total_written,
  657|    376|                              outlen - total_written, FALSE, &bytes_written);
  ------------------
  |  | 1000|    376|#define FALSE false
  ------------------
  658|    376|      total_written += bytes_written;
  659|    376|      break;
  660|    376|    }
  661|    376|  }
  662|       |
  663|    376|  return result;
  664|    376|}
telnet.c:telnet_done:
 1212|  3.04k|{
 1213|  3.04k|  (void)status;
 1214|  3.04k|  (void)premature;
 1215|  3.04k|  Curl_meta_remove(data, CURL_META_TELNET_EASY);
  ------------------
  |  |   91|  3.04k|#define CURL_META_TELNET_EASY   "meta:proto:telnet:easy"
  ------------------
 1216|  3.04k|  return CURLE_OK;
 1217|  3.04k|}

Curl_thrdpool_set_props:
  282|  3.74k|{
  283|  3.74k|  CURLcode result = CURLE_OK;
  284|  3.74k|  size_t running;
  285|       |
  286|  3.74k|  if(!max_threads || (min_threads > max_threads))
  ------------------
  |  Branch (286:6): [True: 0, False: 3.74k]
  |  Branch (286:22): [True: 0, False: 3.74k]
  ------------------
  287|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  288|       |
  289|  3.74k|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|  3.74k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  290|  3.74k|  tpool->min_threads = min_threads;
  291|  3.74k|  tpool->max_threads = max_threads;
  292|  3.74k|  tpool->idle_time_ms = idle_time_ms;
  293|  3.74k|  running = Curl_llist_count(&tpool->slots);
  294|  3.74k|  if(tpool->min_threads > running) {
  ------------------
  |  Branch (294:6): [True: 0, False: 3.74k]
  ------------------
  295|      0|    result = thrdpool_signal(tpool, tpool->min_threads - (uint32_t)running);
  296|      0|  }
  297|  3.74k|  Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|  3.74k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  298|       |
  299|  3.74k|  return result;
  300|  3.74k|}
Curl_thrdpool_create:
  311|  3.74k|{
  312|  3.74k|  struct curl_thrdpool *tpool;
  313|  3.74k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  314|  3.74k|  DEBUGASSERT(name);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (314:3): [True: 0, False: 3.74k]
  |  Branch (314:3): [True: 3.74k, False: 0]
  ------------------
  315|       |
  316|  3.74k|  tpool = curlx_calloc(1, sizeof(*tpool));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  317|  3.74k|  if(!tpool)
  ------------------
  |  Branch (317:6): [True: 0, False: 3.74k]
  ------------------
  318|      0|    goto out;
  319|  3.74k|  tpool->refcount = 1;
  320|       |
  321|  3.74k|  Curl_mutex_init(&tpool->lock);
  ------------------
  |  |   50|  3.74k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  322|  3.74k|  Curl_cond_init(&tpool->await);
  ------------------
  |  |   55|  3.74k|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  323|  3.74k|  Curl_llist_init(&tpool->slots, NULL);
  324|  3.74k|  Curl_llist_init(&tpool->zombies, NULL);
  325|  3.74k|  tpool->fn_take = fn_take;
  326|  3.74k|  tpool->fn_process = fn_process;
  327|  3.74k|  tpool->fn_return = fn_return;
  328|  3.74k|  tpool->fn_user_data = user_data;
  329|       |
  330|       |  /* a const string that remains */
  331|  3.74k|  tpool->name = name;
  332|       |
  333|  3.74k|#ifdef DEBUGBUILD
  334|  3.74k|  {
  335|  3.74k|    const char *p = getenv("CURL_DBG_THRDPOOL_FAIL_STARTS");
  336|  3.74k|    if(p) {
  ------------------
  |  Branch (336:8): [True: 0, False: 3.74k]
  ------------------
  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|  3.74k|  }
  342|  3.74k|#endif
  343|       |
  344|  3.74k|  result = Curl_thrdpool_set_props(tpool, min_threads, max_threads,
  345|  3.74k|                                   idle_time_ms);
  346|       |
  347|  3.74k|out:
  348|  3.74k|  if(result && tpool) {
  ------------------
  |  Branch (348:6): [True: 0, False: 3.74k]
  |  Branch (348:16): [True: 0, False: 0]
  ------------------
  349|      0|    tpool->aborted = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  350|      0|    thrdpool_unlink(tpool, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  351|       |    tpool = NULL;
  352|      0|  }
  353|  3.74k|  *ptpool = tpool;
  354|  3.74k|  return result;
  355|  3.74k|}
Curl_thrdpool_destroy:
  358|  3.74k|{
  359|  3.74k|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|  3.74k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  360|       |
  361|  3.74k|  tpool->aborted = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  362|       |
  363|  3.74k|  while(join && Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (363:9): [True: 3.74k, False: 0]
  |  Branch (363:17): [True: 0, False: 3.74k]
  ------------------
  364|      0|    thrdpool_wake_all(tpool);
  365|      0|    Curl_cond_wait(&tpool->await, &tpool->lock);
  366|      0|  }
  367|       |
  368|  3.74k|  thrdpool_join_zombies(tpool);
  369|       |
  370|       |  /* detach all still running threads */
  371|  3.74k|  if(Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (371:6): [True: 0, False: 3.74k]
  ------------------
  372|      0|    struct Curl_llist_node *e;
  373|      0|    for(e = Curl_llist_head(&tpool->slots); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (373:45): [True: 0, False: 0]
  ------------------
  374|      0|      struct thrdslot *tslot = Curl_node_elem(e);
  375|      0|      if(tslot->thread != curl_thread_t_null)
  ------------------
  |  |   49|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (375:10): [True: 0, False: 0]
  ------------------
  376|      0|        Curl_thread_destroy(&tslot->thread);
  377|      0|    }
  378|      0|    tpool->detached = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  379|      0|  }
  380|       |
  381|  3.74k|  if(!thrdpool_unlink(tpool, TRUE)) {
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  |  Branch (381:6): [True: 0, False: 3.74k]
  ------------------
  382|       |    /* tpool not destroyed */
  383|      0|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  384|      0|  }
  385|  3.74k|}
thrdpool.c:thrdpool_unlink:
  227|  3.74k|{
  228|  3.74k|  DEBUGASSERT(tpool->refcount);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (228:3): [True: 0, False: 3.74k]
  |  Branch (228:3): [True: 3.74k, False: 0]
  ------------------
  229|  3.74k|  if(tpool->refcount)
  ------------------
  |  Branch (229:6): [True: 3.74k, False: 0]
  ------------------
  230|  3.74k|    tpool->refcount--;
  231|  3.74k|  if(tpool->refcount)
  ------------------
  |  Branch (231:6): [True: 0, False: 3.74k]
  ------------------
  232|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  233|       |
  234|       |  /* no more references, free */
  235|  3.74k|  DEBUGASSERT(tpool->aborted);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (235:3): [True: 0, False: 3.74k]
  |  Branch (235:3): [True: 3.74k, False: 0]
  ------------------
  236|  3.74k|  thrdpool_join_zombies(tpool);
  237|  3.74k|  if(locked)
  ------------------
  |  Branch (237:6): [True: 3.74k, False: 0]
  ------------------
  238|  3.74k|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|  3.74k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  239|  3.74k|  Curl_cond_destroy(&tpool->await);
  ------------------
  |  |   56|  3.74k|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
  240|  3.74k|  Curl_mutex_destroy(&tpool->lock);
  ------------------
  |  |   53|  3.74k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  241|  3.74k|  curlx_free(tpool);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  242|       |  return TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  243|  3.74k|}
thrdpool.c:thrdpool_join_zombies:
  208|  7.48k|{
  209|  7.48k|  struct Curl_llist_node *e;
  210|       |
  211|  7.48k|  for(e = Curl_llist_head(&tpool->zombies); e;
  ------------------
  |  Branch (211:45): [True: 0, False: 7.48k]
  ------------------
  212|  7.48k|      e = Curl_llist_head(&tpool->zombies)) {
  213|      0|    struct thrdslot *tslot = Curl_node_elem(e);
  214|       |
  215|      0|    Curl_node_remove(&tslot->node);
  216|      0|    if(tslot->thread != curl_thread_t_null) {
  ------------------
  |  |   49|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (216:8): [True: 0, False: 0]
  ------------------
  217|      0|      Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  218|      0|      Curl_thread_join(&tslot->thread);
  219|      0|      Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|      0|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  220|      0|      tslot->thread = curl_thread_t_null;
  ------------------
  |  |   49|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  221|      0|    }
  222|      0|    thrdslot_destroy(tslot);
  223|      0|  }
  224|  7.48k|}

Curl_thrdq_create:
  206|  3.74k|{
  207|  3.74k|  struct curl_thrdq *tqueue;
  208|  3.74k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  209|  3.74k|  DEBUGASSERT(name);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 3.74k]
  |  Branch (209:3): [True: 3.74k, False: 0]
  ------------------
  210|       |
  211|  3.74k|  tqueue = curlx_calloc(1, sizeof(*tqueue));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  212|  3.74k|  if(!tqueue)
  ------------------
  |  Branch (212:6): [True: 0, False: 3.74k]
  ------------------
  213|      0|    goto out;
  214|       |
  215|  3.74k|  Curl_mutex_init(&tqueue->lock);
  ------------------
  |  |   50|  3.74k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  216|  3.74k|  Curl_cond_init(&tqueue->await);
  ------------------
  |  |   55|  3.74k|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  217|  3.74k|  Curl_llist_init(&tqueue->sendq, thrdq_item_list_dtor);
  218|  3.74k|  Curl_llist_init(&tqueue->recvq, thrdq_item_list_dtor);
  219|  3.74k|  tqueue->fn_free = fn_free;
  220|  3.74k|  tqueue->fn_process = fn_process;
  221|  3.74k|  tqueue->fn_event = fn_event;
  222|  3.74k|  tqueue->fn_user_data = user_data;
  223|       |
  224|       |  /* a const string that remains */
  225|  3.74k|  tqueue->name = name;
  226|       |
  227|  3.74k|  result = Curl_thrdpool_create(&tqueue->tpool, name,
  228|  3.74k|                                min_threads, max_threads, idle_time_ms,
  229|  3.74k|                                thrdq_tpool_take,
  230|  3.74k|                                thrdq_tpool_process,
  231|  3.74k|                                thrdq_tpool_return,
  232|  3.74k|                                tqueue);
  233|       |
  234|  3.74k|out:
  235|  3.74k|  if(result && tqueue) {
  ------------------
  |  Branch (235:6): [True: 0, False: 3.74k]
  |  Branch (235:16): [True: 0, False: 0]
  ------------------
  236|      0|    tqueue->aborted = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  237|      0|    thrdq_unlink(tqueue, FALSE, TRUE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
                  thrdq_unlink(tqueue, FALSE, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  238|       |    tqueue = NULL;
  239|      0|  }
  240|  3.74k|  *ptqueue = tqueue;
  241|  3.74k|  return result;
  242|  3.74k|}
Curl_thrdq_destroy:
  245|  3.74k|{
  246|  3.74k|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|  3.74k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  247|  3.74k|  DEBUGASSERT(!tqueue->aborted);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:3): [True: 0, False: 3.74k]
  |  Branch (247:3): [True: 3.74k, False: 0]
  ------------------
  248|  3.74k|  tqueue->aborted = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  249|       |  thrdq_unlink(tqueue, TRUE, join);
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  250|  3.74k|}
Curl_thrdq_recv:
  307|  3.74k|{
  308|  3.74k|  CURLcode result = CURLE_AGAIN;
  309|  3.74k|  struct Curl_llist_node *e;
  310|  3.74k|  uint32_t signals = 0;
  311|       |
  312|  3.74k|  *pitem = NULL;
  313|  3.74k|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|  3.74k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  314|  3.74k|  if(tqueue->aborted) {
  ------------------
  |  Branch (314:6): [True: 0, False: 3.74k]
  ------------------
  315|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      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|  3.74k|  e = Curl_llist_head(&tqueue->recvq);
  321|  3.74k|  if(e) {
  ------------------
  |  Branch (321:6): [True: 0, False: 3.74k]
  ------------------
  322|      0|    struct thrdq_item *qitem = Curl_node_take_elem(e);
  323|      0|    *pitem = qitem->item;
  324|      0|    qitem->item = NULL;
  325|      0|    thrdq_item_destroy(qitem);
  326|      0|    result = CURLE_OK;
  327|      0|  }
  328|  3.74k|  else
  329|  3.74k|    signals = thrdq_get_signals(tqueue);
  330|       |
  331|  3.74k|out:
  332|  3.74k|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|  3.74k|#  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|  3.74k|  if(signals)
  ------------------
  |  Branch (338:6): [True: 0, False: 3.74k]
  ------------------
  339|      0|    (void)Curl_thrdpool_signal(tqueue->tpool, (uint32_t)signals);
  340|  3.74k|  return result;
  341|  3.74k|}
Curl_thrdq_trace:
  406|  7.48k|{
  407|  7.48k|  struct curl_trc_feat *feat = &Curl_trc_feat_threads;
  408|  7.48k|  if(Curl_trc_ft_is_verbose(data, feat)) {
  ------------------
  |  |  329|  7.48k|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|  14.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 7.48k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 7.48k]
  |  |  |  |  ------------------
  |  |  |  |  323|  14.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((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.48k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  409|      0|    struct Curl_llist_node *e;
  410|      0|    struct thrdq_item *qitem;
  411|       |
  412|      0|    Curl_thrdpool_trace(tqueue->tpool, data);
  413|      0|    Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|      0|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  414|      0|    if(!Curl_llist_count(&tqueue->sendq) &&
  ------------------
  |  Branch (414:8): [True: 0, False: 0]
  ------------------
  415|      0|       !Curl_llist_count(&tqueue->recvq)) {
  ------------------
  |  Branch (415:8): [True: 0, False: 0]
  ------------------
  416|      0|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] empty", tqueue->name);
  417|      0|    }
  418|      0|    for(e = Curl_llist_head(&tqueue->sendq); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (418:46): [True: 0, False: 0]
  ------------------
  419|      0|      qitem = Curl_node_elem(e);
  420|      0|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] in: %s",
  421|      0|                          tqueue->name, qitem->description);
  422|      0|    }
  423|      0|    for(e = Curl_llist_head(&tqueue->recvq); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (423:46): [True: 0, False: 0]
  ------------------
  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|      0|    Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  429|      0|  }
  430|  7.48k|}
thrdqueue.c:thrdq_unlink:
  177|  3.74k|{
  178|  3.74k|  DEBUGASSERT(tqueue->aborted);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 3.74k]
  |  Branch (178:3): [True: 3.74k, False: 0]
  ------------------
  179|  3.74k|  if(tqueue->tpool) {
  ------------------
  |  Branch (179:6): [True: 3.74k, False: 0]
  ------------------
  180|  3.74k|    if(locked)
  ------------------
  |  Branch (180:8): [True: 3.74k, False: 0]
  ------------------
  181|  3.74k|      Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|  3.74k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  182|  3.74k|    Curl_thrdpool_destroy(tqueue->tpool, join);
  183|  3.74k|    tqueue->tpool = NULL;
  184|  3.74k|    if(locked)
  ------------------
  |  Branch (184:8): [True: 3.74k, False: 0]
  ------------------
  185|  3.74k|      Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|  3.74k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  186|  3.74k|  }
  187|       |
  188|  3.74k|  Curl_llist_destroy(&tqueue->sendq, NULL);
  189|  3.74k|  Curl_llist_destroy(&tqueue->recvq, NULL);
  190|  3.74k|  Curl_cond_destroy(&tqueue->await);
  ------------------
  |  |   56|  3.74k|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
  191|  3.74k|  if(locked)
  ------------------
  |  Branch (191:6): [True: 3.74k, False: 0]
  ------------------
  192|  3.74k|    Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|  3.74k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  193|  3.74k|  Curl_mutex_destroy(&tqueue->lock);
  ------------------
  |  |   53|  3.74k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  194|  3.74k|  curlx_free(tqueue);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  195|  3.74k|}
thrdqueue.c:thrdq_get_signals:
  253|  3.74k|{
  254|  3.74k|  size_t qlen = Curl_llist_count(&tqueue->sendq);
  255|  3.74k|  return (qlen <= UINT32_MAX) ? (uint32_t)qlen : UINT32_MAX;
  ------------------
  |  Branch (255:10): [True: 3.74k, False: 0]
  ------------------
  256|  3.74k|}

Curl_init_CONNECT:
  429|  3.74k|{
  430|  3.74k|  data->state.fread_func = data->set.fread_func_set;
  431|  3.74k|  data->state.in = data->set.in_set;
  432|  3.74k|  data->state.upload = (data->state.httpreq == HTTPREQ_PUT);
  433|  3.74k|}
Curl_pretransfer:
  441|  3.74k|{
  442|  3.74k|  CURLcode result = CURLE_OK;
  443|       |
  444|       |  /* Reset the retry count at the start of each request.
  445|       |   * If the retry count is not reset, when the connection drops,
  446|       |   * it will not enter the retry mechanism on CONN_MAX_RETRIES + 1 attempts
  447|       |   * and will immediately throw
  448|       |   * "Connection died, tried CONN_MAX_RETRIES times before giving up".
  449|       |   * By resetting it here, we ensure each new request starts fresh. */
  450|  3.74k|  data->state.retrycount = 0;
  451|       |
  452|  3.74k|  if(!CURL_EASY_STR(data, STRING_SET_URL) && !data->set.uh) {
  ------------------
  |  | 1234|  7.48k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  |  Branch (452:6): [True: 0, False: 3.74k]
  |  Branch (452:46): [True: 0, False: 0]
  ------------------
  453|       |    /* we cannot do anything without URL */
  454|      0|    failf(data, "No URL set");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  455|      0|    return CURLE_URL_MALFORMAT;
  456|      0|  }
  457|       |
  458|       |  /* CURLOPT_CURLU overrides CURLOPT_URL and the contents of the CURLU handle
  459|       |     is allowed to be changed by the user between transfers */
  460|  3.74k|  if(data->set.uh) {
  ------------------
  |  Branch (460:6): [True: 0, False: 3.74k]
  ------------------
  461|      0|    char *url = NULL;
  462|      0|    CURLUcode uc;
  463|      0|    uc = curl_url_get(data->set.uh, CURLUPART_URL, &url, 0);
  464|      0|    if(uc) {
  ------------------
  |  Branch (464:8): [True: 0, False: 0]
  ------------------
  465|       |      /* clear the pointer to not point to freed memory anymore */
  466|      0|      Curl_bufref_set(&data->state.url, NULL, 0, NULL);
  467|      0|      failf(data, "No URL set");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  468|      0|      return CURLE_URL_MALFORMAT;
  469|      0|    }
  470|      0|    result = CURL_EASY_STR_SETN(data, STRING_SET_URL, url);
  ------------------
  |  | 1238|      0|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), (s))
  ------------------
  471|      0|    if(result)
  ------------------
  |  Branch (471:8): [True: 0, False: 0]
  ------------------
  472|      0|      return result;
  473|      0|  }
  474|       |
  475|  3.74k|  Curl_bufref_set(&data->state.url, CURL_EASY_STR(data, STRING_SET_URL),
  ------------------
  |  | 1234|  3.74k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  476|  3.74k|                  0, NULL);
  477|       |
  478|  3.74k|  if(data->set.postfields && data->set.set_resume_from) {
  ------------------
  |  Branch (478:6): [True: 0, False: 3.74k]
  |  Branch (478:30): [True: 0, False: 0]
  ------------------
  479|       |    /* we cannot */
  480|      0|    failf(data, "cannot mix POSTFIELDS with RESUME_FROM");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  481|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  482|      0|  }
  483|       |
  484|  3.74k|  data->state.prefer_ascii = data->set.prefer_ascii;
  485|  3.74k|#ifdef CURL_LIST_ONLY_PROTOCOL
  486|  3.74k|  data->state.list_only = data->set.list_only;
  487|  3.74k|#endif
  488|  3.74k|  data->state.httpreq = data->set.method;
  489|       |
  490|       |  /* initial transfer request coming up, forget the initial origin
  491|       |   * from a previous perform() on this handle. */
  492|  3.74k|  Curl_peer_unlink(&data->state.initial_origin);
  493|  3.74k|  Curl_peer_unlink(&data->state.origin);
  494|  3.74k|  data->state.requests = 0;
  495|  3.74k|  data->state.followlocation = 0; /* reset the location-follow counter */
  496|  3.74k|  data->state.this_is_a_follow = FALSE; /* reset this */
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  497|  3.74k|  data->state.http_ignorecustom = FALSE; /* use custom HTTP method */
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  498|  3.74k|  data->state.errorbuf = FALSE; /* no error has occurred */
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  499|  3.74k|#ifndef CURL_DISABLE_HTTP
  500|  3.74k|  Curl_http_neg_init(data, &data->state.http_neg);
  501|  3.74k|#endif
  502|  3.74k|  data->state.authproblem = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  503|  3.74k|  data->state.authhost.want = data->set.httpauth;
  504|  3.74k|  data->state.authproxy.want = data->set.proxyauth;
  505|  3.74k|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1284|  3.74k|  do {                      \
  |  | 1285|  3.74k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.74k|    (ptr) = NULL;           \
  |  | 1287|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  506|  3.74k|  Curl_data_priority_clear_state(data);
  507|  3.74k|  if(data->set.http_auto_referer)
  ------------------
  |  Branch (507:6): [True: 0, False: 3.74k]
  ------------------
  508|      0|    Curl_bufref_free(&data->state.referer);
  509|  3.74k|  if(CURL_EASY_STR(data, STRING_SET_REFERER))
  ------------------
  |  | 1234|  3.74k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 3.74k]
  |  |  ------------------
  ------------------
  510|      0|    Curl_bufref_set(&data->state.referer,
  511|      0|                    CURL_EASY_STR(data, STRING_SET_REFERER), 0, NULL);
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  512|  3.74k|  else
  513|  3.74k|    Curl_bufref_free(&data->state.referer);
  514|       |
  515|  3.74k|  if(data->state.httpreq == HTTPREQ_PUT)
  ------------------
  |  Branch (515:6): [True: 0, False: 3.74k]
  ------------------
  516|      0|    data->state.infilesize = data->set.filesize;
  517|  3.74k|  else if((data->state.httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (517:11): [True: 0, False: 3.74k]
  ------------------
  518|      0|          (data->state.httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (518:11): [True: 0, False: 0]
  ------------------
  519|      0|    data->state.infilesize = data->set.postfieldsize;
  520|      0|    if(data->set.postfields && (data->state.infilesize == -1))
  ------------------
  |  Branch (520:8): [True: 0, False: 0]
  |  Branch (520:32): [True: 0, False: 0]
  ------------------
  521|      0|      data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
  522|      0|  }
  523|  3.74k|  else
  524|  3.74k|    data->state.infilesize = 0;
  525|       |
  526|       |  /* If there is a list of cookie files to read, do it now! */
  527|  3.74k|  result = Curl_cookie_loadfiles(data,
  528|  3.74k|                                 data->set.cookiesession ?
  ------------------
  |  Branch (528:34): [True: 0, False: 3.74k]
  ------------------
  529|  3.74k|                                 COOKIE_NOSESSION : 0);
  ------------------
  |  |  118|      0|#define COOKIE_NOSESSION  (1<<6) /* drop session cookies */
  ------------------
  530|  3.74k|  if(!result)
  ------------------
  |  Branch (530:6): [True: 3.74k, False: 0]
  ------------------
  531|  3.74k|    Curl_cookie_run(data); /* activate */
  532|       |
  533|       |  /* If there is a list of host pairs to deal with */
  534|  3.74k|  if(!result && data->state.resolve)
  ------------------
  |  Branch (534:6): [True: 3.74k, False: 0]
  |  Branch (534:17): [True: 0, False: 3.74k]
  ------------------
  535|      0|    result = Curl_loadhostpairs(data);
  536|       |
  537|  3.74k|  if(!result)
  ------------------
  |  Branch (537:6): [True: 3.74k, False: 0]
  ------------------
  538|       |    /* If there is a list of hsts files to read */
  539|  3.74k|    result = Curl_hsts_loadfiles(data);
  540|       |
  541|  3.74k|  if(!result) {
  ------------------
  |  Branch (541:6): [True: 3.74k, False: 0]
  ------------------
  542|       |    /* Allow data->set.use_port to set which port to use. This needs to be
  543|       |     * disabled for example when we follow Location: headers to URLs using
  544|       |     * different ports! */
  545|  3.74k|    data->state.allow_port = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  546|       |
  547|       |#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(MSG_NOSIGNAL)
  548|       |    /*************************************************************
  549|       |     * Tell signal handler to ignore SIGPIPE
  550|       |     *************************************************************/
  551|       |    if(!data->set.no_signal)
  552|       |      data->state.prev_signal = signal(SIGPIPE, SIG_IGN);
  553|       |#endif
  554|       |
  555|  3.74k|    Curl_initinfo(data); /* reset session-specific information "variables" */
  556|  3.74k|    Curl_pgrsResetTransferSizes(data);
  557|  3.74k|    Curl_pgrsStart(data, NULL);
  558|       |
  559|       |    /* In case the handle is reused and an authentication method was picked
  560|       |       in the session we need to make sure we only use the one(s) we now
  561|       |       consider to be fine */
  562|  3.74k|    data->state.authhost.picked &= data->state.authhost.want;
  563|  3.74k|    data->state.authproxy.picked &= data->state.authproxy.want;
  564|       |
  565|  3.74k|#ifndef CURL_DISABLE_FTP
  566|  3.74k|    data->state.wildcardmatch = data->set.wildcard_enabled;
  567|  3.74k|    if(data->state.wildcardmatch) {
  ------------------
  |  Branch (567:8): [True: 0, False: 3.74k]
  ------------------
  568|      0|      struct WildcardData *wc;
  569|      0|      if(!data->wildcard) {
  ------------------
  |  Branch (569:10): [True: 0, False: 0]
  ------------------
  570|      0|        data->wildcard = curlx_calloc(1, sizeof(struct WildcardData));
  ------------------
  |  | 1425|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  571|      0|        if(!data->wildcard)
  ------------------
  |  Branch (571:12): [True: 0, False: 0]
  ------------------
  572|      0|          return CURLE_OUT_OF_MEMORY;
  573|      0|      }
  574|      0|      wc = data->wildcard;
  575|      0|      if(wc->state < CURLWC_INIT) {
  ------------------
  |  Branch (575:10): [True: 0, False: 0]
  ------------------
  576|      0|        if(wc->ftpwc)
  ------------------
  |  Branch (576:12): [True: 0, False: 0]
  ------------------
  577|      0|          wc->dtor(wc->ftpwc);
  578|      0|        curlx_safefree(wc->pattern);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  579|      0|        curlx_safefree(wc->path);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  580|      0|        Curl_wildcard_init(wc); /* init wildcard structures */
  581|      0|      }
  582|      0|    }
  583|  3.74k|#endif
  584|  3.74k|    result = Curl_hsts_loadcb(data, data->hsts);
  585|  3.74k|  }
  586|       |
  587|  3.74k|  data->req.headerbytecount = 0;
  588|  3.74k|  Curl_headers_cleanup(data);
  589|  3.74k|  return result;
  590|  3.74k|}
Curl_xfer_setup_nop:
  705|  2.91k|{
  706|  2.91k|  xfer_setup(data, -1, -1, -1);
  707|  2.91k|}
Curl_xfer_write_done:
  791|  3.04k|{
  792|  3.04k|  (void)premature;
  793|  3.04k|  return Curl_cw_out_done(data);
  794|  3.04k|}
Curl_xfer_needs_flush:
  797|  5.95k|{
  798|  5.95k|  return Curl_conn_needs_flush(data, data->conn->send_idx);
  799|  5.95k|}
Curl_xfer_send:
  809|    376|{
  810|    376|  CURLcode result;
  811|       |
  812|    376|  DEBUGASSERT(data);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (812:3): [True: 0, False: 376]
  |  Branch (812:3): [True: 376, False: 0]
  ------------------
  813|    376|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (813:3): [True: 0, False: 376]
  |  Branch (813:3): [True: 376, False: 0]
  ------------------
  814|       |
  815|    376|  result = Curl_conn_send(data, data->conn->send_idx,
  816|    376|                          buf, blen, eos, pnwritten);
  817|    376|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (817:6): [True: 0, False: 376]
  ------------------
  818|      0|    result = CURLE_OK;
  819|      0|    *pnwritten = 0;
  820|      0|  }
  821|    376|  else if(!result && *pnwritten)
  ------------------
  |  Branch (821:11): [True: 376, False: 0]
  |  Branch (821:22): [True: 376, False: 0]
  ------------------
  822|    376|    data->info.request_size += *pnwritten;
  823|       |
  824|    376|  DEBUGF(infof(data, "Curl_xfer_send(len=%zu, eos=%d) -> %d, %zu",
  ------------------
  |  | 1013|  3.76k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 376, False: 0]
  |  |  |  Branch (1013:19): [True: 376, False: 0]
  |  |  |  Branch (1013:19): [True: 376, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 376]
  |  |  ------------------
  ------------------
  825|    376|               blen, eos, (int)result, *pnwritten));
  826|    376|  return result;
  827|    376|}
Curl_xfer_recv:
  832|  4.11k|{
  833|  4.11k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (833:3): [True: 0, False: 4.11k]
  |  Branch (833:3): [True: 4.11k, False: 0]
  ------------------
  834|  4.11k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (834:3): [True: 0, False: 4.11k]
  |  Branch (834:3): [True: 4.11k, False: 0]
  ------------------
  835|  4.11k|  DEBUGASSERT(data->set.buffer_size > 0);
  ------------------
  |  | 1027|  4.11k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (835:3): [True: 0, False: 4.11k]
  |  Branch (835:3): [True: 4.11k, False: 0]
  ------------------
  836|       |
  837|  4.11k|  if(curlx_uitouz(data->set.buffer_size) < blen)
  ------------------
  |  Branch (837:6): [True: 0, False: 4.11k]
  ------------------
  838|      0|    blen = curlx_uitouz(data->set.buffer_size);
  839|  4.11k|  return Curl_conn_recv(data, data->conn->recv_idx, buf, blen, pnrcvd);
  840|  4.11k|}
Curl_xfer_recv_is_paused:
  866|  3.04k|{
  867|  3.04k|  return Curl_rlimit_is_blocked(&data->progress.dl.rlimit);
  868|  3.04k|}
transfer.c:xfer_setup:
  665|  2.91k|{
  666|  2.91k|  struct SingleRequest *k = &data->req;
  667|  2.91k|  struct connectdata *conn = data->conn;
  668|       |
  669|  2.91k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  2.91k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (669:3): [True: 0, False: 2.91k]
  |  Branch (669:3): [True: 2.91k, False: 0]
  ------------------
  670|       |  /* indexes are in range */
  671|  2.91k|  DEBUGASSERT((send_idx <= 1) && (send_idx >= -1));
  ------------------
  |  | 1027|  2.91k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (671:3): [True: 0, False: 2.91k]
  |  Branch (671:3): [True: 0, False: 0]
  |  Branch (671:3): [True: 2.91k, False: 0]
  |  Branch (671:3): [True: 2.91k, False: 0]
  ------------------
  672|  2.91k|  DEBUGASSERT((recv_idx <= 1) && (recv_idx >= -1));
  ------------------
  |  | 1027|  2.91k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (672:3): [True: 0, False: 2.91k]
  |  Branch (672:3): [True: 0, False: 0]
  |  Branch (672:3): [True: 2.91k, False: 0]
  |  Branch (672:3): [True: 2.91k, False: 0]
  ------------------
  673|       |  /* if request wants to send, switching off the send direction is wrong */
  674|  2.91k|  DEBUGASSERT((send_idx >= 0) || !Curl_req_want_send(data));
  ------------------
  |  | 1027|  2.91k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (674:3): [True: 2.91k, False: 0]
  |  Branch (674:3): [True: 0, False: 0]
  |  Branch (674:3): [True: 0, False: 2.91k]
  |  Branch (674:3): [True: 2.91k, False: 0]
  ------------------
  675|       |
  676|  2.91k|  conn->send_idx = send_idx;
  677|  2.91k|  conn->recv_idx = recv_idx;
  678|       |
  679|       |  /* without receiving, there should be not recv_size */
  680|  2.91k|  DEBUGASSERT((conn->recv_idx >= 0) || (recv_size == -1));
  ------------------
  |  | 1027|  2.91k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (680:3): [True: 2.91k, False: 0]
  |  Branch (680:3): [True: 0, False: 0]
  |  Branch (680:3): [True: 0, False: 2.91k]
  |  Branch (680:3): [True: 2.91k, False: 0]
  ------------------
  681|  2.91k|  k->size = recv_size;
  682|  2.91k|  k->header = !!conn->scheme->run->write_resp_hd;
  683|       |  /* by default, we do not shutdown at the end of the transfer */
  684|  2.91k|  k->shutdown = FALSE;
  ------------------
  |  | 1000|  2.91k|#define FALSE false
  ------------------
  685|  2.91k|  k->shutdown_err_ignore = FALSE;
  ------------------
  |  | 1000|  2.91k|#define FALSE false
  ------------------
  686|       |
  687|       |  /* The code sequence below is placed in this function because all necessary
  688|       |     input is not always known in do_complete() as this function may be called
  689|       |     after that */
  690|  2.91k|  if(!k->header && (recv_size > 0))
  ------------------
  |  Branch (690:6): [True: 2.91k, False: 0]
  |  Branch (690:20): [True: 0, False: 2.91k]
  ------------------
  691|      0|    Curl_pgrsSetDownloadSize(data, recv_size);
  692|       |
  693|       |  /* we want header and/or body, if neither then do not do this! */
  694|  2.91k|  if(conn->scheme->run->write_resp_hd || !data->req.no_body) {
  ------------------
  |  Branch (694:6): [True: 0, False: 2.91k]
  |  Branch (694:42): [True: 2.91k, False: 0]
  ------------------
  695|  2.91k|    if(conn->recv_idx != -1)
  ------------------
  |  Branch (695:8): [True: 0, False: 2.91k]
  ------------------
  696|      0|      CURL_REQ_SET_RECV(data);
  ------------------
  |  |   45|      0|#define CURL_REQ_SET_RECV(d)   ((d)->req.io_flags |= REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|      0|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  697|  2.91k|    if(conn->send_idx != -1)
  ------------------
  |  Branch (697:8): [True: 0, False: 2.91k]
  ------------------
  698|      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 */
  |  |  ------------------
  ------------------
  699|  2.91k|  }
  700|  2.91k|  CURL_TRC_M(data, "xfer_setup: recv_idx=%d, send_idx=%d",
  ------------------
  |  |  148|  2.91k|  do {                                   \
  |  |  149|  2.91k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  2.91k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  2.91k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  5.83k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 2.91k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 2.91k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  5.83k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 2.91k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  2.91k|    ((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.91k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  2.91k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 2.91k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  2.91k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  2.91k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 2.91k]
  |  |  ------------------
  ------------------
  701|  2.91k|             conn->recv_idx, conn->send_idx);
  702|  2.91k|}

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

Curl_u8_strset_init:
   75|  22.4k|{
   76|       |#if defined(__GNUC__) && __GNUC__ >= 13
   77|       |#pragma GCC diagnostic push
   78|       |#pragma GCC diagnostic ignored "-Warray-bounds"
   79|       |#endif
   80|  22.4k|  memset(set, 0, sizeof(*set));
   81|       |#if defined(__GNUC__) && __GNUC__ >= 13
   82|       |#pragma GCC diagnostic pop
   83|       |#endif
   84|  22.4k|  set->data = set->sdata;
   85|  22.4k|  set->ids = set->sids;
   86|  22.4k|  set->psl = set->spsl;
   87|  22.4k|  set->slotbits = CURL_U8_STRSET_START_BITS;
  ------------------
  |  |   39|  22.4k|#define CURL_U8_STRSET_START_BITS   3
  ------------------
   88|  22.4k|  set->count = 0;
   89|  22.4k|#ifdef DEBUGBUILD
   90|  22.4k|  set->init = CURL_U8_STRSET_MAGIC;
  ------------------
  |  |   31|  22.4k|#define CURL_U8_STRSET_MAGIC 0x7117e783
  ------------------
   91|  22.4k|#endif
   92|  22.4k|}
Curl_u8_strset_clear:
   95|  7.48k|{
   96|  7.48k|  uint16_t i;
   97|  7.48k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (97:3): [True: 0, False: 7.48k]
  |  Branch (97:3): [True: 7.48k, False: 0]
  ------------------
   98|  67.3k|  for(i = 0; i < CURL_U8_SET_SLOT_CNT(set); ++i)
  ------------------
  |  |   52|  67.3k|#define CURL_U8_SET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   51|  67.3k|#define CURL_U8_SLOT_CNT(i)           ((uint16_t)u8_smask[(i)] + 1)
  |  |  ------------------
  ------------------
  |  Branch (98:14): [True: 59.8k, False: 7.48k]
  ------------------
   99|  59.8k|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1284|  67.3k|  do {                      \
  |  | 1285|  59.8k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  59.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  59.8k|    (ptr) = NULL;           \
  |  | 1287|  59.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 59.8k]
  |  |  ------------------
  ------------------
  100|       |
  101|  7.48k|  if(set->data != set->sdata)
  ------------------
  |  Branch (101:6): [True: 0, False: 7.48k]
  ------------------
  102|       |    curlx_safefree(set->data);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  103|  7.48k|  Curl_u8_strset_init(set);
  104|  7.48k|}
Curl_u8_strset_get:
  205|   166k|{
  206|   166k|  uint8_t i;
  207|   166k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1027|   166k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (207:3): [True: 0, False: 166k]
  |  Branch (207:3): [True: 166k, False: 0]
  ------------------
  208|   166k|  if(u8_strset_get_index(set, id, &i))
  ------------------
  |  Branch (208:6): [True: 25.8k, False: 140k]
  ------------------
  209|  25.8k|    return set->data[i];
  210|   140k|  return NULL;
  211|   166k|}
Curl_u8_strset_setn:
  215|  28.2k|{
  216|  28.2k|  uint8_t i;
  217|       |
  218|  28.2k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1027|  28.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (218:3): [True: 0, False: 28.2k]
  |  Branch (218:3): [True: 28.2k, False: 0]
  ------------------
  219|       |#if CURL_U8_STRSET_DEBUG
  220|       |  curl_mfprintf(stderr, "u8_strset_setn %d=%s\n", id, str);
  221|       |#endif
  222|  28.2k|  if(!str) {
  ------------------
  |  Branch (222:6): [True: 1.52k, False: 26.6k]
  ------------------
  223|  1.52k|    Curl_u8_strset_unset(set, id);
  224|  1.52k|    return CURLE_OK;
  225|  1.52k|  }
  226|       |
  227|  26.6k|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (227:6): [True: 3.46k, False: 23.2k]
  ------------------
  228|       |    /* `id` is in set, replace value */
  229|  3.46k|    curlx_free(set->data[i]);
  ------------------
  |  | 1428|  3.46k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  230|  3.46k|    set->data[i] = str;
  231|  3.46k|    return CURLE_OK;
  232|  3.46k|  }
  233|       |  /* `id` not in set yet, grow if full */
  234|  23.2k|  if((set->count >= CURL_U8_SET_SLOT_CNT(set)) && !u8_strset_grow(set)) {
  ------------------
  |  |   52|  23.2k|#define CURL_U8_SET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   51|  23.2k|#define CURL_U8_SLOT_CNT(i)           ((uint16_t)u8_smask[(i)] + 1)
  |  |  ------------------
  ------------------
  |  Branch (234:6): [True: 0, False: 23.2k]
  |  Branch (234:51): [True: 0, False: 0]
  ------------------
  235|      0|    curlx_free(str);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  236|      0|    return CURLE_OUT_OF_MEMORY;
  237|      0|  }
  238|       |
  239|  23.2k|  u8_strset_addn(set, id, str);
  240|  23.2k|  return CURLE_OK;
  241|  23.2k|}
Curl_u8_strset_setx:
  245|  23.5k|{
  246|  23.5k|  char *val;
  247|       |
  248|  23.5k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1027|  23.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 23.5k]
  |  Branch (248:3): [True: 23.5k, False: 0]
  ------------------
  249|  23.5k|  if(!str) {
  ------------------
  |  Branch (249:6): [True: 0, False: 23.5k]
  ------------------
  250|      0|    Curl_u8_strset_unset(set, id);
  251|      0|    return CURLE_OK;
  252|      0|  }
  253|       |
  254|  23.5k|  val = curlx_memdup0(str, slen);
  255|  23.5k|  if(!val)
  ------------------
  |  Branch (255:6): [True: 0, False: 23.5k]
  ------------------
  256|      0|    return CURLE_OUT_OF_MEMORY;
  257|  23.5k|  return Curl_u8_strset_setn(set, id, val);
  258|  23.5k|}
Curl_u8_strset_unset:
  296|  1.52k|{
  297|       |  u8_strset_unset(set, id, FALSE);
  ------------------
  |  | 1000|  1.52k|#define FALSE false
  ------------------
  298|  1.52k|}
Curl_u8_strset_unset0:
  301|  37.4k|{
  302|       |  u8_strset_unset(set, id, TRUE);
  ------------------
  |  |  997|  37.4k|#define TRUE true
  ------------------
  303|  37.4k|}
uint-hashset.c:u8_strset_get_index:
  175|   231k|{
  176|   231k|  uint8_t i = CURL_U8_SET_SLOT_IDX(set, id);
  ------------------
  |  |   50|   231k|#define CURL_U8_SET_SLOT_IDX(s, i)    (uint8_t)((i) & u8_smask[(s)->slotbits])
  ------------------
  177|   231k|  uint8_t psl = 0;
  178|   399k|  while(set->data[i] && (psl <= set->psl[i])) {
  ------------------
  |  Branch (178:9): [True: 252k, False: 147k]
  |  Branch (178:25): [True: 197k, False: 54.9k]
  ------------------
  179|   197k|    if(set->ids[i] == id) {
  ------------------
  |  Branch (179:8): [True: 29.9k, False: 167k]
  ------------------
  180|  29.9k|      *pindex = i;
  181|       |#if CURL_U8_STRSET_DEBUG
  182|       |      curl_mfprintf(stderr, "u8_strset_index %d=%s\n", id, set->data[i]);
  183|       |#endif
  184|  29.9k|      return TRUE;
  ------------------
  |  |  997|  29.9k|#define TRUE true
  ------------------
  185|  29.9k|    }
  186|   167k|    i = CURL_U8_SET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   50|   167k|#define CURL_U8_SET_SLOT_IDX(s, i)    (uint8_t)((i) & u8_smask[(s)->slotbits])
  ------------------
  187|   167k|    ++psl;
  188|   167k|  }
  189|       |#if CURL_U8_STRSET_DEBUG
  190|       |  curl_mfprintf(stderr, "u8_strset_index %d not found\n", id);
  191|       |#endif
  192|   201k|  *pindex = 0;
  193|       |  return FALSE;
  ------------------
  |  | 1000|   201k|#define FALSE false
  ------------------
  194|   231k|}
uint-hashset.c:u8_strset_addn:
  107|  23.2k|{
  108|  23.2k|  uint8_t i = CURL_U8_SET_SLOT_IDX(set, id);
  ------------------
  |  |   50|  23.2k|#define CURL_U8_SET_SLOT_IDX(s, i)    (uint8_t)((i) & u8_smask[(s)->slotbits])
  ------------------
  109|  23.2k|  uint8_t psl = 0;
  110|  32.9k|  while(set->data[i]) {
  ------------------
  |  Branch (110:9): [True: 9.76k, False: 23.2k]
  ------------------
  111|  9.76k|    if(psl > set->psl[i]) { /* SWAP */
  ------------------
  |  Branch (111:8): [True: 3.95k, False: 5.80k]
  ------------------
  112|  3.95k|      char *tmpdata;
  113|  3.95k|      tmpdata = set->data[i];
  114|  3.95k|      set->data[i] = val;
  115|  3.95k|      val = tmpdata;
  116|  3.95k|      CURL_SWAP(set->psl[i], psl);
  ------------------
  |  |   36|  3.95k|#define CURL_SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
  ------------------
  117|  3.95k|      CURL_SWAP(set->ids[i], id);
  ------------------
  |  |   36|  3.95k|#define CURL_SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
  ------------------
  118|  3.95k|    }
  119|  9.76k|    i = CURL_U8_SET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   50|  9.76k|#define CURL_U8_SET_SLOT_IDX(s, i)    (uint8_t)((i) & u8_smask[(s)->slotbits])
  ------------------
  120|  9.76k|    ++psl;
  121|  9.76k|  }
  122|  23.2k|  set->ids[i] = id;
  123|  23.2k|  set->data[i] = val;
  124|  23.2k|  set->psl[i] = psl;
  125|  23.2k|  ++set->count;
  126|  23.2k|}
uint-hashset.c:u8_strset_unset:
  270|  38.9k|{
  271|  38.9k|  uint8_t i, j;
  272|       |
  273|  38.9k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1027|  38.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 38.9k]
  |  Branch (273:3): [True: 38.9k, False: 0]
  ------------------
  274|  38.9k|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (274:6): [True: 562, False: 38.3k]
  ------------------
  275|       |    /* `id` is in set */
  276|    562|    if(zero)
  ------------------
  |  Branch (276:8): [True: 119, False: 443]
  ------------------
  277|    119|      curlx_strzero(set->data[i]);
  278|    562|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1284|    562|  do {                      \
  |  | 1285|    562|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|    562|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|    562|    (ptr) = NULL;           \
  |  | 1287|    562|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 562]
  |  |  ------------------
  ------------------
  279|    562|    set->ids[i] = set->psl[i] = 0;
  280|    562|    --set->count;
  281|    562|    j = CURL_U8_SET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   50|    562|#define CURL_U8_SET_SLOT_IDX(s, i)    (uint8_t)((i) & u8_smask[(s)->slotbits])
  ------------------
  282|       |    /* shift all entries with positive psl "down" */
  283|    596|    while(set->data[j] && set->psl[j]) {
  ------------------
  |  Branch (283:11): [True: 548, False: 48]
  |  Branch (283:27): [True: 34, False: 514]
  ------------------
  284|     34|      set->data[i] = set->data[j];
  285|     34|      set->ids[i] = set->ids[j];
  286|     34|      set->psl[i] = (uint8_t)(set->psl[j] - 1);
  287|     34|      set->data[j] = NULL;
  288|     34|      set->ids[j] = set->psl[j] = 0;
  289|     34|      i = j;
  290|     34|      j = CURL_U8_SET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   50|     34|#define CURL_U8_SET_SLOT_IDX(s, i)    (uint8_t)((i) & u8_smask[(s)->slotbits])
  ------------------
  291|     34|    }
  292|    562|  }
  293|  38.9k|}

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

Curl_freeset:
  148|  7.48k|{
  149|       |  /* Free all dynamic strings stored in the data->set substructure. */
  150|  7.48k|  enum dupblob j;
  151|       |
  152|  7.48k|  CURL_EASY_STR_CLEAR0(data, STRING_PASSWORD);
  ------------------
  |  | 1242|  7.48k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  153|  7.48k|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD);
  ------------------
  |  | 1242|  7.48k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  154|  7.48k|  CURL_EASY_STR_CLEAR0(data, STRING_BEARER);
  ------------------
  |  | 1242|  7.48k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  155|  7.48k|#ifndef CURL_DISABLE_PROXY
  156|  7.48k|  CURL_EASY_STR_CLEAR0(data, STRING_PROXYPASSWORD);
  ------------------
  |  | 1242|  7.48k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  157|  7.48k|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD_PROXY);
  ------------------
  |  | 1242|  7.48k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  158|  7.48k|#endif
  159|  7.48k|  Curl_u8_strset_clear(&data->set.strings);
  160|  7.48k|  curlx_safefree(data->set.str_copypostfields);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  161|       |
  162|  67.3k|  for(j = (enum dupblob)0; j < BLOB_LAST; j++) {
  ------------------
  |  Branch (162:28): [True: 59.8k, False: 7.48k]
  ------------------
  163|  59.8k|    curlx_safefree(data->set.blobs[j]);
  ------------------
  |  | 1284|  59.8k|  do {                      \
  |  | 1285|  59.8k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  59.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  59.8k|    (ptr) = NULL;           \
  |  | 1287|  59.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 59.8k]
  |  |  ------------------
  ------------------
  164|  59.8k|  }
  165|       |
  166|  7.48k|  Curl_bufref_free(&data->state.referer);
  167|  7.48k|  Curl_bufref_free(&data->state.url);
  168|       |
  169|  7.48k|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
  170|  7.48k|  Curl_mime_cleanpart(data->set.mimepostp);
  171|  7.48k|  curlx_safefree(data->set.mimepostp);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  172|  7.48k|#endif
  173|       |
  174|  7.48k|#ifndef CURL_DISABLE_COOKIES
  175|  7.48k|  curl_slist_free_all(data->state.cookielist);
  176|       |  data->state.cookielist = NULL;
  177|  7.48k|#endif
  178|  7.48k|}
Curl_close:
  198|  7.48k|{
  199|  7.48k|  struct Curl_easy *data;
  200|       |
  201|  7.48k|  if(!datap || !*datap)
  ------------------
  |  Branch (201:6): [True: 0, False: 7.48k]
  |  Branch (201:16): [True: 0, False: 7.48k]
  ------------------
  202|      0|    return CURLE_OK;
  203|       |
  204|  7.48k|  data = *datap;
  205|  7.48k|  *datap = NULL;
  206|       |
  207|  7.48k|  if(!data->state.internal && data->multi) {
  ------------------
  |  Branch (207:6): [True: 3.74k, False: 3.74k]
  |  Branch (207:31): [True: 0, False: 3.74k]
  ------------------
  208|       |    /* This handle is still part of a multi handle, take care of this first
  209|       |       and detach this handle from there.
  210|       |       This detaches the connection. */
  211|      0|    Curl_multi_remove_handle(data->multi, data);
  212|      0|  }
  213|  7.48k|  else {
  214|       |    /* Detach connection if any is left. This should not be normal, but can be
  215|       |       the case for example with CONNECT_ONLY + recv/send (test 556) */
  216|  7.48k|    Curl_detach_connection(data);
  217|  7.48k|    if(!data->state.internal && data->multi_easy) {
  ------------------
  |  Branch (217:8): [True: 3.74k, False: 3.74k]
  |  Branch (217:33): [True: 0, False: 3.74k]
  ------------------
  218|       |      /* when curl_easy_perform() is used, it creates its own multi handle to
  219|       |         use and this is the one */
  220|      0|      curl_multi_cleanup(data->multi_easy);
  221|      0|      data->multi_easy = NULL;
  222|      0|    }
  223|  7.48k|  }
  224|  7.48k|  DEBUGASSERT(!data->conn || data->state.internal);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 7.48k, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  |  Branch (224:3): [True: 7.48k, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  ------------------
  225|       |
  226|  7.48k|  Curl_expire_clear_all(data); /* shut off any timers left */
  227|       |
  228|  7.48k|  if(data->state.rangestringalloc)
  ------------------
  |  Branch (228:6): [True: 0, False: 7.48k]
  ------------------
  229|      0|    curlx_free(data->state.range);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  230|       |
  231|       |  /* release any resolve information this transfer kept */
  232|  7.48k|  Curl_resolv_destroy_all(data);
  233|       |
  234|  7.48k|  data->set.verbose = FALSE; /* no more calls to DEBUGFUNCTION */
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  235|  7.48k|  data->magic = 0; /* force a clear AFTER the possibly enforced removal from
  236|       |                    * the multi handle and async dns shutdown. The multi
  237|       |                    * handle might check the magic and so might any
  238|       |                    * DEBUGFUNCTION invoked for tracing */
  239|       |
  240|       |  /* freed here in case DONE was not called */
  241|  7.48k|  Curl_req_free(&data->req, data);
  242|       |
  243|       |  /* Close down all open SSL info and sessions */
  244|  7.48k|  Curl_ssl_close_all(data);
  245|  7.48k|  Curl_peer_unlink(&data->state.origin);
  246|  7.48k|  Curl_peer_unlink(&data->state.initial_origin);
  247|  7.48k|  Curl_ssl_free_certinfo(data);
  248|       |
  249|  7.48k|  Curl_bufref_free(&data->state.referer);
  250|       |
  251|  7.48k|  up_free(data);
  252|  7.48k|  curlx_dyn_free(&data->state.headerb);
  253|  7.48k|  Curl_flush_cookies(data, TRUE);
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  254|  7.48k|#ifndef CURL_DISABLE_ALTSVC
  255|  7.48k|  Curl_altsvc_save(data, data->asi, CURL_EASY_STR(data, STRING_ALTSVC));
  ------------------
  |  | 1234|  7.48k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  256|  7.48k|  Curl_altsvc_cleanup(&data->asi);
  257|  7.48k|#endif
  258|  7.48k|#ifndef CURL_DISABLE_HSTS
  259|  7.48k|  Curl_hsts_save(data, data->hsts, CURL_EASY_STR(data, STRING_HSTS));
  ------------------
  |  | 1234|  7.48k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  260|  7.48k|  if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (260:6): [True: 7.48k, False: 0]
  |  Branch (260:22): [True: 0, False: 0]
  ------------------
  261|  7.48k|    Curl_hsts_cleanup(&data->hsts);
  262|  7.48k|  curl_slist_free_all(data->state.hstslist); /* clean up list */
  263|  7.48k|#endif
  264|  7.48k|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
  265|  7.48k|  Curl_http_auth_cleanup_digest(data);
  266|  7.48k|#endif
  267|  7.48k|  curlx_safefree(data->state.most_recent_ftp_entrypath);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  268|  7.48k|  curlx_safefree(data->info.contenttype);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  269|  7.48k|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  270|       |
  271|       |  /* No longer a dirty share, if it exists */
  272|  7.48k|  if(Curl_share_easy_unlink(data))
  ------------------
  |  Branch (272:6): [True: 0, False: 7.48k]
  ------------------
  273|  7.48k|    DEBUGASSERT(0);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:5): [Folded, False: 0]
  |  Branch (273:5): [Folded, False: 0]
  ------------------
  274|       |
  275|  7.48k|  Curl_hash_destroy(&data->meta_hash);
  276|  7.48k|  Curl_creds_unlink(&data->state.creds);
  277|  7.48k|#ifndef CURL_DISABLE_HTTP
  278|  7.48k|  curlx_safefree(data->state.rangeline);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  279|  7.48k|  curlx_safefree(data->state.http_host);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  280|  7.48k|#endif
  281|  7.48k|#ifndef CURL_DISABLE_COOKIES
  282|  7.48k|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  283|  7.48k|#endif
  284|       |
  285|  7.48k|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API)
  286|  7.48k|  Curl_mime_cleanpart(data->state.formp);
  287|  7.48k|  curlx_safefree(data->state.formp);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  288|  7.48k|#endif
  289|       |
  290|       |  /* destruct wildcard structures if it is needed */
  291|  7.48k|  Curl_wildcard_dtor(&data->wildcard);
  292|  7.48k|  Curl_freeset(data);
  293|  7.48k|  Curl_headers_cleanup(data);
  294|  7.48k|  Curl_netrc_cleanup(&data->state.netrc);
  295|  7.48k|#ifndef CURL_DISABLE_DIGEST_AUTH
  296|  7.48k|  curlx_free(data->state.envproxy);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  297|  7.48k|#endif
  298|  7.48k|  curlx_memzero(data, sizeof(*data));
  299|  7.48k|  curlx_free(data);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  300|  7.48k|  return CURLE_OK;
  301|  7.48k|}
Curl_init_userdefined:
  308|  7.48k|{
  309|  7.48k|  struct UserDefined *set = &data->set;
  310|       |
  311|  7.48k|  set->out = stdout;  /* default output to stdout */
  312|  7.48k|  set->in_set = stdin;  /* default input from stdin */
  313|  7.48k|  set->err = stderr;  /* default stderr to stderr */
  314|       |
  315|  7.48k|  Curl_u8_strset_init(&data->set.strings);
  316|       |
  317|  7.48k|#if defined(__clang__) && __clang_major__ >= 16
  318|  7.48k|#pragma clang diagnostic push
  319|  7.48k|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  320|  7.48k|#endif
  321|       |  /* use fwrite as default function to store output */
  322|  7.48k|  set->fwrite_func = (curl_write_callback)fwrite;
  323|       |
  324|       |  /* use fread as default function to read input */
  325|  7.48k|  set->fread_func_set = (curl_read_callback)fread;
  326|  7.48k|#if defined(__clang__) && __clang_major__ >= 16
  327|  7.48k|#pragma clang diagnostic pop
  328|  7.48k|#endif
  329|  7.48k|  set->is_fread_set = 0;
  330|       |
  331|  7.48k|  set->seek_client = ZERO_NULL;
  ------------------
  |  | 1110|  7.48k|#define ZERO_NULL 0
  ------------------
  332|       |
  333|  7.48k|  set->filesize = -1;        /* we do not know the size */
  334|  7.48k|  set->postfieldsize = -1;   /* unknown size */
  335|  7.48k|  set->maxredirs = 30;       /* sensible default */
  336|       |
  337|  7.48k|  set->method = HTTPREQ_GET; /* Default HTTP request */
  338|  7.48k|#ifndef CURL_DISABLE_RTSP
  339|  7.48k|  set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */
  ------------------
  |  |   34|  7.48k|#define RTSPREQ_OPTIONS CURL_RTSPREQ_OPTIONS
  |  |  ------------------
  |  |  |  | 2367|  7.48k|#define CURL_RTSPREQ_OPTIONS       1L
  |  |  ------------------
  ------------------
  340|  7.48k|#endif
  341|  7.48k|#ifndef CURL_DISABLE_FTP
  342|  7.48k|  set->ftp_use_epsv = TRUE;   /* FTP defaults to EPSV operations */
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  343|  7.48k|  set->ftp_use_eprt = TRUE;   /* FTP defaults to EPRT operations */
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  344|  7.48k|  set->ftp_use_pret = FALSE;  /* mainly useful for drftpd servers */
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  345|  7.48k|  set->ftp_filemethod = FTPFILE_MULTICWD;
  346|  7.48k|  set->ftp_skip_ip = TRUE;    /* skip PASV IP by default */
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  347|  7.48k|#endif
  348|  7.48k|  set->dns_cache_timeout_ms = 60000; /* Timeout every 60 seconds by default */
  349|       |
  350|       |  /* Timeout every 24 hours by default */
  351|  7.48k|  set->ssl_ca_cache_timeout = 24 * 60 * 60;
  352|       |
  353|  7.48k|  set->httpauth = CURLAUTH_BASIC;  /* defaults to basic */
  ------------------
  |  |  833|  7.48k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  354|       |
  355|  7.48k|  Curl_ssl_config_init(&data->set.ssl);
  356|  7.48k|#ifndef CURL_DISABLE_PROXY
  357|  7.48k|  Curl_ssl_config_init(&data->set.proxy_ssl);
  358|  7.48k|  set->proxyport = 0;
  359|  7.48k|  set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
  ------------------
  |  |  792|  7.48k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  360|  7.48k|  set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
  ------------------
  |  |  833|  7.48k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  361|       |  /* SOCKS5 proxy auth defaults to username/password + GSS-API */
  362|  7.48k|  set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  833|  7.48k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  839|  7.48k|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|  7.48k|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  363|  7.48k|#endif
  364|       |
  365|  7.48k|#ifndef CURL_DISABLE_DOH
  366|  7.48k|  set->doh_verifyhost = TRUE;
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  367|  7.48k|  set->doh_verifypeer = TRUE;
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  368|  7.48k|#endif
  369|       |#ifdef USE_SSH
  370|       |  /* defaults to any auth type */
  371|       |  set->ssh_auth_types = CURLSSH_AUTH_DEFAULT;
  372|       |  set->new_directory_perms = 0755; /* Default permissions */
  373|       |#endif
  374|       |
  375|  7.48k|  set->new_file_perms = 0644;    /* Default permissions */
  376|  7.48k|  set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   66|  7.48k|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
  377|  7.48k|  set->redir_protocols = CURLPROTO_REDIR;
  ------------------
  |  |   69|  7.48k|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1088|  7.48k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1089|  7.48k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1090|  7.48k|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   70|  7.48k|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1091|  7.48k|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  378|       |
  379|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  380|       |  /*
  381|       |   * disallow unprotected protection negotiation NEC reference implementation
  382|       |   * seem not to follow rfc1961 section 4.3/4.4
  383|       |   */
  384|       |  set->socks5_gssapi_nec = FALSE;
  385|       |#endif
  386|       |
  387|       |  /* set default minimum TLS version */
  388|  7.48k|#ifdef USE_SSL
  389|  7.48k|  Curl_setopt_SSLVERSION(data, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|  7.48k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  390|  7.48k|#ifndef CURL_DISABLE_PROXY
  391|  7.48k|  Curl_setopt_SSLVERSION(data, CURLOPT_PROXY_SSLVERSION,
  392|  7.48k|                         CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|  7.48k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  393|  7.48k|#endif
  394|  7.48k|#endif
  395|  7.48k|#ifndef CURL_DISABLE_FTP
  396|  7.48k|  set->wildcard_enabled = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  397|  7.48k|  set->chunk_bgn = ZERO_NULL;
  ------------------
  |  | 1110|  7.48k|#define ZERO_NULL 0
  ------------------
  398|  7.48k|  set->chunk_end = ZERO_NULL;
  ------------------
  |  | 1110|  7.48k|#define ZERO_NULL 0
  ------------------
  399|  7.48k|  set->fnmatch = ZERO_NULL;
  ------------------
  |  | 1110|  7.48k|#define ZERO_NULL 0
  ------------------
  400|  7.48k|#endif
  401|  7.48k|  set->tcp_keepalive = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  402|  7.48k|  set->tcp_keepintvl = 60;
  403|  7.48k|  set->tcp_keepidle = 60;
  404|  7.48k|  set->tcp_keepcnt = 9;
  405|  7.48k|  set->tcp_fastopen = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  406|  7.48k|  set->tcp_nodelay = TRUE;
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  407|  7.48k|  set->ssl_enable_alpn = TRUE;
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  408|  7.48k|  set->expect_100_timeout = 1000L; /* Wait for a second by default. */
  409|  7.48k|  set->sep_headers = TRUE; /* separated header lists by default */
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  410|  7.48k|  set->buffer_size = READBUFFER_SIZE;
  ------------------
  |  |  120|  7.48k|#define READBUFFER_SIZE CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  267|  7.48k|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
  411|  7.48k|  set->upload_buffer_size = UPLOADBUFFER_DEFAULT;
  ------------------
  |  |  132|  7.48k|#define UPLOADBUFFER_DEFAULT 65536
  ------------------
  412|  7.48k|  set->upload_flags = CURLULFLAG_SEEN;
  ------------------
  |  | 1054|  7.48k|#define CURLULFLAG_SEEN     (1L << 4)
  ------------------
  413|  7.48k|  set->happy_eyeballs_timeout = CURL_HET_DEFAULT;
  ------------------
  |  |  979|  7.48k|#define CURL_HET_DEFAULT 200L
  ------------------
  414|  7.48k|  set->upkeep_interval_ms = CURL_UPKEEP_INTERVAL_DEFAULT;
  ------------------
  |  |  982|  7.48k|#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
  ------------------
  415|  7.48k|  set->maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
  ------------------
  |  |   38|  7.48k|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  416|  7.48k|  set->conn_max_idle_ms = 118 * 1000;
  417|  7.48k|  set->conn_max_age_ms = 24 * 3600 * 1000;
  418|  7.48k|  set->http09_allowed = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  419|  7.48k|  set->httpwant = CURL_HTTP_VERSION_NONE;
  ------------------
  |  | 2338|  7.48k|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  420|  7.48k|#if defined(USE_HTTP2) || defined(USE_HTTP3)
  421|  7.48k|  set->weight = 0;
  422|  7.48k|#endif
  423|  7.48k|  set->quick_exit = 0L;
  424|  7.48k|#ifndef CURL_DISABLE_WEBSOCKETS
  425|  7.48k|  set->ws_raw_mode = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  426|       |  set->ws_no_auto_pong = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  427|  7.48k|#endif
  428|  7.48k|}
Curl_open:
  449|  7.48k|{
  450|  7.48k|  struct Curl_easy *data;
  451|       |
  452|       |  /* simple start-up: alloc the struct, init it with zeroes and return */
  453|  7.48k|  data = curlx_calloc(1, sizeof(struct Curl_easy));
  ------------------
  |  | 1425|  7.48k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  454|  7.48k|  if(!data) {
  ------------------
  |  Branch (454:6): [True: 0, False: 7.48k]
  ------------------
  455|       |    /* this is a serious error */
  456|      0|    DEBUGF(curl_mfprintf(stderr, "Error: calloc of Curl_easy failed\n"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  ------------------
  457|      0|    return CURLE_OUT_OF_MEMORY;
  458|      0|  }
  459|       |
  460|  7.48k|  data->magic = CURLEASY_MAGIC_NUMBER;
  ------------------
  |  |   28|  7.48k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  ------------------
  461|       |  /* most recent connection is not yet defined */
  462|  7.48k|  data->state.lastconnect_id = -1;
  463|       |  /* and not assigned an id yet */
  464|  7.48k|  data->id = -1;
  465|  7.48k|  data->mid = UINT32_MAX;
  466|  7.48k|  data->master_mid = UINT32_MAX;
  467|  7.48k|  data->progress.hide = TRUE;
  ------------------
  |  |  997|  7.48k|#define TRUE true
  ------------------
  468|       |
  469|  7.48k|  Curl_hash_init(&data->meta_hash, 23, CURL_HASH_TYPE_BYTES,
  470|  7.48k|                 easy_meta_freeentry);
  471|  7.48k|  DEBUGASSERT(STRING_LAST <= UINT8_MAX);
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (471:3): [True: 0, Folded]
  |  Branch (471:3): [True: 7.48k, Folded]
  ------------------
  472|  7.48k|  Curl_u8_strset_init(&data->set.strings);
  473|  7.48k|  curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|  7.48k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  474|  7.48k|  Curl_bufref_init(&data->state.url);
  475|  7.48k|  Curl_bufref_init(&data->state.referer);
  476|  7.48k|  Curl_req_init(&data->req);
  477|  7.48k|  Curl_initinfo(data);
  478|  7.48k|#ifndef CURL_DISABLE_HTTP
  479|  7.48k|  Curl_llist_init(&data->state.httphdrs, NULL);
  480|  7.48k|#endif
  481|  7.48k|  Curl_netrc_init(&data->state.netrc);
  482|  7.48k|  Curl_init_userdefined(data);
  483|       |
  484|  7.48k|  *curl = data;
  485|  7.48k|  return CURLE_OK;
  486|  7.48k|}
Curl_conn_free:
  489|  3.04k|{
  490|  3.04k|  int8_t i;
  491|       |
  492|  3.04k|  DEBUGASSERT(conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (492:3): [True: 0, False: 3.04k]
  |  Branch (492:3): [True: 3.04k, False: 0]
  ------------------
  493|       |
  494|  3.04k|  if(conn->scheme && conn->scheme->run->disconnect &&
  ------------------
  |  Branch (494:6): [True: 3.04k, False: 0]
  |  Branch (494:22): [True: 0, False: 3.04k]
  ------------------
  495|      0|     !conn->bits.shutdown_handler)
  ------------------
  |  Branch (495:6): [True: 0, False: 0]
  ------------------
  496|      0|    conn->scheme->run->disconnect(data, conn, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  497|       |
  498|  9.12k|  for(i = 0; i < (int8_t)CURL_ARRAYSIZE(conn->cfilter); ++i) {
  ------------------
  |  | 1251|  9.12k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (498:14): [True: 6.08k, False: 3.04k]
  ------------------
  499|  6.08k|    Curl_conn_cf_discard_all(data, conn, i);
  500|  6.08k|  }
  501|       |
  502|  3.04k|#ifndef CURL_DISABLE_PROXY
  503|  3.04k|  Curl_peer_unlink(&conn->http_proxy.peer);
  504|  3.04k|  Curl_peer_unlink(&conn->socks_proxy.peer);
  505|  3.04k|  Curl_creds_unlink(&conn->http_proxy.creds);
  506|  3.04k|  Curl_creds_unlink(&conn->socks_proxy.creds);
  507|  3.04k|#endif
  508|  3.04k|  Curl_creds_unlink(&conn->creds);
  509|  3.04k|  Curl_peer_unlink(&conn->creds_origin);
  510|  3.04k|  curlx_safefree(conn->options);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  511|  3.04k|  curlx_safefree(conn->localdev);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  512|  3.04k|  Curl_ssl_conn_config_cleanup(conn);
  513|       |
  514|  3.04k|  curlx_safefree(conn->destination);
  ------------------
  |  | 1284|  3.04k|  do {                      \
  |  | 1285|  3.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.04k|    (ptr) = NULL;           \
  |  | 1287|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  515|  3.04k|  Curl_hash_destroy(&conn->meta_hash);
  516|  3.04k|  Curl_peer_unlink(&conn->origin);
  517|  3.04k|  Curl_peer_unlink(&conn->via_peer);
  518|  3.04k|  Curl_peer_unlink(&conn->origin2);
  519|  3.04k|  Curl_peer_unlink(&conn->via_peer2);
  520|       |
  521|  3.04k|  curlx_free(conn); /* free all the connection oriented data */
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  522|  3.04k|}
Curl_uc_to_curlcode:
 1187|    489|{
 1188|    489|  switch(uc) {
 1189|    489|  default:
  ------------------
  |  Branch (1189:3): [True: 489, False: 0]
  ------------------
 1190|    489|    return CURLE_URL_MALFORMAT;
 1191|      0|  case CURLUE_UNSUPPORTED_SCHEME:
  ------------------
  |  Branch (1191:3): [True: 0, False: 489]
  ------------------
 1192|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
 1193|      0|  case CURLUE_OUT_OF_MEMORY:
  ------------------
  |  Branch (1193:3): [True: 0, False: 489]
  ------------------
 1194|      0|    return CURLE_OUT_OF_MEMORY;
 1195|      0|  case CURLUE_USER_NOT_ALLOWED:
  ------------------
  |  Branch (1195:3): [True: 0, False: 489]
  ------------------
 1196|      0|    return CURLE_LOGIN_DENIED;
 1197|    489|  }
 1198|    489|}
Curl_parse_login_details:
 1597|  2.53k|{
 1598|  2.53k|  char *ubuf = NULL;
 1599|  2.53k|  char *pbuf = NULL;
 1600|  2.53k|  const char *psep = NULL;
 1601|  2.53k|  const char *osep = NULL;
 1602|  2.53k|  size_t ulen;
 1603|  2.53k|  size_t plen;
 1604|  2.53k|  size_t olen;
 1605|       |
 1606|  2.53k|  DEBUGASSERT(userp);
  ------------------
  |  | 1027|  2.53k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1606:3): [True: 0, False: 2.53k]
  |  Branch (1606:3): [True: 2.53k, False: 0]
  ------------------
 1607|  2.53k|  DEBUGASSERT(passwdp);
  ------------------
  |  | 1027|  2.53k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1607:3): [True: 0, False: 2.53k]
  |  Branch (1607:3): [True: 2.53k, False: 0]
  ------------------
 1608|       |
 1609|       |  /* Attempt to find the password separator */
 1610|  2.53k|  psep = memchr(login, ':', len);
 1611|       |
 1612|       |  /* Attempt to find the options separator */
 1613|  2.53k|  if(optionsp)
  ------------------
  |  Branch (1613:6): [True: 0, False: 2.53k]
  ------------------
 1614|      0|    osep = memchr(login, ';', len);
 1615|       |
 1616|       |  /* Calculate the portion lengths */
 1617|  2.53k|  ulen = (psep ?
  ------------------
  |  Branch (1617:11): [True: 839, False: 1.69k]
  ------------------
 1618|    839|          (size_t)(osep && psep > osep ? osep - login : psep - login) :
  ------------------
  |  Branch (1618:20): [True: 0, False: 839]
  |  Branch (1618:28): [True: 0, False: 0]
  ------------------
 1619|  2.53k|          (osep ? (size_t)(osep - login) : len));
  ------------------
  |  Branch (1619:12): [True: 0, False: 1.69k]
  ------------------
 1620|  2.53k|  plen = (psep ?
  ------------------
  |  Branch (1620:11): [True: 839, False: 1.69k]
  ------------------
 1621|    839|          (osep && osep > psep ? (size_t)(osep - psep) :
  ------------------
  |  Branch (1621:12): [True: 0, False: 839]
  |  Branch (1621:20): [True: 0, False: 0]
  ------------------
 1622|  1.69k|           (size_t)(login + len - psep)) - 1 : 0);
 1623|  2.53k|  olen = (osep ?
  ------------------
  |  Branch (1623:11): [True: 0, False: 2.53k]
  ------------------
 1624|      0|          (psep && psep > osep ? (size_t)(psep - osep) :
  ------------------
  |  Branch (1624:12): [True: 0, False: 0]
  |  Branch (1624:20): [True: 0, False: 0]
  ------------------
 1625|  2.53k|           (size_t)(login + len - osep)) - 1 : 0);
 1626|       |
 1627|       |  /* Clone the user portion buffer, which can be zero length */
 1628|  2.53k|  ubuf = curlx_memdup0(login, ulen);
 1629|  2.53k|  if(!ubuf)
  ------------------
  |  Branch (1629:6): [True: 0, False: 2.53k]
  ------------------
 1630|      0|    goto error;
 1631|       |
 1632|       |  /* Clone the password portion buffer */
 1633|  2.53k|  if(psep) {
  ------------------
  |  Branch (1633:6): [True: 839, False: 1.69k]
  ------------------
 1634|    839|    pbuf = curlx_memdup0(&psep[1], plen);
 1635|    839|    if(!pbuf)
  ------------------
  |  Branch (1635:8): [True: 0, False: 839]
  ------------------
 1636|      0|      goto error;
 1637|    839|  }
 1638|       |
 1639|       |  /* Allocate the options portion buffer */
 1640|  2.53k|  if(optionsp) {
  ------------------
  |  Branch (1640:6): [True: 0, False: 2.53k]
  ------------------
 1641|      0|    char *obuf = NULL;
 1642|      0|    if(olen) {
  ------------------
  |  Branch (1642:8): [True: 0, False: 0]
  ------------------
 1643|      0|      obuf = curlx_memdup0(&osep[1], olen);
 1644|      0|      if(!obuf)
  ------------------
  |  Branch (1644:10): [True: 0, False: 0]
  ------------------
 1645|      0|        goto error;
 1646|      0|    }
 1647|      0|    *optionsp = obuf;
 1648|      0|  }
 1649|  2.53k|  *userp = ubuf;
 1650|  2.53k|  *passwdp = pbuf;
 1651|  2.53k|  return CURLE_OK;
 1652|      0|error:
 1653|      0|  curlx_free(ubuf);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1654|      0|  curlx_free(pbuf);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1655|      0|  return CURLE_OUT_OF_MEMORY;
 1656|  2.53k|}
Curl_connect:
 2437|  3.74k|{
 2438|  3.74k|  CURLcode result;
 2439|  3.74k|  struct connectdata *conn = NULL;
 2440|  3.74k|  const struct curltime *pnow = NULL;
 2441|  3.74k|  *pconnected = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2442|       |
 2443|       |  /* Set the request to virgin state based on transfer settings */
 2444|  3.74k|  Curl_req_hard_reset(&data->req, data);
 2445|       |  /* Determine the origin of the transfer and what credentials to use */
 2446|  3.74k|  result = url_set_data_origin_and_creds(data);
 2447|  3.74k|  if(result)
  ------------------
  |  Branch (2447:6): [True: 699, False: 3.04k]
  ------------------
 2448|    699|    goto out;
 2449|  3.04k|  if(!data->state.origin) { /* just make really sure */
  ------------------
  |  Branch (2449:6): [True: 0, False: 3.04k]
  ------------------
 2450|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2450:5): [Folded, False: 0]
  |  Branch (2450:5): [Folded, False: 0]
  ------------------
 2451|      0|    result = CURLE_FAILED_INIT;
 2452|      0|    goto out;
 2453|      0|  }
 2454|       |
 2455|       |  /* Get or create a connection for the transfer. */
 2456|  3.04k|  pnow = Curl_pgrs_now(data);
 2457|  3.04k|  Curl_pgrsTimeWas(data, TIMER_POSTQUEUE, *pnow);
 2458|  3.04k|  result = url_find_or_create_conn(data, pnow);
 2459|  3.04k|  conn = data->conn;
 2460|  3.04k|  if(result)
  ------------------
  |  Branch (2460:6): [True: 0, False: 3.04k]
  ------------------
 2461|      0|    goto out;
 2462|  3.04k|  if(!data->conn) { /* just make really sure */
  ------------------
  |  Branch (2462:6): [True: 0, False: 3.04k]
  ------------------
 2463|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2463:5): [Folded, False: 0]
  |  Branch (2463:5): [Folded, False: 0]
  ------------------
 2464|      0|    result = CURLE_FAILED_INIT;
 2465|      0|    goto out;
 2466|      0|  }
 2467|       |
 2468|  3.04k|  if(conn->bits.reuse) {
  ------------------
  |  Branch (2468:6): [True: 0, False: 3.04k]
  ------------------
 2469|      0|    if(conn->attached_xfers > 1)
  ------------------
  |  Branch (2469:8): [True: 0, False: 0]
  ------------------
 2470|       |      /* multiplexed */
 2471|      0|      *pconnected = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2472|      0|  }
 2473|  3.04k|  else if(conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  211|  3.04k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (2473:11): [True: 0, False: 3.04k]
  ------------------
 2474|      0|    Curl_pgrsTime(data, TIMER_NAMELOOKUP);
 2475|      0|    *pconnected = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2476|      0|  }
 2477|  3.04k|  else {
 2478|  3.04k|    result = Curl_conn_setup(data, conn, FIRSTSOCKET, CURL_CF_SSL_DEFAULT);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
                  result = Curl_conn_setup(data, conn, FIRSTSOCKET, CURL_CF_SSL_DEFAULT);
  ------------------
  |  |  364|  3.04k|#define CURL_CF_SSL_DEFAULT  (-1)
  ------------------
 2479|  3.04k|    if(!result)
  ------------------
  |  Branch (2479:8): [True: 3.04k, False: 0]
  ------------------
 2480|  3.04k|      result = Curl_headers_init(data);
 2481|  3.04k|    CURL_TRC_M(data, "Curl_conn_setup() -> %d", (int)result);
  ------------------
  |  |  148|  3.04k|  do {                                   \
  |  |  149|  3.04k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.04k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
 2482|  3.04k|  }
 2483|       |
 2484|  3.74k|out:
 2485|  3.74k|  if(result == CURLE_NO_CONNECTION_AVAILABLE)
  ------------------
  |  Branch (2485:6): [True: 0, False: 3.74k]
  ------------------
 2486|  3.74k|    DEBUGASSERT(!conn);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2486:5): [True: 0, False: 0]
  |  Branch (2486:5): [True: 0, False: 0]
  ------------------
 2487|       |
 2488|  3.74k|  if(result && conn) {
  ------------------
  |  Branch (2488:6): [True: 699, False: 3.04k]
  |  Branch (2488:16): [True: 0, False: 699]
  ------------------
 2489|       |    /* We are not allowed to return failure with memory left allocated in the
 2490|       |       connectdata struct, free those here */
 2491|      0|    Curl_detach_connection(data);
 2492|      0|    Curl_conn_close(data, conn, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2493|      0|  }
 2494|       |
 2495|  3.74k|  return result;
 2496|  3.74k|}
Curl_init_transfer:
 2508|  3.04k|{
 2509|  3.04k|  CURLcode result;
 2510|       |
 2511|  3.04k|  if(conn) {
  ------------------
  |  Branch (2511:6): [True: 3.04k, False: 0]
  ------------------
 2512|  3.04k|    conn->bits.do_more = FALSE; /* by default there is no curl_do_more() to
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 2513|       |                                   use */
 2514|       |    /* if the protocol used does not support wildcards, switch it off */
 2515|  3.04k|    if(data->state.wildcardmatch &&
  ------------------
  |  Branch (2515:8): [True: 0, False: 3.04k]
  ------------------
 2516|      0|       !(conn->scheme->flags & PROTOPT_WILDCARD))
  ------------------
  |  |  227|      0|#define PROTOPT_WILDCARD (1 << 12)  /* protocol supports wildcard matching */
  ------------------
  |  Branch (2516:8): [True: 0, False: 0]
  ------------------
 2517|      0|      data->state.wildcardmatch = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2518|  3.04k|  }
 2519|       |
 2520|  3.04k|  data->state.done = FALSE; /* *_done() is not called yet */
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 2521|       |
 2522|  3.04k|  data->req.no_body = data->set.opt_no_body;
 2523|  3.04k|  if(data->req.no_body)
  ------------------
  |  Branch (2523:6): [True: 0, False: 3.04k]
  ------------------
 2524|       |    /* in HTTP lingo, no body means using the HEAD request... */
 2525|      0|    data->state.httpreq = HTTPREQ_HEAD;
 2526|       |
 2527|  3.04k|  result = Curl_req_start(&data->req, data);
 2528|  3.04k|  if(!result) {
  ------------------
  |  Branch (2528:6): [True: 3.04k, False: 0]
  ------------------
 2529|  3.04k|    Curl_pgrsReset(data);
 2530|  3.04k|  }
 2531|  3.04k|  return result;
 2532|  3.04k|}
Curl_data_priority_clear_state:
 2537|  3.74k|{
 2538|  3.74k|  data->state.weight = 0;
 2539|  3.74k|}
Curl_conn_meta_remove:
 2555|  3.04k|{
 2556|  3.04k|  Curl_hash_delete(&conn->meta_hash, key, strlen(key) + 1);
 2557|  3.04k|}
Curl_get_admin:
 2565|  9.12k|{
 2566|  9.12k|  struct Curl_easy *admin;
 2567|       |
 2568|  9.12k|  if(!data->mid) /* already an admin handle */
  ------------------
  |  Branch (2568:6): [True: 0, False: 9.12k]
  ------------------
 2569|      0|    admin = data;
 2570|  9.12k|  else if(data->multi)
  ------------------
  |  Branch (2570:11): [True: 9.12k, False: 0]
  ------------------
 2571|  9.12k|    admin = data->multi->admin;
 2572|      0|  else if(data->multi_easy)
  ------------------
  |  Branch (2572:11): [True: 0, False: 0]
  ------------------
 2573|      0|    admin = data->multi_easy->admin;
 2574|      0|  else {
 2575|      0|    DEBUGASSERT(0); /* we do not want this. does it happen? */
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2575:5): [Folded, False: 0]
  |  Branch (2575:5): [Folded, False: 0]
  ------------------
 2576|      0|    admin = data;
 2577|      0|  }
 2578|  9.12k|  if(admin != data) {
  ------------------
  |  Branch (2578:6): [True: 9.12k, False: 0]
  ------------------
 2579|  9.12k|    admin->set.conn_max_idle_ms = data->set.conn_max_idle_ms;
 2580|  9.12k|    admin->set.conn_max_age_ms = data->set.conn_max_age_ms;
 2581|  9.12k|    admin->set.upkeep_interval_ms = data->set.upkeep_interval_ms;
 2582|  9.12k|    admin->set.timeout = data->set.timeout;
 2583|  9.12k|    admin->set.server_response_timeout = data->set.server_response_timeout;
 2584|  9.12k|    admin->set.no_signal = data->set.no_signal;
 2585|  9.12k|  }
 2586|  9.12k|  return admin;
 2587|  9.12k|}
Curl_1st_fatal:
 2590|  3.04k|{
 2591|  3.04k|  if(r1 && (r1 != CURLE_AGAIN))
  ------------------
  |  Branch (2591:6): [True: 0, False: 3.04k]
  |  Branch (2591:12): [True: 0, False: 0]
  ------------------
 2592|      0|    return r1;
 2593|  3.04k|  if(r2 && (r2 != CURLE_AGAIN))
  ------------------
  |  Branch (2593:6): [True: 0, False: 3.04k]
  |  Branch (2593:12): [True: 0, False: 0]
  ------------------
 2594|      0|    return r2;
 2595|  3.04k|  return r1;
 2596|  3.04k|}
url.c:up_free:
  182|  11.2k|{
  183|  11.2k|  struct urlpieces *up = &data->state.up;
  184|  11.2k|  curlx_safefree(up->options);
  ------------------
  |  | 1284|  11.2k|  do {                      \
  |  | 1285|  11.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  11.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  11.2k|    (ptr) = NULL;           \
  |  | 1287|  11.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 11.2k]
  |  |  ------------------
  ------------------
  185|  11.2k|  curlx_safefree(up->path);
  ------------------
  |  | 1284|  11.2k|  do {                      \
  |  | 1285|  11.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  11.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  11.2k|    (ptr) = NULL;           \
  |  | 1287|  11.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 11.2k]
  |  |  ------------------
  ------------------
  186|  11.2k|  curlx_safefree(up->query);
  ------------------
  |  | 1284|  11.2k|  do {                      \
  |  | 1285|  11.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  11.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  11.2k|    (ptr) = NULL;           \
  |  | 1287|  11.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 11.2k]
  |  |  ------------------
  ------------------
  187|  11.2k|  curl_url_cleanup(data->state.uh);
  188|       |  data->state.uh = NULL;
  189|  11.2k|}
url.c:url_set_data_origin_and_creds:
 2054|  3.74k|{
 2055|  3.74k|  CURLcode result = CURLE_OK;
 2056|  3.74k|  CURLU *uh;
 2057|  3.74k|  CURLUcode uc;
 2058|  3.74k|  bool use_set_uh = (data->set.uh && !data->state.this_is_a_follow);
  ------------------
  |  Branch (2058:22): [True: 0, False: 3.74k]
  |  Branch (2058:38): [True: 0, False: 0]
  ------------------
 2059|  3.74k|  uint16_t port_override = data->state.allow_port ? data->set.use_port : 0;
  ------------------
  |  Branch (2059:28): [True: 3.74k, False: 0]
  ------------------
 2060|  3.74k|  uint32_t scope_id = 0;
 2061|       |
 2062|       |  /*************************************************************
 2063|       |   * Check input data
 2064|       |   *************************************************************/
 2065|  3.74k|  if(!Curl_bufref_ptr(&data->state.url)) {
  ------------------
  |  Branch (2065:6): [True: 0, False: 3.74k]
  ------------------
 2066|      0|    result = CURLE_URL_MALFORMAT;
 2067|      0|    goto out;
 2068|      0|  }
 2069|       |
 2070|  3.74k|  up_free(data); /* cleanup previous leftovers first */
 2071|       |
 2072|       |  /* parse the URL */
 2073|  3.74k|  if(use_set_uh)
  ------------------
  |  Branch (2073:6): [True: 0, False: 3.74k]
  ------------------
 2074|      0|    uh = data->state.uh = curl_url_dup(data->set.uh);
 2075|  3.74k|  else
 2076|  3.74k|    uh = data->state.uh = curl_url();
 2077|  3.74k|  if(!uh) {
  ------------------
  |  Branch (2077:6): [True: 0, False: 3.74k]
  ------------------
 2078|      0|    result = CURLE_OUT_OF_MEMORY;
 2079|      0|    goto out;
 2080|      0|  }
 2081|       |
 2082|       |  /* Calculate the *real* URL this transfer uses, applying defaults
 2083|       |   * where information is missing. */
 2084|  3.74k|  if(CURL_EASY_STR(data, STRING_DEFAULT_PROTOCOL) &&
  ------------------
  |  | 1234|  7.48k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 3.74k]
  |  |  ------------------
  ------------------
 2085|      0|     !Curl_is_absolute_url(Curl_bufref_ptr(&data->state.url), NULL, 0, TRUE)) {
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  |  Branch (2085:6): [True: 0, False: 0]
  ------------------
 2086|      0|    char *url = curl_maprintf("%s://%s",
 2087|      0|                              CURL_EASY_STR(data, STRING_DEFAULT_PROTOCOL),
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2088|      0|                              Curl_bufref_ptr(&data->state.url));
 2089|      0|    if(!url) {
  ------------------
  |  Branch (2089:8): [True: 0, False: 0]
  ------------------
 2090|      0|      result = CURLE_OUT_OF_MEMORY;
 2091|      0|      goto out;
 2092|      0|    }
 2093|      0|    Curl_bufref_set(&data->state.url, url, 0, curl_free);
 2094|      0|  }
 2095|       |
 2096|  3.74k|  if(!use_set_uh) {
  ------------------
  |  Branch (2096:6): [True: 3.74k, False: 0]
  ------------------
 2097|  3.74k|    char *newurl;
 2098|  3.74k|    uc = curl_url_set(uh, CURLUPART_URL, Curl_bufref_ptr(&data->state.url),
 2099|  3.74k|                      (unsigned int)(CURLU_GUESS_SCHEME |
  ------------------
  |  |   97|  3.74k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 2100|  3.74k|                       CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   91|  3.74k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
 2101|  3.74k|                       (data->set.disallow_username_in_url ?
  ------------------
  |  Branch (2101:25): [True: 0, False: 3.74k]
  ------------------
 2102|  3.74k|                        CURLU_DISALLOW_USER : 0) |
  ------------------
  |  |   93|      0|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
 2103|  3.74k|                       (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)));
  ------------------
  |  |   92|      0|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (2103:25): [True: 0, False: 3.74k]
  ------------------
 2104|  3.74k|    if(uc) {
  ------------------
  |  Branch (2104:8): [True: 489, False: 3.25k]
  ------------------
 2105|    489|      failf(data, "URL rejected: %s", curl_url_strerror(uc));
  ------------------
  |  |   62|    489|#define failf Curl_failf
  ------------------
 2106|    489|      result = Curl_uc_to_curlcode(uc);
 2107|    489|      goto out;
 2108|    489|    }
 2109|       |
 2110|       |    /* after it was parsed, get the generated normalized version */
 2111|  3.25k|    uc = curl_url_get(uh, CURLUPART_URL, &newurl, CURLU_GET_EMPTY);
  ------------------
  |  |  103|  3.25k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 2112|  3.25k|    if(uc) {
  ------------------
  |  Branch (2112:8): [True: 0, False: 3.25k]
  ------------------
 2113|      0|      result = Curl_uc_to_curlcode(uc);
 2114|      0|      goto out;
 2115|      0|    }
 2116|  3.25k|    Curl_bufref_set(&data->state.url, newurl, 0, curl_free);
 2117|  3.25k|  }
 2118|       |
 2119|  3.25k|#ifdef USE_IPV6
 2120|  3.25k|  scope_id = data->set.scope_id;
 2121|  3.25k|#endif
 2122|       |
 2123|       |  /* `uh` is now as the connection should use it, probably. */
 2124|  3.25k|  result = Curl_peer_from_url(uh, data, port_override, scope_id,
 2125|  3.25k|                              &data->state.origin);
 2126|  3.25k|  if(result)
  ------------------
  |  Branch (2126:6): [True: 185, False: 3.06k]
  ------------------
 2127|    185|    goto out;
 2128|       |  /* The origin might get changed when HSTS applies */
 2129|  3.06k|  result = hsts_upgrade(data, uh, port_override, scope_id);
 2130|  3.06k|  if(result)
  ------------------
  |  Branch (2130:6): [True: 0, False: 3.06k]
  ------------------
 2131|      0|    goto out;
 2132|       |
 2133|       |  /* When the transfers initial_origin is not set, this is the initial
 2134|       |   * request. Remember this starting point. */
 2135|  3.06k|  if(!data->state.initial_origin)
  ------------------
  |  Branch (2135:6): [True: 3.06k, False: 0]
  ------------------
 2136|  3.06k|    Curl_peer_link(&data->state.initial_origin, data->state.origin);
 2137|       |
 2138|  3.06k|  uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, CURLU_URLENCODE);
  ------------------
  |  |   95|  3.06k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2139|  3.06k|  if(uc) {
  ------------------
  |  Branch (2139:6): [True: 0, False: 3.06k]
  ------------------
 2140|      0|    result = Curl_uc_to_curlcode(uc);
 2141|      0|    goto out;
 2142|      0|  }
 2143|  3.06k|  uc = curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query,
 2144|  3.06k|                    CURLU_GET_EMPTY);
  ------------------
  |  |  103|  3.06k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 2145|  3.06k|  if(uc && (uc != CURLUE_NO_QUERY)) {
  ------------------
  |  Branch (2145:6): [True: 3.03k, False: 31]
  |  Branch (2145:12): [True: 0, False: 3.03k]
  ------------------
 2146|      0|    result = CURLE_OUT_OF_MEMORY;
 2147|      0|    goto out;
 2148|      0|  }
 2149|       |
 2150|  3.06k|  uc = curl_url_get(uh, CURLUPART_OPTIONS, &data->state.up.options,
 2151|  3.06k|                    CURLU_URLDECODE);
  ------------------
  |  |   94|  3.06k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 2152|  3.06k|  if(uc && (uc != CURLUE_NO_OPTIONS)) {
  ------------------
  |  Branch (2152:6): [True: 3.06k, False: 0]
  |  Branch (2152:12): [True: 0, False: 3.06k]
  ------------------
 2153|      0|    result = Curl_uc_to_curlcode(uc);
 2154|      0|    goto out;
 2155|      0|  }
 2156|       |
 2157|  3.06k|  result = url_set_data_creds(data, uh);
 2158|  3.06k|  if(result)
  ------------------
  |  Branch (2158:6): [True: 25, False: 3.04k]
  ------------------
 2159|     25|    goto out;
 2160|       |
 2161|  3.74k|out:
 2162|  3.74k|  return result;
 2163|  3.06k|}
url.c:hsts_upgrade:
 1205|  3.06k|{
 1206|       |  /* HSTS upgrade */
 1207|  3.06k|  if(data->hsts && (data->state.origin->scheme == &Curl_scheme_http) &&
  ------------------
  |  Branch (1207:6): [True: 3.06k, False: 0]
  |  Branch (1207:20): [True: 0, False: 3.06k]
  ------------------
 1208|      0|     Curl_hsts_applies(data->hsts, data->state.origin)) {
  ------------------
  |  Branch (1208:6): [True: 0, False: 0]
  ------------------
 1209|      0|    char *url;
 1210|      0|    CURLUcode uc;
 1211|      0|    CURLcode result;
 1212|       |
 1213|      0|    uc = curl_url_set(uh, CURLUPART_SCHEME, "https", 0);
 1214|      0|    if(uc)
  ------------------
  |  Branch (1214:8): [True: 0, False: 0]
  ------------------
 1215|      0|      return Curl_uc_to_curlcode(uc);
 1216|      0|    Curl_bufref_free(&data->state.url);
 1217|       |    /* after update, get the updated version */
 1218|      0|    uc = curl_url_get(uh, CURLUPART_URL, &url, 0);
 1219|      0|    if(uc)
  ------------------
  |  Branch (1219:8): [True: 0, False: 0]
  ------------------
 1220|      0|      return Curl_uc_to_curlcode(uc);
 1221|      0|    Curl_bufref_set(&data->state.url, url, 0, curl_free);
 1222|       |
 1223|      0|    result = Curl_peer_from_url(uh, data, port_override, scope_id,
 1224|      0|                                &data->state.origin);
 1225|      0|    if(result)
  ------------------
  |  Branch (1225:8): [True: 0, False: 0]
  ------------------
 1226|      0|      return result;
 1227|      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]
  |  |  ------------------
  ------------------
 1228|      0|  }
 1229|  3.06k|  return CURLE_OK;
 1230|  3.06k|}
url.c:url_set_data_creds:
 1356|  3.06k|{
 1357|  3.06k|  struct Curl_creds *newcreds = NULL;
 1358|  3.06k|  CURLcode result = CURLE_OK;
 1359|       |
 1360|  3.06k|  if((CURL_EASY_STR(data, STRING_USERNAME) ||
  ------------------
  |  | 1234|  6.13k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 132, False: 2.93k]
  |  |  ------------------
  ------------------
 1361|  2.93k|      CURL_EASY_STR(data, STRING_PASSWORD) ||
  ------------------
  |  | 1234|  6.00k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 44, False: 2.89k]
  |  |  ------------------
  ------------------
 1362|  2.89k|      CURL_EASY_STR(data, STRING_BEARER) ||
  ------------------
  |  | 1234|  5.96k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 2.89k]
  |  |  ------------------
  ------------------
 1363|  2.89k|      CURL_EASY_STR(data, STRING_SASL_AUTHZID) ||
  ------------------
  |  | 1234|  5.96k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 2.89k]
  |  |  ------------------
  ------------------
 1364|  2.89k|      CURL_EASY_STR(data, STRING_SERVICE_NAME)) &&
  ------------------
  |  | 1234|  2.89k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 2.89k]
  |  |  ------------------
  ------------------
 1365|    176|     Curl_auth_allowed_to_origin(data, data->state.origin)) {
  ------------------
  |  Branch (1365:6): [True: 176, False: 0]
  ------------------
 1366|    176|    result = Curl_creds_create(CURL_EASY_STR(data, STRING_USERNAME),
  ------------------
  |  | 1234|    176|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1367|    176|                               CURL_EASY_STR(data, STRING_PASSWORD),
  ------------------
  |  | 1234|    176|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1368|    176|                               CURL_EASY_STR(data, STRING_BEARER),
  ------------------
  |  | 1234|    176|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1369|    176|                               CURL_EASY_STR(data, STRING_SASL_AUTHZID),
  ------------------
  |  | 1234|    176|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1370|    176|                               CURL_EASY_STR(data, STRING_SERVICE_NAME),
  ------------------
  |  | 1234|    176|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1371|    176|                               CREDS_OPTION, &newcreds);
  ------------------
  |  |   31|    176|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
 1372|    176|    if(result)
  ------------------
  |  Branch (1372:8): [True: 0, False: 176]
  ------------------
 1373|      0|      goto out;
 1374|    176|    if(newcreds &&
  ------------------
  |  Branch (1374:8): [True: 176, False: 0]
  ------------------
 1375|    176|       !(data->state.origin->scheme->flags & PROTOPT_USERPWDCTRL) &&
  ------------------
  |  |  228|    176|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (1375:8): [True: 176, False: 0]
  ------------------
 1376|    176|       (str_has_ctrl(Curl_creds_user(newcreds)) ||
  ------------------
  |  |   81|    176|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (81:43): [True: 176, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1376:9): [True: 12, False: 164]
  ------------------
 1377|    164|        str_has_ctrl(Curl_creds_passwd(newcreds)))) {
  ------------------
  |  |   82|    164|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 164, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1377:9): [True: 12, False: 152]
  ------------------
 1378|       |      /* if the protocol cannot handle control codes in credentials, make
 1379|       |         sure there are none */
 1380|     24|      failf(data, "control code detected in credentials");
  ------------------
  |  |   62|     24|#define failf Curl_failf
  ------------------
 1381|     24|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1382|     24|      goto out;
 1383|     24|    }
 1384|    176|  }
 1385|       |
 1386|       |  /* Extract credentials from the URL only if there are none OR
 1387|       |   * if no CURLOPT_USER was set. */
 1388|  3.04k|  if(!newcreds || !Curl_creds_has_user(newcreds)) {
  ------------------
  |  |   75|    152|#define Curl_creds_has_user(c)           ((c) && (c)->user[0])
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 152, False: 0]
  |  |  |  Branch (75:50): [True: 47, False: 105]
  |  |  ------------------
  ------------------
  |  Branch (1388:6): [True: 2.89k, False: 152]
  ------------------
 1389|  2.99k|    char *user = NULL;
 1390|  2.99k|    char *passwd = NULL;
 1391|  2.99k|    char *udecoded = NULL;
 1392|  2.99k|    char *pdecoded = NULL;
 1393|  2.99k|    CURLUcode uc;
 1394|       |
 1395|  2.99k|    uc = curl_url_get(uh, CURLUPART_USER, &user, 0);
 1396|  2.99k|    if(uc && (uc != CURLUE_NO_USER))
  ------------------
  |  Branch (1396:8): [True: 2.80k, False: 194]
  |  Branch (1396:14): [True: 0, False: 2.80k]
  ------------------
 1397|      0|      result = Curl_uc_to_curlcode(uc);
 1398|  2.99k|    if(!result) {
  ------------------
  |  Branch (1398:8): [True: 2.99k, False: 0]
  ------------------
 1399|  2.99k|      uc = curl_url_get(uh, CURLUPART_PASSWORD, &passwd, 0);
 1400|  2.99k|      if(uc && (uc != CURLUE_NO_PASSWORD))
  ------------------
  |  Branch (1400:10): [True: 2.96k, False: 34]
  |  Branch (1400:16): [True: 0, False: 2.96k]
  ------------------
 1401|      0|        result = Curl_uc_to_curlcode(uc);
 1402|  2.99k|    }
 1403|  2.99k|    if(!result && user) {
  ------------------
  |  Branch (1403:8): [True: 2.99k, False: 0]
  |  Branch (1403:19): [True: 194, False: 2.80k]
  ------------------
 1404|    194|      result = Curl_urldecode(user, 0, &udecoded, NULL,
 1405|    194|                              (data->state.origin->scheme->flags &
  ------------------
  |  Branch (1405:31): [True: 0, False: 194]
  ------------------
 1406|    194|                               PROTOPT_USERPWDCTRL) ?
  ------------------
  |  |  228|    194|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
 1407|    194|                              REJECT_ZERO : REJECT_CTRL);
 1408|    194|    }
 1409|  2.99k|    if(!result && passwd) {
  ------------------
  |  Branch (1409:8): [True: 2.99k, False: 1]
  |  Branch (1409:19): [True: 34, False: 2.96k]
  ------------------
 1410|     34|      result = Curl_urldecode(passwd, 0, &pdecoded, NULL,
 1411|     34|                              (data->state.origin->scheme->flags &
  ------------------
  |  Branch (1411:31): [True: 0, False: 34]
  ------------------
 1412|     34|                               PROTOPT_USERPWDCTRL) ?
  ------------------
  |  |  228|     34|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
 1413|     34|                              REJECT_ZERO : REJECT_CTRL);
 1414|     34|    }
 1415|  2.99k|    if(!result)
  ------------------
  |  Branch (1415:8): [True: 2.99k, False: 1]
  ------------------
 1416|  2.99k|      result = Curl_creds_merge(udecoded, pdecoded, newcreds,
 1417|  2.99k|                                CREDS_URL, &newcreds);
  ------------------
  |  |   30|  2.99k|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
 1418|       |
 1419|  2.99k|    curlx_free(udecoded);
  ------------------
  |  | 1428|  2.99k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1420|  2.99k|    curlx_free(pdecoded);
  ------------------
  |  | 1428|  2.99k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1421|  2.99k|    curlx_free(passwd);
  ------------------
  |  | 1428|  2.99k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1422|  2.99k|    curlx_free(user);
  ------------------
  |  | 1428|  2.99k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1423|  2.99k|    if(result) {
  ------------------
  |  Branch (1423:8): [True: 1, False: 2.99k]
  ------------------
 1424|      1|      failf(data, "error extracting credentials from URL");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1425|      1|      goto out;
 1426|      1|    }
 1427|  2.99k|  }
 1428|       |
 1429|  3.04k|#ifndef CURL_DISABLE_NETRC
 1430|       |  /* Check for overridden login details and set them accordingly so that
 1431|       |     they are known when protocol->setup_connection is called! */
 1432|  3.04k|  result = url_set_data_creds_netrc(data, &newcreds);
 1433|  3.04k|#endif /* CURL_DISABLE_NETRC */
 1434|       |
 1435|  3.06k|out:
 1436|  3.06k|  if(!result && !Curl_creds_equal(data->state.creds, newcreds)) {
  ------------------
  |  Branch (1436:6): [True: 3.04k, False: 25]
  |  Branch (1436:17): [True: 331, False: 2.71k]
  ------------------
 1437|       |    /* Do we have more things to trigger on credentials change? */
 1438|    331|    Curl_creds_link(&data->state.creds, newcreds);
 1439|    331|  }
 1440|  3.06k|  Curl_creds_unlink(&newcreds);
 1441|  3.06k|  return result;
 1442|  3.04k|}
url.c:str_has_ctrl:
 1236|    340|{
 1237|    340|  if(input) {
  ------------------
  |  Branch (1237:6): [True: 340, False: 0]
  ------------------
 1238|    340|    const unsigned char *str = (const unsigned char *)input;
 1239|  52.6k|    while(*str) {
  ------------------
  |  Branch (1239:11): [True: 52.3k, False: 316]
  ------------------
 1240|  52.3k|      if(*str < 0x20)
  ------------------
  |  Branch (1240:10): [True: 24, False: 52.3k]
  ------------------
 1241|     24|        return TRUE;
  ------------------
  |  |  997|     24|#define TRUE true
  ------------------
 1242|  52.3k|      str++;
 1243|  52.3k|    }
 1244|    340|  }
 1245|    316|  return FALSE;
  ------------------
  |  | 1000|    316|#define FALSE false
  ------------------
 1246|    340|}
url.c:url_set_data_creds_netrc:
 1255|  3.04k|{
 1256|  3.04k|  struct Curl_creds *ncreds_out = NULL;
 1257|  3.04k|  CURLcode result = CURLE_OK;
 1258|       |
 1259|  3.04k|  if(data->set.use_netrc) { /* not CURL_NETRC_IGNORED */
  ------------------
  |  Branch (1259:6): [True: 0, False: 3.04k]
  ------------------
 1260|      0|    struct Curl_creds *ncreds_in = NULL;
 1261|      0|    bool scan_netrc = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1262|      0|    NETRCcode ret;
 1263|      0|    CURLUcode uc;
 1264|       |
 1265|      0|    if(*pcreds) {
  ------------------
  |  Branch (1265:8): [True: 0, False: 0]
  ------------------
 1266|      0|      switch((*pcreds)->source) {
 1267|      0|      case CREDS_OPTION:
  ------------------
  |  |   31|      0|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
  |  Branch (1267:7): [True: 0, False: 0]
  ------------------
 1268|       |        /* we never override credentials set via CURLOPT_*, leave. */
 1269|      0|        scan_netrc = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1270|      0|        break;
 1271|      0|      case CREDS_URL: /* only apply when netrc is not required */
  ------------------
  |  |   30|      0|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
  |  Branch (1271:7): [True: 0, False: 0]
  ------------------
 1272|      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 (1272:12): [True: 0, False: 0]
  ------------------
 1273|       |          /* We ignore password from URL */
 1274|      0|          ncreds_in = *pcreds;
 1275|      0|        }
 1276|      0|        else if(!Curl_creds_has_user(*pcreds) ||
  ------------------
  |  |   75|      0|#define Curl_creds_has_user(c)           ((c) && (c)->user[0])
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 0, False: 0]
  |  |  |  Branch (75:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1277|      0|                !Curl_creds_has_passwd(*pcreds)) {
  ------------------
  |  |   76|      0|#define Curl_creds_has_passwd(c)         ((c) && (c)->passwd[0])
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 0, False: 0]
  |  |  |  Branch (76:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1278|       |          /* We use netrc to complete what is missing */
 1279|      0|          ncreds_in = *pcreds;
 1280|      0|        }
 1281|      0|        else
 1282|      0|          scan_netrc = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1283|      0|        break;
 1284|      0|      default: /* ignore credentials from other sources */
  ------------------
  |  Branch (1284:7): [True: 0, False: 0]
  ------------------
 1285|      0|        break;
 1286|      0|      }
 1287|      0|    }
 1288|       |
 1289|      0|    if(!scan_netrc)
  ------------------
  |  Branch (1289:8): [True: 0, False: 0]
  ------------------
 1290|      0|      goto out;
 1291|       |
 1292|      0|    ret = Curl_netrc_scan(data, &data->state.netrc,
 1293|      0|                          data->state.origin->hostname,
 1294|      0|                          Curl_creds_user(ncreds_in),
  ------------------
  |  |   81|      0|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (81:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1295|      0|                          CURL_EASY_STR(data, STRING_NETRC_FILE),
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1296|      0|                          &ncreds_out);
 1297|      0|    DEBUGASSERT(!ret || !ncreds_out);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1297:5): [True: 0, False: 0]
  |  Branch (1297:5): [True: 0, False: 0]
  |  Branch (1297:5): [True: 0, False: 0]
  |  Branch (1297:5): [True: 0, False: 0]
  ------------------
 1298|      0|    if(ret == NETRC_OUT_OF_MEMORY) {
  ------------------
  |  Branch (1298:8): [True: 0, False: 0]
  ------------------
 1299|      0|      result = CURLE_OUT_OF_MEMORY;
 1300|      0|      goto out;
 1301|      0|    }
 1302|      0|    else if(ret && ((ret == NETRC_NO_MATCH) ||
  ------------------
  |  Branch (1302:13): [True: 0, False: 0]
  |  Branch (1302:21): [True: 0, False: 0]
  ------------------
 1303|      0|                    (data->set.use_netrc == CURL_NETRC_OPTIONAL))) {
  ------------------
  |  | 2383|      0|#define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL is preferred
  ------------------
  |  Branch (1303:21): [True: 0, False: 0]
  ------------------
 1304|      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]
  |  |  ------------------
  ------------------
 1305|      0|            data->state.origin->hostname,
 1306|      0|            (CURL_EASY_STR(data, STRING_NETRC_FILE) ?
 1307|      0|             CURL_EASY_STR(data, STRING_NETRC_FILE) : ".netrc"));
 1308|      0|    }
 1309|      0|    else if(ret) {
  ------------------
  |  Branch (1309:13): [True: 0, False: 0]
  ------------------
 1310|      0|      const char *m = Curl_netrc_strerror(ret);
 1311|      0|      failf(data, ".netrc error: %s", m);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1312|      0|      result = CURLE_READ_ERROR;
 1313|      0|      goto out;
 1314|      0|    }
 1315|      0|    else if(ncreds_out) {
  ------------------
  |  Branch (1315:13): [True: 0, False: 0]
  ------------------
 1316|      0|      if(!(data->state.origin->scheme->flags & PROTOPT_USERPWDCTRL) &&
  ------------------
  |  |  228|      0|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (1316:10): [True: 0, False: 0]
  ------------------
 1317|       |         /* if the protocol cannot handle control codes in credentials, make
 1318|       |            sure there are none */
 1319|      0|         (str_has_ctrl(ncreds_out->user) ||
  ------------------
  |  Branch (1319:11): [True: 0, False: 0]
  ------------------
 1320|      0|          str_has_ctrl(ncreds_out->passwd))) {
  ------------------
  |  Branch (1320:11): [True: 0, False: 0]
  ------------------
 1321|      0|        failf(data, "control code detected in .netrc credentials");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1322|      0|        result = CURLE_READ_ERROR;
 1323|      0|        goto out;
 1324|      0|      }
 1325|      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]
  |  |  ------------------
  ------------------
 1326|      0|                 data->state.origin->hostname, ncreds_out->user);
 1327|      0|      result = Curl_creds_merge(ncreds_out->user, ncreds_out->passwd,
 1328|      0|                                *pcreds, CREDS_NETRC, pcreds);
  ------------------
  |  |   32|      0|#define CREDS_NETRC  3 /* username/passwd found in netrc */
  ------------------
 1329|      0|      if(result)
  ------------------
  |  Branch (1329:10): [True: 0, False: 0]
  ------------------
 1330|      0|        goto out;
 1331|       |      /* for updated strings, we update them in the URL */
 1332|      0|      uc = curl_url_set(data->state.uh, CURLUPART_USER,
 1333|      0|                        Curl_creds_user(*pcreds), CURLU_URLENCODE);
  ------------------
  |  |   81|      0|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (81:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                      Curl_creds_user(*pcreds), CURLU_URLENCODE);
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 1334|      0|      if(!uc)
  ------------------
  |  Branch (1334:10): [True: 0, False: 0]
  ------------------
 1335|      0|        uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD,
 1336|      0|                          Curl_creds_passwd(*pcreds),
  ------------------
  |  |   82|      0|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1337|      0|                          CURLU_URLENCODE);
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 1338|      0|      if(uc)
  ------------------
  |  Branch (1338:10): [True: 0, False: 0]
  ------------------
 1339|      0|        result = Curl_uc_to_curlcode(uc);
 1340|      0|    }
 1341|      0|    else
 1342|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1342:7): [Folded, False: 0]
  |  Branch (1342:7): [Folded, False: 0]
  ------------------
 1343|      0|  }
 1344|       |
 1345|  3.04k|#ifdef CURLVERBOSE
 1346|  3.04k|  Curl_creds_trace(data, data->state.creds, "transfer credentials");
 1347|  3.04k|#endif
 1348|       |
 1349|  3.04k|out:
 1350|  3.04k|  Curl_creds_unlink(&ncreds_out);
 1351|  3.04k|  return result;
 1352|  3.04k|}
url.c:url_find_or_create_conn:
 2231|  3.04k|{
 2232|  3.04k|  struct connectdata *needle = NULL;
 2233|  3.04k|  struct url_conn_match match;
 2234|  3.04k|  bool match_initialized = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 2235|  3.04k|  CURLcode result;
 2236|       |
 2237|       |  /* create the template connection for transfer data. Use this needle to
 2238|       |   * find an existing connection or, if none exists, convert needle
 2239|       |   * to a full connection and attach it to data. */
 2240|  3.04k|  result = url_create_needle(data, &needle);
 2241|  3.04k|  if(result)
  ------------------
  |  Branch (2241:6): [True: 0, False: 3.04k]
  ------------------
 2242|      0|    goto out;
 2243|  3.04k|  DEBUGASSERT(needle);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2243:3): [True: 0, False: 3.04k]
  |  Branch (2243:3): [True: 3.04k, False: 0]
  ------------------
 2244|       |
 2245|  3.04k|  result = url_match_init(data, needle, &match);
 2246|  3.04k|  if(result)
  ------------------
  |  Branch (2246:6): [True: 0, False: 3.04k]
  ------------------
 2247|      0|    goto out;
 2248|  3.04k|  match_initialized = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 2249|       |
 2250|       |  /***********************************************************************
 2251|       |   * file: is a special case in that it does not need a network connection
 2252|       |   ***********************************************************************/
 2253|  3.04k|#ifndef CURL_DISABLE_FILE
 2254|  3.04k|  if(needle->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  211|  3.04k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (2254:6): [True: 0, False: 3.04k]
  ------------------
 2255|      0|    bool done;
 2256|       |    /* this is supposed to be the connect function so we better at least check
 2257|       |       that the file is present here! */
 2258|      0|    DEBUGASSERT(needle->scheme->run->connect_it);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2258:5): [True: 0, False: 0]
  |  Branch (2258:5): [True: 0, False: 0]
  ------------------
 2259|      0|    data->info.conn_scheme = needle->scheme->name;
 2260|       |    /* conn_protocol can only provide "old" protocols */
 2261|      0|    data->info.conn_protocol = needle->scheme->protocol & CURLPROTO_MASK;
  ------------------
  |  |   77|      0|#define CURLPROTO_MASK   0x3fffffff
  ------------------
 2262|      0|    result = needle->scheme->run->connect_it(data, &done);
 2263|      0|    if(result)
  ------------------
  |  Branch (2263:8): [True: 0, False: 0]
  ------------------
 2264|      0|      goto out;
 2265|       |
 2266|       |    /* Setup a "faked" transfer that will do nothing */
 2267|      0|    result = Curl_cpool_add(data, needle, pnow);
 2268|      0|    Curl_attach_connection(data, needle, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2269|      0|    needle = NULL;
 2270|      0|    if(!result) {
  ------------------
  |  Branch (2270:8): [True: 0, False: 0]
  ------------------
 2271|       |      /* Setup whatever necessary for a resumed transfer */
 2272|      0|      result = setup_range(data);
 2273|      0|      if(!result) {
  ------------------
  |  Branch (2273:10): [True: 0, False: 0]
  ------------------
 2274|      0|        Curl_xfer_setup_nop(data);
 2275|      0|        result = Curl_init_transfer(data, data->conn);
 2276|      0|      }
 2277|      0|    }
 2278|       |
 2279|      0|    if(result) {
  ------------------
  |  Branch (2279:8): [True: 0, False: 0]
  ------------------
 2280|      0|      DEBUGASSERT(data->conn->scheme->run->done);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2280:7): [True: 0, False: 0]
  |  Branch (2280:7): [True: 0, False: 0]
  ------------------
 2281|       |      /* we ignore the return code for the protocol-specific DONE */
 2282|      0|      (void)data->conn->scheme->run->done(data, result, FALSE);
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2283|      0|    }
 2284|      0|    goto out;
 2285|      0|  }
 2286|  3.04k|#endif
 2287|       |
 2288|       |  /*************************************************************
 2289|       |   * Reuse of existing connection is not allowed when
 2290|       |   * - connect_only is set or
 2291|       |   * - reuse_fresh is set and this is not a follow-up request
 2292|       |   *   (like with HTTP followlocation)
 2293|       |   *************************************************************/
 2294|  3.04k|  if((!data->set.reuse_fresh || data->state.followlocation) &&
  ------------------
  |  Branch (2294:7): [True: 3.04k, False: 0]
  |  Branch (2294:33): [True: 0, False: 0]
  ------------------
 2295|  3.04k|     !data->set.connect_only) {
  ------------------
  |  Branch (2295:6): [True: 3.04k, False: 0]
  ------------------
 2296|       |    /* Ok, try to find and attach an existing one */
 2297|  3.04k|    url_attach_existing(data, needle, &match);
 2298|  3.04k|  }
 2299|       |
 2300|  3.04k|  if(data->conn) {
  ------------------
  |  Branch (2300:6): [True: 0, False: 3.04k]
  ------------------
 2301|       |    /* We attached an existing connection for this transfer. Copy
 2302|       |     * over transfer specific properties over from needle. */
 2303|      0|    struct connectdata *conn = data->conn;
 2304|      0|    VERBOSE(bool tls_upgraded =
  ------------------
  |  | 1563|      0|#define VERBOSE(x) x
  |  |  ------------------
  |  |  |  Branch (1563:20): [True: 0, False: 0]
  |  |  |  Branch (1563:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2305|      0|      (!(needle->origin->scheme->flags & PROTOPT_SSL) &&
 2306|      0|       Curl_conn_is_ssl(conn, FIRSTSOCKET)));
 2307|       |
 2308|      0|    conn->bits.reuse = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2309|      0|    url_conn_reuse_adjust(data, needle);
 2310|       |
 2311|      0|#ifndef CURL_DISABLE_PROXY
 2312|      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]
  |  |  ------------------
  ------------------
 2313|      0|          conn->origin->scheme->name,
 2314|      0|          tls_upgraded ? " (upgraded to SSL)" : "",
 2315|      0|          (conn->socks_proxy.peer || conn->http_proxy.peer) ? "proxy" : "host",
 2316|      0|          conn->socks_proxy.peer ? conn->socks_proxy.peer->user_hostname :
 2317|      0|          conn->http_proxy.peer ? conn->http_proxy.peer->user_hostname :
 2318|      0|          conn->origin->hostname);
 2319|       |#else
 2320|       |    infof(data, "Reusing existing %s: connection%s with host %s",
 2321|       |          conn->origin->scheme->name,
 2322|       |          tls_upgraded ? " (upgraded to SSL)" : "",
 2323|       |          conn->origin->hostname);
 2324|       |#endif
 2325|      0|  }
 2326|  3.04k|  else {
 2327|       |    /* We have decided that we want a new connection. We may not be able to do
 2328|       |       that if we have reached the limit of how many connections we are
 2329|       |       allowed to open. */
 2330|       |
 2331|  3.04k|    if(match.wait_pipe) {
  ------------------
  |  Branch (2331:8): [True: 0, False: 3.04k]
  ------------------
 2332|       |      /* There is a connection that *might* become usable for multiplexing
 2333|       |         "soon", and we wait for that */
 2334|      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]
  |  |  ------------------
  ------------------
 2335|      0|      result = CURLE_NO_CONNECTION_AVAILABLE;
 2336|      0|      goto out;
 2337|      0|    }
 2338|  3.04k|    else {
 2339|  3.04k|      switch(Curl_cpool_check_limits(data, needle, pnow)) {
 2340|      0|      case CPOOL_LIMIT_DEST:
  ------------------
  |  |  104|      0|#define CPOOL_LIMIT_DEST   1
  ------------------
  |  Branch (2340:7): [True: 0, False: 3.04k]
  ------------------
 2341|      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]
  |  |  ------------------
  ------------------
 2342|      0|        result = CURLE_NO_CONNECTION_AVAILABLE;
 2343|      0|        goto out;
 2344|      0|      case CPOOL_LIMIT_TOTAL:
  ------------------
  |  |  105|      0|#define CPOOL_LIMIT_TOTAL  2
  ------------------
  |  Branch (2344:7): [True: 0, False: 3.04k]
  ------------------
 2345|      0|        if(data->master_mid != UINT32_MAX)
  ------------------
  |  Branch (2345:12): [True: 0, False: 0]
  ------------------
 2346|      0|          CURL_TRC_M(data, "Allowing sub-requests (like DoH) to override "
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2347|      0|                     "max connection limit");
 2348|      0|        else {
 2349|      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]
  |  |  ------------------
  ------------------
 2350|      0|                data->multi->max_total_connections);
 2351|      0|          result = CURLE_NO_CONNECTION_AVAILABLE;
 2352|      0|          goto out;
 2353|      0|        }
 2354|      0|        break;
 2355|  3.04k|      default:
  ------------------
  |  Branch (2355:7): [True: 3.04k, False: 0]
  ------------------
 2356|  3.04k|        break;
 2357|  3.04k|      }
 2358|  3.04k|    }
 2359|       |
 2360|       |    /* Convert needle into a full connection by cloning the
 2361|       |     * ssl filter config used in matching into the connection. */
 2362|  3.04k|    result = Curl_ssl_conn_config_clone(&match.ssl_config,
 2363|  3.04k|#ifndef CURL_DISABLE_PROXY
 2364|  3.04k|                                        &match.proxy_ssl_config,
 2365|       |#else
 2366|       |                                        NULL,
 2367|       |#endif
 2368|  3.04k|                                        needle);
 2369|  3.04k|    if(result) {
  ------------------
  |  Branch (2369:8): [True: 0, False: 3.04k]
  ------------------
 2370|      0|      DEBUGF(infof(data, "Error: clone connection SSL config"));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2371|      0|      goto out;
 2372|      0|    }
 2373|       |
 2374|       |    /* Add needle to conn pool, which assigns the connection id.
 2375|       |     * Attach regardless of result, for correct handling. */
 2376|  3.04k|    result = Curl_cpool_add(data, needle, pnow);
 2377|  3.04k|    Curl_attach_connection(data, needle, TRUE);
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 2378|  3.04k|    needle = NULL;
 2379|  3.04k|    if(result)
  ------------------
  |  Branch (2379:8): [True: 0, False: 3.04k]
  ------------------
 2380|      0|      goto out;
 2381|       |
 2382|       |#ifdef USE_NTLM
 2383|       |    /* If NTLM is requested in a part of this connection, make sure we do not
 2384|       |       assume the state is fine as this is a fresh connection and NTLM is
 2385|       |       connection based. */
 2386|       |    if((data->state.authhost.picked & CURLAUTH_NTLM) &&
 2387|       |       data->state.authhost.done) {
 2388|       |      infof(data, "NTLM picked AND auth done set, clear picked");
 2389|       |      data->state.authhost.picked = CURLAUTH_NONE;
 2390|       |      data->state.authhost.done = FALSE;
 2391|       |    }
 2392|       |
 2393|       |    if((data->state.authproxy.picked & CURLAUTH_NTLM) &&
 2394|       |       data->state.authproxy.done) {
 2395|       |      infof(data, "NTLM-proxy picked AND auth done set, clear picked");
 2396|       |      data->state.authproxy.picked = CURLAUTH_NONE;
 2397|       |      data->state.authproxy.done = FALSE;
 2398|       |    }
 2399|       |#endif
 2400|  3.04k|  }
 2401|       |
 2402|       |  /* Setup and init stuff before DO starts, in preparing for the transfer. */
 2403|  3.04k|  result = Curl_init_transfer(data, data->conn);
 2404|  3.04k|  if(result)
  ------------------
  |  Branch (2404:6): [True: 0, False: 3.04k]
  ------------------
 2405|      0|    goto out;
 2406|       |
 2407|       |  /* Setup whatever necessary for a resumed transfer */
 2408|  3.04k|  result = setup_range(data);
 2409|  3.04k|  if(result)
  ------------------
  |  Branch (2409:6): [True: 0, False: 3.04k]
  ------------------
 2410|      0|    goto out;
 2411|       |
 2412|       |  /* persist the scheme and handler the transfer is using */
 2413|  3.04k|  data->info.conn_scheme = data->conn->scheme->name;
 2414|       |  /* conn_protocol can only provide "old" protocols */
 2415|  3.04k|  data->info.conn_protocol = data->conn->scheme->protocol & CURLPROTO_MASK;
  ------------------
  |  |   77|  3.04k|#define CURLPROTO_MASK   0x3fffffff
  ------------------
 2416|  3.04k|  data->info.used_proxy =
 2417|       |#ifdef CURL_DISABLE_PROXY
 2418|       |    0
 2419|       |#else
 2420|  3.04k|    (data->conn->socks_proxy.peer || data->conn->http_proxy.peer)
  ------------------
  |  Branch (2420:6): [True: 0, False: 3.04k]
  |  Branch (2420:38): [True: 0, False: 3.04k]
  ------------------
 2421|  3.04k|#endif
 2422|  3.04k|    ;
 2423|       |
 2424|       |  /* Lastly, inform connection filters that a new transfer is attached */
 2425|  3.04k|  result = Curl_conn_ev_data_setup(data);
 2426|       |
 2427|  3.04k|out:
 2428|  3.04k|  if(match_initialized)
  ------------------
  |  Branch (2428:6): [True: 3.04k, False: 0]
  ------------------
 2429|  3.04k|    url_match_destroy(&match);
 2430|  3.04k|  if(needle)
  ------------------
  |  Branch (2430:6): [True: 0, False: 3.04k]
  ------------------
 2431|      0|    Curl_conn_free(data, needle);
 2432|  3.04k|  DEBUGASSERT(result || data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2432:3): [True: 3.04k, False: 0]
  |  Branch (2432:3): [True: 0, False: 0]
  |  Branch (2432:3): [True: 0, False: 3.04k]
  |  Branch (2432:3): [True: 3.04k, False: 0]
  ------------------
 2433|  3.04k|  return result;
 2434|  3.04k|}
url.c:url_create_needle:
 1936|  3.04k|{
 1937|  3.04k|  struct connectdata *needle = NULL;
 1938|  3.04k|  CURLcode result = CURLE_OK;
 1939|  3.04k|  bool network_scheme = TRUE; /* almost all are */
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1940|       |
 1941|       |  /* Allocate a temporary connection data struct (needle) and fill in for
 1942|       |     comparison purposes. */
 1943|  3.04k|  needle = allocate_conn(data);
 1944|  3.04k|  if(!needle) {
  ------------------
  |  Branch (1944:6): [True: 0, False: 3.04k]
  ------------------
 1945|      0|    result = CURLE_OUT_OF_MEMORY;
 1946|      0|    goto out;
 1947|      0|  }
 1948|       |
 1949|       |  /* Do the unfailable inits first, before checks that may early return */
 1950|  3.04k|  Curl_hash_init(&needle->meta_hash, 23, CURL_HASH_TYPE_BYTES,
 1951|  3.04k|                 conn_meta_freeentry);
 1952|       |
 1953|       |  /*************************************************************
 1954|       |   * Determine `conn->origin` and populate `data->state.up` and
 1955|       |   * other URL related properties.
 1956|       |   *************************************************************/
 1957|  3.04k|  result = url_set_conn_origin_etc(data, needle);
 1958|  3.04k|  if(result)
  ------------------
  |  Branch (1958:6): [True: 0, False: 3.04k]
  ------------------
 1959|      0|    goto out;
 1960|       |
 1961|  3.04k|  DEBUGASSERT(needle->origin);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1961:3): [True: 0, False: 3.04k]
  |  Branch (1961:3): [True: 3.04k, False: 0]
  ------------------
 1962|  3.04k|  network_scheme = !(needle->origin->scheme->flags & PROTOPT_NONETWORK);
  ------------------
  |  |  211|  3.04k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
 1963|       |
 1964|  3.04k|#ifdef USE_UNIX_SOCKETS
 1965|       |  /*************************************************************
 1966|       |   * Set UDS first. It overrides "via_peer" and proxy settings.
 1967|       |   *************************************************************/
 1968|  3.04k|  if(network_scheme && CURL_EASY_STR(data, STRING_UNIX_SOCKET_PATH)) {
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (1968:6): [True: 3.04k, False: 0]
  ------------------
 1969|      0|    result = Curl_peer_uds_create(
 1970|      0|      needle->origin->scheme, CURL_EASY_STR(data, STRING_UNIX_SOCKET_PATH),
  ------------------
  |  | 1234|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1971|      0|      (bool)data->set.abstract_unix_socket, &needle->via_peer);
 1972|      0|    if(result)
  ------------------
  |  Branch (1972:8): [True: 0, False: 0]
  ------------------
 1973|      0|      goto out;
 1974|      0|  }
 1975|  3.04k|#endif /* USE_UNIX_SOCKETS */
 1976|       |
 1977|  3.04k|  if(network_scheme && !needle->via_peer) {
  ------------------
  |  Branch (1977:6): [True: 3.04k, False: 0]
  |  Branch (1977:24): [True: 3.04k, False: 0]
  ------------------
 1978|       |    /*************************************************************
 1979|       |     * If the `via_peer` is not already set (via UDS above),
 1980|       |     * determine if we talk to `conn->origin` directly or use
 1981|       |     * `conn->via_peer` using "connect to" and "alt-svc" properties.
 1982|       |     *************************************************************/
 1983|  3.04k|    result = url_set_conn_peer(data, needle);
 1984|  3.04k|    if(result)
  ------------------
  |  Branch (1984:8): [True: 0, False: 3.04k]
  ------------------
 1985|      0|      goto out;
 1986|  3.04k|  }
 1987|       |
 1988|       |  /*************************************************************
 1989|       |   * Check whether the host and the "connect to host" are equal.
 1990|       |   * Do this after the hostnames have been IDN-converted and
 1991|       |   * before initializing the proxy.
 1992|       |   *************************************************************/
 1993|  3.04k|  if(Curl_peer_equal(needle->origin, needle->via_peer)) {
  ------------------
  |  Branch (1993:6): [True: 1, False: 3.04k]
  ------------------
 1994|      1|    Curl_peer_unlink(&needle->via_peer);
 1995|      1|  }
 1996|       |
 1997|  3.04k|#ifndef CURL_DISABLE_PROXY
 1998|       |  /* Going via a unix socket ignores any proxy settings */
 1999|  3.04k|  if(network_scheme &&
  ------------------
  |  Branch (1999:6): [True: 3.04k, False: 0]
  ------------------
 2000|  3.04k|     (!needle->via_peer || !needle->via_peer->unix_socket)) {
  ------------------
  |  Branch (2000:7): [True: 1, False: 3.04k]
  |  Branch (2000:28): [True: 3.04k, False: 0]
  ------------------
 2001|  3.04k|    result = Curl_proxy_init_conn(data, needle);
 2002|  3.04k|    if(result)
  ------------------
  |  Branch (2002:8): [True: 0, False: 3.04k]
  ------------------
 2003|      0|      goto out;
 2004|  3.04k|  }
 2005|  3.04k|#endif /* CURL_DISABLE_PROXY */
 2006|       |
 2007|  3.04k|  result = url_set_conn_login(data, needle); /* default credentials */
 2008|  3.04k|  if(result)
  ------------------
  |  Branch (2008:6): [True: 0, False: 3.04k]
  ------------------
 2009|      0|    goto out;
 2010|       |
 2011|       |  /*************************************************************
 2012|       |   * Setup internals depending on protocol. Needs to be done after
 2013|       |   * we figured out what/if proxy to use.
 2014|       |   *************************************************************/
 2015|  3.04k|  result = setup_connection_internals(data, needle);
 2016|  3.04k|  if(result)
  ------------------
  |  Branch (2016:6): [True: 0, False: 3.04k]
  ------------------
 2017|      0|    goto out;
 2018|       |
 2019|  3.04k|  if(needle->scheme->flags & PROTOPT_ALPN) {
  ------------------
  |  |  219|  3.04k|#define PROTOPT_ALPN (1 << 8) /* set ALPN for this */
  ------------------
  |  Branch (2019:6): [True: 0, False: 3.04k]
  ------------------
 2020|       |    /* The protocol wants it, so set the bits if enabled in the easy handle
 2021|       |       (default) */
 2022|      0|    if(data->set.ssl_enable_alpn)
  ------------------
  |  Branch (2022:8): [True: 0, False: 0]
  ------------------
 2023|      0|      needle->bits.tls_enable_alpn = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2024|      0|  }
 2025|       |
 2026|  3.04k|  if(network_scheme) {
  ------------------
  |  Branch (2026:6): [True: 3.04k, False: 0]
  ------------------
 2027|       |    /* Setup callbacks for network connections */
 2028|  3.04k|    needle->recv[FIRSTSOCKET] = Curl_cf_recv;
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
 2029|  3.04k|    needle->send[FIRSTSOCKET] = Curl_cf_send;
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
 2030|  3.04k|    needle->recv[SECONDARYSOCKET] = Curl_cf_recv;
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
 2031|  3.04k|    needle->send[SECONDARYSOCKET] = Curl_cf_send;
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
 2032|  3.04k|    needle->bits.tcp_fastopen = data->set.tcp_fastopen;
 2033|  3.04k|#ifdef USE_UNIX_SOCKETS
 2034|  3.04k|    if(Curl_conn_get_first_peer(needle, FIRSTSOCKET)->unix_socket)
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2034:8): [True: 0, False: 3.04k]
  ------------------
 2035|      0|      needle->transport_wanted = TRNSPRT_UNIX;
  ------------------
  |  |  240|      0|#define TRNSPRT_UNIX 6
  ------------------
 2036|  3.04k|#endif
 2037|  3.04k|  }
 2038|       |
 2039|  3.04k|out:
 2040|  3.04k|  if(!result) {
  ------------------
  |  Branch (2040:6): [True: 3.04k, False: 0]
  ------------------
 2041|  3.04k|    DEBUGASSERT(needle);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2041:5): [True: 0, False: 3.04k]
  |  Branch (2041:5): [True: 3.04k, False: 0]
  ------------------
 2042|  3.04k|    DEBUGASSERT(needle->origin);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2042:5): [True: 0, False: 3.04k]
  |  Branch (2042:5): [True: 3.04k, False: 0]
  ------------------
 2043|  3.04k|    *pneedle = needle;
 2044|  3.04k|  }
 2045|      0|  else {
 2046|      0|    *pneedle = NULL;
 2047|      0|    if(needle)
  ------------------
  |  Branch (2047:8): [True: 0, False: 0]
  ------------------
 2048|      0|      Curl_conn_free(data, needle);
 2049|      0|  }
 2050|  3.04k|  return result;
 2051|  3.04k|}
url.c:allocate_conn:
 1115|  3.04k|{
 1116|  3.04k|  struct connectdata *conn = curlx_calloc(1, sizeof(struct connectdata));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1117|  3.04k|  if(!conn)
  ------------------
  |  Branch (1117:6): [True: 0, False: 3.04k]
  ------------------
 1118|      0|    return NULL;
 1119|       |
 1120|       |  /* and we setup a few fields in case we end up actually using this struct */
 1121|  3.04k|  conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD;     /* no file descriptor */
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
                conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD;     /* no file descriptor */
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1122|  3.04k|  conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
                conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
  ------------------
  |  |  147|  3.04k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1123|  3.04k|  conn->recv_idx = 0; /* default for receiving transfer data */
 1124|  3.04k|  conn->send_idx = 0; /* default for sending transfer data */
 1125|  3.04k|  conn->connection_id = -1;    /* no ID */
 1126|  3.04k|  conn->attached_xfers = 0;
 1127|  3.04k|  conn->shutdown.start_ms[FIRSTSOCKET] =
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
 1128|  3.04k|    conn->shutdown.start_ms[SECONDARYSOCKET] = -1;
  ------------------
  |  |  234|  3.04k|#define SECONDARYSOCKET 1
  ------------------
 1129|       |
 1130|  3.04k|#ifndef CURL_DISABLE_FTP
 1131|  3.04k|  conn->bits.ftp_use_epsv = data->set.ftp_use_epsv;
 1132|  3.04k|  conn->bits.ftp_use_eprt = data->set.ftp_use_eprt;
 1133|  3.04k|#endif
 1134|  3.04k|  conn->ip_version = data->set.ipver;
 1135|  3.04k|  conn->bits.connect_only = (bool)data->set.connect_only;
 1136|  3.04k|  conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */
  ------------------
  |  |  237|  3.04k|#define TRNSPRT_TCP  3
  ------------------
 1137|       |
 1138|       |  /* Store the local bind parameters that will be used for this connection */
 1139|  3.04k|  if(CURL_EASY_STR(data, STRING_DEVICE)) {
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
 1140|      0|    conn->localdev = curlx_strdup(CURL_EASY_STR(data, STRING_DEVICE));
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1141|      0|    if(!conn->localdev)
  ------------------
  |  Branch (1141:8): [True: 0, False: 0]
  ------------------
 1142|      0|      goto error;
 1143|      0|  }
 1144|  3.04k|#ifndef CURL_DISABLE_BINDLOCAL
 1145|  3.04k|  conn->localportrange = data->set.localportrange;
 1146|  3.04k|  conn->localport = data->set.localport;
 1147|  3.04k|#endif
 1148|       |
 1149|       |  /* the close socket stuff needs to be copied to the connection struct as
 1150|       |     it may live on without (this specific) Curl_easy */
 1151|  3.04k|  conn->fclosesocket = data->set.fclosesocket;
 1152|  3.04k|  conn->closesocket_client = data->set.closesocket_client;
 1153|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1154|       |  conn->gssapi_delegation = data->set.gssapi_delegation;
 1155|       |#endif
 1156|  3.04k|  return conn;
 1157|      0|error:
 1158|       |
 1159|      0|  curlx_free(conn->localdev);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1160|      0|  curlx_free(conn);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1161|       |  return NULL;
 1162|  3.04k|}
url.c:url_set_conn_origin_etc:
 1446|  3.04k|{
 1447|  3.04k|  CURLcode result = CURLE_OK;
 1448|       |
 1449|  3.04k|  Curl_peer_link(&conn->origin, data->state.origin);
 1450|       |
 1451|       |  /* set the connection scheme */
 1452|  3.04k|  result = url_set_conn_scheme(data, conn);
 1453|  3.04k|  if(result)
  ------------------
  |  Branch (1453:6): [True: 0, False: 3.04k]
  ------------------
 1454|      0|    goto out;
 1455|       |
 1456|       |  /* set the connection options */
 1457|  3.04k|  if(CURL_EASY_STR(data, STRING_OPTIONS)) {
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
 1458|      0|    conn->options = curlx_strdup(CURL_EASY_STR(data, STRING_OPTIONS));
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1459|      0|    if(!conn->options) {
  ------------------
  |  Branch (1459:8): [True: 0, False: 0]
  ------------------
 1460|      0|      result = CURLE_OUT_OF_MEMORY;
 1461|      0|      goto out;
 1462|      0|    }
 1463|      0|  }
 1464|  3.04k|  else if(data->state.up.options) {
  ------------------
  |  Branch (1464:11): [True: 0, False: 3.04k]
  ------------------
 1465|      0|    conn->options = curlx_strdup(data->state.up.options);
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1466|      0|    if(!conn->options) {
  ------------------
  |  Branch (1466:8): [True: 0, False: 0]
  ------------------
 1467|      0|      result = CURLE_OUT_OF_MEMORY;
 1468|      0|      goto out;
 1469|      0|    }
 1470|      0|  }
 1471|       |
 1472|  3.04k|out:
 1473|  3.04k|  return result;
 1474|  3.04k|}
url.c:url_set_conn_scheme:
 1166|  3.04k|{
 1167|       |  /* URL scheme is usable for connection when it is
 1168|       |   * - allowed
 1169|       |   * - not from a redirect or an allowed redirect protocol */
 1170|  3.04k|  const struct Curl_scheme *scheme = conn->origin->scheme;
 1171|  3.04k|  if(scheme->run &&
  ------------------
  |  Branch (1171:6): [True: 3.04k, False: 0]
  ------------------
 1172|  3.04k|     (data->set.allowed_protocols & scheme->protocol) &&
  ------------------
  |  Branch (1172:6): [True: 3.04k, False: 0]
  ------------------
 1173|  3.04k|     (!data->state.this_is_a_follow ||
  ------------------
  |  Branch (1173:7): [True: 3.04k, False: 0]
  ------------------
 1174|  3.04k|       (data->set.redir_protocols & scheme->protocol))) {
  ------------------
  |  Branch (1174:8): [True: 0, False: 0]
  ------------------
 1175|  3.04k|    conn->scheme = scheme;
 1176|  3.04k|    return CURLE_OK;
 1177|  3.04k|  }
 1178|      0|  if(scheme->flags & PROTOPT_NO_TRANSFER)
  ------------------
  |  |  235|      0|#define PROTOPT_NO_TRANSFER (1 << 17) /* this protocol is not for transfers */
  ------------------
  |  Branch (1178:6): [True: 0, False: 0]
  ------------------
 1179|      0|    failf(data, "Protocol \"%s\" is not for transfers", scheme->name);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1180|      0|  else
 1181|      0|    failf(data, "Protocol \"%s\" is disabled%s", scheme->name,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1182|      0|          data->state.this_is_a_follow ? " (in redirect)" : "");
  ------------------
  |  Branch (1182:11): [True: 0, False: 0]
  ------------------
 1183|      0|  return CURLE_UNSUPPORTED_PROTOCOL;
 1184|  3.04k|}
url.c:url_set_conn_peer:
 1751|  3.04k|{
 1752|  3.04k|  CURLcode result = CURLE_OK;
 1753|  3.04k|  struct Curl_peer *origin = conn->origin;
 1754|  3.04k|  struct Curl_peer *via_peer = NULL;
 1755|  3.04k|  struct curl_slist *conn_to_entry = data->set.connect_to;
 1756|       |
 1757|  3.04k|  DEBUGASSERT(!conn->via_peer);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1757:3): [True: 0, False: 3.04k]
  |  Branch (1757:3): [True: 3.04k, False: 0]
  ------------------
 1758|  3.04k|  Curl_peer_unlink(&conn->via_peer);
 1759|       |
 1760|  6.08k|  while(conn_to_entry && !via_peer) {
  ------------------
  |  Branch (1760:9): [True: 3.04k, False: 3.04k]
  |  Branch (1760:26): [True: 3.04k, False: 0]
  ------------------
 1761|  3.04k|    result = parse_connect_to_string(data, origin, conn_to_entry->data,
 1762|  3.04k|                                     &via_peer);
 1763|  3.04k|    if(result)
  ------------------
  |  Branch (1763:8): [True: 0, False: 3.04k]
  ------------------
 1764|      0|      return result;
 1765|  3.04k|    conn_to_entry = conn_to_entry->next;
 1766|  3.04k|  }
 1767|       |
 1768|  3.04k|#ifndef CURL_DISABLE_ALTSVC
 1769|  3.04k|  if(data->asi && !via_peer &&
  ------------------
  |  Branch (1769:6): [True: 3.04k, False: 0]
  |  Branch (1769:19): [True: 0, False: 3.04k]
  ------------------
 1770|      0|     ((conn->scheme->protocol == CURLPROTO_HTTPS) ||
  ------------------
  |  | 1089|      0|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (1770:7): [True: 0, False: 0]
  ------------------
 1771|      0|#ifdef DEBUGBUILD
 1772|       |      /* allow debug builds to circumvent the HTTPS restriction */
 1773|      0|      getenv("CURL_ALTSVC_HTTP")
  ------------------
  |  Branch (1773:7): [True: 0, False: 0]
  ------------------
 1774|       |#else
 1775|       |      0
 1776|       |#endif
 1777|      0|       )) {
 1778|       |    /* no connect_to match, try alt-svc! */
 1779|      0|    enum alpnid srcalpnid = ALPN_none;
 1780|      0|    bool hit = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1781|      0|    struct altsvc *as = NULL;
 1782|      0|    int allowed_alpns = ALPN_none;
 1783|      0|    struct http_negotiation *neg = &data->state.http_neg;
 1784|      0|    bool same_dest = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1785|       |
 1786|      0|    DEBUGF(infof(data, "Alt-svc check wanted=%x, allowed=%x",
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1787|      0|                 neg->wanted, neg->allowed));
 1788|       |#ifdef USE_HTTP3
 1789|       |    if(neg->allowed & CURL_HTTP_V3x)
 1790|       |      allowed_alpns |= ALPN_h3;
 1791|       |#endif
 1792|      0|#ifdef USE_HTTP2
 1793|      0|    if(neg->allowed & CURL_HTTP_V2x)
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (1793:8): [True: 0, False: 0]
  ------------------
 1794|      0|      allowed_alpns |= ALPN_h2;
 1795|      0|#endif
 1796|      0|    if(neg->allowed & CURL_HTTP_V1x)
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (1796:8): [True: 0, False: 0]
  ------------------
 1797|      0|      allowed_alpns |= ALPN_h1;
 1798|      0|    allowed_alpns &= (int)data->asi->flags;
 1799|       |
 1800|      0|    DEBUGF(infof(data, "check Alt-Svc for host '%s'", origin->hostname));
  ------------------
  |  | 1013|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [True: 0, False: 0]
  |  |  |  Branch (1013:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1801|       |#ifdef USE_HTTP3
 1802|       |    if(!hit && (neg->wanted & CURL_HTTP_V3x)) {
 1803|       |      srcalpnid = ALPN_h3;
 1804|       |      hit = Curl_altsvc_lookup(data->asi,
 1805|       |                               origin, ALPN_h3, /* from */
 1806|       |                               &as /* to */,
 1807|       |                               allowed_alpns, &same_dest);
 1808|       |    }
 1809|       |#endif
 1810|      0|#ifdef USE_HTTP2
 1811|      0|    if(!hit && (neg->wanted & CURL_HTTP_V2x) &&
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (1811:8): [True: 0, False: 0]
  |  Branch (1811:16): [True: 0, False: 0]
  ------------------
 1812|      0|       !neg->h2_prior_knowledge) {
  ------------------
  |  Branch (1812:8): [True: 0, False: 0]
  ------------------
 1813|      0|      srcalpnid = ALPN_h2;
 1814|      0|      hit = Curl_altsvc_lookup(data->asi,
 1815|      0|                               origin, ALPN_h2, /* from */
 1816|      0|                               &as /* to */,
 1817|      0|                               allowed_alpns, &same_dest);
 1818|      0|    }
 1819|      0|#endif
 1820|      0|    if(!hit && (neg->wanted & CURL_HTTP_V1x) &&
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (1820:8): [True: 0, False: 0]
  |  Branch (1820:16): [True: 0, False: 0]
  ------------------
 1821|      0|       !neg->only_10) {
  ------------------
  |  Branch (1821:8): [True: 0, False: 0]
  ------------------
 1822|      0|      srcalpnid = ALPN_h1;
 1823|      0|      hit = Curl_altsvc_lookup(data->asi,
 1824|      0|                               origin, ALPN_h1, /* from */
 1825|      0|                               &as /* to */,
 1826|      0|                               allowed_alpns, &same_dest);
 1827|      0|    }
 1828|       |
 1829|      0|    if(hit && same_dest) {
  ------------------
  |  Branch (1829:8): [True: 0, False: 0]
  |  Branch (1829:15): [True: 0, False: 0]
  ------------------
 1830|       |      /* same destination, but more HTTPS version options */
 1831|      0|      switch(as->dst.alpnid) {
 1832|      0|      case ALPN_h1:
  ------------------
  |  Branch (1832:7): [True: 0, False: 0]
  ------------------
 1833|      0|        neg->wanted |= CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1834|      0|        neg->preferred = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1835|      0|        break;
 1836|      0|      case ALPN_h2:
  ------------------
  |  Branch (1836:7): [True: 0, False: 0]
  ------------------
 1837|      0|        neg->wanted |= CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1838|      0|        neg->preferred = CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1839|      0|        break;
 1840|      0|      case ALPN_h3:
  ------------------
  |  Branch (1840:7): [True: 0, False: 0]
  ------------------
 1841|      0|        neg->wanted |= CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 1842|      0|        neg->preferred = CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 1843|      0|        break;
 1844|      0|      default: /* should not be possible */
  ------------------
  |  Branch (1844:7): [True: 0, False: 0]
  ------------------
 1845|      0|        break;
 1846|      0|      }
 1847|      0|    }
 1848|      0|    else if(hit) {
  ------------------
  |  Branch (1848:13): [True: 0, False: 0]
  ------------------
 1849|      0|      result = Curl_peer_create(data, conn->origin->scheme,
 1850|      0|                                as->dst.host, as->dst.port,
 1851|      0|                                &via_peer);
 1852|      0|      if(result)
  ------------------
  |  Branch (1852:10): [True: 0, False: 0]
  ------------------
 1853|      0|        return result;
 1854|      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]
  |  |  ------------------
  ------------------
 1855|      0|            Curl_alpnid2str(srcalpnid), origin->hostname, origin->port,
 1856|      0|            Curl_alpnid2str(as->dst.alpnid),
 1857|      0|            via_peer->hostname, via_peer->port);
 1858|      0|      conn->bits.altused = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1859|      0|      if(srcalpnid != as->dst.alpnid) {
  ------------------
  |  Branch (1859:10): [True: 0, False: 0]
  ------------------
 1860|       |        /* protocol version switch */
 1861|      0|        switch(as->dst.alpnid) {
 1862|      0|        case ALPN_h1:
  ------------------
  |  Branch (1862:9): [True: 0, False: 0]
  ------------------
 1863|      0|          neg->wanted = neg->allowed = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1864|      0|          neg->only_10 = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1865|      0|          break;
 1866|      0|        case ALPN_h2:
  ------------------
  |  Branch (1866:9): [True: 0, False: 0]
  ------------------
 1867|      0|          neg->wanted = neg->allowed = CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1868|      0|          break;
 1869|      0|        case ALPN_h3:
  ------------------
  |  Branch (1869:9): [True: 0, False: 0]
  ------------------
 1870|      0|          conn->transport_wanted = TRNSPRT_QUIC;
  ------------------
  |  |  239|      0|#define TRNSPRT_QUIC 5
  ------------------
 1871|      0|          neg->wanted = neg->allowed = CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 1872|      0|          break;
 1873|      0|        default: /* should not be possible */
  ------------------
  |  Branch (1873:9): [True: 0, False: 0]
  ------------------
 1874|      0|          break;
 1875|      0|        }
 1876|      0|      }
 1877|      0|    }
 1878|      0|  }
 1879|  3.04k|#endif
 1880|       |
 1881|  3.04k|  if(via_peer)
  ------------------
  |  Branch (1881:6): [True: 3.04k, False: 0]
  ------------------
 1882|  3.04k|    conn->via_peer = via_peer;
 1883|       |
 1884|  3.04k|  return result;
 1885|  3.04k|}
url.c:parse_connect_to_string:
 1691|  3.04k|{
 1692|  3.04k|  CURLcode result = CURLE_OK;
 1693|  3.04k|  const char *ptr = conn_to_line;
 1694|  3.04k|  bool host_match = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1695|  3.04k|  bool port_match = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1696|       |
 1697|  3.04k|  *pvia_dest = NULL;
 1698|       |
 1699|  3.04k|  if(*ptr == ':') {
  ------------------
  |  Branch (1699:6): [True: 3.04k, False: 0]
  ------------------
 1700|       |    /* an empty hostname always matches */
 1701|  3.04k|    host_match = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1702|  3.04k|    ptr++;
 1703|  3.04k|  }
 1704|      0|  else {
 1705|       |    /* check whether the URL's hostname matches. Use the URL hostname
 1706|       |     * when it was an IPv6 address. Otherwise use the connection's hostname
 1707|       |     * that has IDN conversion. */
 1708|      0|    size_t hlen = strlen(dest->hostname);
 1709|      0|    host_match = curl_strnequal(ptr, dest->hostname, hlen);
 1710|      0|    if(!host_match && (dest->user_hostname != dest->hostname)) {
  ------------------
  |  Branch (1710:8): [True: 0, False: 0]
  |  Branch (1710:23): [True: 0, False: 0]
  ------------------
 1711|       |      /* hostname was normalized, could be IPv6 or IDN */
 1712|      0|      hlen = strlen(dest->user_hostname);
 1713|      0|      host_match = curl_strnequal(ptr, dest->user_hostname, hlen);
 1714|      0|    }
 1715|      0|    host_match = host_match && ptr[hlen] == ':';
  ------------------
  |  Branch (1715:18): [True: 0, False: 0]
  |  Branch (1715:32): [True: 0, False: 0]
  ------------------
 1716|      0|    if(host_match)
  ------------------
  |  Branch (1716:8): [True: 0, False: 0]
  ------------------
 1717|      0|      ptr += hlen + 1;
 1718|      0|  }
 1719|       |
 1720|  3.04k|  if(host_match) {
  ------------------
  |  Branch (1720:6): [True: 3.04k, False: 0]
  ------------------
 1721|  3.04k|    if(*ptr == ':') {
  ------------------
  |  Branch (1721:8): [True: 3.04k, False: 0]
  ------------------
 1722|       |      /* an empty port always matches */
 1723|  3.04k|      port_match = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1724|  3.04k|      ptr++;
 1725|  3.04k|    }
 1726|      0|    else {
 1727|       |      /* check whether the URL's port matches */
 1728|      0|      const char *ptr_next = strchr(ptr, ':');
 1729|      0|      if(ptr_next) {
  ------------------
  |  Branch (1729:10): [True: 0, False: 0]
  ------------------
 1730|      0|        curl_off_t port_to_match;
 1731|      0|        if(!curlx_str_number(&ptr, &port_to_match, 0xffff) &&
  ------------------
  |  Branch (1731:12): [True: 0, False: 0]
  ------------------
 1732|      0|           ((uint16_t)port_to_match == dest->port)) {
  ------------------
  |  Branch (1732:12): [True: 0, False: 0]
  ------------------
 1733|      0|          port_match = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1734|      0|        }
 1735|      0|        ptr = ptr_next + 1;
 1736|      0|      }
 1737|      0|    }
 1738|  3.04k|  }
 1739|       |
 1740|  3.04k|  if(host_match && port_match && ptr && *ptr)
  ------------------
  |  Branch (1740:6): [True: 3.04k, False: 0]
  |  Branch (1740:20): [True: 3.04k, False: 0]
  |  Branch (1740:34): [True: 3.04k, False: 0]
  |  Branch (1740:41): [True: 3.04k, False: 0]
  ------------------
 1741|  3.04k|    result = Curl_peer_from_connect_to(data, dest, ptr, pvia_dest);
 1742|       |
 1743|  3.04k|  return result;
 1744|  3.04k|}
url.c:url_set_conn_login:
 1663|  3.04k|{
 1664|       |  /* If our protocol needs a password and we have none, use the defaults */
 1665|  3.04k|  if((conn->scheme->flags & PROTOPT_NEEDSPWD) && !conn->creds) {
  ------------------
  |  |  212|  3.04k|#define PROTOPT_NEEDSPWD (1 << 5)  /* needs a password, and if none is set it
  ------------------
  |  Branch (1665:6): [True: 0, False: 3.04k]
  |  Branch (1665:50): [True: 0, False: 0]
  ------------------
 1666|      0|    Curl_peer_link(&conn->creds_origin, data->state.origin);
 1667|      0|    if(data->state.creds)
  ------------------
  |  Branch (1667:8): [True: 0, False: 0]
  ------------------
 1668|      0|      Curl_creds_link(&conn->creds, data->state.creds);
 1669|      0|    else
 1670|      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"
  ------------------
 1671|      0|                               NULL, NULL, NULL, CREDS_NONE, &conn->creds);
  ------------------
  |  |   29|      0|#define CREDS_NONE   0 /* used for default username/passwd */
  ------------------
 1672|      0|  }
 1673|  3.04k|  else if(!(conn->scheme->flags & PROTOPT_CREDSPERREQUEST)) {
  ------------------
  |  |  216|  3.04k|#define PROTOPT_CREDSPERREQUEST (1 << 7) /* requires login credentials per
  ------------------
  |  Branch (1673:11): [True: 3.04k, False: 0]
  ------------------
 1674|       |    /* for protocols that do not handle credentials per request,
 1675|       |     * the connection credentials are set by the initial transfer. */
 1676|  3.04k|    Curl_peer_link(&conn->creds_origin, data->state.origin);
 1677|  3.04k|    Curl_creds_link(&conn->creds, data->state.creds);
 1678|  3.04k|  }
 1679|       |
 1680|  3.04k|  return CURLE_OK;
 1681|  3.04k|}
url.c:setup_connection_internals:
 1518|  3.04k|{
 1519|  3.04k|  struct Curl_peer *peer = NULL;
 1520|  3.04k|  CURLcode result;
 1521|       |
 1522|  3.04k|  if(conn->scheme->run->setup_connection) {
  ------------------
  |  Branch (1522:6): [True: 0, False: 3.04k]
  ------------------
 1523|      0|    result = conn->scheme->run->setup_connection(data, conn);
 1524|      0|    if(result)
  ------------------
  |  Branch (1524:8): [True: 0, False: 0]
  ------------------
 1525|      0|      return result;
 1526|      0|  }
 1527|       |
 1528|       |  /* Now create the destination name */
 1529|  3.04k|  peer = Curl_conn_get_destination(conn, FIRSTSOCKET);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
 1530|  3.04k|  if(!peer)
  ------------------
  |  Branch (1530:6): [True: 0, False: 3.04k]
  ------------------
 1531|      0|    return CURLE_FAILED_INIT;
 1532|       |
 1533|       |  /* IPv6 addresses with a scope_id (0 is default == global) have a
 1534|       |   * printable representation with a '%<scope_id>' suffix. */
 1535|  3.04k|  if(peer->ipv6)
  ------------------
  |  Branch (1535:6): [True: 0, False: 3.04k]
  ------------------
 1536|      0|    if(peer->scopeid)
  ------------------
  |  Branch (1536:8): [True: 0, False: 0]
  ------------------
 1537|      0|      conn->destination = curl_maprintf("[%s%%%u]:%u",
 1538|      0|        peer->hostname, peer->scopeid, peer->port);
 1539|      0|    else
 1540|      0|      conn->destination = curl_maprintf("[%s]:%u",
 1541|      0|        peer->hostname, peer->port);
 1542|  3.04k|  else
 1543|  3.04k|    conn->destination = curl_maprintf("%s:%u", peer->hostname, peer->port);
 1544|  3.04k|  if(!conn->destination)
  ------------------
  |  Branch (1544:6): [True: 0, False: 3.04k]
  ------------------
 1545|      0|    return CURLE_OUT_OF_MEMORY;
 1546|       |
 1547|  3.04k|  Curl_strntolower(conn->destination, conn->destination,
 1548|  3.04k|                   strlen(conn->destination));
 1549|       |
 1550|  3.04k|#ifdef USE_IPV6
 1551|  3.04k|  if(data->set.scope_id)
  ------------------
  |  Branch (1551:6): [True: 0, False: 3.04k]
  ------------------
 1552|      0|    conn->scope_id = data->set.scope_id;
 1553|  3.04k|  else {
 1554|  3.04k|    struct Curl_peer *first = Curl_conn_get_first_peer(conn, FIRSTSOCKET);
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
 1555|  3.04k|    if(!first)
  ------------------
  |  Branch (1555:8): [True: 0, False: 3.04k]
  ------------------
 1556|      0|      return CURLE_FAILED_INIT;
 1557|  3.04k|    conn->scope_id = first->scopeid;
 1558|  3.04k|  }
 1559|  3.04k|#endif
 1560|       |
 1561|  3.04k|  return CURLE_OK;
 1562|  3.04k|}
url.c:url_match_init:
 2168|  3.04k|{
 2169|  3.04k|  memset(m, 0, sizeof(*m));
 2170|  3.04k|  m->data = data;
 2171|  3.04k|  m->needle = needle;
 2172|  3.04k|  m->now = *Curl_pgrs_now(data);
 2173|  3.04k|  m->may_multiplex = xfer_may_multiplex(data, needle);
 2174|       |
 2175|       |#ifdef USE_NTLM
 2176|       |  m->want_ntlm_http =
 2177|       |    (data->state.authhost.want & CURLAUTH_NTLM) &&
 2178|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP) &&
 2179|       |    Curl_auth_allowed_to_host(data);
 2180|       |#ifndef CURL_DISABLE_PROXY
 2181|       |  m->want_proxy_ntlm_http =
 2182|       |    needle->http_proxy.creds &&
 2183|       |    (data->state.authproxy.want & CURLAUTH_NTLM) &&
 2184|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 2185|       |#endif
 2186|       |#endif
 2187|       |
 2188|       |#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
 2189|       |  m->want_nego_http =
 2190|       |    (data->state.authhost.want & CURLAUTH_NEGOTIATE) &&
 2191|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP) &&
 2192|       |    Curl_auth_allowed_to_host(data);
 2193|       |#ifndef CURL_DISABLE_PROXY
 2194|       |  m->want_proxy_nego_http =
 2195|       |    needle->http_proxy.creds &&
 2196|       |    (data->state.authproxy.want & CURLAUTH_NEGOTIATE) &&
 2197|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 2198|       |#endif
 2199|       |#endif
 2200|  3.04k|  m->require_tls = data->set.use_ssl >= CURLUSESSL_CONTROL;
  ------------------
  |  |  936|  3.04k|#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
  ------------------
 2201|  3.04k|  m->may_tls = data->set.use_ssl > CURLUSESSL_NONE;
  ------------------
  |  |  934|  3.04k|#define CURLUSESSL_NONE    0L /* do not attempt to use SSL */
  ------------------
 2202|       |
 2203|       |  /* Get a shallow setup of filter configs for connection cache matching */
 2204|  3.04k|  return Curl_ssl_filter_config_tmp_init(data, needle->origin,
 2205|  3.04k|                                         &m->ssl_config,
 2206|  3.04k|#ifndef CURL_DISABLE_PROXY
 2207|  3.04k|                                         &m->proxy_ssl_config);
 2208|       |#else
 2209|       |                                         NULL);
 2210|       |#endif
 2211|  3.04k|}
url.c:xfer_may_multiplex:
  532|  3.04k|{
  533|  3.04k|#ifndef CURL_DISABLE_HTTP
  534|       |  /* If an HTTP protocol and multiplexing is enabled */
  535|  3.04k|  if((conn->scheme->protocol & PROTO_FAMILY_HTTP) &&
  ------------------
  |  |   82|  3.04k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|  3.04k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|  3.04k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   61|  3.04k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   83|  3.04k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   62|  3.04k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (535:6): [True: 0, False: 3.04k]
  ------------------
  536|      0|     (!conn->bits.protoconnstart || !conn->bits.close)) {
  ------------------
  |  Branch (536:7): [True: 0, False: 0]
  |  Branch (536:37): [True: 0, False: 0]
  ------------------
  537|       |
  538|      0|    if(Curl_multiplex_wanted(data->multi) &&
  ------------------
  |  Branch (538:8): [True: 0, False: 0]
  ------------------
  539|      0|       (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)))
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                     (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)))
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (539:8): [True: 0, False: 0]
  ------------------
  540|       |      /* allows HTTP/2 or newer */
  541|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  542|      0|  }
  543|       |#else
  544|       |  (void)data;
  545|       |  (void)conn;
  546|       |#endif
  547|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  548|  3.04k|}
url.c:setup_range:
 1481|  3.04k|{
 1482|  3.04k|  struct UrlState *s = &data->state;
 1483|  3.04k|  s->resume_from = data->set.set_resume_from;
 1484|  3.04k|  if(s->resume_from || CURL_EASY_STR(data, STRING_SET_RANGE)) {
  ------------------
  |  | 1234|  3.04k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1234:3): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (1484:6): [True: 0, False: 3.04k]
  ------------------
 1485|      0|    if(s->rangestringalloc)
  ------------------
  |  Branch (1485:8): [True: 0, False: 0]
  ------------------
 1486|      0|      curlx_free(s->range);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1487|       |
 1488|      0|    if(s->resume_from)
  ------------------
  |  Branch (1488:8): [True: 0, False: 0]
  ------------------
 1489|      0|      s->range = curl_maprintf("%" FMT_OFF_T "-", s->resume_from);
 1490|      0|    else
 1491|      0|      s->range = curlx_strdup(CURL_EASY_STR(data, STRING_SET_RANGE));
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1492|       |
 1493|      0|    if(!s->range)
  ------------------
  |  Branch (1493:8): [True: 0, False: 0]
  ------------------
 1494|      0|      return CURLE_OUT_OF_MEMORY;
 1495|       |
 1496|      0|    s->rangestringalloc = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1497|       |
 1498|       |    /* tell ourselves to fetch this range */
 1499|      0|    s->use_range = TRUE;        /* enable range download */
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1500|      0|  }
 1501|  3.04k|  else
 1502|  3.04k|    s->use_range = FALSE; /* disable range download */
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1503|       |
 1504|  3.04k|  return CURLE_OK;
 1505|  3.04k|}
url.c:url_attach_existing:
 1095|  3.04k|{
 1096|  3.04k|  struct cpool *cpool = Curl_cpool_get_instance(data);
 1097|  3.04k|  bool success;
 1098|       |
 1099|  3.04k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1099:3): [True: 0, False: 3.04k]
  |  Branch (1099:3): [True: 3.04k, False: 0]
  ------------------
 1100|       |
 1101|  3.04k|  Curl_cpool_prune_dead(cpool, data);
 1102|       |
 1103|       |  /* Find a connection in the pool that matches what "data + needle"
 1104|       |   * requires. If a suitable candidate is found, it is attached to "data". */
 1105|  3.04k|  success = Curl_cpool_find(data, needle->destination,
 1106|  3.04k|                            url_match_conn, url_match_result, m);
 1107|       |
 1108|  3.04k|  return success;
 1109|  3.04k|}
url.c:url_match_result:
 1061|  3.04k|{
 1062|  3.04k|  struct url_conn_match *match = userdata;
 1063|  3.04k|  if(match->found) {
  ------------------
  |  Branch (1063:6): [True: 0, False: 3.04k]
  ------------------
 1064|       |    /* Attach it now while still under lock, so the connection does
 1065|       |     * no longer appear idle and can be reaped. */
 1066|      0|    Curl_attach_connection(match->data, match->found, TRUE);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1067|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1068|      0|  }
 1069|  3.04k|  else if(match->seen_single_use_conn && !match->seen_multiplex_conn) {
  ------------------
  |  Branch (1069:11): [True: 0, False: 3.04k]
  |  Branch (1069:42): [True: 0, False: 0]
  ------------------
 1070|       |    /* We have seen a single-use, existing connection to the destination and
 1071|       |     * no multiplexed one. It seems safe to assume that the server does
 1072|       |     * not support multiplexing. */
 1073|      0|    match->wait_pipe = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1074|      0|  }
 1075|  3.04k|  else if(match->seen_pending_conn && match->data->set.pipewait) {
  ------------------
  |  Branch (1075:11): [True: 0, False: 3.04k]
  |  Branch (1075:39): [True: 0, False: 0]
  ------------------
 1076|      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]
  |  |  ------------------
  ------------------
 1077|      0|          "Found pending candidate for reuse and CURLOPT_PIPEWAIT is set");
 1078|      0|    match->wait_pipe = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1079|      0|  }
 1080|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
 1081|  3.04k|}
url.c:url_match_destroy:
 2214|  3.04k|{
 2215|  3.04k|  Curl_ssl_config_cleanup(&m->ssl_config);
 2216|  3.04k|#ifndef CURL_DISABLE_PROXY
 2217|  3.04k|  Curl_ssl_config_cleanup(&m->proxy_ssl_config);
 2218|  3.04k|#endif
 2219|  3.04k|}

urlencode_str:
  130|  3.06k|{
  131|       |  /* we must add this with whitespace-replacing */
  132|  3.06k|  const unsigned char *iptr;
  133|  3.06k|  const unsigned char *host_sep = (const unsigned char *)url;
  134|  3.06k|  CURLcode result = CURLE_OK;
  135|       |
  136|  3.06k|  DEBUGASSERT((query >= QUERY_NO) && (query <= QUERY_YES));
  ------------------
  |  | 1027|  3.06k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (136:3): [True: 0, False: 3.06k]
  |  Branch (136:3): [True: 0, False: 0]
  |  Branch (136:3): [True: 3.06k, False: 0]
  |  Branch (136:3): [True: 3.06k, False: 0]
  ------------------
  137|       |
  138|  3.06k|  if(!relative) {
  ------------------
  |  Branch (138:6): [True: 0, False: 3.06k]
  ------------------
  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|   303k|  for(iptr = host_sep; len && !result;) {
  ------------------
  |  Branch (148:24): [True: 300k, False: 3.06k]
  |  Branch (148:31): [True: 300k, False: 0]
  ------------------
  149|   300k|    if(*iptr == ' ') {
  ------------------
  |  Branch (149:8): [True: 0, False: 300k]
  ------------------
  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|   300k|    else if((*iptr < ' ') || (*iptr >= 0x7f)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 300k]
  |  Branch (157:30): [True: 263k, False: 36.9k]
  ------------------
  158|   263k|      unsigned char out[3] = { '%' };
  159|   263k|      Curl_hexbyte(&out[1], *iptr);
  160|   263k|      result = curlx_dyn_addn(o, out, 3);
  161|   263k|      iptr++;
  162|   263k|      len--;
  163|   263k|    }
  164|  36.9k|    else if(*iptr == '%' && (len >= 3) &&
  ------------------
  |  Branch (164:13): [True: 19.4k, False: 17.4k]
  |  Branch (164:29): [True: 19.4k, False: 6]
  ------------------
  165|  19.4k|            ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|  56.4k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  38.9k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 8.51k, False: 10.9k]
  |  |  |  |  |  Branch (42:38): [True: 5.02k, False: 3.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  33.9k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 2.08k, False: 12.3k]
  |  |  |  |  |  Branch (27:43): [True: 1.77k, False: 312]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  12.6k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 1.70k, False: 10.9k]
  |  |  |  |  |  Branch (28:43): [True: 1.35k, False: 352]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|  45.1k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  16.3k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 7.31k, False: 840]
  |  |  |  |  |  Branch (42:38): [True: 82, False: 7.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  16.2k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 6.65k, False: 1.41k]
  |  |  |  |  |  Branch (27:43): [True: 5.68k, False: 970]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  2.38k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 1.54k, False: 840]
  |  |  |  |  |  Branch (28:43): [True: 576, False: 971]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  6.34k|            (ISLOWER(iptr[1]) || ISLOWER(iptr[2]))) {
  ------------------
  |  |   41|  12.6k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 1.43k, False: 4.90k]
  |  |  |  Branch (41:38): [True: 1.43k, False: 0]
  |  |  ------------------
  ------------------
                          (ISLOWER(iptr[1]) || ISLOWER(iptr[2]))) {
  ------------------
  |  |   41|  4.90k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 4.70k, False: 201]
  |  |  |  Branch (41:38): [True: 4.70k, False: 0]
  |  |  ------------------
  ------------------
  167|       |      /* uppercase it */
  168|  6.14k|      unsigned char hex = (unsigned char)((curlx_hexval(iptr[1]) << 4) |
  ------------------
  |  |  111|  6.14k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  169|  6.14k|                                          curlx_hexval(iptr[2]));
  ------------------
  |  |  111|  6.14k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  170|  6.14k|      unsigned char out[3] = { '%' };
  171|  6.14k|      Curl_hexbyte(&out[1], hex);
  172|  6.14k|      result = curlx_dyn_addn(o, out, 3);
  173|  6.14k|      iptr += 3;
  174|  6.14k|      len -= 3;
  175|  6.14k|    }
  176|  30.8k|    else {
  177|  30.8k|      const unsigned char *start = iptr;
  178|   629k|      while(len) {
  ------------------
  |  Branch (178:13): [True: 626k, False: 2.95k]
  ------------------
  179|   626k|        if(*iptr == ' ' || *iptr < ' ' || *iptr >= 0x7f)
  ------------------
  |  Branch (179:12): [True: 0, False: 626k]
  |  Branch (179:28): [True: 0, False: 626k]
  |  Branch (179:43): [True: 23.1k, False: 603k]
  ------------------
  180|  23.1k|          break;
  181|   603k|        if(*iptr == '%' && (len >= 3) &&
  ------------------
  |  Branch (181:12): [True: 163k, False: 440k]
  |  Branch (181:28): [True: 163k, False: 78]
  ------------------
  182|   163k|           ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|   767k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|   327k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 36.8k, False: 126k]
  |  |  |  |  |  Branch (42:38): [True: 16.1k, False: 20.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|   310k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 16.7k, False: 130k]
  |  |  |  |  |  Branch (27:43): [True: 3.72k, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|   143k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 16.8k, False: 126k]
  |  |  |  |  |  Branch (28:43): [True: 3.71k, False: 13.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                         ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|   627k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  47.2k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 16.0k, False: 7.61k]
  |  |  |  |  |  Branch (42:38): [True: 1.27k, False: 14.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  45.9k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 12.5k, False: 9.82k]
  |  |  |  |  |  Branch (27:43): [True: 4.34k, False: 8.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  18.0k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 10.3k, False: 7.62k]
  |  |  |  |  |  Branch (28:43): [True: 2.11k, False: 8.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|  7.73k|           (ISLOWER(iptr[1]) || ISLOWER(iptr[2])))
  ------------------
  |  |   41|  15.4k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 1.26k, False: 6.47k]
  |  |  |  Branch (41:38): [True: 1.26k, False: 0]
  |  |  ------------------
  ------------------
                         (ISLOWER(iptr[1]) || ISLOWER(iptr[2])))
  ------------------
  |  |   41|  6.47k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 3.51k, False: 2.95k]
  |  |  |  Branch (41:38): [True: 3.51k, False: 0]
  |  |  ------------------
  ------------------
  184|  4.78k|          break;
  185|   599k|        if(*iptr == '?') {
  ------------------
  |  Branch (185:12): [True: 0, False: 599k]
  ------------------
  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|   599k|        iptr++;
  194|   599k|        len--;
  195|   599k|      }
  196|  30.8k|      result = curlx_dyn_addn(o, (const char *)start, (size_t)(iptr - start));
  197|  30.8k|    }
  198|   300k|  }
  199|       |
  200|  3.06k|  if(result)
  ------------------
  |  Branch (200:6): [True: 0, False: 3.06k]
  ------------------
  201|      0|    return cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  202|  3.06k|  return CURLUE_OK;
  203|  3.06k|}
Curl_is_absolute_url:
  215|  7.48k|{
  216|  7.48k|  size_t i = 0;
  217|  7.48k|  DEBUGASSERT(!buf || (buflen > MAX_SCHEME_LEN));
  ------------------
  |  | 1027|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (217:3): [True: 7.48k, False: 0]
  |  Branch (217:3): [True: 0, False: 0]
  |  Branch (217:3): [True: 3.74k, False: 3.74k]
  |  Branch (217:3): [True: 3.74k, False: 0]
  ------------------
  218|  7.48k|  (void)buflen; /* only used in debug-builds */
  219|  7.48k|  if(buf)
  ------------------
  |  Branch (219:6): [True: 3.74k, False: 3.74k]
  ------------------
  220|  3.74k|    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|  7.48k|  if(ISALPHA(url[0])) {
  ------------------
  |  |   36|  7.48k|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   41|  14.9k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:22): [True: 7.48k, False: 0]
  |  |  |  |  |  Branch (41:38): [True: 7.48k, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  7.48k|    if(buf)
  ------------------
  |  Branch (226:8): [True: 3.74k, False: 3.74k]
  ------------------
  227|  3.74k|      buf[0] = Curl_raw_tolower(url[0]);
  228|  44.9k|    for(i = 1; i < MAX_SCHEME_LEN; ++i) {
  ------------------
  |  |   55|  44.9k|#define MAX_SCHEME_LEN 40
  ------------------
  |  Branch (228:16): [True: 44.9k, False: 0]
  ------------------
  229|  44.9k|      char s = url[i];
  230|  44.9k|      if(s && (ISALNUM(s) || (s == '+') || (s == '-') || (s == '.'))) {
  ------------------
  |  |   39|  89.8k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  89.8k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 44.9k, False: 0]
  |  |  |  |  |  Branch (42:38): [True: 0, False: 44.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   41|  89.8k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:22): [True: 37.4k, False: 7.48k]
  |  |  |  |  |  Branch (41:38): [True: 37.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   40|  7.48k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:22): [True: 0, False: 7.48k]
  |  |  |  |  |  Branch (40:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (230:10): [True: 44.9k, False: 0]
  |  Branch (230:30): [True: 0, False: 7.48k]
  |  Branch (230:44): [True: 0, False: 7.48k]
  |  Branch (230:58): [True: 0, False: 7.48k]
  ------------------
  231|  37.4k|        if(buf)
  ------------------
  |  Branch (231:12): [True: 18.7k, False: 18.7k]
  ------------------
  232|  18.7k|          buf[i] = Curl_raw_tolower(s);
  233|  37.4k|      }
  234|  7.48k|      else {
  235|  7.48k|        break;
  236|  7.48k|      }
  237|  44.9k|    }
  238|  7.48k|  }
  239|  7.48k|  if(i && (url[i] == ':') && ((url[i + 1] == '/') || !guess_scheme)) {
  ------------------
  |  Branch (239:6): [True: 7.48k, False: 0]
  |  Branch (239:11): [True: 7.48k, False: 0]
  |  Branch (239:31): [True: 7.48k, False: 0]
  |  Branch (239:54): [True: 0, False: 0]
  ------------------
  240|       |    /* If this does not guess scheme, the scheme always ends with the colon so
  241|       |       that this also detects data: URLs etc. In guessing mode, data: could
  242|       |       be the hostname "data" with a specified port number. */
  243|       |
  244|       |    /* the length of the scheme is the name part only */
  245|  7.48k|    size_t len = i;
  246|  7.48k|    if(buf)
  ------------------
  |  Branch (246:8): [True: 3.74k, False: 3.74k]
  ------------------
  247|  3.74k|      buf[i] = 0;
  248|  7.48k|    return len;
  249|  7.48k|  }
  250|      0|  if(buf)
  ------------------
  |  Branch (250:6): [True: 0, False: 0]
  ------------------
  251|      0|    buf[0] = 0;
  252|      0|  return 0;
  253|  7.48k|}
parse_hostname_login:
  286|  3.72k|{
  287|  3.72k|  CURLUcode ures = CURLUE_OK;
  288|  3.72k|  CURLcode result;
  289|  3.72k|  char *userp = NULL;
  290|  3.72k|  char *passwdp = NULL;
  291|  3.72k|  char *optionsp = NULL;
  292|  3.72k|  const struct Curl_scheme *h = NULL;
  293|       |
  294|       |  /* At this point, we assume all the other special cases have been taken
  295|       |   * care of, so the host is at most
  296|       |   *
  297|       |   *   [user[:password][;options]]@]hostname
  298|       |   *
  299|       |   * We need somewhere to put the embedded details, so do that first.
  300|       |   */
  301|  3.72k|  const char *ptr;
  302|       |
  303|  3.72k|  DEBUGASSERT(login);
  ------------------
  |  | 1027|  3.72k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (303:3): [True: 0, False: 3.72k]
  |  Branch (303:3): [True: 3.72k, False: 0]
  ------------------
  304|       |
  305|  3.72k|  *hostname_offset = 0;
  306|  3.72k|  ptr = memchr(login, '@', len);
  307|  3.72k|  if(!ptr)
  ------------------
  |  Branch (307:6): [True: 3.49k, False: 223]
  ------------------
  308|  3.49k|    goto out;
  309|       |
  310|       |  /* We will now try to extract the
  311|       |   * possible login information in a string like:
  312|       |   * ftp://user:password@ftp.site.example:8021/README */
  313|    223|  ptr++;
  314|       |
  315|       |  /* if this is a known scheme, get some details */
  316|    223|  if(u->scheme)
  ------------------
  |  Branch (316:6): [True: 223, False: 0]
  ------------------
  317|    223|    h = Curl_get_scheme(u->scheme);
  318|       |
  319|       |  /* We could use the login information in the URL so extract it. Only parse
  320|       |     options if the handler says we should. Note that 'h' might be NULL! */
  321|    223|  result = Curl_parse_login_details(login, ptr - login - 1,
  322|    223|                                    &userp, &passwdp,
  323|    223|                                    (h && (h->flags & PROTOPT_URLOPTIONS)) ?
  ------------------
  |  |  221|    223|#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
  ------------------
  |  Branch (323:38): [True: 223, False: 0]
  |  Branch (323:43): [True: 0, False: 223]
  ------------------
  324|    223|                                    &optionsp : NULL);
  325|    223|  if(result) {
  ------------------
  |  Branch (325:6): [True: 0, False: 223]
  ------------------
  326|       |    /* the only possible error from Curl_parse_login_details is out of
  327|       |       memory: */
  328|      0|    ures = CURLUE_OUT_OF_MEMORY;
  329|      0|    goto out;
  330|      0|  }
  331|       |
  332|    223|  if(userp) {
  ------------------
  |  Branch (332:6): [True: 223, False: 0]
  ------------------
  333|    223|    if(flags & CURLU_DISALLOW_USER) {
  ------------------
  |  |   93|    223|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
  |  Branch (333:8): [True: 0, False: 223]
  ------------------
  334|       |      /* Option DISALLOW_USER is set and URL contains username. */
  335|      0|      ures = CURLUE_USER_NOT_ALLOWED;
  336|      0|      goto out;
  337|      0|    }
  338|    223|    curlx_free(u->user);
  ------------------
  |  | 1428|    223|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  339|    223|    u->user = userp;
  340|    223|  }
  341|       |
  342|    223|  if(passwdp) {
  ------------------
  |  Branch (342:6): [True: 45, False: 178]
  ------------------
  343|     45|    curlx_strzero(u->password);
  344|     45|    curlx_free(u->password);
  ------------------
  |  | 1428|     45|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  345|     45|    u->password = passwdp;
  346|     45|  }
  347|       |
  348|    223|  if(optionsp) {
  ------------------
  |  Branch (348:6): [True: 0, False: 223]
  ------------------
  349|      0|    curlx_free(u->options);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  350|      0|    u->options = optionsp;
  351|      0|  }
  352|       |
  353|    223|  if(userp && badoctets(userp, strlen(userp), flags))
  ------------------
  |  Branch (353:6): [True: 223, False: 0]
  |  Branch (353:15): [True: 2, False: 221]
  ------------------
  354|      2|    ures = CURLUE_BAD_USER;
  355|    221|  else if(passwdp && badoctets(passwdp, strlen(passwdp), flags))
  ------------------
  |  Branch (355:11): [True: 45, False: 176]
  |  Branch (355:22): [True: 0, False: 45]
  ------------------
  356|      0|    ures = CURLUE_BAD_PASSWORD;
  357|    221|  else if(optionsp && badoctets(optionsp, strlen(optionsp), flags))
  ------------------
  |  Branch (357:11): [True: 0, False: 221]
  |  Branch (357:23): [True: 0, False: 0]
  ------------------
  358|      0|    ures = CURLUE_MALFORMED_INPUT;
  359|       |
  360|    223|  userp = passwdp = optionsp = NULL;
  361|       |
  362|    223|  if(!ures) {
  ------------------
  |  Branch (362:6): [True: 221, False: 2]
  ------------------
  363|       |    /* the hostname starts at this offset */
  364|    221|    *hostname_offset = ptr - login;
  365|    221|    return CURLUE_OK;
  366|    221|  }
  367|       |
  368|  3.50k|out:
  369|       |
  370|  3.50k|  curlx_free(userp);
  ------------------
  |  | 1428|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  371|  3.50k|  curlx_strzero(passwdp);
  372|  3.50k|  curlx_free(passwdp);
  ------------------
  |  | 1428|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  373|  3.50k|  curlx_free(optionsp);
  ------------------
  |  | 1428|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  374|  3.50k|  curlx_safefree(u->user);
  ------------------
  |  | 1284|  3.50k|  do {                      \
  |  | 1285|  3.50k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.50k|    (ptr) = NULL;           \
  |  | 1287|  3.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.50k]
  |  |  ------------------
  ------------------
  375|  3.50k|  curlx_strzero(u->password);
  376|  3.50k|  curlx_safefree(u->password);
  ------------------
  |  | 1284|  3.50k|  do {                      \
  |  | 1285|  3.50k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.50k|    (ptr) = NULL;           \
  |  | 1287|  3.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.50k]
  |  |  ------------------
  ------------------
  377|  3.50k|  curlx_safefree(u->options);
  ------------------
  |  | 1284|  3.50k|  do {                      \
  |  | 1285|  3.50k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  3.50k|    (ptr) = NULL;           \
  |  | 1287|  3.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 3.50k]
  |  |  ------------------
  ------------------
  378|       |
  379|  3.50k|  return ures;
  380|    223|}
parse_port:
  387|  3.72k|{
  388|  3.72k|  const char *portptr;
  389|  3.72k|  const char *hostname = curlx_dyn_ptr(host);
  390|       |  /*
  391|       |   * Find the end of an IPv6 address on the ']' ending bracket.
  392|       |   */
  393|  3.72k|  u->portnum = 0;
  394|  3.72k|  u->port_present = FALSE;
  ------------------
  |  | 1000|  3.72k|#define FALSE false
  ------------------
  395|  3.72k|  if(hostname[0] == '[') {
  ------------------
  |  Branch (395:6): [True: 275, False: 3.44k]
  ------------------
  396|    275|    portptr = memchr(hostname + 1, ']', curlx_dyn_len(host) - 1);
  397|    275|    if(!portptr)
  ------------------
  |  Branch (397:8): [True: 3, False: 272]
  ------------------
  398|      3|      return CURLUE_BAD_IPV6;
  399|    272|    portptr++;
  400|       |    /* this is a RFC2732-style specified IP-address */
  401|    272|    if(*portptr) {
  ------------------
  |  Branch (401:8): [True: 13, False: 259]
  ------------------
  402|     13|      if(*portptr != ':')
  ------------------
  |  Branch (402:10): [True: 12, False: 1]
  ------------------
  403|     12|        return CURLUE_BAD_PORT_NUMBER;
  404|     13|    }
  405|    259|    else
  406|    259|      portptr = NULL;
  407|    272|  }
  408|  3.44k|  else
  409|  3.44k|    portptr = memchr(hostname, ':', curlx_dyn_len(host));
  410|       |
  411|  3.70k|  if(portptr) {
  ------------------
  |  Branch (411:6): [True: 107, False: 3.59k]
  ------------------
  412|    107|    curl_off_t port;
  413|    107|    size_t keep = portptr - hostname;
  414|    107|    int rc;
  415|       |
  416|       |    /* Browser behavior adaptation. If there is a colon with no digits after,
  417|       |       cut off the name there which makes us ignore the colon and use the
  418|       |       default port. Firefox, Chrome and Safari all do that.
  419|       |
  420|       |       Do not do it if the URL has no scheme, to make something that looks like
  421|       |       a scheme not work! */
  422|    107|    curlx_dyn_setlen(host, keep);
  423|    107|    portptr++;
  424|    107|    if(!*portptr)
  ------------------
  |  Branch (424:8): [True: 33, False: 74]
  ------------------
  425|     33|      return has_scheme ? CURLUE_OK : CURLUE_BAD_PORT_NUMBER;
  ------------------
  |  Branch (425:14): [True: 33, False: 0]
  ------------------
  426|     74|    if(*portptr == '\\')
  ------------------
  |  Branch (426:8): [True: 1, False: 73]
  ------------------
  427|      1|      return CURLUE_BACKSLASH;
  428|     73|    rc = curlx_str_number(&portptr, &port, 0xffff);
  429|     73|    if(rc)
  ------------------
  |  Branch (429:8): [True: 26, False: 47]
  ------------------
  430|     26|      return CURLUE_BAD_PORT_NUMBER;
  431|     47|    else if(*portptr == '\\')
  ------------------
  |  Branch (431:13): [True: 1, False: 46]
  ------------------
  432|      1|      return CURLUE_BACKSLASH;
  433|     46|    else if(*portptr)
  ------------------
  |  Branch (433:13): [True: 12, False: 34]
  ------------------
  434|     12|      return CURLUE_BAD_PORT_NUMBER;
  435|       |
  436|     34|    u->portnum = (uint16_t)port;
  437|     34|    u->port_present = TRUE;
  ------------------
  |  |  997|     34|#define TRUE true
  ------------------
  438|     34|  }
  439|       |
  440|  3.63k|  return CURLUE_OK;
  441|  3.70k|}
ipv6_parse:
  452|    260|{
  453|    260|  size_t len;
  454|    260|  DEBUGASSERT(*hostname == '[');
  ------------------
  |  | 1027|    260|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (454:3): [True: 0, False: 260]
  |  Branch (454:3): [True: 260, False: 0]
  ------------------
  455|    260|  if(hlen < 4) /* '[::]' is the shortest possible valid string */
  ------------------
  |  Branch (455:6): [True: 3, False: 257]
  ------------------
  456|      3|    return CURLUE_BAD_IPV6;
  457|    257|  hostname++;
  458|    257|  hlen -= 2;
  459|       |
  460|       |  /* only valid IPv6 letters are ok */
  461|    257|  len = strspn(hostname, "0123456789abcdefABCDEF:.");
  462|       |
  463|    257|  if(hlen != len) {
  ------------------
  |  Branch (463:6): [True: 85, False: 172]
  ------------------
  464|     85|    hlen = len;
  465|     85|    if(hostname[len] == '%') {
  ------------------
  |  Branch (465:8): [True: 64, False: 21]
  ------------------
  466|       |      /* this could now be '%[zone id]' */
  467|     64|      char zoneid[MAX_ZONEID_LEN];
  468|     64|      int i = 0;
  469|     64|      char *h = &hostname[len + 1];
  470|       |      /* pass '25' if present and is a URL encoded percent sign */
  471|     64|      if(!strncmp(h, "25", 2) && h[2] && (h[2] != ']'))
  ------------------
  |  Branch (471:10): [True: 9, False: 55]
  |  Branch (471:34): [True: 9, False: 0]
  |  Branch (471:42): [True: 8, False: 1]
  ------------------
  472|      8|        h += 2;
  473|    428|      while(*h && (*h != ']') && (i < (MAX_ZONEID_LEN - 1)) &&
  ------------------
  |  |   56|    379|#define MAX_ZONEID_LEN 16
  ------------------
  |  Branch (473:13): [True: 428, False: 0]
  |  Branch (473:19): [True: 379, False: 49]
  |  Branch (473:34): [True: 364, False: 15]
  ------------------
  474|    364|            (*h != ' '))
  ------------------
  |  Branch (474:13): [True: 364, False: 0]
  ------------------
  475|    364|        zoneid[i++] = *h++;
  476|     64|      if(!i || (']' != *h))
  ------------------
  |  Branch (476:10): [True: 2, False: 62]
  |  Branch (476:16): [True: 15, False: 47]
  ------------------
  477|     17|        return CURLUE_BAD_IPV6;
  478|     47|      zoneid[i] = 0;
  479|     47|      u->zoneid = curlx_strdup(zoneid);
  ------------------
  |  | 1422|     47|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  480|     47|      if(!u->zoneid)
  ------------------
  |  Branch (480:10): [True: 0, False: 47]
  ------------------
  481|      0|        return CURLUE_OUT_OF_MEMORY;
  482|     47|      hostname[len] = ']'; /* insert end bracket */
  483|     47|      hostname[len + 1] = 0; /* terminate the hostname */
  484|     47|    }
  485|     21|    else
  486|     21|      return CURLUE_BAD_IPV6;
  487|       |    /* hostname is fine */
  488|     85|  }
  489|       |
  490|       |  /* Normalize the IPv6 address */
  491|    219|  {
  492|    219|    char dest[16]; /* fits a binary IPv6 address */
  493|    219|    hostname[hlen] = 0; /* end the address there */
  494|    219|    if(curlx_inet_pton(AF_INET6, hostname, dest) != 1)
  ------------------
  |  Branch (494:8): [True: 109, False: 110]
  ------------------
  495|    109|      return CURLUE_BAD_IPV6;
  496|    110|    if(!curlx_inet_ntop(AF_INET6, dest, hostname, hlen + 1)) {
  ------------------
  |  Branch (496:8): [True: 93, False: 17]
  ------------------
  497|     93|      hlen = strlen(hostname); /* might be shorter now */
  498|     93|      hostname[hlen + 1] = 0;
  499|     93|    }
  500|    110|    hostname[hlen] = ']'; /* restore ending bracket */
  501|    110|  }
  502|      0|  return CURLUE_OK;
  503|    219|}
ipv4_normalize:
  570|  3.34k|{
  571|  3.34k|  bool done = FALSE;
  ------------------
  |  | 1000|  3.34k|#define FALSE false
  ------------------
  572|  3.34k|  int n = 0;
  573|  3.34k|  const char *c = curlx_dyn_ptr(host);
  574|  3.34k|  unsigned int parts[4] = { 0, 0, 0, 0 };
  575|  3.34k|  CURLcode result = CURLE_OK;
  576|       |
  577|  3.34k|  if(!ISDIGIT(*c))
  ------------------
  |  |   42|  3.34k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 3.00k, False: 346]
  |  |  |  Branch (42:38): [True: 1.72k, False: 1.27k]
  |  |  ------------------
  ------------------
  578|  1.62k|    return HOST_NAME;
  ------------------
  |  |   48|  1.62k|#define HOST_NAME    1
  ------------------
  579|       |
  580|  4.47k|  while(!done) {
  ------------------
  |  Branch (580:9): [True: 2.85k, False: 1.61k]
  ------------------
  581|  2.85k|    int rc;
  582|  2.85k|    curl_off_t l;
  583|  2.85k|    if(*c == '0') {
  ------------------
  |  Branch (583:8): [True: 674, False: 2.18k]
  ------------------
  584|    674|      if((c[1] | 0x20) == 'x') {
  ------------------
  |  Branch (584:10): [True: 15, False: 659]
  ------------------
  585|     15|        c += 2; /* skip the prefix */
  586|     15|        rc = curlx_str_hex(&c, &l, UINT_MAX);
  587|     15|        if(rc)
  ------------------
  |  Branch (587:12): [True: 3, False: 12]
  ------------------
  588|      3|          return HOST_NAME;
  ------------------
  |  |   48|      3|#define HOST_NAME    1
  ------------------
  589|     15|      }
  590|    659|      else
  591|    659|        rc = curlx_str_octal(&c, &l, UINT_MAX);
  592|    674|    }
  593|  2.18k|    else
  594|  2.18k|      rc = curlx_str_number(&c, &l, UINT_MAX);
  595|       |
  596|  2.85k|    if(rc) {
  ------------------
  |  Branch (596:8): [True: 61, False: 2.79k]
  ------------------
  597|     61|      if(!n || (rc != STRE_NO_NUM) || *c)
  ------------------
  |  |   36|     39|#define STRE_NO_NUM   8
  ------------------
  |  Branch (597:10): [True: 22, False: 39]
  |  Branch (597:16): [True: 1, False: 38]
  |  Branch (597:39): [True: 9, False: 29]
  ------------------
  598|     32|        return HOST_NAME;
  ------------------
  |  |   48|     32|#define HOST_NAME    1
  ------------------
  599|     29|      n--;
  600|     29|    }
  601|  2.79k|    else
  602|  2.79k|      parts[n] = (unsigned int)l;
  603|       |
  604|  2.82k|    switch(*c) {
  605|  1.14k|    case '.':
  ------------------
  |  Branch (605:5): [True: 1.14k, False: 1.68k]
  ------------------
  606|  1.14k|      if(n == 3) {
  ------------------
  |  Branch (606:10): [True: 9, False: 1.13k]
  ------------------
  607|      9|        if(c[1])
  ------------------
  |  Branch (607:12): [True: 8, False: 1]
  ------------------
  608|       |          /* something follows this dot */
  609|      8|          return HOST_NAME;
  ------------------
  |  |   48|      8|#define HOST_NAME    1
  ------------------
  610|      1|        done = TRUE;
  ------------------
  |  |  997|      1|#define TRUE true
  ------------------
  611|      1|      }
  612|  1.13k|      else {
  613|  1.13k|        n++;
  614|  1.13k|        c++;
  615|  1.13k|      }
  616|  1.13k|      break;
  617|       |
  618|  1.61k|    case '\0':
  ------------------
  |  Branch (618:5): [True: 1.61k, False: 1.20k]
  ------------------
  619|  1.61k|      done = TRUE;
  ------------------
  |  |  997|  1.61k|#define TRUE true
  ------------------
  620|  1.61k|      break;
  621|       |
  622|     65|    default:
  ------------------
  |  Branch (622:5): [True: 65, False: 2.75k]
  ------------------
  623|     65|      return HOST_NAME;
  ------------------
  |  |   48|     65|#define HOST_NAME    1
  ------------------
  624|  2.82k|    }
  625|  2.82k|  }
  626|       |
  627|  1.61k|  switch(n) {
  ------------------
  |  Branch (627:10): [True: 1.61k, False: 0]
  ------------------
  628|  1.15k|  case 0: /* a -- 32 bits */
  ------------------
  |  Branch (628:3): [True: 1.15k, False: 463]
  ------------------
  629|  1.15k|    curlx_dyn_reset(host);
  630|       |
  631|  1.15k|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  632|  1.15k|                            (parts[0] >> 24),
  633|  1.15k|                            ((parts[0] >> 16) & 0xff),
  634|  1.15k|                            ((parts[0] >> 8) & 0xff),
  635|  1.15k|                            (parts[0] & 0xff));
  636|  1.15k|    break;
  637|    113|  case 1: /* a.b -- 8.24 bits */
  ------------------
  |  Branch (637:3): [True: 113, False: 1.50k]
  ------------------
  638|    113|    if((parts[0] > 0xff) || (parts[1] > 0xffffff))
  ------------------
  |  Branch (638:8): [True: 43, False: 70]
  |  Branch (638:29): [True: 11, False: 59]
  ------------------
  639|     54|      return HOST_NAME;
  ------------------
  |  |   48|     54|#define HOST_NAME    1
  ------------------
  640|     59|    curlx_dyn_reset(host);
  641|     59|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  642|     59|                            parts[0],
  643|     59|                            ((parts[1] >> 16) & 0xff),
  644|     59|                            ((parts[1] >> 8) & 0xff),
  645|     59|                            (parts[1] & 0xff));
  646|     59|    break;
  647|    150|  case 2: /* a.b.c -- 8.8.16 bits */
  ------------------
  |  Branch (647:3): [True: 150, False: 1.46k]
  ------------------
  648|    150|    if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xffff))
  ------------------
  |  Branch (648:8): [True: 42, False: 108]
  |  Branch (648:29): [True: 38, False: 70]
  |  Branch (648:50): [True: 27, False: 43]
  ------------------
  649|    107|      return HOST_NAME;
  ------------------
  |  |   48|    107|#define HOST_NAME    1
  ------------------
  650|     43|    curlx_dyn_reset(host);
  651|     43|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  652|     43|                            parts[0],
  653|     43|                            parts[1],
  654|     43|                            ((parts[2] >> 8) & 0xff),
  655|     43|                            (parts[2] & 0xff));
  656|     43|    break;
  657|    200|  case 3: /* a.b.c.d -- 8.8.8.8 bits */
  ------------------
  |  Branch (657:3): [True: 200, False: 1.41k]
  ------------------
  658|    200|    if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff) ||
  ------------------
  |  Branch (658:8): [True: 38, False: 162]
  |  Branch (658:29): [True: 40, False: 122]
  |  Branch (658:50): [True: 40, False: 82]
  ------------------
  659|     82|       (parts[3] > 0xff))
  ------------------
  |  Branch (659:8): [True: 42, False: 40]
  ------------------
  660|    160|      return HOST_NAME;
  ------------------
  |  |   48|    160|#define HOST_NAME    1
  ------------------
  661|     40|    curlx_dyn_reset(host);
  662|     40|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  663|     40|                            parts[0],
  664|     40|                            parts[1],
  665|     40|                            parts[2],
  666|     40|                            parts[3]);
  667|     40|    break;
  668|  1.61k|  }
  669|  1.29k|  if(result)
  ------------------
  |  Branch (669:6): [True: 0, False: 1.29k]
  ------------------
  670|      0|    return HOST_ERROR;
  ------------------
  |  |   47|      0|#define HOST_ERROR   (-1) /* out of memory */
  ------------------
  671|  1.29k|  return HOST_IPV4;
  ------------------
  |  |   49|  1.29k|#define HOST_IPV4    2
  ------------------
  672|  1.29k|}
dedotdotify:
  836|    643|{
  837|    643|  struct dynbuf out;
  838|    643|  CURLcode result = CURLE_OK;
  839|       |
  840|       |  /* variables for leading dot checks */
  841|    643|  const char *dinput = input;
  842|    643|  size_t dlen = clen;
  843|       |
  844|    643|  *outp = NULL;
  845|    643|  if(!needs_dedotdot(input, clen))
  ------------------
  |  Branch (845:6): [True: 246, False: 397]
  ------------------
  846|    246|    return 0;
  847|       |
  848|    397|  curlx_dyn_init(&out, clen + 1);
  849|       |
  850|       |  /* if the input buffer begins with a prefix of "../" or "./", then remove
  851|       |     that prefix from the input buffer; otherwise, */
  852|    397|  if(is_dot(&dinput, &dlen)) {
  ------------------
  |  Branch (852:6): [True: 0, False: 397]
  ------------------
  853|      0|    if(ISSLASH(*dinput)) {
  ------------------
  |  |  791|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  854|       |      /* one dot followed by a slash */
  855|      0|      input = dinput + 1;
  856|      0|      clen = dlen - 1;
  857|      0|    }
  858|       |
  859|       |    /* if the input buffer consists only of "." or "..", then remove
  860|       |       that from the input buffer; otherwise, */
  861|      0|    else if(is_dot(&dinput, &dlen)) {
  ------------------
  |  Branch (861:13): [True: 0, False: 0]
  ------------------
  862|      0|      if(!dlen)
  ------------------
  |  Branch (862:10): [True: 0, False: 0]
  ------------------
  863|       |        /* .. [end] */
  864|      0|        goto end;
  865|      0|      else if(ISSLASH(*dinput)) {
  ------------------
  |  |  791|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  866|       |        /* ../ */
  867|      0|        input = dinput + 1;
  868|      0|        clen = dlen - 1;
  869|      0|      }
  870|      0|    }
  871|      0|  }
  872|       |
  873|   734k|  while(clen && !result) { /* until end of path content */
  ------------------
  |  Branch (873:9): [True: 734k, False: 299]
  |  Branch (873:17): [True: 734k, False: 0]
  ------------------
  874|   734k|    if(ISSLASH(*input)) {
  ------------------
  |  |  791|   734k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 39.5k, False: 694k]
  |  |  ------------------
  ------------------
  875|  39.5k|      const char *p = &input[1];
  876|  39.5k|      size_t blen = clen - 1;
  877|       |      /* if the input buffer begins with a prefix of "/./" or "/.", where "."
  878|       |         is a complete path segment, then replace that prefix with "/" in the
  879|       |         input buffer; otherwise, */
  880|  39.5k|      if(is_dot(&p, &blen)) {
  ------------------
  |  Branch (880:10): [True: 21.1k, False: 18.3k]
  ------------------
  881|  21.1k|        if(!blen) { /* /. */
  ------------------
  |  Branch (881:12): [True: 47, False: 21.1k]
  ------------------
  882|     47|          result = curlx_dyn_addn(&out, "/", 1);
  883|     47|          break;
  884|     47|        }
  885|  21.1k|        else if(ISSLASH(*p)) { /* /./ */
  ------------------
  |  |  791|  21.1k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 1.78k, False: 19.3k]
  |  |  ------------------
  ------------------
  886|  1.78k|          input = p;
  887|  1.78k|          clen = blen;
  888|  1.78k|          continue;
  889|  1.78k|        }
  890|       |
  891|       |        /* if the input buffer begins with a prefix of "/../" or "/..", where
  892|       |           ".." is a complete path segment, then replace that prefix with "/"
  893|       |           in the input buffer and remove the last segment and its preceding
  894|       |           "/" (if any) from the output buffer; otherwise, */
  895|  19.3k|        else if(is_dot(&p, &blen) && (ISSLASH(*p) || !blen)) {
  ------------------
  |  |  791|  26.2k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 6.33k, False: 6.78k]
  |  |  ------------------
  ------------------
  |  Branch (895:17): [True: 13.1k, False: 6.22k]
  |  Branch (895:54): [True: 51, False: 6.73k]
  ------------------
  896|       |          /* remove the last segment from the output buffer */
  897|  6.38k|          size_t len = curlx_dyn_len(&out);
  898|  6.38k|          if(len) {
  ------------------
  |  Branch (898:14): [True: 4.50k, False: 1.87k]
  ------------------
  899|  4.50k|            const char *ptr = curlx_dyn_ptr(&out);
  900|  4.50k|            const char *last = memrchr(ptr, '/', len);
  901|  4.50k|            if(last)
  ------------------
  |  Branch (901:16): [True: 4.50k, False: 0]
  ------------------
  902|       |              /* trim the output at the slash */
  903|  4.50k|              curlx_dyn_setlen(&out, last - ptr);
  904|  4.50k|          }
  905|       |
  906|  6.38k|          if(blen) { /* /../ */
  ------------------
  |  Branch (906:14): [True: 6.33k, False: 51]
  ------------------
  907|  6.33k|            input = p;
  908|  6.33k|            clen = blen;
  909|  6.33k|            continue;
  910|  6.33k|          }
  911|     51|          result = curlx_dyn_addn(&out, "/", 1);
  912|     51|          break;
  913|  6.38k|        }
  914|  21.1k|      }
  915|  39.5k|    }
  916|       |
  917|       |    /* move the first path segment in the input buffer to the end of the
  918|       |       output buffer, including the initial "/" character (if any) and any
  919|       |       subsequent characters up to, but not including, the next "/" character
  920|       |       or the end of the input buffer. */
  921|       |
  922|   726k|    result = curlx_dyn_addn(&out, input, 1);
  923|   726k|    input++;
  924|   726k|    clen--;
  925|   726k|  }
  926|    397|end:
  927|    397|  if(!result) {
  ------------------
  |  Branch (927:6): [True: 397, False: 0]
  ------------------
  928|    397|    if(curlx_dyn_len(&out))
  ------------------
  |  Branch (928:8): [True: 397, False: 0]
  ------------------
  929|    397|      *outp = curlx_dyn_ptr(&out);
  930|      0|    else {
  931|      0|      *outp = curlx_strdup("");
  ------------------
  |  | 1422|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  932|      0|      if(!*outp)
  ------------------
  |  Branch (932:10): [True: 0, False: 0]
  ------------------
  933|      0|        return 1;
  934|      0|    }
  935|    397|  }
  936|    397|  return result ? 1 : 0; /* success */
  ------------------
  |  Branch (936:10): [True: 0, False: 397]
  ------------------
  937|    397|}
curl_url:
 1413|  3.74k|{
 1414|  3.74k|  return curlx_calloc(1, sizeof(struct Curl_URL));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1415|  3.74k|}
curl_url_cleanup:
 1418|  11.2k|{
 1419|  11.2k|  if(u) {
  ------------------
  |  Branch (1419:6): [True: 3.74k, False: 7.48k]
  ------------------
 1420|  3.74k|    free_urlhandle(u);
 1421|  3.74k|    curlx_free(u);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1422|  3.74k|  }
 1423|  11.2k|}
curl_url_get:
 1678|  28.0k|{
 1679|  28.0k|  const char *ptr;
 1680|  28.0k|  CURLUcode ifmissing = CURLUE_UNKNOWN_PART;
 1681|  28.0k|  char portbuf[7];
 1682|  28.0k|  bool plusdecode = FALSE;
  ------------------
  |  | 1000|  28.0k|#define FALSE false
  ------------------
 1683|  28.0k|  if(!u)
  ------------------
  |  Branch (1683:6): [True: 0, False: 28.0k]
  ------------------
 1684|      0|    return CURLUE_BAD_HANDLE;
 1685|  28.0k|  if(!part)
  ------------------
  |  Branch (1685:6): [True: 0, False: 28.0k]
  ------------------
 1686|      0|    return CURLUE_BAD_PARTPOINTER;
 1687|  28.0k|  *part = NULL;
 1688|       |
 1689|  28.0k|  switch(what) {
 1690|  3.25k|  case CURLUPART_SCHEME:
  ------------------
  |  Branch (1690:3): [True: 3.25k, False: 24.7k]
  ------------------
 1691|  3.25k|    ptr = u->scheme;
 1692|  3.25k|    ifmissing = CURLUE_NO_SCHEME;
 1693|  3.25k|    flags &= ~U_CURLU_URLDECODE; /* never for schemes */
  ------------------
  |  |   63|  3.25k|#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
  |  |  ------------------
  |  |  |  |   94|  3.25k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  |  |  ------------------
  ------------------
 1694|  3.25k|    if((flags & CURLU_NO_GUESS_SCHEME) && u->guessed_scheme)
  ------------------
  |  |  106|  3.25k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  |  Branch (1694:8): [True: 0, False: 3.25k]
  |  Branch (1694:43): [True: 0, False: 0]
  ------------------
 1695|      0|      return CURLUE_NO_SCHEME;
 1696|  3.25k|    break;
 1697|  3.25k|  case CURLUPART_USER:
  ------------------
  |  Branch (1697:3): [True: 2.99k, False: 25.0k]
  ------------------
 1698|  2.99k|    ptr = u->user;
 1699|  2.99k|    ifmissing = CURLUE_NO_USER;
 1700|  2.99k|    break;
 1701|  2.99k|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (1701:3): [True: 2.99k, False: 25.0k]
  ------------------
 1702|  2.99k|    ptr = u->password;
 1703|  2.99k|    ifmissing = CURLUE_NO_PASSWORD;
 1704|  2.99k|    break;
 1705|  3.06k|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (1705:3): [True: 3.06k, False: 24.9k]
  ------------------
 1706|  3.06k|    ptr = u->options;
 1707|  3.06k|    ifmissing = CURLUE_NO_OPTIONS;
 1708|  3.06k|    break;
 1709|  3.25k|  case CURLUPART_HOST:
  ------------------
  |  Branch (1709:3): [True: 3.25k, False: 24.7k]
  ------------------
 1710|  3.25k|    ptr = u->host;
 1711|  3.25k|    ifmissing = CURLUE_NO_HOST;
 1712|  3.25k|    break;
 1713|  3.06k|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (1713:3): [True: 3.06k, False: 24.9k]
  ------------------
 1714|  3.06k|    ptr = u->zoneid;
 1715|  3.06k|    ifmissing = CURLUE_NO_ZONEID;
 1716|  3.06k|    break;
 1717|      0|  case CURLUPART_PORT:
  ------------------
  |  Branch (1717:3): [True: 0, False: 28.0k]
  ------------------
 1718|      0|    ptr = NULL;
 1719|      0|    ifmissing = CURLUE_NO_PORT;
 1720|      0|    flags &= ~U_CURLU_URLDECODE; /* never for port */
  ------------------
  |  |   63|      0|#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
  |  |  ------------------
  |  |  |  |   94|      0|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  |  |  ------------------
  ------------------
 1721|      0|    if(u->port_present) {
  ------------------
  |  Branch (1721:8): [True: 0, False: 0]
  ------------------
 1722|      0|      const struct Curl_scheme *h = u->scheme ?
  ------------------
  |  Branch (1722:37): [True: 0, False: 0]
  ------------------
 1723|      0|                                    Curl_get_scheme(u->scheme) : NULL;
 1724|       |      /* there is a stored port number, but ask to inhibit if
 1725|       |         it matches the default one for the scheme */
 1726|      0|      if(h && (h->defport == u->portnum) &&
  ------------------
  |  Branch (1726:10): [True: 0, False: 0]
  |  Branch (1726:15): [True: 0, False: 0]
  ------------------
 1727|      0|         (flags & CURLU_NO_DEFAULT_PORT)) {
  ------------------
  |  |   86|      0|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  |  Branch (1727:10): [True: 0, False: 0]
  ------------------
 1728|      0|        ptr = NULL;
 1729|      0|      }
 1730|      0|      else {
 1731|      0|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", u->portnum);
 1732|      0|        ptr = portbuf;
 1733|      0|      }
 1734|      0|    }
 1735|      0|    else if((flags & CURLU_DEFAULT_PORT) && u->scheme) {
  ------------------
  |  |   85|      0|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  |  Branch (1735:13): [True: 0, False: 0]
  |  Branch (1735:45): [True: 0, False: 0]
  ------------------
 1736|       |      /* there is no stored port number, but asked to deliver
 1737|       |         a default one for the scheme */
 1738|      0|      const struct Curl_scheme *h = Curl_get_scheme(u->scheme);
 1739|      0|      if(h) {
  ------------------
  |  Branch (1739:10): [True: 0, False: 0]
  ------------------
 1740|      0|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
 1741|      0|        ptr = portbuf;
 1742|      0|      }
 1743|      0|    }
 1744|      0|    break;
 1745|  3.06k|  case CURLUPART_PATH:
  ------------------
  |  Branch (1745:3): [True: 3.06k, False: 24.9k]
  ------------------
 1746|  3.06k|    ptr = u->path;
 1747|  3.06k|    if(!ptr)
  ------------------
  |  Branch (1747:8): [True: 2.44k, False: 622]
  ------------------
 1748|  2.44k|      ptr = "/";
 1749|  3.06k|    break;
 1750|  3.06k|  case CURLUPART_QUERY:
  ------------------
  |  Branch (1750:3): [True: 3.06k, False: 24.9k]
  ------------------
 1751|  3.06k|    ptr = u->query;
 1752|  3.06k|    ifmissing = CURLUE_NO_QUERY;
 1753|  3.06k|    plusdecode = flags & CURLU_URLDECODE;
  ------------------
  |  |   94|  3.06k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 1754|  3.06k|    if(ptr && !ptr[0] && !(flags & CURLU_GET_EMPTY))
  ------------------
  |  |  103|     13|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1754:8): [True: 31, False: 3.03k]
  |  Branch (1754:15): [True: 13, False: 18]
  |  Branch (1754:26): [True: 0, False: 13]
  ------------------
 1755|       |      /* there was a blank query and the user does not ask for it */
 1756|      0|      ptr = NULL;
 1757|  3.06k|    break;
 1758|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (1758:3): [True: 0, False: 28.0k]
  ------------------
 1759|      0|    ptr = u->fragment;
 1760|      0|    ifmissing = CURLUE_NO_FRAGMENT;
 1761|      0|    if(!ptr && u->fragment_present && flags & CURLU_GET_EMPTY)
  ------------------
  |  |  103|      0|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1761:8): [True: 0, False: 0]
  |  Branch (1761:16): [True: 0, False: 0]
  |  Branch (1761:39): [True: 0, False: 0]
  ------------------
 1762|       |      /* there was a blank fragment and the user asks for it */
 1763|      0|      ptr = "";
 1764|      0|    break;
 1765|  3.25k|  case CURLUPART_URL:
  ------------------
  |  Branch (1765:3): [True: 3.25k, False: 24.7k]
  ------------------
 1766|  3.25k|    return urlget_url(u, part, flags);
 1767|      0|  default:
  ------------------
  |  Branch (1767:3): [True: 0, False: 28.0k]
  ------------------
 1768|      0|    ptr = NULL;
 1769|      0|    break;
 1770|  28.0k|  }
 1771|  24.7k|  if(ptr)
  ------------------
  |  Branch (1771:6): [True: 9.84k, False: 14.9k]
  ------------------
 1772|  9.84k|    return urlget_format(u, what, ptr, part, plusdecode, flags);
 1773|       |
 1774|  14.9k|  return ifmissing;
 1775|  24.7k|}
curl_url_set:
 2072|  3.74k|{
 2073|  3.74k|  char **storep = NULL;
 2074|  3.74k|  bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
  ------------------
  |  |   95|  3.74k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (2074:20): [True: 0, False: 3.74k]
  ------------------
 2075|  3.74k|  bool plusencode = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2076|  3.74k|  bool pathmode = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2077|  3.74k|  bool leadingslash = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2078|  3.74k|  bool appendquery = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2079|  3.74k|  bool equalsencode = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 2080|  3.74k|  size_t nalloc;
 2081|       |
 2082|  3.74k|  if(!u)
  ------------------
  |  Branch (2082:6): [True: 0, False: 3.74k]
  ------------------
 2083|      0|    return CURLUE_BAD_HANDLE;
 2084|  3.74k|  if(!part)
  ------------------
  |  Branch (2084:6): [True: 0, False: 3.74k]
  ------------------
 2085|       |    /* setting a part to NULL clears it */
 2086|      0|    return urlset_clear(u, what);
 2087|       |
 2088|  3.74k|  nalloc = strlen(part);
 2089|  3.74k|  if(nalloc > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  3.74k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (2089:6): [True: 0, False: 3.74k]
  ------------------
 2090|       |    /* excessive input length */
 2091|      0|    return CURLUE_MALFORMED_INPUT;
 2092|       |
 2093|  3.74k|  switch(what) {
 2094|      0|  case CURLUPART_SCHEME: {
  ------------------
  |  Branch (2094:3): [True: 0, False: 3.74k]
  ------------------
 2095|      0|    CURLUcode status = set_url_scheme(u, part, flags);
 2096|      0|    if(status)
  ------------------
  |  Branch (2096:8): [True: 0, False: 0]
  ------------------
 2097|      0|      return status;
 2098|      0|    storep = &u->scheme;
 2099|      0|    urlencode = FALSE; /* never */
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 2100|      0|    break;
 2101|      0|  }
 2102|      0|  case CURLUPART_USER:
  ------------------
  |  Branch (2102:3): [True: 0, False: 3.74k]
  ------------------
 2103|      0|    storep = &u->user;
 2104|      0|    break;
 2105|      0|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (2105:3): [True: 0, False: 3.74k]
  ------------------
 2106|      0|    storep = &u->password;
 2107|      0|    break;
 2108|      0|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (2108:3): [True: 0, False: 3.74k]
  ------------------
 2109|      0|    storep = &u->options;
 2110|      0|    break;
 2111|      0|  case CURLUPART_HOST:
  ------------------
  |  Branch (2111:3): [True: 0, False: 3.74k]
  ------------------
 2112|      0|    storep = &u->host;
 2113|      0|    curlx_safefree(u->zoneid);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2114|      0|    break;
 2115|      0|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (2115:3): [True: 0, False: 3.74k]
  ------------------
 2116|      0|    storep = &u->zoneid;
 2117|      0|    break;
 2118|      0|  case CURLUPART_PORT:
  ------------------
  |  Branch (2118:3): [True: 0, False: 3.74k]
  ------------------
 2119|      0|    return set_url_port(u, part);
 2120|      0|  case CURLUPART_PATH:
  ------------------
  |  Branch (2120:3): [True: 0, False: 3.74k]
  ------------------
 2121|      0|    pathmode = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2122|      0|    leadingslash = TRUE; /* enforce */
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2123|      0|    storep = &u->path;
 2124|      0|    break;
 2125|      0|  case CURLUPART_QUERY:
  ------------------
  |  Branch (2125:3): [True: 0, False: 3.74k]
  ------------------
 2126|      0|    plusencode = urlencode;
 2127|      0|    appendquery = (flags & CURLU_APPENDQUERY) ? 1 : 0;
  ------------------
  |  |   96|      0|#define CURLU_APPENDQUERY (1 << 8)        /* append a form style part */
  ------------------
  |  Branch (2127:19): [True: 0, False: 0]
  ------------------
 2128|      0|    equalsencode = appendquery;
 2129|      0|    storep = &u->query;
 2130|      0|    u->query_present = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2131|      0|    break;
 2132|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (2132:3): [True: 0, False: 3.74k]
  ------------------
 2133|      0|    storep = &u->fragment;
 2134|      0|    u->fragment_present = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 2135|      0|    break;
 2136|  3.74k|  case CURLUPART_URL:
  ------------------
  |  Branch (2136:3): [True: 3.74k, False: 0]
  ------------------
 2137|  3.74k|    return set_url(u, part, nalloc, flags);
 2138|      0|  default:
  ------------------
  |  Branch (2138:3): [True: 0, False: 3.74k]
  ------------------
 2139|      0|    return CURLUE_UNKNOWN_PART;
 2140|  3.74k|  }
 2141|      0|  DEBUGASSERT(storep);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2141:3): [True: 0, False: 0]
  |  Branch (2141:3): [True: 0, False: 0]
  ------------------
 2142|      0|  {
 2143|      0|    const char *newp = NULL;
 2144|      0|    struct dynbuf enc;
 2145|      0|    CURLUcode status;
 2146|      0|    curlx_dyn_init(&enc, (nalloc * 3) + 1 + leadingslash);
 2147|       |
 2148|      0|    if(leadingslash && (part[0] != '/')) {
  ------------------
  |  Branch (2148:8): [True: 0, False: 0]
  |  Branch (2148:24): [True: 0, False: 0]
  ------------------
 2149|      0|      CURLcode result = curlx_dyn_addn(&enc, "/", 1);
 2150|      0|      if(result)
  ------------------
  |  Branch (2150:10): [True: 0, False: 0]
  ------------------
 2151|      0|        return cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2152|      0|    }
 2153|      0|    if(urlencode)
  ------------------
  |  Branch (2153:8): [True: 0, False: 0]
  ------------------
 2154|      0|      status = url_encode_part(&enc, part, plusencode, pathmode, equalsencode);
 2155|      0|    else
 2156|      0|      status = url_uppercasehex_part(&enc, part);
 2157|      0|    if(!status) {
  ------------------
  |  Branch (2157:8): [True: 0, False: 0]
  ------------------
 2158|      0|      newp = curlx_dyn_ptr(&enc);
 2159|       |
 2160|      0|      if(appendquery && newp)
  ------------------
  |  Branch (2160:10): [True: 0, False: 0]
  |  Branch (2160:25): [True: 0, False: 0]
  ------------------
 2161|      0|        return url_append_query(u, &enc);
 2162|      0|      else if(what == CURLUPART_HOST)
  ------------------
  |  Branch (2162:15): [True: 0, False: 0]
  ------------------
 2163|      0|        status = url_sethost(u, &enc, urlencode, flags);
 2164|      0|    }
 2165|      0|    if(status)
  ------------------
  |  Branch (2165:8): [True: 0, False: 0]
  ------------------
 2166|      0|      return status;
 2167|       |
 2168|      0|    if(what == CURLUPART_PASSWORD)
  ------------------
  |  Branch (2168:8): [True: 0, False: 0]
  ------------------
 2169|      0|      curlx_strzero(*storep);
 2170|      0|    curlx_free(*storep);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2171|      0|    *storep = (char *)CURL_UNCONST(newp);
  ------------------
  |  |  808|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 2172|      0|  }
 2173|      0|  return CURLUE_OK;
 2174|      0|}
Curl_url_get_port:
 2212|  3.06k|{
 2213|  3.06k|  if(u->port_present) {
  ------------------
  |  Branch (2213:6): [True: 23, False: 3.04k]
  ------------------
 2214|     23|    *pport = u->portnum;
 2215|     23|    return CURLUE_OK;
 2216|     23|  }
 2217|  3.04k|  else if(u->scheme) {
  ------------------
  |  Branch (2217:11): [True: 3.04k, False: 0]
  ------------------
 2218|  3.04k|    const struct Curl_scheme *s = Curl_get_scheme(u->scheme);
 2219|  3.04k|    if(s && s->defport) {
  ------------------
  |  Branch (2219:8): [True: 3.04k, False: 0]
  |  Branch (2219:13): [True: 3.04k, False: 0]
  ------------------
 2220|  3.04k|      *pport = s->defport;
 2221|  3.04k|      return CURLUE_OK;
 2222|  3.04k|    }
 2223|  3.04k|  }
 2224|      0|  *pport = 0;
 2225|      0|  return CURLUE_NO_PORT;
 2226|  3.06k|}
urlapi.c:badoctets:
  257|    939|{
  258|    939|  const uint8_t *p = (const unsigned char *)input;
  259|    939|  const uint8_t control = flags & CURLU_ALLOW_SPACE ? 0x1f : 0x20;
  ------------------
  |  |  100|    939|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
  |  Branch (259:27): [True: 0, False: 939]
  ------------------
  260|  1.10M|  while(n--) {
  ------------------
  |  Branch (260:9): [True: 1.10M, False: 936]
  ------------------
  261|  1.10M|    if(*p <= control || *p == 127)
  ------------------
  |  Branch (261:8): [True: 3, False: 1.10M]
  |  Branch (261:25): [True: 0, False: 1.10M]
  ------------------
  262|      3|      return TRUE;
  ------------------
  |  |  997|      3|#define TRUE true
  ------------------
  263|  1.10M|    p++;
  264|  1.10M|  }
  265|    936|  return FALSE;
  ------------------
  |  | 1000|    936|#define FALSE false
  ------------------
  266|    939|}
urlapi.c:parse_authority:
  706|  3.72k|{
  707|  3.72k|  size_t offset;
  708|  3.72k|  CURLUcode uc;
  709|  3.72k|  CURLcode result;
  710|       |
  711|       |  /*
  712|       |   * Parse the login details and strip them out of the hostname.
  713|       |   */
  714|  3.72k|  uc = parse_hostname_login(u, auth, authlen, flags, &offset);
  715|  3.72k|  if(uc)
  ------------------
  |  Branch (715:6): [True: 2, False: 3.72k]
  ------------------
  716|      2|    return uc;
  717|       |
  718|  3.72k|  result = curlx_dyn_addn(host, auth + offset, authlen - offset);
  719|  3.72k|  if(result) {
  ------------------
  |  Branch (719:6): [True: 0, False: 3.72k]
  ------------------
  720|      0|    uc = cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  721|      0|    return uc;
  722|      0|  }
  723|       |
  724|       |  /* parse_port() also sets the hostname length correctly */
  725|  3.72k|  uc = parse_port(u, host, has_scheme);
  726|       |
  727|  3.72k|  if(!curlx_dyn_len(host))
  ------------------
  |  Branch (727:6): [True: 91, False: 3.62k]
  ------------------
  728|       |    /* this makes no-host errors override port number problems */
  729|     91|    uc = CURLUE_NO_HOST;
  730|  3.72k|  if(!uc)
  ------------------
  |  Branch (730:6): [True: 3.61k, False: 110]
  ------------------
  731|  3.61k|    uc = urldecode_host(host);
  732|  3.72k|  if(uc)
  ------------------
  |  Branch (732:6): [True: 111, False: 3.60k]
  ------------------
  733|    111|    ;
  734|  3.60k|  else if(auth[offset] == '[')
  ------------------
  |  Branch (734:11): [True: 260, False: 3.34k]
  ------------------
  735|    260|    uc = ipv6_parse(u, curlx_dyn_ptr(host), curlx_dyn_len(host));
  736|  3.34k|  else {
  737|       |    /* ipv4_normalize() returns *NAME, *IPV4 or *ERROR */
  738|  3.34k|    int type = ipv4_normalize(host);
  739|       |
  740|  3.34k|    if(type == HOST_NAME)
  ------------------
  |  |   48|  3.34k|#define HOST_NAME    1
  ------------------
  |  Branch (740:8): [True: 2.05k, False: 1.29k]
  ------------------
  741|  2.05k|      uc = hostname_check(curlx_dyn_ptr(host), curlx_dyn_len(host));
  742|  1.29k|    else if(type == HOST_ERROR)
  ------------------
  |  |   47|  1.29k|#define HOST_ERROR   (-1) /* out of memory */
  ------------------
  |  Branch (742:13): [True: 0, False: 1.29k]
  ------------------
  743|      0|      uc = CURLUE_OUT_OF_MEMORY;
  744|  3.34k|  }
  745|       |
  746|  3.72k|  return uc;
  747|  3.72k|}
urlapi.c:urldecode_host:
  676|  3.61k|{
  677|  3.61k|  const char *per;
  678|  3.61k|  const char *hostname = curlx_dyn_ptr(host);
  679|  3.61k|  per = memchr(hostname, '%', curlx_dyn_len(host));
  680|  3.61k|  if(!per)
  ------------------
  |  Branch (680:6): [True: 3.42k, False: 189]
  ------------------
  681|       |    /* nothing to decode */
  682|  3.42k|    return CURLUE_OK;
  683|    189|  else {
  684|       |    /* encoded */
  685|    189|    size_t dlen;
  686|    189|    char *decoded;
  687|    189|    CURLcode result = Curl_urldecode(hostname, 0, &decoded, &dlen,
  688|    189|                                     REJECT_CTRL);
  689|    189|    if(result)
  ------------------
  |  Branch (689:8): [True: 1, False: 188]
  ------------------
  690|      1|      return CURLUE_BAD_HOSTNAME;
  691|    188|    curlx_dyn_reset(host);
  692|    188|    result = curlx_dyn_addn(host, decoded, dlen);
  693|    188|    curlx_free(decoded);
  ------------------
  |  | 1428|    188|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  694|    188|    if(result)
  ------------------
  |  Branch (694:8): [True: 0, False: 188]
  ------------------
  695|      0|      return cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  696|    188|  }
  697|       |
  698|    188|  return CURLUE_OK;
  699|  3.61k|}
urlapi.c:hostname_check:
  521|  2.05k|{
  522|  2.05k|  size_t i;
  523|   304k|  for(i = 0; i < hlen; i++) {
  ------------------
  |  Branch (523:14): [True: 302k, False: 1.85k]
  ------------------
  524|   302k|    if(invalid_host_char[(unsigned char)hostname[i]])
  ------------------
  |  Branch (524:8): [True: 199, False: 302k]
  ------------------
  525|    199|      return CURLUE_BAD_HOSTNAME;
  526|   302k|  }
  527|  1.85k|  if((hlen >= 2) &&
  ------------------
  |  Branch (527:6): [True: 511, False: 1.34k]
  ------------------
  528|    511|     (hostname[hlen - 1] == '.') && (hostname[hlen - 2] == '.'))
  ------------------
  |  Branch (528:6): [True: 12, False: 499]
  |  Branch (528:37): [True: 2, False: 10]
  ------------------
  529|       |    /* more than one trailing dot is not allowed */
  530|      2|    return CURLUE_BAD_HOSTNAME;
  531|  1.85k|  else if((hlen == 1) && (hostname[0] == '.'))
  ------------------
  |  Branch (531:11): [True: 1.34k, False: 509]
  |  Branch (531:26): [True: 4, False: 1.33k]
  ------------------
  532|       |    /* a single dot alone is not allowed */
  533|      4|    return CURLUE_BAD_HOSTNAME;
  534|  1.84k|  return CURLUE_OK;
  535|  1.85k|}
urlapi.c:needs_dedotdot:
  795|    643|{
  796|       |  /* a single byte path cannot be cleaned up */
  797|    643|  if(pn < 2)
  ------------------
  |  Branch (797:6): [True: 0, False: 643]
  ------------------
  798|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  799|    643|  if(!memchr(p, '.', pn) && !memchr(p, '%', pn))
  ------------------
  |  Branch (799:6): [True: 181, False: 462]
  |  Branch (799:29): [True: 35, False: 146]
  ------------------
  800|     35|    return FALSE;
  ------------------
  |  | 1000|     35|#define FALSE false
  ------------------
  801|   586k|  while(pn) {
  ------------------
  |  Branch (801:9): [True: 586k, False: 211]
  ------------------
  802|   586k|    if(is_dot(&p, &pn)) {
  ------------------
  |  Branch (802:8): [True: 20.7k, False: 565k]
  ------------------
  803|       |      /* "./" or dot before end of string */
  804|  20.7k|      if(!pn || ISSLASH(*p))
  ------------------
  |  |  791|  20.6k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 113, False: 20.5k]
  |  |  ------------------
  ------------------
  |  Branch (804:10): [True: 150, False: 20.6k]
  ------------------
  805|    263|        return TRUE;
  ------------------
  |  |  997|    263|#define TRUE true
  ------------------
  806|       |      /* "../" or ".." before end of string */
  807|  20.5k|      else if(is_dot(&p, &pn) && (!pn || ISSLASH(*p)))
  ------------------
  |  |  791|  4.71k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 98, False: 4.62k]
  |  |  ------------------
  ------------------
  |  Branch (807:15): [True: 4.75k, False: 15.7k]
  |  Branch (807:35): [True: 36, False: 4.71k]
  ------------------
  808|    134|        return TRUE;
  ------------------
  |  |  997|    134|#define TRUE true
  ------------------
  809|  20.7k|    }
  810|   565k|    else {
  811|   565k|      p++;
  812|   565k|      pn--;
  813|   565k|    }
  814|   586k|  }
  815|    211|  return FALSE;
  ------------------
  |  | 1000|    211|#define FALSE false
  ------------------
  816|    608|}
urlapi.c:is_dot:
  775|   665k|{
  776|   665k|  const char *p = *str;
  777|   665k|  if(*p == '.') {
  ------------------
  |  Branch (777:6): [True: 55.2k, False: 610k]
  ------------------
  778|  55.2k|    (*str)++;
  779|  55.2k|    (*clen)--;
  780|  55.2k|    return TRUE;
  ------------------
  |  |  997|  55.2k|#define TRUE true
  ------------------
  781|  55.2k|  }
  782|   610k|  else if((*clen >= 3) &&
  ------------------
  |  Branch (782:11): [True: 609k, False: 681]
  ------------------
  783|   609k|          (p[0] == '%') && (p[1] == '2') && ((p[2] | 0x20) == 'e')) {
  ------------------
  |  Branch (783:11): [True: 168k, False: 441k]
  |  Branch (783:28): [True: 15.4k, False: 152k]
  |  Branch (783:45): [True: 4.56k, False: 10.8k]
  ------------------
  784|  4.56k|    *str += 3;
  785|  4.56k|    *clen -= 3;
  786|  4.56k|    return TRUE;
  ------------------
  |  |  997|  4.56k|#define TRUE true
  ------------------
  787|  4.56k|  }
  788|   606k|  return FALSE;
  ------------------
  |  | 1000|   606k|#define FALSE false
  ------------------
  789|   665k|}
urlapi.c:free_urlhandle:
   70|  7.48k|{
   71|  7.48k|  curlx_free(u->scheme);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   72|  7.48k|  curlx_free(u->user);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   73|  7.48k|  curlx_strzero(u->password);
   74|  7.48k|  curlx_free(u->password);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   75|  7.48k|  curlx_free(u->options);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   76|  7.48k|  curlx_free(u->host);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   77|  7.48k|  curlx_free(u->zoneid);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   78|  7.48k|  curlx_free(u->path);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  7.48k|  curlx_free(u->query);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   80|  7.48k|  curlx_free(u->fragment);
  ------------------
  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   81|  7.48k|}
urlapi.c:urlget_url:
 1564|  3.25k|{
 1565|  3.25k|  char *url;
 1566|  3.25k|  char *allochost = NULL;
 1567|  3.25k|  const char *fragmentsep =
 1568|  3.25k|    (u->fragment || (u->fragment_present && flags & CURLU_GET_EMPTY)) ?
  ------------------
  |  |  103|      1|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1568:6): [True: 8, False: 3.24k]
  |  Branch (1568:22): [True: 1, False: 3.24k]
  |  Branch (1568:45): [True: 1, False: 0]
  ------------------
 1569|  3.24k|    "#" : "";
 1570|  3.25k|  const char *querysep = ((u->query && u->query[0]) ||
  ------------------
  |  Branch (1570:28): [True: 33, False: 3.22k]
  |  Branch (1570:40): [True: 19, False: 14]
  ------------------
 1571|  3.23k|                          (u->query_present && flags & CURLU_GET_EMPTY)) ?
  ------------------
  |  |  103|     14|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1571:28): [True: 14, False: 3.22k]
  |  Branch (1571:48): [True: 14, False: 0]
  ------------------
 1572|  3.22k|    "?" : "";
 1573|  3.25k|  char portbuf[7];
 1574|  3.25k|  if(curl_strequal("file", u->scheme))
  ------------------
  |  Branch (1574:6): [True: 0, False: 3.25k]
  ------------------
 1575|      0|    return file_url(u, part, fragmentsep, querysep);
 1576|  3.25k|  else if(!u->host)
  ------------------
  |  Branch (1576:11): [True: 0, False: 3.25k]
  ------------------
 1577|      0|    return CURLUE_NO_HOST;
 1578|  3.25k|  else {
 1579|  3.25k|    const char *scheme;
 1580|  3.25k|    char *options = u->options;
 1581|  3.25k|    char *port = NULL;
 1582|  3.25k|    const struct Curl_scheme *h = NULL;
 1583|  3.25k|    char schemebuf[MAX_SCHEME_LEN + 5];
 1584|  3.25k|    if(u->scheme)
  ------------------
  |  Branch (1584:8): [True: 3.25k, False: 0]
  ------------------
 1585|  3.25k|      scheme = u->scheme;
 1586|      0|    else if(flags & CURLU_DEFAULT_SCHEME)
  ------------------
  |  |   89|      0|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
  |  Branch (1586:13): [True: 0, False: 0]
  ------------------
 1587|      0|      scheme = DEFAULT_SCHEME;
  ------------------
  |  |   67|      0|#define DEFAULT_SCHEME "https"
  ------------------
 1588|      0|    else
 1589|      0|      return CURLUE_NO_SCHEME;
 1590|       |
 1591|  3.25k|    if(u->port_present) {
  ------------------
  |  Branch (1591:8): [True: 30, False: 3.22k]
  ------------------
 1592|     30|      curl_msnprintf(portbuf, sizeof(portbuf), "%u", u->portnum);
 1593|     30|      port = portbuf;
 1594|     30|    }
 1595|       |
 1596|  3.25k|    h = Curl_get_scheme(scheme);
 1597|  3.25k|    if(h) {
  ------------------
  |  Branch (1597:8): [True: 3.25k, False: 0]
  ------------------
 1598|  3.25k|      if(!u->port_present && (flags & CURLU_DEFAULT_PORT)) {
  ------------------
  |  |   85|  3.22k|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  |  Branch (1598:10): [True: 3.22k, False: 30]
  |  Branch (1598:30): [True: 0, False: 3.22k]
  ------------------
 1599|       |        /* there is no stored port number, but asked to deliver a default one
 1600|       |           for the scheme */
 1601|      0|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
 1602|      0|        port = portbuf;
 1603|      0|      }
 1604|  3.25k|      else if(u->port_present && (h->defport == u->portnum) &&
  ------------------
  |  Branch (1604:15): [True: 30, False: 3.22k]
  |  Branch (1604:34): [True: 1, False: 29]
  ------------------
 1605|      1|              (flags & CURLU_NO_DEFAULT_PORT)) {
  ------------------
  |  |   86|      1|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  |  Branch (1605:15): [True: 0, False: 1]
  ------------------
 1606|       |        /* there is a stored port number, but asked to inhibit if it matches
 1607|       |           the default port for the scheme */
 1608|      0|        port = NULL;
 1609|      0|      }
 1610|       |
 1611|  3.25k|      if(!(h->flags & PROTOPT_URLOPTIONS))
  ------------------
  |  |  221|  3.25k|#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
  ------------------
  |  Branch (1611:10): [True: 3.25k, False: 0]
  ------------------
 1612|  3.25k|        options = NULL;
 1613|  3.25k|    }
 1614|       |
 1615|  3.25k|    if(u->host[0] == '[') {
  ------------------
  |  Branch (1615:8): [True: 110, False: 3.14k]
  ------------------
 1616|    110|      if(u->zoneid) {
  ------------------
  |  Branch (1616:10): [True: 14, False: 96]
  ------------------
 1617|       |        /* make it '[ host %25 zoneid ]' */
 1618|     14|        struct dynbuf enc;
 1619|     14|        size_t hostlen = strlen(u->host);
 1620|     14|        curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|     14|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1621|     14|        if(curlx_dyn_addf(&enc, "%.*s%%25%s]", (int)hostlen - 1, u->host,
  ------------------
  |  Branch (1621:12): [True: 0, False: 14]
  ------------------
 1622|     14|                          u->zoneid))
 1623|      0|          return CURLUE_OUT_OF_MEMORY;
 1624|     14|        allochost = curlx_dyn_ptr(&enc);
 1625|     14|      }
 1626|    110|    }
 1627|  3.14k|    else if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   95|  3.14k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1627:13): [True: 0, False: 3.14k]
  ------------------
 1628|      0|      allochost = curl_easy_escape(NULL, u->host, 0);
 1629|      0|      if(!allochost)
  ------------------
  |  Branch (1629:10): [True: 0, False: 0]
  ------------------
 1630|      0|        return CURLUE_OUT_OF_MEMORY;
 1631|      0|    }
 1632|  3.14k|    else if(flags & CURLU_PUNYCODE) {
  ------------------
  |  |  101|  3.14k|#define CURLU_PUNYCODE (1 << 12)          /* get the hostname in punycode */
  ------------------
  |  Branch (1632:13): [True: 0, False: 3.14k]
  ------------------
 1633|      0|      if(!Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1633:10): [True: 0, False: 0]
  ------------------
 1634|      0|        CURLUcode ret = host_decode(u->host, &allochost);
 1635|      0|        if(ret)
  ------------------
  |  Branch (1635:12): [True: 0, False: 0]
  ------------------
 1636|      0|          return ret;
 1637|      0|      }
 1638|      0|    }
 1639|  3.14k|    else if(flags & CURLU_PUNY2IDN) {
  ------------------
  |  |  102|  3.14k|#define CURLU_PUNY2IDN (1 << 13)          /* punycode => IDN conversion */
  ------------------
  |  Branch (1639:13): [True: 0, False: 3.14k]
  ------------------
 1640|      0|      if(Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1640:10): [True: 0, False: 0]
  ------------------
 1641|      0|        CURLUcode ret = host_encode(u->host, &allochost);
 1642|      0|        if(ret)
  ------------------
  |  Branch (1642:12): [True: 0, False: 0]
  ------------------
 1643|      0|          return ret;
 1644|      0|      }
 1645|      0|    }
 1646|       |
 1647|  3.25k|    if(!(flags & CURLU_NO_GUESS_SCHEME) || !u->guessed_scheme)
  ------------------
  |  |  106|  3.25k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  |  Branch (1647:8): [True: 3.25k, False: 0]
  |  Branch (1647:44): [True: 0, False: 0]
  ------------------
 1648|  3.25k|      curl_msnprintf(schemebuf, sizeof(schemebuf), "%s://", scheme);
 1649|      0|    else
 1650|      0|      schemebuf[0] = 0;
 1651|       |
 1652|  3.25k|    url = curl_maprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
 1653|  3.25k|                        schemebuf,
 1654|  3.25k|                        u->user ? u->user : "",
  ------------------
  |  Branch (1654:25): [True: 198, False: 3.05k]
  ------------------
 1655|  3.25k|                        u->password ? ":" : "",
  ------------------
  |  Branch (1655:25): [True: 35, False: 3.21k]
  ------------------
 1656|  3.25k|                        u->password ? u->password : "",
  ------------------
  |  Branch (1656:25): [True: 35, False: 3.21k]
  ------------------
 1657|  3.25k|                        options ? ";" : "",
  ------------------
  |  Branch (1657:25): [True: 0, False: 3.25k]
  ------------------
 1658|  3.25k|                        options ? options : "",
  ------------------
  |  Branch (1658:25): [True: 0, False: 3.25k]
  ------------------
 1659|  3.25k|                        (u->user || u->password || options) ? "@" : "",
  ------------------
  |  Branch (1659:26): [True: 198, False: 3.05k]
  |  Branch (1659:37): [True: 0, False: 3.05k]
  |  Branch (1659:52): [True: 0, False: 3.05k]
  ------------------
 1660|  3.25k|                        allochost ? allochost : u->host,
  ------------------
  |  Branch (1660:25): [True: 14, False: 3.23k]
  ------------------
 1661|  3.25k|                        port ? ":" : "",
  ------------------
  |  Branch (1661:25): [True: 30, False: 3.22k]
  ------------------
 1662|  3.25k|                        port ? port : "",
  ------------------
  |  Branch (1662:25): [True: 30, False: 3.22k]
  ------------------
 1663|  3.25k|                        u->path ? u->path : "/",
  ------------------
  |  Branch (1663:25): [True: 643, False: 2.61k]
  ------------------
 1664|  3.25k|                        querysep,
 1665|  3.25k|                        u->query ? u->query : "",
  ------------------
  |  Branch (1665:25): [True: 33, False: 3.22k]
  ------------------
 1666|  3.25k|                        fragmentsep,
 1667|  3.25k|                        u->fragment ? u->fragment : "");
  ------------------
  |  Branch (1667:25): [True: 8, False: 3.24k]
  ------------------
 1668|  3.25k|    curlx_free(allochost);
  ------------------
  |  | 1428|  3.25k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1669|  3.25k|  }
 1670|  3.25k|  if(!url)
  ------------------
  |  Branch (1670:6): [True: 0, False: 3.25k]
  ------------------
 1671|      0|    return CURLUE_OUT_OF_MEMORY;
 1672|  3.25k|  *part = url;
 1673|  3.25k|  return CURLUE_OK;
 1674|  3.25k|}
urlapi.c:urlget_format:
 1484|  9.84k|{
 1485|  9.84k|  CURLUcode uc = CURLUE_OK;
 1486|  9.84k|  size_t partlen = strlen(ptr);
 1487|  9.84k|  bool urldecode = (flags & CURLU_URLDECODE) ? 1 : 0;
  ------------------
  |  |   94|  9.84k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  |  Branch (1487:20): [True: 0, False: 9.84k]
  ------------------
 1488|  9.84k|  bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
  ------------------
  |  |   95|  9.84k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1488:20): [True: 3.06k, False: 6.77k]
  ------------------
 1489|  9.84k|  bool punycode = (flags & CURLU_PUNYCODE) && (what == CURLUPART_HOST);
  ------------------
  |  |  101|  9.84k|#define CURLU_PUNYCODE (1 << 12)          /* get the hostname in punycode */
  ------------------
  |  Branch (1489:19): [True: 0, False: 9.84k]
  |  Branch (1489:47): [True: 0, False: 0]
  ------------------
 1490|  9.84k|  bool depunyfy = (flags & CURLU_PUNY2IDN) && (what == CURLUPART_HOST);
  ------------------
  |  |  102|  9.84k|#define CURLU_PUNY2IDN (1 << 13)          /* punycode => IDN conversion */
  ------------------
  |  Branch (1490:19): [True: 0, False: 9.84k]
  |  Branch (1490:47): [True: 0, False: 0]
  ------------------
 1491|  9.84k|  char *part = curlx_memdup0(ptr, partlen);
 1492|  9.84k|  *partp = NULL;
 1493|  9.84k|  if(!part)
  ------------------
  |  Branch (1493:6): [True: 0, False: 9.84k]
  ------------------
 1494|      0|    return CURLUE_OUT_OF_MEMORY;
 1495|  9.84k|  if(plusdecode) {
  ------------------
  |  Branch (1495:6): [True: 0, False: 9.84k]
  ------------------
 1496|       |    /* convert + to space */
 1497|      0|    char *plus = part;
 1498|      0|    size_t i = 0;
 1499|      0|    for(i = 0; i < partlen; ++plus, i++) {
  ------------------
  |  Branch (1499:16): [True: 0, False: 0]
  ------------------
 1500|      0|      if(*plus == '+')
  ------------------
  |  Branch (1500:10): [True: 0, False: 0]
  ------------------
 1501|      0|        *plus = ' ';
 1502|      0|    }
 1503|      0|  }
 1504|  9.84k|  if(urldecode) {
  ------------------
  |  Branch (1504:6): [True: 0, False: 9.84k]
  ------------------
 1505|      0|    char *decoded;
 1506|      0|    size_t dlen;
 1507|       |    /* this unconditional rejection of control bytes is documented API
 1508|       |       behavior */
 1509|      0|    CURLcode result = Curl_urldecode(part, partlen, &decoded, &dlen,
 1510|      0|                                     REJECT_CTRL);
 1511|      0|    curlx_free(part);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1512|      0|    if(result)
  ------------------
  |  Branch (1512:8): [True: 0, False: 0]
  ------------------
 1513|      0|      return CURLUE_URLDECODE;
 1514|      0|    part = decoded;
 1515|      0|    partlen = dlen;
 1516|      0|  }
 1517|  9.84k|  if(urlencode) {
  ------------------
  |  Branch (1517:6): [True: 3.06k, False: 6.77k]
  ------------------
 1518|  3.06k|    struct dynbuf enc;
 1519|  3.06k|    curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  3.06k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1520|  3.06k|    uc = urlencode_str(&enc, part, partlen, TRUE, what == CURLUPART_QUERY ?
  ------------------
  |  |  997|  3.06k|#define TRUE true
  ------------------
  |  Branch (1520:51): [True: 0, False: 3.06k]
  ------------------
 1521|  3.06k|                       QUERY_YES : QUERY_NO);
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
                                     QUERY_YES : QUERY_NO);
  ------------------
  |  |   52|  6.13k|#define QUERY_NO      2
  ------------------
 1522|  3.06k|    curlx_free(part);
  ------------------
  |  | 1428|  3.06k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1523|  3.06k|    if(uc)
  ------------------
  |  Branch (1523:8): [True: 0, False: 3.06k]
  ------------------
 1524|      0|      return uc;
 1525|  3.06k|    part = curlx_dyn_ptr(&enc);
 1526|  3.06k|  }
 1527|  6.77k|  else if(punycode) {
  ------------------
  |  Branch (1527:11): [True: 0, False: 6.77k]
  ------------------
 1528|      0|    if(!Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1528:8): [True: 0, False: 0]
  ------------------
 1529|      0|      char *punyversion = NULL;
 1530|      0|      uc = host_decode(part, &punyversion);
 1531|      0|      curlx_free(part);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1532|      0|      if(uc)
  ------------------
  |  Branch (1532:10): [True: 0, False: 0]
  ------------------
 1533|      0|        return uc;
 1534|      0|      part = punyversion;
 1535|      0|    }
 1536|      0|  }
 1537|  6.77k|  else if(depunyfy && Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1537:11): [True: 0, False: 6.77k]
  |  Branch (1537:23): [True: 0, False: 0]
  ------------------
 1538|      0|    char *unpunified = NULL;
 1539|      0|    uc = host_encode(part, &unpunified);
 1540|      0|    curlx_free(part);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1541|      0|    if(uc)
  ------------------
  |  Branch (1541:8): [True: 0, False: 0]
  ------------------
 1542|      0|      return uc;
 1543|      0|    part = unpunified;
 1544|      0|  }
 1545|  9.84k|  *partp = part;
 1546|  9.84k|  return CURLUE_OK;
 1547|  9.84k|}
urlapi.c:set_url:
 1824|  3.74k|{
 1825|       |  /*
 1826|       |   * Allow a new URL to replace the existing (if any) contents.
 1827|       |   *
 1828|       |   * If the existing contents is enough for a URL, allow a relative URL to
 1829|       |   * replace it.
 1830|       |   */
 1831|  3.74k|  CURLUcode uc;
 1832|  3.74k|  char *oldurl = NULL;
 1833|       |
 1834|  3.74k|  if(!part_size) {
  ------------------
  |  Branch (1834:6): [True: 0, False: 3.74k]
  ------------------
 1835|       |    /* a blank URL is not a valid URL unless we already have a complete one
 1836|       |       and this is a redirect */
 1837|      0|    uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags);
 1838|      0|    if(!uc) {
  ------------------
  |  Branch (1838:8): [True: 0, False: 0]
  ------------------
 1839|       |      /* success, meaning the "" is a fine relative URL, and the new URL
 1840|       |         inherits scheme/authority/path/query, but not fragment, from the
 1841|       |         existing URL (RFC 3986 section 5.2.2) */
 1842|      0|      curlx_safefree(u->fragment);
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1843|      0|      u->fragment_present = FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
 1844|      0|      curlx_free(oldurl);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1845|      0|      return CURLUE_OK;
 1846|      0|    }
 1847|      0|    if(uc == CURLUE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1847:8): [True: 0, False: 0]
  ------------------
 1848|      0|      return uc;
 1849|      0|    return CURLUE_MALFORMED_INPUT;
 1850|      0|  }
 1851|       |
 1852|       |  /* if the new URL is absolute replace the existing with the new. */
 1853|  3.74k|  if(Curl_is_absolute_url(url, NULL, 0,
  ------------------
  |  Branch (1853:6): [True: 3.74k, False: 0]
  ------------------
 1854|  3.74k|                          flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)))
  ------------------
  |  |   97|  3.74k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
                                        flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)))
  ------------------
  |  |   89|  3.74k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
 1855|  3.74k|    return parseurl_and_replace(url, u, flags);
 1856|       |
 1857|       |  /* if the old URL is incomplete (we cannot get an absolute URL in
 1858|       |     'oldurl'), replace the existing with the new.
 1859|       |     Always include "scheme://" to make the URL "complete" */
 1860|       |  /* Preserve empty query/fragment separators: they affect where relative
 1861|       |     references splice into the base URL. */
 1862|      0|  uc = curl_url_get(u, CURLUPART_URL, &oldurl,
 1863|      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
  ------------------
 1864|      0|  if(uc == CURLUE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1864:6): [True: 0, False: 0]
  ------------------
 1865|      0|    return uc;
 1866|      0|  else if(uc)
  ------------------
  |  Branch (1866:11): [True: 0, False: 0]
  ------------------
 1867|      0|    return parseurl_and_replace(url, u, flags);
 1868|       |
 1869|      0|  DEBUGASSERT(oldurl); /* it is set here */
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1869:3): [True: 0, False: 0]
  |  Branch (1869:3): [True: 0, False: 0]
  ------------------
 1870|       |  /* apply the relative part to create a new URL */
 1871|      0|  uc = redirect_url(oldurl, url, u, flags);
 1872|      0|  curlx_free(oldurl);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1873|      0|  return uc;
 1874|      0|}
urlapi.c:parseurl_and_replace:
 1319|  3.74k|{
 1320|  3.74k|  CURLUcode ures;
 1321|  3.74k|  CURLU tmpurl;
 1322|  3.74k|  memset(&tmpurl, 0, sizeof(tmpurl));
 1323|  3.74k|  ures = parseurl(url, &tmpurl, flags);
 1324|  3.74k|  if(!ures) {
  ------------------
  |  Branch (1324:6): [True: 3.25k, False: 489]
  ------------------
 1325|  3.25k|    free_urlhandle(u);
 1326|  3.25k|    *u = tmpurl;
 1327|  3.25k|  }
 1328|  3.74k|  return ures;
 1329|  3.74k|}
urlapi.c:parseurl:
 1225|  3.74k|{
 1226|  3.74k|  const char *path;
 1227|  3.74k|  size_t pathlen;
 1228|  3.74k|  char schemebuf[MAX_SCHEME_LEN + 1];
 1229|  3.74k|  size_t schemelen = 0;
 1230|  3.74k|  size_t urllen;
 1231|  3.74k|  CURLUcode ures = CURLUE_OK;
 1232|  3.74k|  struct dynbuf host;
 1233|  3.74k|  bool is_file = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
 1234|       |
 1235|  3.74k|  DEBUGASSERT(url);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1235:3): [True: 0, False: 3.74k]
  |  Branch (1235:3): [True: 3.74k, False: 0]
  ------------------
 1236|       |
 1237|  3.74k|  urllen = strlen(url);
 1238|  3.74k|  if(urllen > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  3.74k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1238:6): [True: 0, False: 3.74k]
  ------------------
 1239|      0|    return CURLUE_MALFORMED_INPUT;
 1240|       |
 1241|  3.74k|  curlx_dyn_init(&host, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  3.74k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1242|       |
 1243|  3.74k|  schemelen = Curl_is_absolute_url(url, schemebuf, sizeof(schemebuf),
 1244|  3.74k|                                   flags & (CURLU_GUESS_SCHEME |
  ------------------
  |  |   97|  3.74k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 1245|  3.74k|                                            CURLU_DEFAULT_SCHEME));
  ------------------
  |  |   89|  3.74k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
 1246|       |
 1247|       |  /* handle the file: scheme */
 1248|  3.74k|  if(schemelen == 4 && !memcmp(schemebuf, "file", 4)) {
  ------------------
  |  Branch (1248:6): [True: 0, False: 3.74k]
  |  Branch (1248:24): [True: 0, False: 0]
  ------------------
 1249|      0|    is_file = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
 1250|      0|    ures = parse_file(url, urllen, u, &path, &pathlen);
 1251|      0|  }
 1252|  3.74k|  else {
 1253|  3.74k|    const char *hostp = NULL;
 1254|  3.74k|    const char *p;
 1255|  3.74k|    size_t hostlen;
 1256|  3.74k|    ures = parse_scheme(url, u, schemebuf, schemelen, flags, &hostp);
 1257|  3.74k|    if(ures)
  ------------------
  |  Branch (1257:8): [True: 1, False: 3.74k]
  ------------------
 1258|      1|      goto fail;
 1259|       |
 1260|       |    /* find the end of the hostname + port number */
 1261|  3.74k|    p = hostp;
 1262|   823k|    while(*p && *p != '/' && *p != '?' && *p != '#')
  ------------------
  |  Branch (1262:11): [True: 820k, False: 3.06k]
  |  Branch (1262:17): [True: 819k, False: 649]
  |  Branch (1262:30): [True: 819k, False: 22]
  |  Branch (1262:43): [True: 819k, False: 7]
  ------------------
 1263|   819k|      p++;
 1264|  3.74k|    hostlen = p - hostp;
 1265|  3.74k|    path = p;
 1266|       |
 1267|       |    /* this pathlen also contains the query and the fragment */
 1268|  3.74k|    pathlen = urllen - (path - url);
 1269|  3.74k|    if(hostlen) {
  ------------------
  |  Branch (1269:8): [True: 3.72k, False: 19]
  ------------------
 1270|  3.72k|      ures = parse_authority(u, hostp, hostlen, flags, &host, !!u->scheme);
 1271|  3.72k|      if(!ures && (flags & CURLU_GUESS_SCHEME) && !u->scheme)
  ------------------
  |  |   97|  3.25k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
  |  Branch (1271:10): [True: 3.25k, False: 468]
  |  Branch (1271:19): [True: 3.25k, False: 0]
  |  Branch (1271:51): [True: 0, False: 3.25k]
  ------------------
 1272|      0|        ures = guess_scheme(u, &host);
 1273|  3.72k|    }
 1274|     19|    else if(flags & CURLU_NO_AUTHORITY) {
  ------------------
  |  |   98|     19|#define CURLU_NO_AUTHORITY (1 << 10)      /* Allow empty authority when the
  ------------------
  |  Branch (1274:13): [True: 0, False: 19]
  ------------------
 1275|       |      /* allowed to be empty. */
 1276|      0|      if(curlx_dyn_add(&host, ""))
  ------------------
  |  Branch (1276:10): [True: 0, False: 0]
  ------------------
 1277|      0|        ures = CURLUE_OUT_OF_MEMORY;
 1278|      0|    }
 1279|     19|    else
 1280|     19|      ures = CURLUE_NO_HOST;
 1281|  3.74k|  }
 1282|  3.74k|  if(!ures) {
  ------------------
  |  Branch (1282:6): [True: 3.25k, False: 487]
  ------------------
 1283|       |    /* The path might at this point contain a fragment and/or a query to
 1284|       |       handle */
 1285|  3.25k|    const char *fragment = memchr(path, '#', pathlen);
 1286|  3.25k|    if(fragment) {
  ------------------
  |  Branch (1286:8): [True: 9, False: 3.24k]
  ------------------
 1287|      9|      size_t fraglen = pathlen - (fragment - path);
 1288|      9|      ures = handle_fragment(u, fragment, fraglen, flags);
 1289|       |      /* after this, pathlen still contains the query */
 1290|      9|      pathlen -= fraglen;
 1291|      9|    }
 1292|  3.25k|  }
 1293|  3.74k|  if(!ures) {
  ------------------
  |  Branch (1293:6): [True: 3.25k, False: 487]
  ------------------
 1294|  3.25k|    const char *query = memchr(path, '?', pathlen);
 1295|  3.25k|    if(query) {
  ------------------
  |  Branch (1295:8): [True: 33, False: 3.22k]
  ------------------
 1296|     33|      size_t qlen = pathlen - (query - path);
 1297|     33|      ures = handle_query(u, query, qlen, flags);
 1298|     33|      pathlen -= qlen;
 1299|     33|    }
 1300|  3.25k|  }
 1301|  3.74k|  if(!ures)
  ------------------
  |  Branch (1301:6): [True: 3.25k, False: 487]
  ------------------
 1302|       |    /* the fragment and query parts are trimmed off from the path */
 1303|  3.25k|    ures = handle_path(u, path, pathlen, flags, is_file);
 1304|  3.74k|  if(!ures) {
  ------------------
  |  Branch (1304:6): [True: 3.25k, False: 488]
  ------------------
 1305|  3.25k|    u->host = curlx_dyn_ptr(&host);
 1306|  3.25k|    return CURLUE_OK;
 1307|  3.25k|  }
 1308|    489|fail:
 1309|    489|  curlx_dyn_free(&host);
 1310|    489|  free_urlhandle(u);
 1311|    489|  return ures;
 1312|  3.74k|}
urlapi.c:parse_scheme:
 1037|  3.74k|{
 1038|       |  /* clear path */
 1039|  3.74k|  const char *schemep = NULL;
 1040|       |
 1041|  3.74k|  if(schemelen) {
  ------------------
  |  Branch (1041:6): [True: 3.74k, False: 0]
  ------------------
 1042|  3.74k|    int num_slashes = 0;
 1043|  3.74k|    const char *p = &url[schemelen + 1];
 1044|  3.74k|    if(!Curl_getn_scheme(schemebuf, schemelen) &&
  ------------------
  |  Branch (1044:8): [True: 0, False: 3.74k]
  ------------------
 1045|      0|       !(flags & CURLU_NON_SUPPORT_SCHEME))
  ------------------
  |  |   91|      0|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
  |  Branch (1045:8): [True: 0, False: 0]
  ------------------
 1046|      0|      return CURLUE_UNSUPPORTED_SCHEME;
 1047|       |
 1048|  3.74k|    if(!ISSLASH(*p))
  ------------------
  |  |  791|  3.74k|#define ISSLASH(x) ((x) == '/')
  ------------------
  |  Branch (1048:8): [True: 0, False: 3.74k]
  ------------------
 1049|       |      /* less than one */
 1050|      0|      return CURLUE_BAD_SLASHES;
 1051|  3.74k|    if((flags & CURLU_NO_AUTHORITY)) {
  ------------------
  |  |   98|  3.74k|#define CURLU_NO_AUTHORITY (1 << 10)      /* Allow empty authority when the
  ------------------
  |  Branch (1051:8): [True: 0, False: 3.74k]
  ------------------
 1052|      0|      while(ISSLASH(*p) && (num_slashes < 2)) {
  ------------------
  |  |  791|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1052:28): [True: 0, False: 0]
  ------------------
 1053|      0|        p++;
 1054|      0|        num_slashes++;
 1055|      0|      }
 1056|      0|    }
 1057|  3.74k|    else {
 1058|  11.2k|      while(ISSLASH(*p) && (num_slashes < 4)) {
  ------------------
  |  |  791|  22.5k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (791:20): [True: 7.51k, False: 3.74k]
  |  |  ------------------
  ------------------
  |  Branch (1058:28): [True: 7.51k, False: 0]
  ------------------
 1059|  7.51k|        p++;
 1060|  7.51k|        num_slashes++;
 1061|  7.51k|      }
 1062|  3.74k|      if(num_slashes > 3)
  ------------------
  |  Branch (1062:10): [True: 1, False: 3.74k]
  ------------------
 1063|      1|        return CURLUE_BAD_SLASHES;
 1064|  3.74k|    }
 1065|       |
 1066|  3.74k|    schemep = schemebuf;
 1067|  3.74k|    *hostpp = p; /* hostname starts here */
 1068|  3.74k|  }
 1069|      0|  else {
 1070|       |    /* no scheme! */
 1071|       |
 1072|      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 (1072:8): [True: 0, False: 0]
  ------------------
 1073|      0|      return CURLUE_BAD_SCHEME;
 1074|       |
 1075|      0|    if(flags & CURLU_DEFAULT_SCHEME)
  ------------------
  |  |   89|      0|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
  |  Branch (1075:8): [True: 0, False: 0]
  ------------------
 1076|      0|      schemep = DEFAULT_SCHEME;
  ------------------
  |  |   67|      0|#define DEFAULT_SCHEME "https"
  ------------------
 1077|       |
 1078|       |    /*
 1079|       |     * The URL was badly formatted, let's try without scheme specified.
 1080|       |     */
 1081|      0|    *hostpp = url;
 1082|      0|  }
 1083|       |
 1084|  3.74k|  if(schemep) {
  ------------------
  |  Branch (1084:6): [True: 3.74k, False: 0]
  ------------------
 1085|  3.74k|    u->scheme = curlx_strdup(schemep);
  ------------------
  |  | 1422|  3.74k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1086|  3.74k|    if(!u->scheme)
  ------------------
  |  Branch (1086:8): [True: 0, False: 3.74k]
  ------------------
 1087|      0|      return CURLUE_OUT_OF_MEMORY;
 1088|  3.74k|  }
 1089|  3.74k|  return CURLUE_OK;
 1090|  3.74k|}
urlapi.c:handle_fragment:
 1122|      9|{
 1123|      9|  CURLUcode ures;
 1124|      9|  u->fragment_present = TRUE;
  ------------------
  |  |  997|      9|#define TRUE true
  ------------------
 1125|      9|  if(fraglen > 1) {
  ------------------
  |  Branch (1125:6): [True: 8, False: 1]
  ------------------
 1126|       |    /* skip the leading '#' in the copy but include the null-terminator */
 1127|      8|    if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   95|      8|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1127:8): [True: 0, False: 8]
  ------------------
 1128|      0|      struct dynbuf enc;
 1129|      0|      curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1130|      0|      ures = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, QUERY_NO);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
                    ures = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, QUERY_NO);
  ------------------
  |  |   52|      0|#define QUERY_NO      2
  ------------------
 1131|      0|      if(ures)
  ------------------
  |  Branch (1131:10): [True: 0, False: 0]
  ------------------
 1132|      0|        return ures;
 1133|      0|      u->fragment = curlx_dyn_ptr(&enc);
 1134|      0|    }
 1135|      8|    else {
 1136|      8|      if(badoctets(fragment, fraglen, flags))
  ------------------
  |  Branch (1136:10): [True: 0, False: 8]
  ------------------
 1137|      0|        return CURLUE_BAD_FRAGMENT;
 1138|      8|      u->fragment = curlx_memdup0(fragment + 1, fraglen - 1);
 1139|      8|      if(!u->fragment)
  ------------------
  |  Branch (1139:10): [True: 0, False: 8]
  ------------------
 1140|      0|        return CURLUE_OUT_OF_MEMORY;
 1141|      8|    }
 1142|      8|  }
 1143|      9|  return CURLUE_OK;
 1144|      9|}
urlapi.c:handle_query:
 1148|     33|{
 1149|     33|  u->query_present = TRUE;
  ------------------
  |  |  997|     33|#define TRUE true
  ------------------
 1150|     33|  if(qlen > 1) {
  ------------------
  |  Branch (1150:6): [True: 19, False: 14]
  ------------------
 1151|     19|    if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   95|     19|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1151:8): [True: 0, False: 19]
  ------------------
 1152|      0|      struct dynbuf enc;
 1153|      0|      CURLUcode ures;
 1154|      0|      curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1155|       |      /* skip the leading question mark */
 1156|      0|      ures = urlencode_str(&enc, query + 1, qlen - 1, TRUE, QUERY_YES);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
                    ures = urlencode_str(&enc, query + 1, qlen - 1, TRUE, QUERY_YES);
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
 1157|      0|      if(ures)
  ------------------
  |  Branch (1157:10): [True: 0, False: 0]
  ------------------
 1158|      0|        return ures;
 1159|      0|      u->query = curlx_dyn_ptr(&enc);
 1160|      0|    }
 1161|     19|    else {
 1162|     19|      if(badoctets(query, qlen, flags))
  ------------------
  |  Branch (1162:10): [True: 0, False: 19]
  ------------------
 1163|      0|        return CURLUE_BAD_QUERY;
 1164|       |
 1165|     19|      u->query = curlx_memdup0(query + 1, qlen - 1);
 1166|     19|      if(!u->query)
  ------------------
  |  Branch (1166:10): [True: 0, False: 19]
  ------------------
 1167|      0|        return CURLUE_OUT_OF_MEMORY;
 1168|     19|    }
 1169|     19|  }
 1170|     14|  else {
 1171|       |    /* single byte query */
 1172|     14|    u->query = curlx_strdup("");
  ------------------
  |  | 1422|     14|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1173|     14|    if(!u->query)
  ------------------
  |  Branch (1173:8): [True: 0, False: 14]
  ------------------
 1174|      0|      return CURLUE_OUT_OF_MEMORY;
 1175|     14|  }
 1176|     33|  return CURLUE_OK;
 1177|     33|}
urlapi.c:handle_path:
 1182|  3.25k|{
 1183|  3.25k|  CURLUcode ures;
 1184|  3.25k|  if(pathlen && (flags & CURLU_URLENCODE)) {
  ------------------
  |  |   95|    647|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1184:6): [True: 647, False: 2.60k]
  |  Branch (1184:17): [True: 0, False: 647]
  ------------------
 1185|      0|    struct dynbuf enc;
 1186|      0|    curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1187|      0|    ures = urlencode_str(&enc, path, pathlen, TRUE, QUERY_NO);
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
                  ures = urlencode_str(&enc, path, pathlen, TRUE, QUERY_NO);
  ------------------
  |  |   52|      0|#define QUERY_NO      2
  ------------------
 1188|      0|    if(ures)
  ------------------
  |  Branch (1188:8): [True: 0, False: 0]
  ------------------
 1189|      0|      return ures;
 1190|      0|    pathlen = curlx_dyn_len(&enc);
 1191|      0|    path = u->path = curlx_dyn_ptr(&enc);
 1192|      0|  }
 1193|       |
 1194|  3.25k|  if(pathlen >= (size_t)(1 + !is_file)) {
  ------------------
  |  Branch (1194:6): [True: 644, False: 2.61k]
  ------------------
 1195|    644|    if(badoctets(path, pathlen, flags))
  ------------------
  |  Branch (1195:8): [True: 1, False: 643]
  ------------------
 1196|      1|      return CURLUE_BAD_PATH;
 1197|       |
 1198|       |    /* paths for file:// scheme can be one byte, others need to be two */
 1199|    643|    if(!u->path) {
  ------------------
  |  Branch (1199:8): [True: 643, False: 0]
  ------------------
 1200|    643|      u->path = curlx_memdup0(path, pathlen);
 1201|    643|      if(!u->path)
  ------------------
  |  Branch (1201:10): [True: 0, False: 643]
  ------------------
 1202|      0|        return CURLUE_OUT_OF_MEMORY;
 1203|    643|      path = u->path;
 1204|    643|    }
 1205|      0|    else if(flags & CURLU_URLENCODE)
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1205:13): [True: 0, False: 0]
  ------------------
 1206|       |      /* it might have encoded more than the path so cut it */
 1207|      0|      u->path[pathlen] = 0;
 1208|       |
 1209|    643|    if(!(flags & CURLU_PATH_AS_IS)) {
  ------------------
  |  |   92|    643|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (1209:8): [True: 643, False: 0]
  ------------------
 1210|       |      /* remove ../ and ./ sequences according to RFC3986 */
 1211|    643|      char *dedot;
 1212|    643|      int err = dedotdotify(path, pathlen, &dedot);
 1213|    643|      if(err)
  ------------------
  |  Branch (1213:10): [True: 0, False: 643]
  ------------------
 1214|      0|        return CURLUE_OUT_OF_MEMORY;
 1215|    643|      if(dedot) {
  ------------------
  |  Branch (1215:10): [True: 397, False: 246]
  ------------------
 1216|    397|        curlx_free(u->path);
  ------------------
  |  | 1428|    397|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1217|    397|        u->path = dedot;
 1218|    397|      }
 1219|    643|    }
 1220|    643|  }
 1221|  3.25k|  return CURLUE_OK;
 1222|  3.25k|}

Curl_auth_digest_cleanup:
 1041|  18.7k|{
 1042|  18.7k|  Curl_peer_unlink(&digest->origin);
 1043|  18.7k|  Curl_creds_unlink(&digest->creds);
 1044|  18.7k|  curlx_safefree(digest->nonce);
  ------------------
  |  | 1284|  18.7k|  do {                      \
  |  | 1285|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  18.7k|    (ptr) = NULL;           \
  |  | 1287|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1045|  18.7k|  curlx_safefree(digest->cnonce);
  ------------------
  |  | 1284|  18.7k|  do {                      \
  |  | 1285|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  18.7k|    (ptr) = NULL;           \
  |  | 1287|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1046|  18.7k|  curlx_safefree(digest->realm);
  ------------------
  |  | 1284|  18.7k|  do {                      \
  |  | 1285|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  18.7k|    (ptr) = NULL;           \
  |  | 1287|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1047|  18.7k|  curlx_safefree(digest->opaque);
  ------------------
  |  | 1284|  18.7k|  do {                      \
  |  | 1285|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  18.7k|    (ptr) = NULL;           \
  |  | 1287|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1048|  18.7k|  curlx_safefree(digest->qop);
  ------------------
  |  | 1284|  18.7k|  do {                      \
  |  | 1285|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  18.7k|    (ptr) = NULL;           \
  |  | 1287|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1049|  18.7k|  curlx_safefree(digest->algorithm);
  ------------------
  |  | 1284|  18.7k|  do {                      \
  |  | 1285|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  18.7k|    (ptr) = NULL;           \
  |  | 1287|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1050|       |
 1051|  18.7k|  digest->nc = 0;
 1052|  18.7k|  digest->algo = ALGO_MD5; /* default algorithm */
  ------------------
  |  |   44|  18.7k|#define ALGO_MD5 0
  ------------------
 1053|  18.7k|  digest->stale = FALSE;   /* default means normal, not stale */
  ------------------
  |  | 1000|  18.7k|#define FALSE false
  ------------------
 1054|       |  digest->userhash = FALSE;
  ------------------
  |  | 1000|  18.7k|#define FALSE false
  ------------------
 1055|  18.7k|}

Curl_auth_allowed_to_origin:
  147|    176|{
  148|    176|  return data->set.allow_auth_to_other_hosts ||
  ------------------
  |  Branch (148:10): [True: 0, False: 176]
  ------------------
  149|    176|         Curl_peer_equal(data->state.initial_origin, origin);
  ------------------
  |  Branch (149:10): [True: 176, False: 0]
  ------------------
  150|    176|}

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_multi_init:
  477|  3.74k|{
  478|  3.74k|  CURLcode result;
  479|  3.74k|  DEBUGASSERT(!multi->resolv_thrdq);
  ------------------
  |  | 1027|  3.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (479:3): [True: 0, False: 3.74k]
  |  Branch (479:3): [True: 3.74k, False: 0]
  ------------------
  480|  3.74k|  result = Curl_thrdq_create(&multi->resolv_thrdq, "DNS",
  481|  3.74k|                             min_threads, max_threads, idle_time_ms,
  482|  3.74k|                             async_thrdd_item_free,
  483|  3.74k|                             async_thrdd_item_process,
  484|  3.74k|                             async_thrdd_event,
  485|  3.74k|                             multi);
  486|  3.74k|#ifdef DEBUGBUILD
  487|  3.74k|  if(!result) {
  ------------------
  |  Branch (487:6): [True: 3.74k, False: 0]
  ------------------
  488|  3.74k|    const char *p = getenv("CURL_DBG_RESOLV_MAX_THREADS");
  489|  3.74k|    if(p) {
  ------------------
  |  Branch (489:8): [True: 0, False: 3.74k]
  ------------------
  490|      0|      curl_off_t l;
  491|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (491:10): [True: 0, False: 0]
  ------------------
  492|      0|        result = Curl_async_thrdd_multi_set_props(
  493|      0|          multi, min_threads, (uint32_t)l, idle_time_ms);
  494|      0|      }
  495|      0|    }
  496|  3.74k|  }
  497|  3.74k|#endif
  498|  3.74k|  return result;
  499|  3.74k|}
Curl_async_thrdd_multi_destroy:
  503|  3.74k|{
  504|  3.74k|  if(multi->resolv_thrdq) {
  ------------------
  |  Branch (504:6): [True: 3.74k, False: 0]
  ------------------
  505|  3.74k|#ifdef CURLVERBOSE
  506|  3.74k|    CURL_TRC_DNS(multi->admin, "destroy thread queue+pool, join=%d", join);
  ------------------
  |  |  168|  3.74k|  do {                                 \
  |  |  169|  3.74k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  3.74k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.74k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  7.48k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.74k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  7.48k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((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.74k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.74k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  3.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  507|  3.74k|    Curl_thrdq_trace(multi->resolv_thrdq, multi->admin);
  508|  3.74k|#endif
  509|  3.74k|    Curl_thrdq_destroy(multi->resolv_thrdq, join);
  510|       |    multi->resolv_thrdq = NULL;
  511|  3.74k|  }
  512|  3.74k|}
Curl_async_thrdd_multi_process:
  559|  3.74k|{
  560|  3.74k|  struct Curl_easy *data;
  561|  3.74k|  void *qitem;
  562|       |
  563|  3.74k|  while(!Curl_thrdq_recv(multi->resolv_thrdq, &qitem)) {
  ------------------
  |  Branch (563:9): [True: 0, False: 3.74k]
  ------------------
  564|       |    /* dispatch resolve result */
  565|      0|    struct async_thrdd_item *item = qitem;
  566|      0|    struct Curl_resolv_async *async = NULL;
  567|       |
  568|      0|    data = Curl_multi_get_easy(multi, item->mid);
  569|      0|    if(data)
  ------------------
  |  Branch (569:8): [True: 0, False: 0]
  ------------------
  570|      0|      async = Curl_async_get(data, item->resolv_id);
  571|      0|    if(async) {
  ------------------
  |  Branch (571:8): [True: 0, False: 0]
  ------------------
  572|      0|      struct async_thrdd_item **pdest = &async->thrdd.res_A;
  573|       |
  574|      0|#ifdef CURLRES_IPV6
  575|      0|      if(item->dns_queries & CURL_DNSQ_AAAA)
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (575:10): [True: 0, False: 0]
  ------------------
  576|      0|        pdest = &async->thrdd.res_AAAA;
  577|      0|#endif
  578|      0|      if(!*pdest) {
  ------------------
  |  Branch (578:10): [True: 0, False: 0]
  ------------------
  579|      0|        *pdest = item;
  580|      0|        item = NULL;
  581|      0|      }
  582|      0|      else
  583|      0|        DEBUGASSERT(0); /* should not receive duplicates here */
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (583:9): [Folded, False: 0]
  |  Branch (583:9): [Folded, False: 0]
  ------------------
  584|       |
  585|      0|      --async->queries_ongoing;
  586|      0|      Curl_multi_mark_dirty(data);
  587|      0|    }
  588|      0|    async_thrdd_item_free(item);
  589|      0|  }
  590|  3.74k|  VERBOSE(Curl_thrdq_trace(multi->resolv_thrdq, multi->admin));
  ------------------
  |  | 1563|  3.74k|#define VERBOSE(x) x
  ------------------
  591|  3.74k|}

Curl_conn_dns_add_addr_resolve:
  563|  3.04k|{
  564|       |  /* should only have address query bits */
  565|  3.04k|  DEBUGASSERT(!(dns_queries & ~CURL_DNSQ_ADDR));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (565:3): [True: 0, False: 3.04k]
  |  Branch (565:3): [True: 3.04k, False: 0]
  ------------------
  566|  3.04k|  return cf_dns_add_resolve(data, conn, sockindex, peer,
  567|  3.04k|                            (dns_queries & CURL_DNSQ_ADDR), transport);
  ------------------
  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  568|  3.04k|}
Curl_conn_dns_addr_result:
  580|  3.04k|{
  581|  3.04k|  struct Curl_cfilter *cf = conn->cfilter[sockindex];
  582|  3.04k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (582:9): [True: 3.04k, False: 0]
  ------------------
  583|  3.04k|    if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (583:8): [True: 3.04k, False: 0]
  ------------------
  584|  3.04k|      struct cf_dns_ctx *ctx = cf->ctx;
  585|  3.04k|      if(Curl_peer_same_destination(ctx->peer, peer) &&
  ------------------
  |  Branch (585:10): [True: 3.04k, False: 0]
  ------------------
  586|  3.04k|         (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                       (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (586:10): [True: 3.04k, False: 0]
  ------------------
  587|  3.04k|        if(ctx->dns || ctx->resolv_result)
  ------------------
  |  Branch (587:12): [True: 3.04k, False: 0]
  |  Branch (587:24): [True: 0, False: 0]
  ------------------
  588|  3.04k|          return ctx->resolv_result;
  589|      0|        return CURLE_AGAIN;
  590|  3.04k|      }
  591|  3.04k|    }
  592|  3.04k|  }
  593|      0|  return CURLE_FAILED_INIT; /* no one is resolving */
  594|  3.04k|}
Curl_conn_dns_get_ai:
  605|  6.08k|{
  606|  6.08k|  struct connectdata *conn = data->conn;
  607|  6.08k|  struct Curl_cfilter *cf = conn->cfilter[sockindex];
  608|       |
  609|  6.08k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (609:9): [True: 6.08k, False: 0]
  ------------------
  610|  6.08k|    if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (610:8): [True: 6.08k, False: 0]
  ------------------
  611|  6.08k|      struct cf_dns_ctx *ctx = cf->ctx;
  612|  6.08k|      if(Curl_peer_same_destination(ctx->peer, peer) &&
  ------------------
  |  Branch (612:10): [True: 6.08k, False: 0]
  ------------------
  613|  6.08k|         (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   51|  6.08k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                       (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   52|  6.08k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (613:10): [True: 6.08k, False: 0]
  ------------------
  614|  6.08k|        CURL_TRC_CF(data, cf, "get %uth result for %s:%u, family=%d, dns=%d",
  ------------------
  |  |  153|  6.08k|  do {                                          \
  |  |  154|  6.08k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  6.08k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  12.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 6.08k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 6.08k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  12.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 6.08k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  6.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|  6.08k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  6.08k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 6.08k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 6.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.08k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.08k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.08k]
  |  |  ------------------
  ------------------
  615|  6.08k|                    index, peer->hostname, peer->port, ai_family, !!ctx->dns);
  616|  6.08k|        if(ctx->resolv_result)
  ------------------
  |  Branch (616:12): [True: 0, False: 6.08k]
  ------------------
  617|      0|          return NULL;
  618|  6.08k|        else if(ctx->dns) {
  ------------------
  |  Branch (618:17): [True: 6.08k, False: 0]
  ------------------
  619|       |          /* A cached DNS entry may contain address families that we
  620|       |           * here never queried for. We want to give no results for those. */
  621|  6.08k|          if((ai_family == AF_INET) && !(ctx->dns_queries & CURL_DNSQ_A))
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (621:14): [True: 3.04k, False: 3.04k]
  |  Branch (621:40): [True: 0, False: 3.04k]
  ------------------
  622|      0|            return NULL;
  623|  6.08k|#ifdef USE_IPV6
  624|  6.08k|          if((ai_family == AF_INET6) && !(ctx->dns_queries & CURL_DNSQ_AAAA))
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (624:14): [True: 3.04k, False: 3.04k]
  |  Branch (624:41): [True: 0, False: 3.04k]
  ------------------
  625|      0|            return NULL;
  626|  6.08k|#endif
  627|  6.08k|          return Curl_addrinfo_get(ctx->dns->addr, ai_family, index);
  628|  6.08k|        }
  629|      0|        else
  630|      0|          return Curl_resolv_get_ai(data, ctx->resolv_id, ai_family, index);
  631|  6.08k|      }
  632|  6.08k|    }
  633|  6.08k|  }
  634|      0|  return NULL;
  635|  6.08k|}
cf-dns.c:cf_dns_destroy:
  350|  3.04k|{
  351|  3.04k|  struct cf_dns_ctx *ctx = cf->ctx;
  352|       |
  353|  3.04k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  354|  3.04k|  cf_dns_ctx_destroy(data, ctx);
  355|  3.04k|}
cf-dns.c:cf_dns_ctx_destroy:
   93|  3.04k|{
   94|  3.04k|  if(ctx) {
  ------------------
  |  Branch (94:6): [True: 3.04k, False: 0]
  ------------------
   95|  3.04k|    Curl_peer_unlink(&ctx->peer);
   96|  3.04k|    Curl_dns_entry_unlink(data, &ctx->dns);
   97|  3.04k|    curlx_free(ctx);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|  3.04k|  }
   99|  3.04k|}
cf-dns.c:cf_dns_connect:
  290|  3.04k|{
  291|  3.04k|  struct cf_dns_ctx *ctx = cf->ctx;
  292|  3.04k|  bool ip_query = (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                bool ip_query = (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  293|       |
  294|  3.04k|  if(cf->connected) {
  ------------------
  |  Branch (294:6): [True: 0, False: 3.04k]
  ------------------
  295|      0|    *done = TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  296|      0|    return CURLE_OK;
  297|      0|  }
  298|       |
  299|  3.04k|  *done = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  300|  3.04k|  if(!ctx->started) {
  ------------------
  |  Branch (300:6): [True: 3.04k, False: 0]
  ------------------
  301|  3.04k|    ctx->started = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  302|  3.04k|    ctx->resolv_result = cf_dns_start(cf, data, &ctx->dns);
  303|  3.04k|  }
  304|       |
  305|  3.04k|  if(!ctx->dns && !ctx->resolv_result) {
  ------------------
  |  Branch (305:6): [True: 0, False: 3.04k]
  |  Branch (305:19): [True: 0, False: 0]
  ------------------
  306|      0|    ctx->resolv_result =
  307|      0|      Curl_resolv_take_result(data, ctx->resolv_id, &ctx->dns);
  308|      0|  }
  309|       |
  310|  3.04k|  if(ctx->resolv_result && ip_query) {
  ------------------
  |  Branch (310:6): [True: 0, False: 3.04k]
  |  Branch (310:28): [True: 0, False: 0]
  ------------------
  311|       |    /* failing A|AAAA resolves is a hard failure. */
  312|      0|    CURL_TRC_CF(data, cf, "[%s] error resolving: %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]
  |  |  ------------------
  ------------------
  313|      0|                Curl_resolv_query_str(ctx->dns_queries),
  314|      0|                (int)ctx->resolv_result);
  315|      0|    return ctx->resolv_result;
  316|      0|  }
  317|       |
  318|  3.04k|  if(ctx->dns && !ctx->announced) {
  ------------------
  |  Branch (318:6): [True: 3.04k, False: 0]
  |  Branch (318:18): [True: 3.04k, False: 0]
  ------------------
  319|  3.04k|    ctx->announced = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  320|  3.04k|    if((cf->sockindex == FIRSTSOCKET) && ip_query) {
  ------------------
  |  |  233|  3.04k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (320:8): [True: 3.04k, False: 0]
  |  Branch (320:42): [True: 3.04k, False: 0]
  ------------------
  321|  3.04k|      cf->conn->bits.dns_resolved = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  322|  3.04k|      Curl_pgrsTime(data, TIMER_NAMELOOKUP);
  323|  3.04k|    }
  324|  3.04k|    cf_dns_report(cf, data, ctx->dns);
  325|  3.04k|  }
  326|       |
  327|       |  /* Delay connection sub-filters when we are still waiting for AAAA */
  328|  3.04k|  if(!cf_dns_ready_to_connect(cf, data)) {
  ------------------
  |  Branch (328:6): [True: 0, False: 3.04k]
  ------------------
  329|      0|    return CURLE_OK;
  330|      0|  }
  331|       |
  332|  3.04k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (332:6): [True: 3.04k, False: 0]
  |  Branch (332:18): [True: 3.04k, False: 0]
  ------------------
  333|  3.04k|    bool sub_done;
  334|  3.04k|    CURLcode result = Curl_conn_cf_connect(cf->next, data, &sub_done);
  335|  3.04k|    if(result || !sub_done)
  ------------------
  |  Branch (335:8): [True: 0, False: 3.04k]
  |  Branch (335:18): [True: 0, False: 3.04k]
  ------------------
  336|      0|      return result;
  337|  3.04k|    DEBUGASSERT(sub_done);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (337:5): [True: 0, False: 3.04k]
  |  Branch (337:5): [True: 3.04k, False: 0]
  ------------------
  338|  3.04k|  }
  339|       |
  340|       |  /* sub filter chain is connected, this means the filter has done
  341|       |   * its work and is connected as well, if it has results or not. */
  342|  3.04k|  CURL_TRC_CF(data, cf, "connected filter chain below");
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  343|  3.04k|  *done = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  344|       |  cf->connected = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  345|  3.04k|  Curl_resolv_destroy(data, ctx->resolv_id);
  346|  3.04k|  return CURLE_OK;
  347|  3.04k|}
cf-dns.c:cf_dns_start:
  187|  3.04k|{
  188|  3.04k|  struct cf_dns_ctx *ctx = cf->ctx;
  189|  3.04k|  timediff_t timeout_ms = Curl_timeleft_ms(data);
  190|  3.04k|  CURLcode result = CURLE_OK;
  191|       |
  192|  3.04k|  *pdns = NULL;
  193|       |
  194|  3.04k|  CURL_TRC_CF(data, cf, "[%s] cf_dns_start %s %s:%u",
  ------------------
  |  |  153|  3.04k|  do {                                          \
  |  |  154|  3.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  195|  3.04k|              Curl_resolv_query_str(ctx->dns_queries),
  196|  3.04k|              ctx->peer->unix_socket ? "unix-domain-socket" : "host",
  197|  3.04k|              ctx->peer->hostname, ctx->peer->port);
  198|  3.04k|  if(ctx->peer->unix_socket)
  ------------------
  |  Branch (198:6): [True: 0, False: 3.04k]
  ------------------
  199|      0|    ctx->dns_queries = CURL_DNSQ_A; /* treat it like an A resolve */
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  200|       |
  201|  3.04k|  if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
  ------------------
  |  |   56|  3.04k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 3.04k, False: 0]
  |  |  ------------------
  ------------------
  202|  3.04k|    if(Curl_is_ipv4addr(ctx->peer->hostname))
  ------------------
  |  Branch (202:8): [True: 3.04k, False: 0]
  ------------------
  203|  3.04k|      ctx->dns_queries |= CURL_DNSQ_A;
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  204|      0|#ifdef USE_IPV6
  205|      0|    else if(ctx->peer->ipv6)
  ------------------
  |  Branch (205:13): [True: 0, False: 0]
  ------------------
  206|      0|      ctx->dns_queries |= CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  207|  3.04k|#endif
  208|       |
  209|  3.04k|    result = Curl_resolv(data, ctx->peer, ctx->dns_queries, ctx->transport,
  210|  3.04k|                         (bool)ctx->for_proxy, timeout_ms,
  211|  3.04k|                         &ctx->resolv_id, pdns);
  212|  3.04k|  }
  213|      0|#ifdef USE_HTTPSRR
  214|      0|  else if(ctx->dns_queries == CURL_DNSQ_HTTPS) {
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (214:11): [True: 0, False: 0]
  ------------------
  215|      0|    result = Curl_resolv_https(data, ctx->peer, (bool)ctx->for_proxy,
  216|      0|                               timeout_ms, &ctx->resolv_id, pdns);
  217|      0|  }
  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|  3.04k|  DEBUGASSERT(!result || !*pdns);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 3.04k, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  |  Branch (224:3): [True: 3.04k, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  ------------------
  225|  3.04k|  if(!result) { /* resolved right away, either sync or from dnscache */
  ------------------
  |  Branch (225:6): [True: 3.04k, False: 0]
  ------------------
  226|  3.04k|    DEBUGASSERT(*pdns);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (226:5): [True: 0, False: 3.04k]
  |  Branch (226:5): [True: 3.04k, False: 0]
  ------------------
  227|  3.04k|    return CURLE_OK;
  228|  3.04k|  }
  229|      0|  else if(result == CURLE_AGAIN) { /* async resolv in progress */
  ------------------
  |  Branch (229:11): [True: 0, False: 0]
  ------------------
  230|      0|    return CURLE_OK;
  231|      0|  }
  232|      0|  else if(result == CURLE_OPERATION_TIMEDOUT) { /* took too long */
  ------------------
  |  Branch (232:11): [True: 0, False: 0]
  ------------------
  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|      0|  else {
  239|      0|    DEBUGASSERT(result);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:5): [True: 0, False: 0]
  |  Branch (239:5): [True: 0, False: 0]
  ------------------
  240|      0|    if(ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                  if(ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (240:8): [True: 0, False: 0]
  ------------------
  241|      0|      failf(data, "Could not resolve: %s", ctx->peer->hostname);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  242|      0|    return result;
  243|      0|  }
  244|  3.04k|}
cf-dns.c:cf_dns_report:
  132|  3.04k|{
  133|  3.04k|  struct cf_dns_ctx *ctx = cf->ctx;
  134|  3.04k|  struct dynbuf tmp;
  135|       |
  136|  3.04k|  if(!Curl_trc_is_verbose(data) ||
  ------------------
  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  ------------------
  |  |  324|  3.04k|    ((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|  3.04k|     !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname))
  ------------------
  |  Branch (138:6): [True: 0, False: 3.04k]
  |  Branch (138:27): [True: 3.04k, False: 0]
  ------------------
  139|  3.04k|    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|  3.04k|{
  249|  3.04k|  struct cf_dns_ctx *ctx = cf->ctx;
  250|       |
  251|  3.04k|  if(ctx->resolv_result)
  ------------------
  |  Branch (251:6): [True: 0, False: 3.04k]
  ------------------
  252|      0|    return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  253|  3.04k|  else if(ctx->dns)
  ------------------
  |  Branch (253:11): [True: 3.04k, False: 0]
  ------------------
  254|  3.04k|    return TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  255|      0|#ifdef USE_CURL_ASYNC
  256|      0|  else 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]
  |  |  ------------------
  ------------------
  257|      0|    const struct curltime *pnow;
  258|      0|    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|      0|    if(Curl_resolv_has_answers(data, ctx->resolv_id, CURL_DNSQ_AAAA))
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (264:8): [True: 0, False: 0]
  ------------------
  265|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  266|      0|    pnow = Curl_pgrs_now(data);
  267|      0|    remain_ms = ctx->he_aaaa_await_ms -
  268|      0|                Curl_resolv_elapsed_ms(data, ctx->resolv_id, pnow);
  269|      0|    if(remain_ms <= 0)
  ------------------
  |  Branch (269:8): [True: 0, False: 0]
  ------------------
  270|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  271|      0|    CURL_TRC_CF(data, cf, "[%s] still waiting %" 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]
  |  |  ------------------
  ------------------
  272|      0|                "ms for AAAA result",
  273|      0|                Curl_resolv_query_str(ctx->dns_queries), remain_ms);
  274|      0|    Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, remain_ms, pnow);
  275|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  276|      0|  }
  277|      0|  else {
  278|      0|    return TRUE;
  ------------------
  |  |  997|      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|  3.04k|}
cf-dns.c:cf_dns_cntrl:
  391|  6.08k|{
  392|  6.08k|  struct cf_dns_ctx *ctx = cf->ctx;
  393|  6.08k|  CURLcode result = CURLE_OK;
  394|       |
  395|  6.08k|  (void)arg1;
  396|  6.08k|  (void)arg2;
  397|  6.08k|  switch(event) {
  398|      0|  case CF_CTRL_DATA_DONE:
  ------------------
  |  |  118|      0|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  |  Branch (398:3): [True: 0, False: 6.08k]
  ------------------
  399|      0|    if(ctx->dns) {
  ------------------
  |  Branch (399:8): [True: 0, False: 0]
  ------------------
  400|       |      /* Should only come here when the connect attempt failed and
  401|       |       * `data` is giving up on it. On a successful connect, we already
  402|       |       * unlinked the DNS entry. */
  403|      0|      Curl_dns_entry_unlink(data, &ctx->dns);
  404|      0|    }
  405|      0|    break;
  406|  6.08k|  default:
  ------------------
  |  Branch (406:3): [True: 6.08k, False: 0]
  ------------------
  407|  6.08k|    break;
  408|  6.08k|  }
  409|  6.08k|  return result;
  410|  6.08k|}
cf-dns.c:cf_dns_add_resolve:
  513|  3.04k|{
  514|  3.04k|  struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
  515|  3.04k|  struct Curl_cfilter *cf_dns = NULL;
  516|  3.04k|  bool is_addr = CURL_DNSQ_IS_ADDR(dns_queries);
  ------------------
  |  |   56|  3.04k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|       |
  518|  3.04k|  if((dns_queries & CURL_DNSQ_HTTPS) &&
  ------------------
  |  |   53|  3.04k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (518:6): [True: 0, False: 3.04k]
  ------------------
  519|      0|     Curl_is_ipaddr(peer->hostname)) {
  ------------------
  |  Branch (519:6): [True: 0, False: 0]
  ------------------
  520|      0|    dns_queries = (uint8_t)(dns_queries & ~CURL_DNSQ_HTTPS);
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  521|      0|  }
  522|       |
  523|  6.08k|  for(; cf && dns_queries; cf = cf->next) {
  ------------------
  |  Branch (523:9): [True: 3.04k, False: 3.04k]
  |  Branch (523:15): [True: 3.04k, False: 0]
  ------------------
  524|  3.04k|    if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (524:8): [True: 0, False: 3.04k]
  ------------------
  525|      0|      struct cf_dns_ctx *ctx = cf->ctx;
  526|      0|      cf_dns = cf;
  527|      0|      if(Curl_peer_same_destination(ctx->peer, peer)) {
  ------------------
  |  Branch (527:10): [True: 0, False: 0]
  ------------------
  528|       |        /* subtract queries already being scheduled/ongoing */
  529|      0|        dns_queries = (uint8_t)(~ctx->dns_queries & dns_queries);
  530|      0|        if(!dns_queries) { /* already there */
  ------------------
  |  Branch (530:12): [True: 0, False: 0]
  ------------------
  531|      0|          return CURLE_OK;
  532|      0|        }
  533|      0|        else if(is_addr && !ctx->started &&
  ------------------
  |  Branch (533:17): [True: 0, False: 0]
  |  Branch (533:28): [True: 0, False: 0]
  ------------------
  534|      0|                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]
  |  |  ------------------
  ------------------
  535|      0|          ctx->dns_queries |= dns_queries;
  536|      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]
  |  |  ------------------
  ------------------
  537|      0|                       Curl_resolv_query_str(ctx->dns_queries),
  538|      0|                       Curl_resolv_query_str(dns_queries),
  539|      0|                       peer->hostname, peer->port);
  540|      0|          return CURLE_OK;
  541|      0|        }
  542|      0|      }
  543|      0|    }
  544|  3.04k|  }
  545|       |
  546|  3.04k|  if(dns_queries) {
  ------------------
  |  Branch (546:6): [True: 3.04k, False: 0]
  ------------------
  547|       |    /* No existing filter is handling these, add a new DNS filter
  548|       |     * (after the last one if there was one already. FCFS. */
  549|  3.04k|    if(cf_dns)
  ------------------
  |  Branch (549:8): [True: 0, False: 3.04k]
  ------------------
  550|      0|      return cf_dns_insert_after(cf_dns, data, peer, dns_queries, transport);
  551|  3.04k|    else
  552|  3.04k|      return cf_dns_add(data, conn, sockindex, peer, dns_queries, transport);
  553|  3.04k|  }
  554|      0|  return CURLE_OK;
  555|  3.04k|}
cf-dns.c:cf_dns_create:
  435|  3.04k|{
  436|  3.04k|  struct Curl_cfilter *cf = NULL;
  437|  3.04k|  struct cf_dns_ctx *ctx;
  438|  3.04k|  CURLcode result = CURLE_OK;
  439|       |
  440|  3.04k|  (void)data;
  441|  3.04k|  ctx = cf_dns_ctx_create(data, peer, dns_queries, transport, for_proxy);
  442|  3.04k|  if(!ctx) {
  ------------------
  |  Branch (442:6): [True: 0, False: 3.04k]
  ------------------
  443|      0|    result = CURLE_OUT_OF_MEMORY;
  444|      0|    goto out;
  445|      0|  }
  446|       |
  447|  3.04k|  result = Curl_cf_create(&cf, &Curl_cft_dns, ctx);
  448|       |
  449|  3.04k|out:
  450|  3.04k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (450:10): [True: 0, False: 3.04k]
  ------------------
  451|  3.04k|  if(result)
  ------------------
  |  Branch (451:6): [True: 0, False: 3.04k]
  ------------------
  452|      0|    cf_dns_ctx_destroy(data, ctx);
  453|  3.04k|  return result;
  454|  3.04k|}
cf-dns.c:cf_dns_ctx_create:
   61|  3.04k|{
   62|  3.04k|  struct cf_dns_ctx *ctx;
   63|       |
   64|  3.04k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   65|  3.04k|  if(!ctx)
  ------------------
  |  Branch (65:6): [True: 0, False: 3.04k]
  ------------------
   66|      0|    return NULL;
   67|       |
   68|  3.04k|  Curl_peer_link(&ctx->peer, peer);
   69|  3.04k|  ctx->dns_queries = dns_queries;
   70|  3.04k|  ctx->transport = transport;
   71|  3.04k|  ctx->for_proxy = for_proxy;
   72|  3.04k|  ctx->he_aaaa_await_ms = CURL_HE_AAAA_AWAIT_MS;
  ------------------
  |  |   41|  3.04k|#define CURL_HE_AAAA_AWAIT_MS    25
  ------------------
   73|  3.04k|#ifdef DEBUGBUILD
   74|  3.04k|  {
   75|  3.04k|    const char *p = getenv("CURL_DBG_HE_AAAA_AWAIT_MS");
   76|  3.04k|    if(p) {
  ------------------
  |  Branch (76:8): [True: 0, False: 3.04k]
  ------------------
   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|  3.04k|  }
   83|  3.04k|#endif
   84|       |
   85|  3.04k|  CURL_TRC_DNS(data, "[%s] created DNS filter for %s:%u, transport=%x",
  ------------------
  |  |  168|  3.04k|  do {                                 \
  |  |  169|  3.04k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.04k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
   86|  3.04k|               Curl_resolv_query_str(ctx->dns_queries),
   87|  3.04k|               peer->hostname, peer->port, ctx->transport);
   88|  3.04k|  return ctx;
   89|  3.04k|}
cf-dns.c:cf_dns_add:
  464|  3.04k|{
  465|  3.04k|  struct Curl_cfilter *cf = NULL;
  466|  3.04k|  bool for_proxy = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  467|  3.04k|  CURLcode result;
  468|       |
  469|  3.04k|  if(!peer)
  ------------------
  |  Branch (469:6): [True: 0, False: 3.04k]
  ------------------
  470|      0|    return CURLE_FAILED_INIT;
  471|  3.04k|#ifndef CURL_DISABLE_PROXY
  472|  3.04k|  for_proxy = (peer == conn->socks_proxy.peer) ||
  ------------------
  |  Branch (472:15): [True: 0, False: 3.04k]
  ------------------
  473|  3.04k|              (peer == conn->http_proxy.peer);
  ------------------
  |  Branch (473:15): [True: 0, False: 3.04k]
  ------------------
  474|  3.04k|#endif
  475|       |
  476|  3.04k|  result = cf_dns_create(&cf, data, peer, dns_queries, transport, for_proxy);
  477|  3.04k|  if(result)
  ------------------
  |  Branch (477:6): [True: 0, False: 3.04k]
  ------------------
  478|      0|    goto out;
  479|  3.04k|  Curl_conn_cf_add(data, conn, sockindex, cf);
  480|  3.04k|out:
  481|  3.04k|  return result;
  482|  3.04k|}

Curl_dnscache_prune:
  208|  3.04k|{
  209|  3.04k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  210|       |  /* the timeout may be set -1 (forever) */
  211|  3.04k|  timediff_t timeout_ms = data->set.dns_cache_timeout_ms;
  212|       |
  213|  3.04k|  if(!dnscache || (timeout_ms == -1))
  ------------------
  |  Branch (213:6): [True: 0, False: 3.04k]
  |  Branch (213:19): [True: 0, False: 3.04k]
  ------------------
  214|       |    /* NULL hostcache means we cannot do it */
  215|      0|    return;
  216|       |
  217|  3.04k|  dnscache_lock(data, dnscache);
  218|       |
  219|  3.04k|  do {
  220|       |    /* Remove outdated and unused entries from the hostcache */
  221|  3.04k|    timediff_t oldest_ms =
  222|  3.04k|      dnscache_prune(&dnscache->entries, timeout_ms, pnow);
  223|       |
  224|  3.04k|    if(Curl_hash_count(&dnscache->entries) > MAX_DNS_CACHE_SIZE)
  ------------------
  |  |   61|  3.04k|#define MAX_DNS_CACHE_SIZE 29999
  ------------------
  |  Branch (224:8): [True: 0, False: 3.04k]
  ------------------
  225|       |      /* prune the ones over half this age */
  226|      0|      timeout_ms = oldest_ms / 2;
  227|  3.04k|    else
  228|  3.04k|      break;
  229|       |
  230|       |    /* if the cache size is still too big, use the oldest age as new prune
  231|       |       limit */
  232|  3.04k|  } while(timeout_ms);
  ------------------
  |  Branch (232:11): [True: 0, False: 0]
  ------------------
  233|       |
  234|  3.04k|  dnscache_unlock(data, dnscache);
  235|  3.04k|}
Curl_dnscache_get:
  340|  3.04k|{
  341|  3.04k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  342|  3.04k|  struct Curl_dns_entry *dns = NULL;
  343|  3.04k|  CURLcode result = CURLE_OK;
  344|       |
  345|  3.04k|  dnscache_lock(data, dnscache);
  346|  3.04k|  result = fetch_entry(data, dnscache, dns_queries, peer, &dns);
  347|  3.04k|  if(!result && dns)
  ------------------
  |  Branch (347:6): [True: 3.04k, False: 0]
  |  Branch (347:17): [True: 0, False: 3.04k]
  ------------------
  348|      0|    dns->refcount++; /* we pass out a reference */
  349|  3.04k|  else if(result) {
  ------------------
  |  Branch (349:11): [True: 0, False: 3.04k]
  ------------------
  350|      0|    DEBUGASSERT(!dns);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (350:5): [True: 0, False: 0]
  |  Branch (350:5): [True: 0, False: 0]
  ------------------
  351|      0|    dns = NULL;
  352|      0|  }
  353|  3.04k|  dnscache_unlock(data, dnscache);
  354|       |
  355|  3.04k|  CURL_TRC_DNS(data, "cache lookup %s:%u queries=%s -> %d %sfound",
  ------------------
  |  |  168|  3.04k|  do {                                 \
  |  |  169|  3.04k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.04k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (170:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  171|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  356|  3.04k|               peer->hostname, peer->port, Curl_resolv_query_str(dns_queries),
  357|  3.04k|               (int)result, dns ? "" : "not ");
  358|  3.04k|  *pentry = dns;
  359|  3.04k|  return result;
  360|  3.04k|}
Curl_dnsc_mk_addr:
  550|  3.04k|{
  551|  3.04k|  struct dnsc_id id;
  552|  3.04k|  struct Curl_dns_entry *dns;
  553|       |
  554|  3.04k|  dnsc_peer2id(&id, CURL_DNST_ADDR, peer);
  ------------------
  |  |   41|  3.04k|#define CURL_DNST_ADDR      'A'
  ------------------
  555|  3.04k|  dns = dnsc_entry_create(&id, FALSE);
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  556|       |  dns = dnsc_entry_assign_addr(data, dns, dns_queries, paddr, NULL);
  557|  3.04k|  return dns;
  558|  3.04k|}
Curl_dnscache_add:
  714|  3.04k|{
  715|  3.04k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  716|  3.04k|  struct Curl_str name;
  717|  3.04k|  struct dnsc_id id;
  718|  3.04k|  struct dnsc_key key;
  719|       |
  720|  3.04k|  if(!dnscache)
  ------------------
  |  Branch (720:6): [True: 0, False: 3.04k]
  ------------------
  721|      0|    return CURLE_FAILED_INIT;
  722|  3.04k|  if(!entry || (entry->type == CURL_DNST_INIT))
  ------------------
  |  |   40|  3.04k|#define CURL_DNST_INIT      '\0'
  ------------------
  |  Branch (722:6): [True: 0, False: 3.04k]
  |  Branch (722:16): [True: 0, False: 3.04k]
  ------------------
  723|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  724|       |
  725|  3.04k|  curlx_str_assign(&name, entry->hostname, entry->hostlen);
  726|  3.04k|  dnsc_str2id(&id, entry->type, &name, entry->port);
  727|  3.04k|  dnsc_id2key(&key, &id);
  728|       |
  729|       |  /* Store the resolved data in our DNS cache and up ref count */
  730|  3.04k|  dnscache_lock(data, dnscache);
  731|  3.04k|  if(!dnsc_add_entry(data, dnscache, &key, entry)) {
  ------------------
  |  Branch (731:6): [True: 0, False: 3.04k]
  ------------------
  732|      0|    dnscache_unlock(data, dnscache);
  733|      0|    return CURLE_OUT_OF_MEMORY;
  734|      0|  }
  735|  3.04k|  entry->refcount++;
  736|  3.04k|  dnscache_unlock(data, dnscache);
  737|  3.04k|  CURL_TRC_DNS(data, "cached entry for %s:%u queries=%s",
  ------------------
  |  |  168|  3.04k|  do {                                 \
  |  |  169|  3.04k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.04k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  738|  3.04k|               entry->hostname, entry->port,
  739|  3.04k|               Curl_resolv_query_str(entry->dns_queries));
  740|  3.04k|  return CURLE_OK;
  741|  3.04k|}
Curl_dns_entry_unlink:
  799|  3.04k|{
  800|  3.04k|  if(*pdns) {
  ------------------
  |  Branch (800:6): [True: 3.04k, False: 0]
  ------------------
  801|  3.04k|    struct Curl_dnscache *dnscache = dnscache_get(data);
  802|  3.04k|    struct Curl_dns_entry *dns = *pdns;
  803|  3.04k|    *pdns = NULL;
  804|  3.04k|    dnscache_lock(data, dnscache);
  805|  3.04k|    dns->refcount--;
  806|  3.04k|    if(dns->refcount == 0)
  ------------------
  |  Branch (806:8): [True: 0, False: 3.04k]
  ------------------
  807|      0|      dnscache_entry_free(dns);
  808|  3.04k|    dnscache_unlock(data, dnscache);
  809|  3.04k|  }
  810|  3.04k|}
Curl_dnscache_init:
  825|  3.74k|{
  826|  3.74k|  Curl_hash_init(&dns->entries, size, CURL_HASH_TYPE_BYTES,
  827|  3.74k|                 dnscache_entry_dtor);
  828|  3.74k|}
Curl_dnscache_destroy:
  831|  3.74k|{
  832|  3.74k|  Curl_hash_destroy(&dns->entries);
  833|  3.74k|}
dnscache.c:dnscache_get:
  181|  12.1k|{
  182|  12.1k|  if(data->share && data->share->specifier & (1 << CURL_LOCK_DATA_DNS))
  ------------------
  |  Branch (182:6): [True: 0, False: 12.1k]
  |  Branch (182:21): [True: 0, False: 0]
  ------------------
  183|      0|    return &data->share->dnscache;
  184|  12.1k|  if(data->multi)
  ------------------
  |  Branch (184:6): [True: 12.1k, False: 0]
  ------------------
  185|  12.1k|    return &data->multi->dnscache;
  186|      0|  return NULL;
  187|  12.1k|}
dnscache.c:dnscache_lock:
  191|  12.1k|{
  192|  12.1k|  if(data->share && dnscache == &data->share->dnscache)
  ------------------
  |  Branch (192:6): [True: 0, False: 12.1k]
  |  Branch (192:21): [True: 0, False: 0]
  ------------------
  193|      0|    Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
  194|  12.1k|}
dnscache.c:dnscache_prune:
  166|  3.04k|{
  167|  3.04k|  struct dnscache_prune_data user;
  168|       |
  169|  3.04k|  user.max_age_ms = cache_timeout_ms;
  170|  3.04k|  user.pnow = pnow;
  171|  3.04k|  user.oldest_ms = 0;
  172|       |
  173|  3.04k|  Curl_hash_clean_with_criterium(hostcache,
  174|  3.04k|                                 (void *)&user,
  175|  3.04k|                                 dnscache_entry_is_stale);
  176|       |
  177|  3.04k|  return user.oldest_ms;
  178|  3.04k|}
dnscache.c:dnscache_entry_is_stale:
  130|  3.04k|{
  131|  3.04k|  struct dnscache_prune_data *prune = (struct dnscache_prune_data *)datap;
  132|  3.04k|  struct Curl_dns_entry *dns = (struct Curl_dns_entry *)hc;
  133|       |
  134|  3.04k|  if(!dns->permanent) {
  ------------------
  |  Branch (134:6): [True: 3.04k, False: 0]
  ------------------
  135|       |    /* get age in milliseconds */
  136|  3.04k|    timediff_t age_ms = curlx_ptimediff_ms(prune->pnow, &dns->added);
  137|  3.04k|    switch(dns->type) {
  138|  3.04k|    case CURL_DNST_ADDR:
  ------------------
  |  |   41|  3.04k|#define CURL_DNST_ADDR      'A'
  ------------------
  |  Branch (138:5): [True: 3.04k, False: 0]
  ------------------
  139|  3.04k|      if(!dns->addr)
  ------------------
  |  Branch (139:10): [True: 0, False: 3.04k]
  ------------------
  140|      0|        age_ms *= 2; /* negative entries age twice as fast */
  141|  3.04k|      break;
  142|      0|#ifdef USE_HTTPSRR
  143|      0|    case CURL_DNST_HTTPS:
  ------------------
  |  |   42|      0|#define CURL_DNST_HTTPS     'H'
  ------------------
  |  Branch (143:5): [True: 0, False: 3.04k]
  ------------------
  144|      0|      if(!dns->hinfo)
  ------------------
  |  Branch (144:10): [True: 0, False: 0]
  ------------------
  145|      0|        age_ms *= 2; /* negative entries age twice as fast */
  146|      0|      break;
  147|      0|#endif
  148|      0|    default:
  ------------------
  |  Branch (148:5): [True: 0, False: 3.04k]
  ------------------
  149|      0|      break;
  150|  3.04k|    }
  151|  3.04k|    if(age_ms >= prune->max_age_ms)
  ------------------
  |  Branch (151:8): [True: 0, False: 3.04k]
  ------------------
  152|      0|      return TRUE;
  ------------------
  |  |  997|      0|#define TRUE true
  ------------------
  153|  3.04k|    if(age_ms > prune->oldest_ms)
  ------------------
  |  Branch (153:8): [True: 28, False: 3.01k]
  ------------------
  154|     28|      prune->oldest_ms = age_ms;
  155|  3.04k|  }
  156|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  157|  3.04k|}
dnscache.c:dnscache_unlock:
  198|  12.1k|{
  199|  12.1k|  if(data->share && dnscache == &data->share->dnscache)
  ------------------
  |  Branch (199:6): [True: 0, False: 12.1k]
  |  Branch (199:21): [True: 0, False: 0]
  ------------------
  200|      0|    Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
  201|  12.1k|}
dnscache.c:fetch_entry:
  253|  3.04k|{
  254|  3.04k|  struct Curl_dns_entry *dns = NULL;
  255|  3.04k|  struct dnsc_id id;
  256|  3.04k|  struct dnsc_key key;
  257|  3.04k|  char type = CURL_DNSQ_IS_ADDR(dns_queries) ?
  ------------------
  |  |   56|  3.04k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 3.04k, False: 0]
  |  |  ------------------
  ------------------
  258|  3.04k|              CURL_DNST_ADDR : CURL_DNST_HTTPS;
  ------------------
  |  |   41|  3.04k|#define CURL_DNST_ADDR      'A'
  ------------------
                            CURL_DNST_ADDR : CURL_DNST_HTTPS;
  ------------------
  |  |   42|  3.04k|#define CURL_DNST_HTTPS     'H'
  ------------------
  259|  3.04k|  CURLcode result = CURLE_OK;
  260|       |
  261|  3.04k|  *pdns = NULL;
  262|  3.04k|  if(!dnscache)
  ------------------
  |  Branch (262:6): [True: 0, False: 3.04k]
  ------------------
  263|      0|    return CURLE_OK;
  264|       |
  265|  3.04k|  dnsc_peer2id(&id, type, peer);
  266|  3.04k|  dnsc_id2key(&key, &id);
  267|       |
  268|       |  /* See if it is already in our dns cache */
  269|  3.04k|  dns = Curl_hash_pick(&dnscache->entries, key.data, key.len);
  270|       |
  271|       |  /* No entry found in cache, check if we might have a wildcard entry */
  272|  3.04k|  if(!dns && (type == CURL_DNST_ADDR) && data->state.wildcard_resolve) {
  ------------------
  |  |   41|  3.04k|#define CURL_DNST_ADDR      'A'
  ------------------
  |  Branch (272:6): [True: 3.04k, False: 0]
  |  Branch (272:14): [True: 3.04k, False: 0]
  |  Branch (272:42): [True: 0, False: 3.04k]
  ------------------
  273|      0|    struct Curl_str wildname;
  274|       |
  275|      0|    curlx_str_assign(&wildname, "*", 1);
  276|      0|    dnsc_str2id(&id, CURL_DNST_ADDR, &wildname, peer->port);
  ------------------
  |  |   41|      0|#define CURL_DNST_ADDR      'A'
  ------------------
  277|      0|    dnsc_id2key(&key, &id);
  278|       |
  279|       |    /* See if it is already in our dns cache */
  280|      0|    dns = Curl_hash_pick(&dnscache->entries, key.data, key.len);
  281|      0|  }
  282|       |
  283|  3.04k|  if(dns && (data->set.dns_cache_timeout_ms != -1)) {
  ------------------
  |  Branch (283:6): [True: 0, False: 3.04k]
  |  Branch (283:13): [True: 0, False: 0]
  ------------------
  284|       |    /* See whether the returned entry is stale. Done before we release lock */
  285|      0|    struct dnscache_prune_data user;
  286|       |
  287|      0|    user.pnow = Curl_pgrs_now(data);
  288|      0|    user.max_age_ms = data->set.dns_cache_timeout_ms;
  289|      0|    user.oldest_ms = 0;
  290|       |
  291|      0|    if(dnscache_entry_is_stale(&user, dns)) {
  ------------------
  |  Branch (291:8): [True: 0, False: 0]
  ------------------
  292|      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]
  |  |  ------------------
  ------------------
  293|      0|      dns = NULL; /* the memory deallocation is being handled by the hash */
  294|      0|      Curl_hash_delete(&dnscache->entries, key.data, key.len);
  295|      0|    }
  296|      0|  }
  297|       |
  298|       |  /* We need to cache address information and HTTPS-RR separately. */
  299|  3.04k|  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 (299:6): [True: 0, False: 3.04k]
  ------------------
  300|      0|    if((uint8_t)(dns->dns_queries & dns_queries) !=
  ------------------
  |  Branch (300:8): [True: 0, False: 0]
  ------------------
  301|      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)
  |  |  ------------------
  ------------------
  302|       |      /* The entry does not cover all wanted address queries, a miss. */
  303|      0|      dns = NULL;
  304|      0|    }
  305|      0|    else if(!(dns->dns_responses & dns_queries)) {
  ------------------
  |  Branch (305:13): [True: 0, False: 0]
  ------------------
  306|       |      /* The entry has no responses for the wanted DNS queries. */
  307|      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]
  |  |  ------------------
  ------------------
  308|      0|                   Curl_resolv_query_str(dns_queries));
  309|      0|      dns = NULL;
  310|      0|      result = CURLE_COULDNT_RESOLVE_HOST;
  311|      0|    }
  312|      0|    else if(dns && !dns->addr) { /* negative entry */
  ------------------
  |  Branch (312:13): [True: 0, False: 0]
  |  Branch (312:20): [True: 0, False: 0]
  ------------------
  313|      0|      dns = NULL;
  314|      0|      result = CURLE_COULDNT_RESOLVE_HOST;
  315|      0|    }
  316|      0|  }
  317|       |
  318|  3.04k|  *pdns = dns;
  319|  3.04k|  return result;
  320|  3.04k|}
dnscache.c:dnsc_peer2id:
   71|  6.08k|{
   72|  6.08k|  curlx_str_assign(&pid->name, peer->hostname, strlen(peer->hostname));
   73|  6.08k|  pid->port = peer->port;
   74|  6.08k|  pid->type = type;
   75|  6.08k|}
dnscache.c:dnsc_entry_create:
  455|  3.04k|{
  456|  3.04k|  struct Curl_dns_entry *dns = NULL;
  457|       |
  458|  3.04k|  if(curlx_strlen(&pid->name) > UINT16_MAX)
  ------------------
  |  |   50|  3.04k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (458:6): [True: 0, False: 3.04k]
  ------------------
  459|      0|    goto out;
  460|       |
  461|       |  /* Create a new cache entry, struct already has the hostname NUL */
  462|  3.04k|  dns = curlx_calloc(1, sizeof(struct Curl_dns_entry) +
  ------------------
  |  | 1425|  3.04k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  463|  3.04k|                     curlx_strlen(&pid->name));
  464|  3.04k|  if(!dns)
  ------------------
  |  Branch (464:6): [True: 0, False: 3.04k]
  ------------------
  465|      0|    goto out;
  466|       |
  467|  3.04k|  dns->refcount = 1; /* the cache has the first reference */
  468|  3.04k|  dns->port = pid->port;
  469|  3.04k|  dns->hostlen = (uint16_t)curlx_strlen(&pid->name);
  ------------------
  |  |   50|  3.04k|#define curlx_strlen(x) ((x)->len)
  ------------------
  470|  3.04k|  if(dns->hostlen)
  ------------------
  |  Branch (470:6): [True: 3.04k, False: 0]
  ------------------
  471|  3.04k|    memcpy(dns->hostname, curlx_str(&pid->name), dns->hostlen);
  ------------------
  |  |   49|  3.04k|#define curlx_str(x)    ((x)->str)
  ------------------
  472|  3.04k|  dns->permanent = permanent;
  473|       |
  474|  3.04k|out:
  475|  3.04k|  return dns;
  476|  3.04k|}
dnscache.c:dnsc_entry_assign_addr:
  484|  3.04k|{
  485|  3.04k|  if(!dns)
  ------------------
  |  Branch (485:6): [True: 0, False: 3.04k]
  ------------------
  486|      0|    goto out;
  487|       |  /* only do this when this is the only reference */
  488|  3.04k|  DEBUGASSERT(dns->refcount == 1);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (488:3): [True: 0, False: 3.04k]
  |  Branch (488:3): [True: 3.04k, False: 0]
  ------------------
  489|  3.04k|  DEBUGASSERT(dns->type == CURL_DNST_INIT);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (489:3): [True: 0, False: 3.04k]
  |  Branch (489:3): [True: 3.04k, False: 0]
  ------------------
  490|       |
  491|  3.04k|  dns->type = CURL_DNST_ADDR;
  ------------------
  |  |   41|  3.04k|#define CURL_DNST_ADDR      'A'
  ------------------
  492|       |  /* queries should only be about addresses */
  493|  3.04k|  DEBUGASSERT(!(dns_queries & ~CURL_DNSQ_ADDR));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (493:3): [True: 0, False: 3.04k]
  |  Branch (493:3): [True: 3.04k, False: 0]
  ------------------
  494|  3.04k|  dns->dns_queries = (dns_queries & CURL_DNSQ_ADDR);
  ------------------
  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  495|       |
  496|       |  /* Take the given address lists into the entry */
  497|  3.04k|  if(paddr1 && *paddr1) {
  ------------------
  |  Branch (497:6): [True: 3.04k, False: 0]
  |  Branch (497:16): [True: 3.04k, False: 0]
  ------------------
  498|  3.04k|    dns->addr = *paddr1;
  499|  3.04k|    *paddr1 = NULL;
  500|  3.04k|  }
  501|  3.04k|  if(paddr2 && *paddr2) {
  ------------------
  |  Branch (501:6): [True: 0, False: 3.04k]
  |  Branch (501:16): [True: 0, False: 0]
  ------------------
  502|      0|    struct Curl_addrinfo **phead = &dns->addr;
  503|      0|    while(*phead)
  ------------------
  |  Branch (503:11): [True: 0, False: 0]
  ------------------
  504|      0|      phead = &(*phead)->ai_next;
  505|      0|    *phead = *paddr2;
  506|      0|    *paddr2 = NULL;
  507|      0|  }
  508|       |
  509|  3.04k|  if((dns_queries & CURL_DNSQ_A) &&
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (509:6): [True: 3.04k, False: 0]
  ------------------
  510|  3.04k|     dnscache_ai_has_family(dns->addr, PF_INET))
  ------------------
  |  Branch (510:6): [True: 3.04k, False: 0]
  ------------------
  511|  3.04k|    dns->dns_responses |= CURL_DNSQ_A;
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  512|       |
  513|  3.04k|#ifdef USE_IPV6
  514|  3.04k|  if((dns_queries & CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (514:6): [True: 3.04k, False: 0]
  ------------------
  515|  3.04k|     dnscache_ai_has_family(dns->addr, PF_INET6))
  ------------------
  |  Branch (515:6): [True: 0, False: 3.04k]
  ------------------
  516|      0|    dns->dns_responses |= CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  517|  3.04k|#endif /* USE_IPV6 */
  518|       |
  519|  3.04k|#ifndef CURL_DISABLE_SHUFFLE_DNS
  520|       |  /* shuffle addresses if requested */
  521|  3.04k|  if(data->set.dns_shuffle_addresses && dns->addr) {
  ------------------
  |  Branch (521:6): [True: 0, False: 3.04k]
  |  Branch (521:41): [True: 0, False: 0]
  ------------------
  522|      0|    CURLcode result = dns_shuffle_addr(data, &dns->addr);
  523|      0|    if(result) {
  ------------------
  |  Branch (523:8): [True: 0, False: 0]
  ------------------
  524|       |      /* free without lock, we are the sole owner */
  525|      0|      dnscache_entry_free(dns);
  526|      0|      dns = NULL;
  527|      0|      goto out;
  528|      0|    }
  529|      0|  }
  530|       |#else
  531|       |  (void)data;
  532|       |#endif
  533|       |
  534|  3.04k|out:
  535|  3.04k|  if(paddr1 && *paddr1) {
  ------------------
  |  Branch (535:6): [True: 3.04k, False: 0]
  |  Branch (535:16): [True: 0, False: 3.04k]
  ------------------
  536|      0|    Curl_freeaddrinfo(*paddr1);
  537|      0|    *paddr1 = NULL;
  538|      0|  }
  539|  3.04k|  if(paddr2 && *paddr2) {
  ------------------
  |  Branch (539:6): [True: 0, False: 3.04k]
  |  Branch (539:16): [True: 0, False: 0]
  ------------------
  540|      0|    Curl_freeaddrinfo(*paddr2);
  541|       |    *paddr2 = NULL;
  542|      0|  }
  543|  3.04k|  return dns;
  544|  3.04k|}
dnscache.c:dnscache_ai_has_family:
  445|  6.08k|{
  446|  9.12k|  for(; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (446:9): [True: 6.08k, False: 3.04k]
  ------------------
  447|  6.08k|    if(ai->ai_family == ai_family)
  ------------------
  |  Branch (447:8): [True: 3.04k, False: 3.04k]
  ------------------
  448|  3.04k|      return TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  449|  6.08k|  }
  450|  3.04k|  return FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  451|  6.08k|}
dnscache.c:dnsc_str2id:
   79|  3.04k|{
   80|  3.04k|  pid->name = *name;
   81|  3.04k|  pid->port = port;
   82|  3.04k|  pid->type = type;
   83|  3.04k|}
dnscache.c:dnsc_id2key:
   95|  6.08k|{
   96|  6.08k|  size_t namelen = curlx_strlen(&id->name);
  ------------------
  |  |   50|  6.08k|#define curlx_strlen(x) ((x)->len)
  ------------------
   97|  6.08k|  if(namelen > (sizeof(key->data) - 3))
  ------------------
  |  Branch (97:6): [True: 0, False: 6.08k]
  ------------------
   98|      0|    namelen = sizeof(key->data) - 3;
   99|       |  /* store and lower case the name */
  100|  6.08k|  key->data[0] = id->type;
  101|  6.08k|  key->data[1] = (uint8_t)((id->port >> 8) & 0xff);
  102|  6.08k|  key->data[2] = (uint8_t)(id->port & 0xff);
  103|  6.08k|  Curl_strntolower((char *)key->data + 3, curlx_str(&id->name), namelen);
  ------------------
  |  |   49|  6.08k|#define curlx_str(x)    ((x)->str)
  ------------------
  104|  6.08k|  key->len = namelen + 3;
  105|  6.08k|}
dnscache.c:dnsc_add_entry:
  579|  3.04k|{
  580|  3.04k|  entry->added = *Curl_pgrs_now(data);
  581|  3.04k|  return Curl_hash_add(&dnscache->entries, key->data, key->len, entry);
  582|  3.04k|}
dnscache.c:dnscache_entry_free:
  108|  3.04k|{
  109|  3.04k|  Curl_freeaddrinfo(dns->addr);
  110|  3.04k|#ifdef USE_HTTPSRR
  111|  3.04k|  Curl_httpsrr_destroy(dns->hinfo);
  112|  3.04k|#endif
  113|  3.04k|  curlx_free(dns);
  ------------------
  |  | 1428|  3.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  114|  3.04k|}
dnscache.c:dnscache_entry_dtor:
  813|  3.04k|{
  814|  3.04k|  struct Curl_dns_entry *dns = (struct Curl_dns_entry *)entry;
  815|  3.04k|  DEBUGASSERT(dns && (dns->refcount > 0));
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (815:3): [True: 0, False: 3.04k]
  |  Branch (815:3): [True: 0, False: 0]
  |  Branch (815:3): [True: 3.04k, False: 0]
  |  Branch (815:3): [True: 3.04k, False: 0]
  ------------------
  816|  3.04k|  dns->refcount--;
  817|  3.04k|  if(dns->refcount == 0)
  ------------------
  |  Branch (817:6): [True: 3.04k, False: 0]
  ------------------
  818|  3.04k|    dnscache_entry_free(dns);
  819|  3.04k|}

Curl_resolv_dns_queries:
  126|  3.04k|{
  127|  3.04k|  (void)data;
  128|  3.04k|  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: 3.04k]
  ------------------
  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: 3.04k]
  ------------------
  132|      0|    return CURL_DNSQ_A;
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  133|  3.04k|  default:
  ------------------
  |  Branch (133:3): [True: 3.04k, False: 0]
  ------------------
  134|  3.04k|    if(ipv6works(data))
  ------------------
  |  Branch (134:8): [True: 3.04k, False: 0]
  ------------------
  135|  3.04k|      return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                    return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  136|      0|    else
  137|      0|      return CURL_DNSQ_A;
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  138|  3.04k|  }
  139|  3.04k|}
Curl_probeipv6:
  290|  3.74k|{
  291|       |  /* probe to see if we have a working IPv6 stack */
  292|  3.74k|  curl_socket_t s = CURL_SOCKET(PF_INET6, SOCK_DGRAM, 0);
  ------------------
  |  | 1381|  3.74k|  curl_dbg_socket((int)(domain), type, protocol, __LINE__, __FILE__)
  ------------------
  293|  3.74k|  multi->ipv6_works = FALSE;
  ------------------
  |  | 1000|  3.74k|#define FALSE false
  ------------------
  294|  3.74k|  if(s == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.74k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (294:6): [True: 0, False: 3.74k]
  ------------------
  295|      0|    if(SOCKERRNO == SOCKENOMEM)
  ------------------
  |  | 1041|      0|#define SOCKERRNO         errno
  ------------------
                  if(SOCKERRNO == SOCKENOMEM)
  ------------------
  |  | 1079|      0|#define SOCKENOMEM        ENOMEM
  ------------------
  |  Branch (295:8): [True: 0, False: 0]
  ------------------
  296|      0|      return CURLE_OUT_OF_MEMORY;
  297|      0|  }
  298|  3.74k|  else {
  299|  3.74k|    multi->ipv6_works = TRUE;
  ------------------
  |  |  997|  3.74k|#define TRUE true
  ------------------
  300|  3.74k|    sclose(s);
  ------------------
  |  | 1373|  3.74k|#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
  ------------------
  301|  3.74k|  }
  302|  3.74k|  return CURLE_OK;
  303|  3.74k|}
Curl_host_is_ipnum:
  321|  3.04k|{
  322|  3.04k|  struct in_addr in;
  323|  3.04k|#ifdef USE_IPV6
  324|  3.04k|  struct in6_addr in6;
  325|  3.04k|#endif
  326|  3.04k|  if(curlx_inet_pton(AF_INET, hostname, &in) > 0
  ------------------
  |  Branch (326:6): [True: 3.04k, False: 0]
  ------------------
  327|      0|#ifdef USE_IPV6
  328|      0|     || curlx_inet_pton(AF_INET6, hostname, &in6) > 0
  ------------------
  |  Branch (328:9): [True: 0, False: 0]
  ------------------
  329|  3.04k|#endif
  330|  3.04k|    )
  331|  3.04k|    return TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  332|      0|  return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  333|  3.04k|}
Curl_resolv_announce_start:
  364|  3.04k|{
  365|  3.04k|  if(data->set.resolver_start) {
  ------------------
  |  Branch (365:6): [True: 0, False: 3.04k]
  ------------------
  366|      0|    struct Curl_mapi_guard guard;
  367|      0|    int rc;
  368|       |
  369|      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]
  |  |  ------------------
  ------------------
  370|      0|    CURL_CBAPI_START(&guard, data, easy_resolver_start);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter((g), (d), NULL, CURL_CBAPI_FN_##fn)
  ------------------
  371|      0|    rc = data->set.resolver_start(resolver, NULL,
  372|      0|                                  data->set.resolver_start_client);
  373|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  374|      0|    if(rc) {
  ------------------
  |  Branch (374:8): [True: 0, False: 0]
  ------------------
  375|      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]
  |  |  ------------------
  ------------------
  376|      0|      return CURLE_ABORTED_BY_CALLBACK;
  377|      0|    }
  378|      0|  }
  379|  3.04k|  return CURLE_OK;
  380|  3.04k|}
Curl_resolv:
 1032|  3.04k|{
 1033|  3.04k|  *presolv_id = 0;
 1034|  3.04k|  *pdns = NULL;
 1035|       |
 1036|  3.04k|  if(timeout_ms < 0)
  ------------------
  |  Branch (1036:6): [True: 0, False: 3.04k]
  ------------------
 1037|       |    /* got an already expired timeout */
 1038|      0|    return CURLE_OPERATION_TIMEDOUT;
 1039|  3.04k|  else if(!timeout_ms)
  ------------------
  |  Branch (1039:11): [True: 0, False: 3.04k]
  ------------------
 1040|      0|    timeout_ms = CURL_TIMEOUT_RESOLVE_MS;
  ------------------
  |  |   38|      0|#define CURL_TIMEOUT_RESOLVE_MS (300 * 1000)
  ------------------
 1041|       |
 1042|  3.04k|#ifdef USE_UNIX_SOCKETS
 1043|  3.04k|  if((dns_queries & CURL_DNSQ_ADDR) && peer->unix_socket)
  ------------------
  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  |  Branch (1043:6): [True: 3.04k, False: 0]
  |  Branch (1043:40): [True: 0, False: 3.04k]
  ------------------
 1044|      0|    return resolv_unix(data, peer, pdns);
 1045|       |#else
 1046|       |  if(peer->unix_socket)
 1047|       |    return hostip_resolv_failed(data, peer, for_proxy);
 1048|       |#endif
 1049|       |
 1050|       |#ifdef USE_ALARM_TIMEOUT
 1051|       |  if(dns_queries & CURL_DNSQ_ADDR) {
 1052|       |    if(timeout_ms && data->set.no_signal) {
 1053|       |      /* Cannot use ALARM when signals are disabled */
 1054|       |      timeout_ms = 0;
 1055|       |    }
 1056|       |    if(timeout_ms && !Curl_doh_wanted(data)) {
 1057|       |      return resolv_alarm_timeout(data, dns_queries, peer, transport,
 1058|       |                                  for_proxy, timeout_ms, presolv_id, pdns);
 1059|       |    }
 1060|       |  }
 1061|       |#endif /* !USE_ALARM_TIMEOUT */
 1062|       |
 1063|       |#ifndef CURLRES_ASYNCH
 1064|       |  if(timeout_ms)
 1065|       |    infof(data, "timeout on name lookup is not supported");
 1066|       |#endif
 1067|       |
 1068|  3.04k|  return hostip_resolv(data, dns_queries, peer, transport,
 1069|       |                       for_proxy, timeout_ms, TRUE, presolv_id, pdns);
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
 1070|  3.04k|}
Curl_resolv_destroy:
 1153|  3.04k|{
 1154|  3.04k|  struct Curl_resolv_async **panchor = &data->state.async;
 1155|       |
 1156|  3.04k|  for(; *panchor; panchor = &(*panchor)->next) {
  ------------------
  |  Branch (1156:9): [True: 0, False: 3.04k]
  ------------------
 1157|      0|    struct Curl_resolv_async *async = *panchor;
 1158|      0|    if(async->id == resolv_id) {
  ------------------
  |  Branch (1158:8): [True: 0, False: 0]
  ------------------
 1159|      0|      *panchor = async->next;
 1160|      0|      Curl_async_destroy(data, async);
 1161|      0|      break;
 1162|      0|    }
 1163|      0|  }
 1164|  3.04k|}
Curl_resolv_shutdown_all:
 1167|  3.04k|{
 1168|  3.04k|  struct Curl_resolv_async *async = data->state.async;
 1169|  3.04k|  for(; async; async = async->next) {
  ------------------
  |  Branch (1169:9): [True: 0, False: 3.04k]
  ------------------
 1170|      0|    Curl_async_shutdown(data, async);
 1171|      0|  }
 1172|  3.04k|}
Curl_resolv_destroy_all:
 1175|  11.2k|{
 1176|  11.2k|  while(data->state.async) {
  ------------------
  |  Branch (1176:9): [True: 0, False: 11.2k]
  ------------------
 1177|      0|    struct Curl_resolv_async *async = data->state.async;
 1178|      0|    data->state.async = async->next;
 1179|      0|    Curl_async_destroy(data, async);
 1180|      0|  }
 1181|  11.2k|}
hostip.c:ipv6works:
  309|  3.04k|{
  310|  3.04k|  DEBUGASSERT(data);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (310:3): [True: 0, False: 3.04k]
  |  Branch (310:3): [True: 3.04k, False: 0]
  ------------------
  311|  3.04k|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (311:3): [True: 0, False: 3.04k]
  |  Branch (311:3): [True: 3.04k, False: 0]
  ------------------
  312|  3.04k|  return data ? data->multi->ipv6_works : FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  |  Branch (312:10): [True: 3.04k, False: 0]
  ------------------
  313|  3.04k|}
hostip.c:hostip_resolv:
  713|  3.04k|{
  714|  3.04k|  size_t hostname_len;
  715|  3.04k|  CURLcode result = RESOLV_FAIL(for_proxy);
  ------------------
  |  |   74|  3.04k|  ((for_proxy) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST)
  |  |  ------------------
  |  |  |  Branch (74:4): [True: 0, False: 3.04k]
  |  |  ------------------
  ------------------
  716|  3.04k|  bool cache_dns = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  717|  3.04k|  bool negative = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  718|       |
  719|  3.04k|  (void)timeout_ms; /* not used in all ifdefs */
  720|  3.04k|  *presolv_id = 0;
  721|  3.04k|  *pdns = NULL;
  722|       |
  723|       |#ifdef CURL_DISABLE_DOH
  724|       |  (void)allowDOH;
  725|       |#endif
  726|       |
  727|       |  /* We should intentionally error and not resolve .onion TLDs */
  728|  3.04k|  hostname_len = strlen(peer->hostname);
  729|  3.04k|  DEBUGASSERT(hostname_len);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (729:3): [True: 0, False: 3.04k]
  |  Branch (729:3): [True: 3.04k, False: 0]
  ------------------
  730|  3.04k|  if(hostname_len >= 7 &&
  ------------------
  |  Branch (730:6): [True: 3.04k, False: 0]
  ------------------
  731|  3.04k|     (curl_strequal(&peer->hostname[hostname_len - 6], ".onion") ||
  ------------------
  |  Branch (731:7): [True: 0, False: 3.04k]
  ------------------
  732|  3.04k|      curl_strequal(&peer->hostname[hostname_len - 7], ".onion."))) {
  ------------------
  |  Branch (732:7): [True: 0, False: 3.04k]
  ------------------
  733|      0|    failf(data, "Not resolving .onion address (RFC 7686)");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  734|      0|    goto out;
  735|      0|  }
  736|       |
  737|  3.04k|#ifdef DEBUGBUILD
  738|  3.04k|  CURL_TRC_DNS(data, "[%s] hostip_resolv(%s:%u)",
  ------------------
  |  |  168|  3.04k|  do {                                 \
  |  |  169|  3.04k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.04k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  739|  3.04k|               Curl_resolv_query_str(dns_queries), peer->hostname, peer->port);
  740|  3.04k|  if((CURL_DNSQ_IS_ADDR(dns_queries) == CURL_DNSQ_AAAA) &&
  ------------------
  |  |   56|  3.04k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  3.04k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                if((CURL_DNSQ_IS_ADDR(dns_queries) == CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (740:6): [True: 0, False: 3.04k]
  ------------------
  741|      0|     getenv("CURL_DBG_RESOLV_FAIL_IPV6")) {
  ------------------
  |  Branch (741:6): [True: 0, False: 0]
  ------------------
  742|      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]
  |  |  ------------------
  ------------------
  743|      0|    result = hostip_resolv_failed(data, peer, for_proxy);
  744|      0|    goto out;
  745|      0|  }
  746|  3.04k|#endif
  747|       |  /* Let's check our DNS cache first */
  748|  3.04k|  result = Curl_dnscache_get(data, dns_queries, peer, pdns);
  749|  3.04k|  if(*pdns) {
  ------------------
  |  Branch (749:6): [True: 0, False: 3.04k]
  ------------------
  750|      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]
  |  |  ------------------
  ------------------
  751|      0|    result = CURLE_OK;
  752|      0|  }
  753|  3.04k|  else if(result) {
  ------------------
  |  Branch (753:11): [True: 0, False: 3.04k]
  ------------------
  754|      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]
  |  |  ------------------
  ------------------
  755|      0|    result = hostip_resolv_failed(data, peer, for_proxy);
  756|      0|  }
  757|  3.04k|  else {
  758|       |    /* No luck, we need to start resolving. */
  759|  3.04k|    cache_dns = TRUE;
  ------------------
  |  |  997|  3.04k|#define TRUE true
  ------------------
  760|  3.04k|    result = hostip_resolv_start(data, dns_queries, peer, transport,
  761|  3.04k|                                 for_proxy, timeout_ms, allowDOH,
  762|  3.04k|                                 presolv_id, pdns, &negative);
  763|  3.04k|    CURL_TRC_DNS(data, "[%s] hostip_resolv started -> %d",
  ------------------
  |  |  168|  3.04k|  do {                                 \
  |  |  169|  3.04k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  3.04k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  3.04k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  6.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  6.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.04k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.04k|    ((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.04k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.04k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 3.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  3.04k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  3.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
  764|  3.04k|                 Curl_resolv_query_str(dns_queries), (int)result);
  765|  3.04k|  }
  766|       |
  767|  3.04k|out:
  768|  3.04k|  if(result && (result != CURLE_AGAIN)) {
  ------------------
  |  Branch (768:6): [True: 0, False: 3.04k]
  |  Branch (768:16): [True: 0, False: 0]
  ------------------
  769|      0|    Curl_dns_entry_unlink(data, pdns);
  770|      0|    if(IS_RESOLV_FAIL(result)) {
  ------------------
  |  |   77|      0|  (((result) == CURLE_COULDNT_RESOLVE_HOST) || \
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|   ((result) == CURLE_COULDNT_RESOLVE_PROXY))
  |  |  ------------------
  |  |  |  Branch (78:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  771|      0|      if(cache_dns && negative)
  ------------------
  |  Branch (771:10): [True: 0, False: 0]
  |  Branch (771:23): [True: 0, False: 0]
  ------------------
  772|      0|        Curl_dnscache_add_negative(data, dns_queries, peer);
  773|      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 (773:10): [True: 0, False: 0]
  ------------------
  774|      0|        failf(data, "Could not resolve: %s:%u", peer->hostname, peer->port);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  775|      0|    }
  776|      0|    else {
  777|      0|      failf(data, "Error %d resolving %s:%u",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  778|      0|            (int)result, peer->hostname, peer->port);
  779|      0|    }
  780|      0|  }
  781|  3.04k|  else if(cache_dns && *pdns) {
  ------------------
  |  Branch (781:11): [True: 3.04k, False: 0]
  |  Branch (781:24): [True: 3.04k, False: 0]
  ------------------
  782|  3.04k|    result = Curl_dnscache_add(data, *pdns);
  783|  3.04k|    if(result)
  ------------------
  |  Branch (783:8): [True: 0, False: 3.04k]
  ------------------
  784|      0|      Curl_dns_entry_unlink(data, pdns);
  785|  3.04k|  }
  786|       |
  787|  3.04k|  return result;
  788|  3.04k|}
hostip.c:hostip_resolv_start:
  568|  3.04k|{
  569|  3.04k|#ifdef USE_CURL_ASYNC
  570|  3.04k|  struct Curl_resolv_async *async = NULL;
  571|  3.04k|#endif
  572|  3.04k|  struct Curl_addrinfo *addr = NULL;
  573|  3.04k|  size_t hostname_len;
  574|  3.04k|  bool addr_queries = (dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   51|  3.04k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                bool addr_queries = (dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   52|  3.04k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  575|  3.04k|  CURLcode result = CURLE_OK;
  576|       |
  577|  3.04k|  *pnegative = FALSE;
  ------------------
  |  | 1000|  3.04k|#define FALSE false
  ------------------
  578|       |
  579|  3.04k|  (void)timeout_ms; /* not in all ifdefs */
  580|  3.04k|  *presolv_id = 0;
  581|  3.04k|  *pdns = NULL;
  582|       |
  583|       |  /* Check for "known" things to resolve ourselves. */
  584|  3.04k|  if(addr_queries) {
  ------------------
  |  Branch (584:6): [True: 3.04k, False: 0]
  ------------------
  585|  3.04k|#ifndef USE_RESOLVE_ON_IPS
  586|  3.04k|    if(Curl_is_ipaddr(peer->hostname)) {
  ------------------
  |  Branch (586:8): [True: 3.04k, False: 0]
  ------------------
  587|       |      /* test655 verifies that the announce is done, even though there
  588|       |       * is no real resolving. So, keep doing this. */
  589|  3.04k|      result = Curl_resolv_announce_start(data, NULL);
  590|  3.04k|      if(result)
  ------------------
  |  Branch (590:10): [True: 0, False: 3.04k]
  ------------------
  591|      0|        goto out;
  592|       |      /* shortcut literal IP addresses, if we are not told to resolve them. */
  593|  3.04k|      result = Curl_str2addr(peer->hostname, peer->port, &addr);
  594|  3.04k|      goto out;
  595|  3.04k|    }
  596|      0|#endif
  597|       |
  598|      0|    hostname_len = strlen(peer->hostname);
  599|      0|    if(curl_strequal(peer->hostname, "localhost") ||
  ------------------
  |  Branch (599:8): [True: 0, False: 0]
  ------------------
  600|      0|       curl_strequal(peer->hostname, "localhost.") ||
  ------------------
  |  Branch (600:8): [True: 0, False: 0]
  ------------------
  601|      0|       tailmatch(peer->hostname, hostname_len, STRCONST(".localhost")) ||
  ------------------
  |  | 1249|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1244|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (601:8): [True: 0, False: 0]
  ------------------
  602|      0|       tailmatch(peer->hostname, hostname_len, STRCONST(".localhost."))) {
  ------------------
  |  | 1249|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1244|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (602:8): [True: 0, False: 0]
  ------------------
  603|      0|      result = Curl_resolv_announce_start(data, NULL);
  604|      0|      if(result)
  ------------------
  |  Branch (604:10): [True: 0, False: 0]
  ------------------
  605|      0|        goto out;
  606|      0|      addr = get_localhost(peer->port, peer->hostname);
  607|      0|      if(!addr)
  ------------------
  |  Branch (607:10): [True: 0, False: 0]
  ------------------
  608|      0|        result = CURLE_OUT_OF_MEMORY;
  609|      0|      goto out;
  610|      0|    }
  611|      0|  }
  612|      0|#ifndef CURL_DISABLE_DOH
  613|      0|  if(!Curl_is_ipaddr(peer->hostname) && allowDOH && data->set.doh) {
  ------------------
  |  Branch (613:6): [True: 0, False: 0]
  |  Branch (613:41): [True: 0, False: 0]
  |  Branch (613:53): [True: 0, False: 0]
  ------------------
  614|      0|    result = Curl_resolv_announce_start(data, NULL);
  615|      0|    if(result)
  ------------------
  |  Branch (615:8): [True: 0, False: 0]
  ------------------
  616|      0|      goto out;
  617|      0|    if(!async) {
  ------------------
  |  Branch (617:8): [True: 0, False: 0]
  ------------------
  618|      0|      async = hostip_async_new(data, dns_queries, peer, transport,
  619|      0|                               for_proxy, timeout_ms);
  620|      0|      if(!async) {
  ------------------
  |  Branch (620:10): [True: 0, False: 0]
  ------------------
  621|      0|        result = CURLE_OUT_OF_MEMORY;
  622|      0|        goto out;
  623|      0|      }
  624|      0|    }
  625|      0|    result = Curl_doh(data, async);
  626|      0|    goto out;
  627|      0|  }
  628|       |#else
  629|       |  (void)allowDOH;
  630|       |#endif
  631|       |
  632|       |  /* Can we provide the requested IP specifics in resolving? */
  633|      0|  if(!can_resolve_dns_queries(data, dns_queries)) {
  ------------------
  |  Branch (633:6): [True: 0, False: 0]
  ------------------
  634|      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]
  |  |  ------------------
  ------------------
  635|      0|    goto out;
  636|      0|  }
  637|       |
  638|      0|#ifdef CURLRES_ASYNCH
  639|      0|  (void)addr;
  640|      0|  if(!async) {
  ------------------
  |  Branch (640:6): [True: 0, False: 0]
  ------------------
  641|      0|    async = hostip_async_new(data, dns_queries, peer, transport,
  642|      0|                             for_proxy, timeout_ms);
  643|      0|    if(!async) {
  ------------------
  |  Branch (643:8): [True: 0, False: 0]
  ------------------
  644|      0|      result = CURLE_OUT_OF_MEMORY;
  645|      0|      goto out;
  646|      0|    }
  647|      0|  }
  648|      0|  result = Curl_async_getaddrinfo(data, async);
  649|      0|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (649:6): [True: 0, False: 0]
  ------------------
  650|       |    /* the answer might be there already. Check. */
  651|      0|    CURLcode r2 = hostip_resolv_take_result(data, async, pdns);
  652|      0|    if(r2)
  ------------------
  |  Branch (652:8): [True: 0, False: 0]
  ------------------
  653|      0|      result = r2;
  654|      0|    else if(*pdns)
  ------------------
  |  Branch (654:13): [True: 0, False: 0]
  ------------------
  655|      0|      result = CURLE_OK;
  656|      0|  }
  657|       |#else
  658|       |  result = Curl_resolv_announce_start(data, NULL);
  659|       |  if(result)
  660|       |    goto out;
  661|       |  addr = Curl_sync_getaddrinfo(data, dns_queries, peer->hostname, peer->port,
  662|       |                               transport);
  663|       |  if(!addr) {
  664|       |    result = RESOLV_FAIL(for_proxy);
  665|       |    /* the synchronous resolvers do not tell a transient failure from
  666|       |       an authoritative negative answer, treat it as before */
  667|       |    *pnegative = TRUE;
  668|       |  }
  669|       |#endif
  670|       |
  671|  3.04k|out:
  672|  3.04k|  if(!result) {
  ------------------
  |  Branch (672:6): [True: 3.04k, False: 0]
  ------------------
  673|  3.04k|    if(addr) {
  ------------------
  |  Branch (673:8): [True: 3.04k, False: 0]
  ------------------
  674|       |      /* we got a response, create a dns entry, add to cache, return */
  675|  3.04k|      DEBUGASSERT(!*pdns);
  ------------------
  |  | 1027|  3.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (675:7): [True: 0, False: 3.04k]
  |  Branch (675:7): [True: 3.04k, False: 0]
  ------------------
  676|  3.04k|      *pdns = Curl_dnsc_mk_addr(data, dns_queries, &addr, peer);
  677|  3.04k|      if(!*pdns)
  ------------------
  |  Branch (677:10): [True: 0, False: 3.04k]
  ------------------
  678|      0|        result = CURLE_OUT_OF_MEMORY;
  679|  3.04k|    }
  680|      0|    else if(!*pdns)
  ------------------
  |  Branch (680:13): [True: 0, False: 0]
  ------------------
  681|      0|      result = CURLE_AGAIN;
  682|  3.04k|  }
  683|      0|  else if(*pdns)
  ------------------
  |  Branch (683:11): [True: 0, False: 0]
  ------------------
  684|      0|    Curl_dns_entry_unlink(data, pdns);
  685|      0|  else if(addr)
  ------------------
  |  Branch (685:11): [True: 0, False: 0]
  ------------------
  686|      0|    Curl_freeaddrinfo(addr);
  687|       |
  688|  3.04k|#ifdef USE_CURL_ASYNC
  689|  3.04k|  if(async) {
  ------------------
  |  Branch (689:6): [True: 0, False: 3.04k]
  ------------------
  690|      0|    if(result == CURLE_AGAIN) { /* still need it, link, return id. */
  ------------------
  |  Branch (690:8): [True: 0, False: 0]
  ------------------
  691|      0|      *presolv_id = async->id;
  692|      0|      async->next = data->state.async;
  693|      0|      data->state.async = async;
  694|      0|    }
  695|      0|    else {
  696|      0|      *pnegative = !!async->negative_answer;
  697|      0|      Curl_async_destroy(data, async);
  698|      0|    }
  699|      0|  }
  700|  3.04k|#endif
  701|  3.04k|  return result;
  702|  3.04k|}

Curl_httpsrr_destroy:
  229|  3.04k|{
  230|  3.04k|  if(rrinfo) {
  ------------------
  |  Branch (230:6): [True: 0, False: 3.04k]
  ------------------
  231|      0|    curlx_free(rrinfo->target);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  232|      0|    curlx_free(rrinfo->echconfiglist);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  233|      0|    curlx_free(rrinfo->ipv4hints);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  234|      0|    curlx_free(rrinfo->ipv6hints);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  235|      0|    curlx_free(rrinfo);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  236|      0|  }
  237|  3.04k|}

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);
  ------------------
  |  |   76|      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);
  ------------------
  |  |   81|      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|}

openssl.c:ossl_provider_cleanup:
 1728|  7.48k|{
 1729|  7.48k|  if(data->state.baseprov) {
  ------------------
  |  Branch (1729:6): [True: 0, False: 7.48k]
  ------------------
 1730|      0|    OSSL_PROVIDER_unload(data->state.baseprov);
 1731|      0|    data->state.baseprov = NULL;
 1732|      0|  }
 1733|  7.48k|  if(data->state.provider) {
  ------------------
  |  Branch (1733:6): [True: 0, False: 7.48k]
  ------------------
 1734|      0|    OSSL_PROVIDER_unload(data->state.provider);
 1735|      0|    data->state.provider = NULL;
 1736|      0|  }
 1737|  7.48k|  OSSL_LIB_CTX_free(data->state.libctx);
 1738|  7.48k|  data->state.libctx = NULL;
 1739|  7.48k|  curlx_safefree(data->state.propq);
  ------------------
  |  | 1284|  7.48k|  do {                      \
  |  | 1285|  7.48k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  7.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  7.48k|    (ptr) = NULL;           \
  |  | 1287|  7.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
 1740|       |  data->state.provider_loaded = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
 1741|  7.48k|}
openssl.c:ossl_init:
 1612|      2|{
 1613|      2|  const uint64_t flags =
 1614|      2|#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
 1615|       |    /* not present in BoringSSL */
 1616|      2|    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
 1617|      2|#endif
 1618|       |#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1619|       |    OPENSSL_INIT_NO_LOAD_CONFIG |
 1620|       |#else
 1621|      2|    OPENSSL_INIT_LOAD_CONFIG |
 1622|      2|#endif
 1623|      2|    0;
 1624|      2|  OPENSSL_init_ssl(flags, NULL);
 1625|       |
 1626|      2|#ifndef HAVE_KEYLOG_UPSTREAM
 1627|      2|  Curl_tls_keylog_open();
 1628|      2|#endif
 1629|       |
 1630|      2|  return 1;
 1631|      2|}
openssl.c:ossl_close_all:
 1975|  7.48k|{
 1976|       |#ifdef USE_OPENSSL_ENGINE
 1977|       |  if(data->state.engine) {
 1978|       |    ENGINE_finish(data->state.engine);
 1979|       |    ENGINE_free(data->state.engine);
 1980|       |    data->state.engine = NULL;
 1981|       |  }
 1982|       |#else
 1983|  7.48k|  (void)data;
 1984|  7.48k|#endif
 1985|  7.48k|#ifdef OPENSSL_HAS_PROVIDERS
 1986|  7.48k|  ossl_provider_cleanup(data);
 1987|  7.48k|#endif
 1988|  7.48k|}

Curl_ssl_backend:
  131|  6.08k|{
  132|  6.08k|#ifdef USE_SSL
  133|  6.08k|  multissl_setup(NULL);
  134|  6.08k|  return Curl_ssl->info.id;
  135|       |#else
  136|       |  return CURLSSLBACKEND_NONE;
  137|       |#endif
  138|  6.08k|}
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 */
  ------------------
  |  |  997|      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|  7.48k|{
  229|  7.48k|  if(Curl_ssl->close_all)
  ------------------
  |  Branch (229:6): [True: 7.48k, False: 0]
  ------------------
  230|  7.48k|    Curl_ssl->close_all(data);
  231|  7.48k|}
Curl_ssl_free_certinfo:
  297|  18.7k|{
  298|  18.7k|  struct curl_certinfo *ci = &data->info.certs;
  299|       |
  300|  18.7k|  if(ci->num_of_certs) {
  ------------------
  |  Branch (300:6): [True: 0, False: 18.7k]
  ------------------
  301|       |    /* free all individual lists used */
  302|      0|    int i;
  303|      0|    for(i = 0; i < ci->num_of_certs; i++) {
  ------------------
  |  Branch (303:16): [True: 0, False: 0]
  ------------------
  304|      0|      curl_slist_free_all(ci->certinfo[i]);
  305|      0|      ci->certinfo[i] = NULL;
  306|      0|    }
  307|       |
  308|       |    curlx_safefree(ci->certinfo); /* free the actual array too */
  ------------------
  |  | 1284|      0|  do {                      \
  |  | 1285|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|      0|    (ptr) = NULL;           \
  |  | 1287|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  309|      0|    ci->num_of_certs = 0;
  310|      0|  }
  311|  18.7k|}
vtls.c:multissl_setup:
  780|  6.08k|{
  781|  6.08k|  int i;
  782|  6.08k|  char *env;
  783|       |
  784|  6.08k|  if(Curl_ssl != &Curl_ssl_multi)
  ------------------
  |  Branch (784:6): [True: 6.08k, False: 0]
  ------------------
  785|  6.08k|    return 1;
  786|       |
  787|      0|  if(backend) {
  ------------------
  |  Branch (787:6): [True: 0, False: 0]
  ------------------
  788|      0|    Curl_ssl = backend;
  789|      0|    return 0;
  790|      0|  }
  791|       |
  792|      0|  if(!available_backends[0])
  ------------------
  |  Branch (792:6): [True: 0, False: 0]
  ------------------
  793|      0|    return 1;
  794|       |
  795|      0|  env = curl_getenv("CURL_SSL_BACKEND");
  796|      0|  if(env) {
  ------------------
  |  Branch (796:6): [True: 0, False: 0]
  ------------------
  797|      0|    for(i = 0; available_backends[i]; i++) {
  ------------------
  |  Branch (797:16): [True: 0, False: 0]
  ------------------
  798|      0|      if(curl_strequal(env, available_backends[i]->info.name)) {
  ------------------
  |  Branch (798:10): [True: 0, False: 0]
  ------------------
  799|      0|        Curl_ssl = available_backends[i];
  800|      0|        curlx_free(env);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  801|      0|        return 0;
  802|      0|      }
  803|      0|    }
  804|      0|  }
  805|       |
  806|       |#ifdef CURL_DEFAULT_SSL_BACKEND
  807|       |  for(i = 0; available_backends[i]; i++) {
  808|       |    if(curl_strequal(CURL_DEFAULT_SSL_BACKEND,
  809|       |                     available_backends[i]->info.name)) {
  810|       |      Curl_ssl = available_backends[i];
  811|       |      curlx_free(env);
  812|       |      return 0;
  813|       |    }
  814|       |  }
  815|       |#endif
  816|       |
  817|       |  /* Fall back to first available backend */
  818|      0|  Curl_ssl = available_backends[0];
  819|      0|  curlx_free(env);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  820|      0|  return 0;
  821|      0|}

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

Curl_ssl_scache_create:
  627|  3.74k|{
  628|  3.74k|  struct Curl_ssl_scache *scache;
  629|  3.74k|  struct Curl_ssl_scache_peer *peers;
  630|  3.74k|  size_t i;
  631|       |
  632|  3.74k|  *pscache = NULL;
  633|  3.74k|  peers = curlx_calloc(max_peers, sizeof(*peers));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  634|  3.74k|  if(!peers)
  ------------------
  |  Branch (634:6): [True: 0, False: 3.74k]
  ------------------
  635|      0|    return CURLE_OUT_OF_MEMORY;
  636|       |
  637|  3.74k|  scache = curlx_calloc(1, sizeof(*scache));
  ------------------
  |  | 1425|  3.74k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  638|  3.74k|  if(!scache) {
  ------------------
  |  Branch (638:6): [True: 0, False: 3.74k]
  ------------------
  639|      0|    curlx_free(peers);
  ------------------
  |  | 1428|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  640|      0|    return CURLE_OUT_OF_MEMORY;
  641|      0|  }
  642|       |
  643|  3.74k|  scache->magic = CURL_SCACHE_MAGIC;
  ------------------
  |  |   62|  3.74k|#define CURL_SCACHE_MAGIC 0x000e1551
  ------------------
  644|  3.74k|  scache->default_lifetime_secs = (24 * 60 * 60); /* 1 day */
  645|  3.74k|  scache->peer_count = max_peers;
  646|  3.74k|  scache->peers = peers;
  647|  3.74k|  scache->age = 1;
  648|  97.2k|  for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (648:14): [True: 93.5k, False: 3.74k]
  ------------------
  649|  93.5k|    scache->peers[i].max_sessions = max_sessions_per_peer;
  650|  93.5k|    Curl_llist_init(&scache->peers[i].sessions,
  651|  93.5k|                    cf_ssl_scache_session_ldestroy);
  652|  93.5k|  }
  653|  3.74k|#ifdef USE_MUTEX
  654|       |  Curl_mutex_init(&scache->mutex);
  ------------------
  |  |   50|  3.74k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  655|  3.74k|#endif
  656|  3.74k|  *pscache = scache;
  657|  3.74k|  return CURLE_OK;
  658|  3.74k|}
Curl_ssl_scache_destroy:
  661|  3.74k|{
  662|  3.74k|  if(GOOD_SCACHE(scache)) {
  ------------------
  |  |   64|  3.74k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   62|  3.74k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (64:25): [True: 3.74k, False: 0]
  |  |  |  Branch (64:32): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
  663|  3.74k|    size_t i;
  664|  3.74k|    scache->magic = 0;
  665|  97.2k|    for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (665:16): [True: 93.5k, False: 3.74k]
  ------------------
  666|  93.5k|      cf_ssl_scache_clear_peer(&scache->peers[i]);
  667|  93.5k|    }
  668|  3.74k|    curlx_free(scache->peers);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  669|  3.74k|#ifdef USE_MUTEX
  670|  3.74k|    Curl_mutex_destroy(&scache->mutex);
  ------------------
  |  |   53|  3.74k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  671|  3.74k|#endif
  672|  3.74k|    curlx_free(scache);
  ------------------
  |  | 1428|  3.74k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  673|  3.74k|  }
  674|  3.74k|}
Curl_ssl_scache_is_locked_by_current_thread:
  728|  7.48k|{
  729|  7.48k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  730|  7.48k|  bool locked = FALSE;
  ------------------
  |  | 1000|  7.48k|#define FALSE false
  ------------------
  731|  7.48k|  if(!scache)
  ------------------
  |  Branch (731:6): [True: 0, False: 7.48k]
  ------------------
  732|      0|    return FALSE;
  ------------------
  |  | 1000|      0|#define FALSE false
  ------------------
  733|  7.48k|#ifdef USE_MUTEX
  734|  7.48k|  Curl_mutex_acquire(&scache->mutex);
  ------------------
  |  |   51|  7.48k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  735|  7.48k|  locked = scache->is_locked && Curl_thread_is_current(scache->locking_thread);
  ------------------
  |  Branch (735:12): [True: 0, False: 7.48k]
  |  Branch (735:33): [True: 0, False: 0]
  ------------------
  736|  7.48k|  Curl_mutex_release(&scache->mutex);
  ------------------
  |  |   52|  7.48k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  737|       |#else
  738|       |  locked = (bool)scache->is_locked;
  739|       |#endif
  740|  7.48k|  return locked;
  741|  7.48k|}
vtls_scache.c:cf_ssl_scache_clear_peer:
  504|  93.5k|{
  505|  93.5k|  Curl_llist_destroy(&peer->sessions, NULL);
  506|  93.5k|  if(peer->sobj) {
  ------------------
  |  Branch (506:6): [True: 0, False: 93.5k]
  ------------------
  507|      0|    DEBUGASSERT(peer->sobj_free);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (507:5): [True: 0, False: 0]
  |  Branch (507:5): [True: 0, False: 0]
  ------------------
  508|      0|    if(peer->sobj_free)
  ------------------
  |  Branch (508:8): [True: 0, False: 0]
  ------------------
  509|      0|      peer->sobj_free(peer->sobj);
  510|      0|    peer->sobj = NULL;
  511|      0|  }
  512|  93.5k|  peer->sobj_free = NULL;
  513|  93.5k|  curlx_safefree(peer->clientcert);
  ------------------
  |  | 1284|  93.5k|  do {                      \
  |  | 1285|  93.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  93.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  93.5k|    (ptr) = NULL;           \
  |  | 1287|  93.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 93.5k]
  |  |  ------------------
  ------------------
  514|  93.5k|  curlx_safefree(peer->key_passwd);
  ------------------
  |  | 1284|  93.5k|  do {                      \
  |  | 1285|  93.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  93.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  93.5k|    (ptr) = NULL;           \
  |  | 1287|  93.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 93.5k]
  |  |  ------------------
  ------------------
  515|  93.5k|  curlx_safefree(peer->ssl_peer_key);
  ------------------
  |  | 1284|  93.5k|  do {                      \
  |  | 1285|  93.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1428|  93.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1286|  93.5k|    (ptr) = NULL;           \
  |  | 1287|  93.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1287:11): [Folded, False: 93.5k]
  |  |  ------------------
  ------------------
  516|  93.5k|  peer->age = 0;
  517|       |  peer->hmac_set = FALSE;
  ------------------
  |  | 1000|  93.5k|#define FALSE false
  ------------------
  518|  93.5k|}
vtls_scache.c:cf_ssl_scache_get:
  368|  7.48k|{
  369|  7.48k|  struct Curl_ssl_scache *scache = NULL;
  370|       |  /* If a share is present, its ssl_scache has preference over the multi */
  371|  7.48k|  if(data->share && data->share->ssl_scache)
  ------------------
  |  Branch (371:6): [True: 0, False: 7.48k]
  |  Branch (371:21): [True: 0, False: 0]
  ------------------
  372|      0|    scache = data->share->ssl_scache;
  373|  7.48k|  else if(data->multi && data->multi->ssl_scache)
  ------------------
  |  Branch (373:11): [True: 7.48k, False: 0]
  |  Branch (373:26): [True: 7.48k, False: 0]
  ------------------
  374|  7.48k|    scache = data->multi->ssl_scache;
  375|  7.48k|  if(scache && !GOOD_SCACHE(scache)) {
  ------------------
  |  |   64|  7.48k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   62|  7.48k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (64:25): [True: 7.48k, False: 0]
  |  |  |  Branch (64:32): [True: 7.48k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (375:6): [True: 7.48k, False: 0]
  ------------------
  376|      0|    failf(data, "transfer would use an invalid scache at %p, denied",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  377|      0|          (void *)scache);
  378|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1027|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (378:5): [Folded, False: 0]
  |  Branch (378:5): [Folded, False: 0]
  ------------------
  379|      0|    return NULL;
  380|      0|  }
  381|  7.48k|  return scache;
  382|  7.48k|}

LLVMFuzzerTestOneInput:
   38|  4.54k|                                      std::size_t size) {
   39|  4.54k|  return proto_fuzzer::ProtoFuzzerTestOneInput(kProfile, data, size);
   40|  4.54k|}

_ZN12proto_fuzzer25BoundedAnonymousInputFileC2Em:
   21|  18.7k|    : max_bytes_(max_bytes), file_(nullptr), ready_(false) {}
_ZN12proto_fuzzer25BoundedAnonymousInputFileD2Ev:
   23|  18.7k|BoundedAnonymousInputFile::~BoundedAnonymousInputFile() {
   24|  18.7k|  if (file_ != nullptr) {
  ------------------
  |  Branch (24:7): [True: 0, False: 18.7k]
  ------------------
   25|      0|    std::fclose(file_);
   26|      0|  }
   27|  18.7k|}

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

_ZN12proto_fuzzer23ProtoFuzzerTestOneInputENS_13TargetProfileEPKhm:
   98|  4.54k|int ProtoFuzzerTestOneInput(TargetProfile profile, const std::uint8_t* data, std::size_t size) {
   99|  4.54k|  EnsureTargetPostProcessor(profile);
  100|  4.54k|  curl::fuzzer::proto::Scenario scenario;
  101|  4.54k|  if (protobuf_mutator::libfuzzer::LoadProtoInput(kUseBinaryFormat, data, size, &scenario)) {
  ------------------
  |  Branch (101:7): [True: 3.99k, False: 545]
  ------------------
  102|  3.99k|    proto_fuzzer::RunScenario(scenario, RunModeFor(profile));
  103|  3.99k|  }
  104|  4.54k|  return 0;
  105|  4.54k|}
fuzzer_main.cc:_ZN12_GLOBAL__N_119CurlGlobalBootstrapC2Ev:
   61|      2|  CurlGlobalBootstrap() {
   62|       |    // Open curl's TLS keylog at backend init. Curl_tls_keylog_open() runs once
   63|       |    // inside curl_global_init, so setting this after bootstrap would be too
   64|       |    // late. Keep the output in /dev/null and let a reproducer override it.
   65|      2|    (void)setenv("SSLKEYLOGFILE", "/dev/null", 0);
   66|       |
   67|       |    // Keep parity with the legacy harness. libcurl normally suppresses
   68|       |    // SIGPIPE for its own writes, but fuzzed connection lifecycles also race
   69|       |    // mock-peer teardown; those failures should be reported as socket errors,
   70|       |    // not mistaken for process crashes.
   71|      2|    std::signal(SIGPIPE, SIG_IGN);
   72|      2|    curl_global_init(CURL_GLOBAL_ALL);
  ------------------
  |  | 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)
  |  |  ------------------
  ------------------
   73|      2|  }
fuzzer_main.cc:_ZN12_GLOBAL__N_125EnsureTargetPostProcessorEN12proto_fuzzer13TargetProfileE:
   39|  4.54k|void EnsureTargetPostProcessor(proto_fuzzer::TargetProfile profile) {
   40|  4.54k|  if (profile == proto_fuzzer::TargetProfile::kCompatibility) {
  ------------------
  |  Branch (40:7): [True: 0, False: 4.54k]
  ------------------
   41|      0|    return;
   42|      0|  }
   43|       |
   44|  4.54k|  static const proto_fuzzer::TargetProfile registered_profile = profile;
   45|  4.54k|  static const protobuf_mutator::libfuzzer::PostProcessorRegistration<curl::fuzzer::proto::Scenario>
   46|  4.54k|      policy_registration([](curl::fuzzer::proto::Scenario* scenario, unsigned int /*seed*/) {
   47|  4.54k|        proto_fuzzer::ApplyTargetPolicy(scenario, registered_profile);
   48|  4.54k|        proto_fuzzer::CanonicalizeOptionValueCases(scenario);
   49|  4.54k|      });
   50|       |
   51|       |  // A second profile in one process would cause LPM's global registry to
   52|       |  // enforce the wrong lane. Real fuzz binaries cannot do this; keep the
   53|       |  // assertion to make misuse by future in-process callers immediately clear.
   54|  4.54k|  assert(profile == registered_profile);
  ------------------
  |  Branch (54:3): [True: 4.54k, False: 0]
  ------------------
   55|  4.54k|  (void)policy_registration;
   56|  4.54k|}
fuzzer_main.cc:_ZZN12_GLOBAL__N_125EnsureTargetPostProcessorEN12proto_fuzzer13TargetProfileEENK3$_0clEPN4curl6fuzzer5proto8ScenarioEj:
   46|  3.99k|      policy_registration([](curl::fuzzer::proto::Scenario* scenario, unsigned int /*seed*/) {
   47|  3.99k|        proto_fuzzer::ApplyTargetPolicy(scenario, registered_profile);
   48|  3.99k|        proto_fuzzer::CanonicalizeOptionValueCases(scenario);
   49|  3.99k|      });

_ZN12proto_fuzzer14MockConnectionC2Ev:
   57|  3.04k|MockConnection::MockConnection() : server_fd_(-1), client_fd_(-1), drain_limit_(0) {
   58|  3.04k|  int fds[2];
   59|       |
   60|  3.04k|  if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) != 0) {
  ------------------
  |  Branch (60:7): [True: 0, False: 3.04k]
  ------------------
   61|      0|    return;
   62|      0|  }
   63|       |
   64|       |  // The fds must be small enough to fit in an fd_set for select(). If not, close them and fail the constructor.
   65|  3.04k|  if (!FdFitsInFdSet(fds[0]) || !FdFitsInFdSet(fds[1])) {
  ------------------
  |  Branch (65:7): [True: 0, False: 3.04k]
  |  Branch (65:33): [True: 0, False: 3.04k]
  ------------------
   66|      0|    close(fds[0]);
   67|      0|    close(fds[1]);
   68|      0|    return;
   69|      0|  }
   70|       |
   71|       |  // Set the server-side fd non-blocking so we can write to it without risk of hanging the fuzzer.
   72|  3.04k|  int flags = fcntl(fds[0], F_GETFL, 0);
   73|  3.04k|  if (flags < 0 || fcntl(fds[0], F_SETFL, flags | O_NONBLOCK) < 0) {
  ------------------
  |  Branch (73:7): [True: 0, False: 3.04k]
  |  Branch (73:20): [True: 0, False: 3.04k]
  ------------------
   74|      0|    close(fds[0]);
   75|      0|    close(fds[1]);
   76|      0|    return;
   77|      0|  }
   78|       |
   79|       |  // Success: store the file descriptors.
   80|  3.04k|  server_fd_ = fds[0];
   81|  3.04k|  client_fd_ = fds[1];
   82|  3.04k|}
_ZN12proto_fuzzer14MockConnectionD2Ev:
   85|  3.04k|MockConnection::~MockConnection() {
   86|  3.04k|  if (server_fd_ >= 0) {
  ------------------
  |  Branch (86:7): [True: 3.04k, False: 0]
  ------------------
   87|  3.04k|    close(server_fd_);
   88|  3.04k|  }
   89|  3.04k|  if (client_fd_ >= 0) {
  ------------------
  |  Branch (89:7): [True: 0, False: 3.04k]
  ------------------
   90|      0|    close(client_fd_);
   91|      0|  }
   92|  3.04k|}
_ZNK12proto_fuzzer14MockConnection2okEv:
   95|  3.04k|bool MockConnection::ok() const { return server_fd_ >= 0; }
_ZNK12proto_fuzzer14MockConnection23client_send_buffer_sizeEv:
  103|  3.04k|std::size_t MockConnection::client_send_buffer_size() const {
  104|  3.04k|  if (client_fd_ < 0) {
  ------------------
  |  Branch (104:7): [True: 0, False: 3.04k]
  ------------------
  105|      0|    return 0;
  106|      0|  }
  107|  3.04k|  int size = 0;
  108|  3.04k|  socklen_t length = sizeof(size);
  109|  3.04k|  if (getsockopt(client_fd_, SOL_SOCKET, SO_SNDBUF, &size, &length) != 0 || size <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 3.04k]
  |  Branch (109:77): [True: 0, False: 3.04k]
  ------------------
  110|      0|    return 0;
  111|      0|  }
  112|  3.04k|  return static_cast<std::size_t>(size);
  113|  3.04k|}
_ZN12proto_fuzzer14MockConnection26EnsureClientSendBufferSizeEm:
  118|  3.04k|bool MockConnection::EnsureClientSendBufferSize(std::size_t minimum) {
  119|  3.04k|  if (client_send_buffer_size() >= minimum) {
  ------------------
  |  Branch (119:7): [True: 3.04k, False: 0]
  ------------------
  120|  3.04k|    return true;
  121|  3.04k|  }
  122|      0|  if (client_fd_ < 0 || minimum > static_cast<std::size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (122:7): [True: 0, False: 0]
  |  Branch (122:25): [True: 0, False: 0]
  ------------------
  123|      0|    return false;
  124|      0|  }
  125|      0|  const int requested = static_cast<int>(minimum);
  126|      0|  if (setsockopt(client_fd_, SOL_SOCKET, SO_SNDBUF, &requested, sizeof(requested)) != 0) {
  ------------------
  |  Branch (126:7): [True: 0, False: 0]
  ------------------
  127|      0|    return false;
  128|      0|  }
  129|      0|  return client_send_buffer_size() >= minimum;
  130|      0|}
_ZN12proto_fuzzer14MockConnection14take_client_fdEv:
  135|  3.04k|curl_socket_t MockConnection::take_client_fd() {
  136|  3.04k|  int fd = client_fd_;
  137|  3.04k|  client_fd_ = -1;
  138|  3.04k|  return static_cast<curl_socket_t>(fd);
  139|  3.04k|}
_ZN12proto_fuzzer14MockConnection8WriteAllEPKhm:
  149|  1.61k|bool MockConnection::WriteAll(const unsigned char* data, std::size_t size) {
  150|  1.61k|  if (server_fd_ < 0) {
  ------------------
  |  Branch (150:7): [True: 0, False: 1.61k]
  ------------------
  151|      0|    return false;
  152|      0|  }
  153|  1.61k|  std::size_t written = 0;
  154|  3.22k|  while (written < size) {
  ------------------
  |  Branch (154:10): [True: 1.61k, False: 1.61k]
  ------------------
  155|  1.61k|    ssize_t n = ::send(server_fd_, data + written, size - written, MSG_NOSIGNAL);
  156|  1.61k|    if (n <= 0) {
  ------------------
  |  Branch (156:9): [True: 0, False: 1.61k]
  ------------------
  157|      0|      return false;
  158|      0|    }
  159|  1.61k|    written += static_cast<std::size_t>(n);
  160|  1.61k|  }
  161|  1.61k|  return true;
  162|  1.61k|}
_ZN12proto_fuzzer14MockConnection13DrainIncomingEv:
  169|  4.24k|std::size_t MockConnection::DrainIncoming() {
  170|  4.24k|  if (server_fd_ < 0) {
  ------------------
  |  Branch (170:7): [True: 0, False: 4.24k]
  ------------------
  171|      0|    return 0;
  172|      0|  }
  173|  4.24k|  unsigned char scratch[4096];
  174|  4.24k|  std::size_t drained = 0;
  175|  4.91k|  while (drain_limit_ == 0 || drained < drain_limit_) {
  ------------------
  |  Branch (175:10): [True: 4.91k, False: 0]
  |  Branch (175:31): [True: 0, False: 0]
  ------------------
  176|  4.91k|    std::size_t want = sizeof(scratch);
  177|  4.91k|    if (drain_limit_ != 0) {
  ------------------
  |  Branch (177:9): [True: 0, False: 4.91k]
  ------------------
  178|      0|      const std::size_t remaining = drain_limit_ - drained;
  179|      0|      if (remaining < want) {
  ------------------
  |  Branch (179:11): [True: 0, False: 0]
  ------------------
  180|      0|        want = remaining;
  181|      0|      }
  182|      0|    }
  183|  4.91k|    ssize_t n = ::read(server_fd_, scratch, want);
  184|  4.91k|    if (n <= 0) {
  ------------------
  |  Branch (184:9): [True: 4.24k, False: 668]
  ------------------
  185|  4.24k|      break;
  186|  4.24k|    }
  187|    668|    drained += static_cast<std::size_t>(n);
  188|    668|  }
  189|  4.24k|  return drained;
  190|  4.24k|}
_ZN12proto_fuzzer14MockConnection13ShutdownWriteEv:
  230|  3.04k|void MockConnection::ShutdownWrite() {
  231|  3.04k|  if (server_fd_ < 0) {
  ------------------
  |  Branch (231:7): [True: 0, False: 3.04k]
  ------------------
  232|      0|    return;
  233|      0|  }
  234|  3.04k|  ::shutdown(server_fd_, SHUT_WR);
  235|  3.04k|}
mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_113FdFitsInFdSetEi:
   47|  6.08k|bool FdFitsInFdSet(int fd) { return fd >= 0 && fd < FD_SETSIZE; }
  ------------------
  |  Branch (47:37): [True: 6.08k, False: 0]
  |  Branch (47:48): [True: 6.08k, False: 0]
  ------------------

_ZN12proto_fuzzer34MockServerBaseOpenSocketTrampolineEPv12curlsocktypeP13curl_sockaddr:
   35|  3.04k|curl_socket_t MockServerBaseOpenSocketTrampoline(void* clientp, curlsocktype purpose, struct curl_sockaddr* address) {
   36|  3.04k|  return static_cast<MockServerBase*>(clientp)->HandleOpenSocket(purpose, address);
   37|  3.04k|}
_ZN12proto_fuzzer31MockServerBaseSockOptTrampolineEPvi12curlsocktype:
   48|  3.04k|int MockServerBaseSockOptTrampoline(void* clientp, curl_socket_t curlfd, curlsocktype purpose) {
   49|  3.04k|  const auto disposition = static_cast<MockServerBase*>(clientp)->GetSocketSetupDisposition(curlfd, purpose);
   50|  3.04k|  return disposition == SocketSetupDisposition::kAlreadyConnected ? CURL_SOCKOPT_ALREADY_CONNECTED : CURL_SOCKOPT_OK;
  ------------------
  |  |  423|  3.04k|#define CURL_SOCKOPT_ALREADY_CONNECTED 2
  ------------------
                return disposition == SocketSetupDisposition::kAlreadyConnected ? CURL_SOCKOPT_ALREADY_CONNECTED : CURL_SOCKOPT_OK;
  ------------------
  |  |  420|      0|#define CURL_SOCKOPT_OK 0
  ------------------
  |  Branch (50:10): [True: 3.04k, False: 0]
  ------------------
   51|  3.04k|}
_ZN12proto_fuzzer14MockServerBaseC2Ev:
   55|  3.74k|    : connection_(nullptr),
   56|  3.74k|      pending_recv_buf_bytes_(0),
   57|  3.74k|      pending_drain_limit_(0),
   58|  3.74k|      multi_socket_driver_(nullptr),
   59|  3.74k|      additional_handle_cleanup_count_(0),
   60|  3.74k|      resume_response_(false) {}
_ZN12proto_fuzzer14MockServerBaseD2Ev:
   65|  3.74k|MockServerBase::~MockServerBase() = default;
_ZN12proto_fuzzer14MockServerBase7InstallEPv:
   72|  3.74k|void MockServerBase::Install(CURL* easy) {
   73|  3.74k|  curl_easy_setopt(easy, CURLOPT_OPENSOCKETFUNCTION, &MockServerBaseOpenSocketTrampoline);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   74|  3.74k|  curl_easy_setopt(easy, CURLOPT_OPENSOCKETDATA, this);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   75|  3.74k|  curl_easy_setopt(easy, CURLOPT_SOCKOPTFUNCTION, &MockServerBaseSockOptTrampoline);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   76|  3.74k|  curl_easy_setopt(easy, CURLOPT_SOCKOPTDATA, this);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   77|  3.74k|}
_ZNK12proto_fuzzer14MockServerBase25GetSocketSetupDispositionEi12curlsocktype:
   79|  3.04k|SocketSetupDisposition MockServerBase::GetSocketSetupDisposition(curl_socket_t /*curlfd*/, curlsocktype purpose) const {
   80|       |  // curl itself accepted CURLSOCKTYPE_ACCEPT descriptors, so they must follow
   81|       |  // its normal post-accept option path. Every IPCXN socket returned by the
   82|       |  // ordinary stream mocks is one end of an already-connected socketpair.
   83|  3.04k|  return purpose == CURLSOCKTYPE_ACCEPT ? SocketSetupDisposition::kNeedsSetup
  ------------------
  |  Branch (83:10): [True: 0, False: 3.04k]
  ------------------
   84|  3.04k|                                        : SocketSetupDisposition::kAlreadyConnected;
   85|  3.04k|}
_ZN12proto_fuzzer14MockServerBase13DriveScenarioEPvRKN4curl6fuzzer5proto8ScenarioEbbb:
   96|  3.74k|                                       bool wake_multi, bool resume_response) {
   97|       |  // Cache backpressure knobs so HandleOpenSocket can apply them the moment
   98|       |  // connection_ exists. Both default to 0, which matches the legacy "drain
   99|       |  // greedily, kernel-default buffers" behaviour exactly.
  100|  3.74k|  const auto& bp = scenario.connection().backpressure();
  101|  3.74k|  pending_recv_buf_bytes_ = static_cast<int>(bp.recv_buf_bytes());
  102|  3.74k|  pending_drain_limit_ = static_cast<std::size_t>(bp.drain_limit());
  103|  3.74k|  additional_handle_cleanup_count_ = 0;
  104|  3.74k|  resume_response_ = resume_response;
  105|       |
  106|  3.74k|  CurlMultiPtr multi(curl_multi_init());
  107|  3.74k|  if (multi == nullptr) {
  ------------------
  |  Branch (107:7): [True: 0, False: 3.74k]
  ------------------
  108|      0|    resume_response_ = false;
  109|      0|    return CURLE_FAILED_INIT;
  110|      0|  }
  111|       |
  112|  3.74k|  CURLcode transfer_result = CURLE_FAILED_INIT;
  113|       |
  114|       |  // Callback data must survive both remove_handle and multi_cleanup, since
  115|       |  // either may emit CURL_POLL_REMOVE. Keeping it in this outer scope provides
  116|       |  // that lifetime without allocating per-watch state.
  117|  3.74k|  MultiSocketDriver socket_driver;
  118|  3.74k|  if (use_multi_socket && socket_driver.Install(multi.get())) {
  ------------------
  |  Branch (118:7): [True: 0, False: 3.74k]
  |  Branch (118:27): [True: 0, False: 0]
  ------------------
  119|      0|    multi_socket_driver_ = &socket_driver;
  120|      0|  }
  121|  3.74k|  if (curl_multi_add_handle(multi.get(), easy) == CURLM_OK) {
  ------------------
  |  Branch (121:7): [True: 3.74k, False: 0]
  ------------------
  122|  3.74k|    if (wake_multi) {
  ------------------
  |  Branch (122:9): [True: 0, False: 3.74k]
  ------------------
  123|      0|      if (multi_socket_driver_ != nullptr) {
  ------------------
  |  Branch (123:11): [True: 0, False: 0]
  ------------------
  124|      0|        multi_socket_driver_->ProbeControlApis();
  125|      0|      } else {
  126|      0|        long timeout_ms = -1;
  127|      0|        (void)curl_multi_timeout(multi.get(), &timeout_ms);
  128|      0|        (void)curl_multi_wakeup(multi.get());
  129|      0|      }
  130|      0|    }
  131|  3.74k|    RunLoop(multi.get(), easy, scenario);
  132|       |
  133|       |    // Completion messages are the multi API's only durable record of the
  134|       |    // transfer result. Consume them while all easy handles are still attached:
  135|       |    // otherwise every scenario systematically skips curl_multi_info_read's
  136|       |    // result path and removal discards the opportunity. An accepted HTTP/2
  137|       |    // push can contribute one additional completion message; only the caller's
  138|       |    // parent determines DriveScenario's result.
  139|  3.74k|    int messages_remaining = 0;
  140|  3.74k|    CURLMsg* message = nullptr;
  141|  7.48k|    while ((message = curl_multi_info_read(multi.get(), &messages_remaining)) != nullptr) {
  ------------------
  |  Branch (141:12): [True: 3.74k, False: 3.74k]
  ------------------
  142|  3.74k|      if (message->msg == CURLMSG_DONE && message->easy_handle == easy) {
  ------------------
  |  Branch (142:11): [True: 3.74k, False: 0]
  |  Branch (142:43): [True: 3.74k, False: 0]
  ------------------
  143|  3.74k|        transfer_result = message->data.result;
  144|  3.74k|      }
  145|  3.74k|    }
  146|       |
  147|       |    // CURL_PUSH_OK transfers ownership of each automatically-added easy to
  148|       |    // the application. Enumerate attached handles only after draining their
  149|       |    // completion messages, then honor the public remove-before-cleanup
  150|       |    // lifecycle. The original `easy` remains caller-owned.
  151|  3.74k|    CURL** handles = curl_multi_get_handles(multi.get());
  152|  3.74k|    if (handles != nullptr) {
  ------------------
  |  Branch (152:9): [True: 3.74k, False: 0]
  ------------------
  153|  7.48k|      for (std::size_t index = 0; handles[index] != nullptr; ++index) {
  ------------------
  |  Branch (153:35): [True: 3.74k, False: 3.74k]
  ------------------
  154|  3.74k|        CURL* handle = handles[index];
  155|  3.74k|        if (handle != easy && curl_multi_remove_handle(multi.get(), handle) == CURLM_OK) {
  ------------------
  |  Branch (155:13): [True: 0, False: 3.74k]
  |  Branch (155:31): [True: 0, False: 0]
  ------------------
  156|      0|          curl_easy_cleanup(handle);
  157|      0|          ++additional_handle_cleanup_count_;
  158|      0|        }
  159|  3.74k|      }
  160|  3.74k|      curl_free(handles);
  161|  3.74k|    }
  162|       |
  163|  3.74k|    curl_multi_remove_handle(multi.get(), easy);
  164|  3.74k|  }
  165|  3.74k|  multi.reset();
  166|  3.74k|  multi_socket_driver_ = nullptr;
  167|  3.74k|  resume_response_ = false;
  168|  3.74k|  return transfer_result;
  169|  3.74k|}

_ZN12proto_fuzzer17MultiSocketDriverC2Ev:
   54|  3.74k|MultiSocketDriver::MultiSocketDriver() : multi_(nullptr), timeout_ms_(-1), timer_pending_(false), generation_(0) {}
_ZN12proto_fuzzer17MultiSocketDriverD2Ev:
   58|  3.74k|MultiSocketDriver::~MultiSocketDriver() = default;

_ZN12proto_fuzzer28CanonicalizeOptionValueCasesEPN4curl6fuzzer5proto8ScenarioE:
  157|  3.99k|void CanonicalizeOptionValueCases(curl::fuzzer::proto::Scenario* scenario) {
  158|  3.99k|  if (scenario == nullptr) {
  ------------------
  |  Branch (158:7): [True: 0, False: 3.99k]
  ------------------
  159|      0|    return;
  160|      0|  }
  161|  6.43k|  for (auto& option : *scenario->mutable_options()) {
  ------------------
  |  Branch (161:21): [True: 6.43k, False: 3.99k]
  ------------------
  162|  6.43k|    const OptionDescriptor* desc = LookupOptionDescriptor(option.option_id());
  163|  6.43k|    if (desc == nullptr) {
  ------------------
  |  Branch (163:9): [True: 0, False: 6.43k]
  ------------------
  164|      0|      continue;
  165|      0|    }
  166|       |
  167|  6.43k|    switch (desc->kind) {
  ------------------
  |  Branch (167:13): [True: 6.43k, False: 0]
  ------------------
  168|  3.76k|      case OptionValueKind::kString:
  ------------------
  |  Branch (168:7): [True: 3.76k, False: 2.66k]
  ------------------
  169|  3.76k|        if (option.value_case() != curl::fuzzer::proto::SetOption::kStringValue) {
  ------------------
  |  Branch (169:13): [True: 169, False: 3.59k]
  ------------------
  170|    169|          option.set_string_value("");
  171|    169|        }
  172|  3.76k|        if (desc->curlopt == CURLOPT_PINNEDPUBLICKEY) {
  ------------------
  |  Branch (172:13): [True: 0, False: 3.76k]
  ------------------
  173|      0|          ConstrainPinnedPublicKeyValue(option.mutable_string_value());
  174|      0|        }
  175|  3.76k|        break;
  176|    739|      case OptionValueKind::kUint:
  ------------------
  |  Branch (176:7): [True: 739, False: 5.69k]
  ------------------
  177|    739|        if (option.value_case() != curl::fuzzer::proto::SetOption::kUintValue) {
  ------------------
  |  Branch (177:13): [True: 130, False: 609]
  ------------------
  178|    130|          option.set_uint_value(DecodeIntegralValue(*desc, option));
  179|    130|        }
  180|    739|        break;
  181|  1.92k|      case OptionValueKind::kBool:
  ------------------
  |  Branch (181:7): [True: 1.92k, False: 4.50k]
  ------------------
  182|  1.92k|        if (option.value_case() != curl::fuzzer::proto::SetOption::kBoolValue) {
  ------------------
  |  Branch (182:13): [True: 430, False: 1.49k]
  ------------------
  183|    430|          option.set_bool_value(DecodeIntegralValue(*desc, option) != 0);
  184|    430|        }
  185|  1.92k|        break;
  186|  6.43k|    }
  187|  6.43k|  }
  188|  3.99k|}
_ZN12proto_fuzzer20ApplyBaselineOptionsEPvN4curl6fuzzer5proto6SchemeEb:
  197|  3.74k|struct curl_slist* ApplyBaselineOptions(CURL* easy, curl::fuzzer::proto::Scheme scheme, bool trace_ids) {
  198|  3.74k|  EnableDebugHttpTransportMetadata();
  199|       |
  200|  3.74k|  curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, &SilentWriteCallback);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  201|  3.74k|  curl_easy_setopt(easy, CURLOPT_HEADERFUNCTION, &SilentWriteCallback);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  202|       |
  203|  3.74k|  const bool user_requested_verbose = std::getenv(kVerboseEnvVar) != nullptr;
  204|  3.74k|  if (trace_ids) {
  ------------------
  |  Branch (204:7): [True: 7, False: 3.73k]
  ------------------
  205|      7|    EnableTraceIds();
  206|       |    // Keep trace-ID coverage enabled during fuzzing without flooding the
  207|       |    // process log. The callback still executes curl_trc.c's formatting path.
  208|      7|    curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, &SilentDebugCallback);
  ------------------
  |  | 3364|      7|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      7|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  209|      7|    curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
  ------------------
  |  | 3364|      7|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      7|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  210|  3.73k|  } else if (scheme == curl::fuzzer::proto::SCHEME_TELNET && !user_requested_verbose) {
  ------------------
  |  Branch (210:14): [True: 3.73k, False: 0]
  |  Branch (210:62): [True: 3.73k, False: 0]
  ------------------
  211|       |    // printoption() and printsub() contain a substantial part of curl's TELNET
  212|       |    // parser diagnostics but run only in verbose mode. Keep those paths in the
  213|       |    // ordinary TELNET coverage lane while suppressing their high-volume text.
  214|       |    // An explicit FUZZ_VERBOSE still skips the sink so reproductions remain
  215|       |    // inspectable from the terminal.
  216|  3.73k|    curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, &SilentDebugCallback);
  ------------------
  |  | 3364|  3.73k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.73k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  217|  3.73k|    curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
  ------------------
  |  | 3364|  3.73k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.73k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  218|  3.73k|  }
  219|       |
  220|       |  // Each non-HTTP protocol must use its dedicated peer invariants. Keep them
  221|       |  // out of the redirect allowlist so an HTTP response cannot switch a stream
  222|       |  // mock into synchronous TELNET, two-channel FTP, or datagram TFTP semantics.
  223|       |  // CURLOPT_PROTOCOLS_STR arrived in 7.85.0.
  224|  3.74k|  const char* direct_protocols = kEventDrivenProtocolsAllowed;
  225|  3.74k|  switch (scheme) {
  226|  3.74k|    case curl::fuzzer::proto::SCHEME_TELNET:
  ------------------
  |  Branch (226:5): [True: 3.74k, False: 0]
  ------------------
  227|  3.74k|      direct_protocols = kTelnetProtocolAllowed;
  228|  3.74k|      break;
  229|      0|    case curl::fuzzer::proto::SCHEME_FTP:
  ------------------
  |  Branch (229:5): [True: 0, False: 3.74k]
  ------------------
  230|      0|      direct_protocols = kFtpProtocolAllowed;
  231|      0|      break;
  232|      0|    case curl::fuzzer::proto::SCHEME_TFTP:
  ------------------
  |  Branch (232:5): [True: 0, False: 3.74k]
  ------------------
  233|      0|      direct_protocols = kTftpProtocolAllowed;
  234|      0|      break;
  235|      0|    case curl::fuzzer::proto::SCHEME_GOPHER:
  ------------------
  |  Branch (235:5): [True: 0, False: 3.74k]
  ------------------
  236|      0|      direct_protocols = "gopher";
  237|      0|      break;
  238|      0|    case curl::fuzzer::proto::SCHEME_GOPHERS:
  ------------------
  |  Branch (238:5): [True: 0, False: 3.74k]
  ------------------
  239|      0|      direct_protocols = "gophers";
  240|      0|      break;
  241|      0|    case curl::fuzzer::proto::SCHEME_HTTP:
  ------------------
  |  Branch (241:5): [True: 0, False: 3.74k]
  ------------------
  242|      0|    case curl::fuzzer::proto::SCHEME_HTTPS:
  ------------------
  |  Branch (242:5): [True: 0, False: 3.74k]
  ------------------
  243|      0|    case curl::fuzzer::proto::SCHEME_WS:
  ------------------
  |  Branch (243:5): [True: 0, False: 3.74k]
  ------------------
  244|      0|    case curl::fuzzer::proto::SCHEME_WSS:
  ------------------
  |  Branch (244:5): [True: 0, False: 3.74k]
  ------------------
  245|      0|    case curl::fuzzer::proto::SCHEME_UNSPECIFIED:
  ------------------
  |  Branch (245:5): [True: 0, False: 3.74k]
  ------------------
  246|      0|    default:
  ------------------
  |  Branch (246:5): [True: 0, False: 3.74k]
  ------------------
  247|      0|      break;
  248|  3.74k|  }
  249|  3.74k|  curl_easy_setopt(easy, CURLOPT_PROTOCOLS_STR, direct_protocols);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  250|  3.74k|  curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS_STR, kEventDrivenProtocolsAllowed);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  251|       |
  252|       |  // CONNECT_TO confines direct connections, but an ambient http_proxy or
  253|       |  // ALL_PROXY can select a proxy before curl asks the harness for a socket.
  254|       |  // An explicit empty proxy keeps every transfer inside the socketpair and
  255|       |  // makes replay independent of the machine running the fuzzer.
  256|  3.74k|  curl_easy_setopt(easy, CURLOPT_PROXY, "");
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  257|       |
  258|       |  // Keep raw secure-scheme inputs independent of the host trust store,
  259|       |  // matching the legacy harness. The dedicated TLS mock installs its own
  260|       |  // in-memory trust anchor after this baseline; scenario options still run
  261|       |  // last and can deliberately select verification failures.
  262|  3.74k|  curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  263|       |
  264|       |  // Force every name lookup to the fuzzer's in-process mock peer. The caller
  265|       |  // owns the returned slist and must free it after curl_easy_cleanup.
  266|  3.74k|  struct curl_slist* connect_to = curl_slist_append(nullptr, kConnectToOverride);
  267|  3.74k|  curl_easy_setopt(easy, CURLOPT_CONNECT_TO, connect_to);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  268|       |
  269|       |  // Short bounds: fuzzing should never sit waiting on real I/O. Response
  270|       |  // volume is already bounded by libFuzzer's input-size limit, so do not rate
  271|       |  // limit receive traffic here: a global bytes-per-second throttle turns every
  272|       |  // otherwise-complete large response into wall-clock sleep.
  273|  3.74k|  curl_easy_setopt(easy, CURLOPT_CONNECTTIMEOUT_MS, kConnectTimeoutMs);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  274|  3.74k|  curl_easy_setopt(easy, CURLOPT_TIMEOUT_MS, kTimeoutMs);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  275|       |
  276|       |  // Keep every persistence/read path deterministic and prevent scenarios from
  277|       |  // leaking state onto the filesystem. COOKIEFILE also makes the in-memory
  278|       |  // engine's RELOAD command traverse its loader against a harmless empty
  279|       |  // source. These path options deliberately remain absent from the generated
  280|       |  // mutation manifest, so a proto cannot replace /dev/null.
  281|  3.74k|  curl_easy_setopt(easy, CURLOPT_COOKIEJAR, kDevNull);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  282|  3.74k|  curl_easy_setopt(easy, CURLOPT_COOKIEFILE, kDevNull);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  283|  3.74k|  curl_easy_setopt(easy, CURLOPT_ALTSVC, kDevNull);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  284|  3.74k|  curl_easy_setopt(easy, CURLOPT_HSTS, kDevNull);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  285|  3.74k|  curl_easy_setopt(easy, CURLOPT_NETRC_FILE, kDevNull);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  286|       |  // Do not set CRLFILE merely to mirror the legacy harness. An empty CRL is
  287|       |  // not a harmless sink: when a scenario restores certificate verification,
  288|       |  // OpenSSL rejects /dev/null before it can exercise useful handshake and
  289|       |  // verification paths. The option is absent from the mutation manifest, so
  290|       |  // leaving it unset introduces neither filesystem writes nor external input.
  291|       |
  292|       |  // Match the legacy TLV fuzzer: FUZZ_VERBOSE in the environment flips curl's
  293|       |  // own verbose logging on. Useful when reproducing a crashing corpus entry.
  294|  3.74k|  if (user_requested_verbose) {
  ------------------
  |  Branch (294:7): [True: 0, False: 3.74k]
  ------------------
  295|      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)
  |  |  ------------------
  ------------------
  296|      0|  }
  297|  3.74k|  return connect_to;
  298|  3.74k|}
_ZN12proto_fuzzer14ApplySetOptionEPvRKN4curl6fuzzer5proto9SetOptionE:
  310|  5.71k|CURLcode ApplySetOption(CURL* easy, const curl::fuzzer::proto::SetOption& option) {
  311|  5.71k|  const OptionDescriptor* desc = LookupOptionDescriptor(option.option_id());
  312|  5.71k|  if (desc == nullptr) {
  ------------------
  |  Branch (312:7): [True: 0, False: 5.71k]
  ------------------
  313|      0|    return CURLE_UNKNOWN_OPTION;
  314|      0|  }
  315|       |
  316|  5.71k|  switch (desc->kind) {
  ------------------
  |  Branch (316:11): [True: 5.71k, False: 0]
  ------------------
  317|  3.44k|    case OptionValueKind::kString: {
  ------------------
  |  Branch (317:5): [True: 3.44k, False: 2.27k]
  ------------------
  318|  3.44k|      const std::string& value = option.string_value();
  319|       |
  320|       |      // POSTFIELDS borrows its pointer and COPYPOSTFIELDS copies exactly the
  321|       |      // previously configured size. Apply the correlated byte length first so
  322|       |      // either option accepts embedded NULs without strlen semantics and the
  323|       |      // copying variant can never read beyond the protobuf-owned buffer.
  324|  3.44k|      if (desc->curlopt == CURLOPT_POSTFIELDS || desc->curlopt == CURLOPT_COPYPOSTFIELDS) {
  ------------------
  |  Branch (324:11): [True: 0, False: 3.44k]
  |  Branch (324:50): [True: 0, False: 3.44k]
  ------------------
  325|      0|        CURLcode result = curl_easy_setopt(easy, CURLOPT_POSTFIELDSIZE_LARGE, static_cast<curl_off_t>(value.size()));
  ------------------
  |  | 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)
  |  |  ------------------
  ------------------
  326|      0|        if (result != CURLE_OK) {
  ------------------
  |  Branch (326:13): [True: 0, False: 0]
  ------------------
  327|      0|          return result;
  328|      0|        }
  329|      0|      }
  330|       |
  331|       |      // Curl otherwise treats this option as a filename during the TLS
  332|       |      // handshake. Fixed-policy inputs normally arrive pre-constrained by the
  333|       |      // postprocessor; this runtime check also protects compatibility inputs,
  334|       |      // which intentionally bypass it. Curl copies this option in setopt, so
  335|       |      // the temporary remains valid for the call's full ownership contract.
  336|  3.44k|      if (desc->curlopt == CURLOPT_PINNEDPUBLICKEY && !UsesInMemoryPublicKeyPin(value)) {
  ------------------
  |  Branch (336:11): [True: 0, False: 3.44k]
  |  Branch (336:55): [True: 0, False: 0]
  ------------------
  337|      0|        std::string constrained = value;
  338|      0|        ConstrainPinnedPublicKeyValue(&constrained);
  339|      0|        return curl_easy_setopt(easy, desc->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)
  |  |  ------------------
  ------------------
  340|      0|      }
  341|       |
  342|  3.44k|      return curl_easy_setopt(easy, desc->curlopt, value.c_str());
  ------------------
  |  | 3364|  3.44k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.44k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  343|  3.44k|    }
  344|       |
  345|       |    // Decode the uint_value and pass it as either a long or a curl_off_t depending on the option.
  346|    663|    case OptionValueKind::kUint: {
  ------------------
  |  Branch (346:5): [True: 663, False: 5.05k]
  ------------------
  347|    663|      const std::uint64_t raw = DecodeIntegralValue(*desc, option);
  348|       |      // CURLOPTTYPE_OFF_T options start at 30000. Everything below takes a
  349|       |      // long; everything at/above takes a curl_off_t.
  350|    663|      if (static_cast<int>(desc->curlopt) >= 30000) {
  ------------------
  |  Branch (350:11): [True: 663, False: 0]
  ------------------
  351|    663|        return curl_easy_setopt(easy, desc->curlopt, static_cast<curl_off_t>(raw));
  ------------------
  |  | 3364|    663|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    663|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  352|    663|      }
  353|      0|      return curl_easy_setopt(easy, desc->curlopt, static_cast<long>(raw));
  ------------------
  |  | 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)
  |  |  ------------------
  ------------------
  354|    663|    }
  355|       |
  356|       |    // Decode the bool_value and pass it as a long flag (0 or 1).
  357|  1.60k|    case OptionValueKind::kBool: {
  ------------------
  |  Branch (357:5): [True: 1.60k, False: 4.10k]
  ------------------
  358|  1.60k|      const long flag = static_cast<long>(DecodeIntegralValue(*desc, option));
  359|  1.60k|      return curl_easy_setopt(easy, desc->curlopt, flag);
  ------------------
  |  | 3364|  1.60k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  1.60k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  360|    663|    }
  361|  5.71k|  }
  362|      0|  return CURLE_UNKNOWN_OPTION;
  363|  5.71k|}
_ZN12proto_fuzzer18RuntimeOptionCountERKN4curl6fuzzer5proto8ScenarioE:
  367|  3.74k|std::size_t RuntimeOptionCount(const curl::fuzzer::proto::Scenario& scenario) {
  368|  3.74k|  return std::min<std::size_t>(static_cast<std::size_t>(scenario.options_size()), scenario_limits::kMaxOptions);
  369|  3.74k|}
_ZN12proto_fuzzer20ApplyScenarioOptionsEPvRKN4curl6fuzzer5proto8ScenarioE:
  374|  3.74k|std::size_t ApplyScenarioOptions(CURL* easy, const curl::fuzzer::proto::Scenario& scenario) {
  375|  3.74k|  const std::size_t option_count = RuntimeOptionCount(scenario);
  376|  9.45k|  for (std::size_t index = 0; index < option_count; ++index) {
  ------------------
  |  Branch (376:31): [True: 5.71k, False: 3.74k]
  ------------------
  377|  5.71k|    (void)ApplySetOption(easy, scenario.options(static_cast<int>(index)));
  378|  5.71k|  }
  379|  3.74k|  return option_count;
  380|  3.74k|}
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_119DecodeIntegralValueERKNS_16OptionDescriptorERKN4curl6fuzzer5proto9SetOptionE:
  120|  2.83k|std::uint64_t DecodeIntegralValue(const OptionDescriptor& descriptor, const curl::fuzzer::proto::SetOption& option) {
  121|  2.83k|  if (descriptor.kind == OptionValueKind::kString) {
  ------------------
  |  Branch (121:7): [True: 0, False: 2.83k]
  ------------------
  122|      0|    return 0;
  123|      0|  }
  124|  2.83k|  switch (option.value_case()) {
  ------------------
  |  Branch (124:11): [True: 2.83k, False: 0]
  ------------------
  125|  1.65k|    case curl::fuzzer::proto::SetOption::kBoolValue:
  ------------------
  |  Branch (125:5): [True: 1.65k, False: 1.17k]
  ------------------
  126|  1.65k|      return option.bool_value() ? 1U : 0U;
  ------------------
  |  Branch (126:14): [True: 443, False: 1.21k]
  ------------------
  127|    907|    case curl::fuzzer::proto::SetOption::kUintValue:
  ------------------
  |  Branch (127:5): [True: 907, False: 1.92k]
  ------------------
  128|    907|      if (descriptor.kind == OptionValueKind::kBool) {
  ------------------
  |  Branch (128:11): [True: 244, False: 663]
  ------------------
  129|    244|        return option.uint_value() != 0 ? 1U : 0U;
  ------------------
  |  Branch (129:16): [True: 164, False: 80]
  ------------------
  130|    244|      }
  131|    663|      return option.uint_value();
  132|     68|    case curl::fuzzer::proto::SetOption::kStringValue:
  ------------------
  |  Branch (132:5): [True: 68, False: 2.76k]
  ------------------
  133|    265|    case curl::fuzzer::proto::SetOption::VALUE_NOT_SET:
  ------------------
  |  Branch (133:5): [True: 197, False: 2.63k]
  ------------------
  134|    265|      return 0;
  135|  2.83k|  }
  136|      0|  return 0;
  137|  2.83k|}
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_132EnableDebugHttpTransportMetadataEv:
   95|  3.74k|void EnableDebugHttpTransportMetadata() {
   96|  3.74k|  static const bool configured = [] {
   97|       |    // CMake builds the fuzzing copy of curl with ENABLE_DEBUG specifically so
   98|       |    // these curl-provided test hooks are available. Do not overwrite values a
   99|       |    // reproducer deliberately supplied in its environment.
  100|  3.74k|    (void)setenv(kAltSvcHttpEnvVar, "1", 0);
  101|  3.74k|    (void)setenv(kHstsHttpEnvVar, "1", 0);
  102|  3.74k|    return true;
  103|  3.74k|  }();
  104|  3.74k|  (void)configured;
  105|  3.74k|}
option_apply.cc:_ZZN12proto_fuzzer12_GLOBAL__N_132EnableDebugHttpTransportMetadataEvENK3$_0clEv:
   96|      1|  static const bool configured = [] {
   97|       |    // CMake builds the fuzzing copy of curl with ENABLE_DEBUG specifically so
   98|       |    // these curl-provided test hooks are available. Do not overwrite values a
   99|       |    // reproducer deliberately supplied in its environment.
  100|      1|    (void)setenv(kAltSvcHttpEnvVar, "1", 0);
  101|      1|    (void)setenv(kHstsHttpEnvVar, "1", 0);
  102|      1|    return true;
  103|      1|  }();
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_119SilentWriteCallbackEPvmmS1_:
   81|  14.3k|size_t SilentWriteCallback(void* /*contents*/, size_t size, size_t nmemb, void* /*userdata*/) { return size * nmemb; }
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_114EnableTraceIdsEv:
  107|      7|void EnableTraceIds() {
  108|      7|  static const bool enabled = curl_global_trace("+LIB-IDS") == CURLE_OK;
  109|      7|  (void)enabled;
  110|      7|}
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_119SilentDebugCallbackEPv13curl_infotypePcmS1_:
   87|   328k|int SilentDebugCallback(CURL* /*handle*/, curl_infotype /*type*/, char* /*data*/, size_t /*size*/, void* /*userdata*/) {
   88|   328k|  return 0;
   89|   328k|}

_ZN12proto_fuzzer17UploadScriptStateC2ERKN4curl6fuzzer5proto8ScenarioE:
  225|  3.74k|    : data_(),
  226|  3.74k|      read_step_count_(0),
  227|  3.74k|      total_size_(scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET ? 0 : scenario_limits::kMaxUploadBytes),
  ------------------
  |  Branch (227:19): [True: 3.74k, False: 0]
  ------------------
  228|  3.74k|      max_read_size_(scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET ? scenario_limits::kMaxTelnetUploadReadSize
  ------------------
  |  Branch (228:22): [True: 3.74k, False: 0]
  ------------------
  229|  3.74k|                                                                             : scenario_limits::kMaxUploadReadSize),
  230|  3.74k|      offset_(0),
  231|  3.74k|      next_read_size_(0),
  232|  3.74k|      terminal_(curl::fuzzer::proto::UPLOAD_TERMINAL_EOF),
  233|  3.74k|      seek_result_(curl::fuzzer::proto::UPLOAD_SEEK_CANTSEEK),
  234|  3.74k|      before_read_callback_(nullptr),
  235|  3.74k|      before_read_userdata_(nullptr),
  236|  3.74k|      scripted_(scenario.has_upload()) {
  237|  3.74k|  if (!scripted_) {
  ------------------
  |  Branch (237:7): [True: 3.54k, False: 193]
  ------------------
  238|  3.54k|    return;
  239|  3.54k|  }
  240|       |
  241|    193|  const auto& upload = scenario.upload();
  242|    193|  const std::size_t data_limit = scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET
  ------------------
  |  Branch (242:34): [True: 193, False: 0]
  ------------------
  243|    193|                                     ? scenario_limits::kMaxTelnetUploadBytes
  244|    193|                                     : scenario_limits::kMaxUploadBytes;
  245|    193|  const std::size_t data_size = std::min(upload.data().size(), data_limit);
  246|    193|  data_ = std::string_view(upload.data().data(), data_size);
  247|    193|  total_size_ = data_.size();
  248|    193|  terminal_ = upload.terminal();
  249|    193|  if (scenario.scheme() != curl::fuzzer::proto::SCHEME_TELNET &&
  ------------------
  |  Branch (249:7): [True: 0, False: 193]
  ------------------
  250|      0|      terminal_ == curl::fuzzer::proto::UPLOAD_TERMINAL_PAUSE) {
  ------------------
  |  Branch (250:7): [True: 0, False: 0]
  ------------------
  251|       |    // Event-driven protocols need an external resume source. Interpret this
  252|       |    // TELNET-specific outcome as EOF before curl can retain a paused transfer.
  253|      0|    terminal_ = curl::fuzzer::proto::UPLOAD_TERMINAL_EOF;
  254|      0|  }
  255|    193|  seek_result_ = upload.seek_result();
  256|       |
  257|    193|  const std::size_t read_step_limit = scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET
  ------------------
  |  Branch (257:39): [True: 193, False: 0]
  ------------------
  258|    193|                                          ? scenario_limits::kMaxTelnetUploadReadSteps
  259|    193|                                          : scenario_limits::kMaxUploadReadSteps;
  260|    193|  read_step_count_ = std::min<std::size_t>(upload.read_sizes_size(), read_step_limit);
  261|    300|  for (std::size_t i = 0; i < read_step_count_; ++i) {
  ------------------
  |  Branch (261:27): [True: 107, False: 193]
  ------------------
  262|    107|    const std::size_t requested = upload.read_sizes(static_cast<int>(i));
  263|       |    // Zero-as-one ensures every retained step makes progress; see the schema
  264|       |    // comment for why zero is not treated as an early EOF sentinel.
  265|    107|    read_sizes_[i] = std::max<std::size_t>(1, std::min(requested, max_read_size_));
  266|    107|  }
  267|    193|}
_ZN12proto_fuzzer17UploadScriptState4ReadEPcm:
  272|  1.20k|std::size_t UploadScriptState::Read(char* buffer, std::size_t capacity) {
  273|       |  // TELNET can produce negotiation replies while one curl_multi_perform call
  274|       |  // owns the thread. Empty them before returning more callback bytes;
  275|       |  // otherwise send_telnet_data() can consume the whole bounded transfer
  276|       |  // timeout while the synchronous path waits for socket capacity.
  277|  1.20k|  if (before_read_callback_ != nullptr) {
  ------------------
  |  Branch (277:7): [True: 1.20k, False: 0]
  ------------------
  278|  1.20k|    before_read_callback_(before_read_userdata_);
  279|  1.20k|  }
  280|  1.20k|  if (offset_ >= total_size_) {
  ------------------
  |  Branch (280:7): [True: 1.09k, False: 111]
  ------------------
  281|  1.09k|    switch (terminal_) {
  282|      6|      case curl::fuzzer::proto::UPLOAD_TERMINAL_ABORT:
  ------------------
  |  Branch (282:7): [True: 6, False: 1.08k]
  ------------------
  283|      6|        return CURL_READFUNC_ABORT;
  ------------------
  |  |  392|      6|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  284|      4|      case curl::fuzzer::proto::UPLOAD_TERMINAL_PAUSE:
  ------------------
  |  Branch (284:7): [True: 4, False: 1.08k]
  ------------------
  285|      4|        return CURL_READFUNC_PAUSE;
  ------------------
  |  |  395|      4|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  286|  1.08k|      case curl::fuzzer::proto::UPLOAD_TERMINAL_EOF:
  ------------------
  |  Branch (286:7): [True: 1.08k, False: 10]
  ------------------
  287|  1.08k|      default:
  ------------------
  |  Branch (287:7): [True: 0, False: 1.09k]
  ------------------
  288|  1.08k|        return 0;
  289|  1.09k|    }
  290|  1.09k|  }
  291|    111|  if (buffer == nullptr || capacity == 0) {
  ------------------
  |  Branch (291:7): [True: 0, False: 111]
  |  Branch (291:28): [True: 0, False: 111]
  ------------------
  292|      0|    return 0;
  293|      0|  }
  294|       |
  295|    111|  std::size_t chunk_limit = std::min(capacity, max_read_size_);
  296|    111|  if (next_read_size_ < read_step_count_) {
  ------------------
  |  Branch (296:7): [True: 28, False: 83]
  ------------------
  297|     28|    chunk_limit = std::min(chunk_limit, read_sizes_[next_read_size_++]);
  298|     28|  }
  299|    111|  const std::size_t count = std::min(chunk_limit, total_size_ - offset_);
  300|    111|  if (scripted_) {
  ------------------
  |  Branch (300:7): [True: 111, False: 0]
  ------------------
  301|    111|    std::memcpy(buffer, data_.data() + offset_, count);
  302|    111|  } else {
  303|      0|    std::memset(buffer, 'U', count);
  304|      0|  }
  305|    111|  offset_ += count;
  306|    111|  return count;
  307|    111|}
_ZN12proto_fuzzer17UploadScriptState12ReadCallbackEPcmmPv:
  354|  1.20k|std::size_t UploadScriptState::ReadCallback(char* buffer, std::size_t size, std::size_t nitems, void* userdata) {
  355|  1.20k|  if (userdata == nullptr || size == 0 || nitems == 0) {
  ------------------
  |  Branch (355:7): [True: 0, False: 1.20k]
  |  Branch (355:30): [True: 0, False: 1.20k]
  |  Branch (355:43): [True: 0, False: 1.20k]
  ------------------
  356|      0|    return 0;
  357|      0|  }
  358|  1.20k|  const std::size_t max = std::numeric_limits<std::size_t>::max();
  359|  1.20k|  if (nitems > max / size) {
  ------------------
  |  Branch (359:7): [True: 0, False: 1.20k]
  ------------------
  360|      0|    return CURL_READFUNC_ABORT;
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  361|      0|  }
  362|  1.20k|  return static_cast<UploadScriptState*>(userdata)->Read(buffer, size * nitems);
  363|  1.20k|}
_ZN12proto_fuzzer17UploadScriptState21SetBeforeReadCallbackEPFvPvES1_:
  382|  3.74k|void UploadScriptState::SetBeforeReadCallback(BeforeReadCallback callback, void* userdata) {
  383|  3.74k|  before_read_callback_ = callback;
  384|  3.74k|  before_read_userdata_ = userdata;
  385|  3.74k|}
_ZN12proto_fuzzer19ScenarioRequestDataC2EPvRKN4curl6fuzzer5proto8ScenarioEb:
  393|  3.74k|    : easy_(easy),
  394|  3.74k|      request_headers_(nullptr),
  395|  3.74k|      resolve_entries_(nullptr),
  396|  3.74k|      telnet_options_(nullptr),
  397|  3.74k|      mime_post_(nullptr),
  398|  3.74k|      upload_state_(scenario),
  399|  3.74k|      upload_callbacks_installed_(false),
  400|  3.74k|      resolve_entries_ready_(!apply_resolve_entries) {
  401|  3.74k|  if (easy_ == nullptr) {
  ------------------
  |  Branch (401:7): [True: 0, False: 3.74k]
  ------------------
  402|      0|    return;
  403|      0|  }
  404|       |
  405|  3.74k|  if (apply_resolve_entries) {
  ------------------
  |  Branch (405:7): [True: 0, False: 3.74k]
  ------------------
  406|      0|    resolve_entries_ = BuildStringList(scenario.resolve_entries(), scenario_limits::kMaxResolveEntries,
  407|      0|                                       scenario_limits::kMaxResolveEntryBytes, &stats_.resolve_entries);
  408|       |    // This mapping is deliberately last: preceding wildcard or removal
  409|       |    // mutations may exercise host-cache parsing, but cannot redirect the
  410|       |    // canonical resolver-lane origin away from the in-process mock.
  411|      0|    curl_slist* appended = curl_slist_append(resolve_entries_, "resolve.test:80:127.0.0.1");
  412|      0|    if (appended != nullptr) {
  ------------------
  |  Branch (412:9): [True: 0, False: 0]
  ------------------
  413|      0|      resolve_entries_ = appended;
  414|      0|      resolve_entries_ready_ = curl_easy_setopt(easy_, CURLOPT_RESOLVE, resolve_entries_) == 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)
  |  |  ------------------
  ------------------
  415|      0|    }
  416|      0|  }
  417|       |
  418|  3.74k|  if (NeedsUploadCallbacks(scenario)) {
  ------------------
  |  Branch (418:7): [True: 3.74k, False: 0]
  ------------------
  419|       |    // Install a per-run memory source even when Scenario.upload is absent but
  420|       |    // CURLOPT_UPLOAD or TELNET may request caller input. Non-TELNET schemes
  421|       |    // retain the historical fallback bytes; TELNET returns EOF. Either result
  422|       |    // replaces stdin and cannot block OSS-Fuzz. The state remains scoped to
  423|       |    // the complete drive so retries cannot share a cursor across iterations.
  424|  3.74k|    upload_callbacks_installed_ = true;
  425|  3.74k|    (void)curl_easy_setopt(easy_, CURLOPT_READFUNCTION, &UploadScriptState::ReadCallback);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  426|  3.74k|    (void)curl_easy_setopt(easy_, CURLOPT_READDATA, &upload_state_);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  427|  3.74k|    (void)curl_easy_setopt(easy_, CURLOPT_SEEKFUNCTION, &UploadScriptState::SeekCallback);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  428|  3.74k|    (void)curl_easy_setopt(easy_, CURLOPT_SEEKDATA, &upload_state_);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  429|  3.74k|  }
  430|       |
  431|       |  // HTTP headers/MIME and TELNET options are mutually exclusive because only
  432|       |  // the selected protocol can observe them. Avoid allocating protocol-inert
  433|       |  // lists and trees in compatibility inputs that bypass target policy.
  434|  3.74k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET) {
  ------------------
  |  Branch (434:7): [True: 3.74k, False: 0]
  ------------------
  435|  3.74k|    telnet_options_ = BuildStringList(scenario.telnet_options(), scenario_limits::kMaxTelnetOptions,
  436|  3.74k|                                      scenario_limits::kMaxTelnetOptionBytes, &stats_.telnet_options);
  437|  3.74k|    if (telnet_options_ != nullptr) {
  ------------------
  |  Branch (437:9): [True: 338, False: 3.40k]
  ------------------
  438|    338|      (void)curl_easy_setopt(easy_, CURLOPT_TELNETOPTIONS, telnet_options_);
  ------------------
  |  | 3364|    338|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    338|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  439|    338|    }
  440|  3.74k|  } else {
  441|      0|    request_headers_ = BuildStringList(scenario.request_headers(), scenario_limits::kMaxRequestHeaders,
  442|      0|                                       scenario_limits::kMaxMetadataBytes, &stats_.request_headers);
  443|      0|    if (request_headers_ != nullptr) {
  ------------------
  |  Branch (443:9): [True: 0, False: 0]
  ------------------
  444|      0|      (void)curl_easy_setopt(easy_, CURLOPT_HTTPHEADER, request_headers_);
  ------------------
  |  | 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)
  |  |  ------------------
  ------------------
  445|      0|    }
  446|       |
  447|      0|    if (scenario.has_mime_post()) {
  ------------------
  |  Branch (447:9): [True: 0, False: 0]
  ------------------
  448|      0|      mime_post_ = BuildMimePost(easy_, scenario.mime_post(), &stats_);
  449|      0|      if (mime_post_ != nullptr) {
  ------------------
  |  Branch (449:11): [True: 0, False: 0]
  ------------------
  450|      0|        (void)curl_easy_setopt(easy_, CURLOPT_MIMEPOST, mime_post_);
  ------------------
  |  | 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)
  |  |  ------------------
  ------------------
  451|      0|      }
  452|      0|    }
  453|      0|  }
  454|  3.74k|}
_ZN12proto_fuzzer19ScenarioRequestDataD2Ev:
  460|  3.74k|ScenarioRequestData::~ScenarioRequestData() {
  461|  3.74k|  if (easy_ != nullptr) {
  ------------------
  |  Branch (461:7): [True: 3.74k, False: 0]
  ------------------
  462|       |    // Clear callbacks before their userdata member is destroyed. There is no
  463|       |    // perform in this destructor, but making the handle non-dangling keeps the
  464|       |    // ownership rule robust if cleanup later gains diagnostics or getinfo.
  465|  3.74k|    if (upload_callbacks_installed_) {
  ------------------
  |  Branch (465:9): [True: 3.74k, False: 0]
  ------------------
  466|  3.74k|      (void)curl_easy_setopt(easy_, CURLOPT_SEEKFUNCTION, nullptr);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  467|  3.74k|      (void)curl_easy_setopt(easy_, CURLOPT_SEEKDATA, nullptr);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  468|  3.74k|      (void)curl_easy_setopt(easy_, CURLOPT_READFUNCTION, nullptr);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  469|  3.74k|      (void)curl_easy_setopt(easy_, CURLOPT_READDATA, nullptr);
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  470|  3.74k|    }
  471|  3.74k|    if (mime_post_ != nullptr) {
  ------------------
  |  Branch (471:9): [True: 0, False: 3.74k]
  ------------------
  472|      0|      (void)curl_easy_setopt(easy_, CURLOPT_MIMEPOST, 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)
  |  |  ------------------
  ------------------
  473|      0|    }
  474|  3.74k|    if (request_headers_ != nullptr) {
  ------------------
  |  Branch (474:9): [True: 0, False: 3.74k]
  ------------------
  475|      0|      (void)curl_easy_setopt(easy_, CURLOPT_HTTPHEADER, 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)
  |  |  ------------------
  ------------------
  476|      0|    }
  477|  3.74k|    if (resolve_entries_ != nullptr) {
  ------------------
  |  Branch (477:9): [True: 0, False: 3.74k]
  ------------------
  478|      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)
  |  |  ------------------
  ------------------
  479|      0|    }
  480|  3.74k|    if (telnet_options_ != nullptr) {
  ------------------
  |  Branch (480:9): [True: 338, False: 3.40k]
  ------------------
  481|    338|      (void)curl_easy_setopt(easy_, CURLOPT_TELNETOPTIONS, nullptr);
  ------------------
  |  | 3364|    338|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    338|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  482|    338|    }
  483|  3.74k|  }
  484|  3.74k|  curl_mime_free(mime_post_);
  485|  3.74k|  curl_slist_free_all(telnet_options_);
  486|  3.74k|  curl_slist_free_all(resolve_entries_);
  487|  3.74k|  curl_slist_free_all(request_headers_);
  488|  3.74k|}
_ZN12proto_fuzzer19ScenarioRequestData27SetBeforeUploadReadCallbackEPFvPvES1_:
  500|  3.74k|void ScenarioRequestData::SetBeforeUploadReadCallback(UploadScriptState::BeforeReadCallback callback, void* userdata) {
  501|  3.74k|  upload_state_.SetBeforeReadCallback(callback, userdata);
  502|  3.74k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_120NeedsUploadCallbacksERKN4curl6fuzzer5proto8ScenarioE:
   46|  3.74k|bool NeedsUploadCallbacks(const curl::fuzzer::proto::Scenario& scenario) {
   47|       |  // curl's TELNET implementation polls stdin unless a READFUNCTION was
   48|       |  // explicitly installed. Always provide the bounded per-scenario source,
   49|       |  // even when there is no upload payload to send.
   50|  3.74k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET || scenario.has_upload()) {
  ------------------
  |  Branch (50:7): [True: 3.74k, False: 0]
  |  Branch (50:66): [True: 0, False: 0]
  ------------------
   51|  3.74k|    return true;
   52|  3.74k|  }
   53|      0|  const std::size_t option_count = RuntimeOptionCount(scenario);
   54|      0|  for (std::size_t index = 0; index < option_count; ++index) {
  ------------------
  |  Branch (54:31): [True: 0, False: 0]
  ------------------
   55|      0|    const auto& option = scenario.options(static_cast<int>(index));
   56|      0|    if (option.option_id() == curl::fuzzer::proto::CURLOPT_UPLOAD ||
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        option.option_id() == curl::fuzzer::proto::CURLOPT_POST) {
  ------------------
  |  Branch (57:9): [True: 0, False: 0]
  ------------------
   58|      0|      return true;
   59|      0|    }
   60|      0|  }
   61|      0|  return false;
   62|      0|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_114BoundedCStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmPS7_:
   32|    777|const char* BoundedCString(const std::string& value, std::size_t limit, std::string* truncated) {
   33|    777|  if (value.size() <= limit) {
  ------------------
  |  Branch (33:7): [True: 777, False: 0]
  ------------------
   34|    777|    return value.c_str();
   35|    777|  }
   36|      0|  truncated->assign(value.data(), limit);
   37|      0|  return truncated->c_str();
   38|    777|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_115BuildStringListIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEP10curl_slistRKT_mmPm:
   91|  3.74k|                            std::size_t* applied) {
   92|  3.74k|  curl_slist* list = nullptr;
   93|  3.74k|  std::string truncated;
   94|  3.74k|  const std::size_t count = std::min<std::size_t>(count_limit, values.size());
   95|  4.51k|  for (std::size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (95:27): [True: 777, False: 3.74k]
  ------------------
   96|    777|    const std::string& value = values.Get(static_cast<int>(i));
   97|    777|    curl_slist* appended = curl_slist_append(list, BoundedCString(value, value_limit, &truncated));
   98|    777|    if (appended == nullptr) {
  ------------------
  |  Branch (98:9): [True: 0, False: 777]
  ------------------
   99|      0|      break;
  100|      0|    }
  101|    777|    list = appended;
  102|    777|    ++*applied;
  103|    777|  }
  104|  3.74k|  return list;
  105|  3.74k|}

_ZN12proto_fuzzer11RunScenarioERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeE:
  297|  3.99k|int RunScenario(const curl::fuzzer::proto::Scenario& scenario, ScenarioRunMode mode) {
  298|  3.99k|  if (mode == ScenarioRunMode::kMultiTransfer) {
  ------------------
  |  Branch (298:7): [True: 0, False: 3.99k]
  ------------------
  299|      0|    (void)proto_fuzzer::RunMultiTransferScenario(scenario);
  300|      0|    return 0;
  301|      0|  }
  302|       |
  303|  3.99k|  const char* prefix = SchemePrefix(scenario.scheme());
  304|  3.99k|  if (prefix == nullptr || scenario.host_path().empty()) {
  ------------------
  |  Branch (304:7): [True: 0, False: 3.99k]
  |  Branch (304:28): [True: 257, False: 3.74k]
  ------------------
  305|    257|    return 0;
  306|    257|  }
  307|       |
  308|  3.74k|  std::unique_ptr<MockServerBase> mock = MakeMockServerForScenario(scenario, mode);
  309|  3.74k|  if (!mock) {
  ------------------
  |  Branch (309:7): [True: 0, False: 3.74k]
  ------------------
  310|      0|    return 0;
  311|      0|  }
  312|       |
  313|       |  // Declaration order is an ownership invariant: reverse destruction keeps
  314|       |  // anonymous parser files, CONNECT_TO/RESOLVE storage, and share callback
  315|       |  // userdata alive through easy cleanup. This matters for incomplete
  316|       |  // transfers, where cleanup still flushes caches and can release retained
  317|       |  // references.
  318|  3.74k|  std::unique_ptr<ApiLifecycle> api_lifecycle;
  319|  3.74k|  CurlSlistPtr connect_to;
  320|  3.74k|  CurlSlistPtr altsvc_resolve;
  321|  3.74k|  BoundedAnonymousInputFile cookie_file(scenario_limits::kMaxFileInputBytes);
  322|  3.74k|  BoundedAnonymousInputFile altsvc_file(scenario_limits::kMaxFileInputBytes);
  323|  3.74k|  BoundedAnonymousInputFile hsts_file(scenario_limits::kMaxFileInputBytes);
  324|  3.74k|  BoundedAnonymousInputFile netrc_file(scenario_limits::kMaxFileInputBytes + 1);
  325|  3.74k|  BoundedAnonymousInputFile crl_file(scenario_limits::kMaxFileInputBytes);
  326|  3.74k|  if (mode == ScenarioRunMode::kDeepHttpCoverage) {
  ------------------
  |  Branch (326:7): [True: 0, False: 3.74k]
  ------------------
  327|      0|    std::size_t remaining_file_bytes = scenario_limits::kMaxFileInputTotalBytes;
  328|      0|    PrepareInputFile(scenario.cookie_file(), &remaining_file_bytes, &cookie_file);
  329|      0|    PrepareInputFile(scenario.altsvc_file(), &remaining_file_bytes, &altsvc_file);
  330|      0|    PrepareInputFile(scenario.hsts_file(), &remaining_file_bytes, &hsts_file);
  331|      0|    PrepareNetrcInputFile(scenario.netrc_file(), &remaining_file_bytes, &netrc_file);
  332|  3.74k|  } else if (mode == ScenarioRunMode::kTlsCoverage) {
  ------------------
  |  Branch (332:14): [True: 0, False: 3.74k]
  ------------------
  333|      0|    std::size_t remaining_file_bytes = scenario_limits::kMaxFileInputTotalBytes;
  334|      0|    PrepareInputFile(scenario.crl_file(), &remaining_file_bytes, &crl_file);
  335|      0|  }
  336|  3.74k|  CurlEasyPtr easy(curl_easy_init());
  337|  3.74k|  if (!easy) {
  ------------------
  |  Branch (337:7): [True: 0, False: 3.74k]
  ------------------
  338|      0|    return 0;
  339|      0|  }
  340|       |
  341|  3.74k|  std::string url = std::string(prefix) + "://" + scenario.host_path();
  342|  3.74k|  const auto configure_easy = [&] {
  343|  3.74k|    connect_to.reset(ApplyBaselineOptions(easy.get(), scenario.scheme(), scenario.trace_ids()));
  344|  3.74k|    curl_easy_setopt(easy.get(), CURLOPT_URL, url.c_str());
  345|  3.74k|    mock->Install(easy.get());
  346|       |
  347|  3.74k|    if (mode == ScenarioRunMode::kDeepHttpCoverage) {
  348|  3.74k|      ApplyDeepHttpFileOptions(easy.get(), cookie_file, altsvc_file, hsts_file, netrc_file);
  349|  3.74k|    } else if (mode == ScenarioRunMode::kTlsCoverage) {
  350|  3.74k|      ApplyTlsFileOptions(easy.get(), crl_file);
  351|  3.74k|    }
  352|       |
  353|       |    // Compatibility inputs deliberately bypass the mutating postprocessor,
  354|       |    // so enforce the shared option prefix again at the runtime boundary. The
  355|       |    // helper still ignores individual CURLcodes: the fuzzer stresses curl
  356|       |    // rather than treating rejected combinations as harness failures.
  357|  3.74k|    (void)ApplyScenarioOptions(easy.get(), scenario);
  358|  3.74k|  };
  359|  3.74k|  configure_easy();
  360|       |
  361|  3.74k|  if (mode == ScenarioRunMode::kDeepHttpCoverage && altsvc_file.path() != nullptr &&
  ------------------
  |  Branch (361:7): [True: 0, False: 3.74k]
  |  Branch (361:53): [True: 0, False: 0]
  ------------------
  362|      0|      HasCanonicalAltSvcAuthority(scenario.host_path())) {
  ------------------
  |  Branch (362:7): [True: 0, False: 0]
  ------------------
  363|      0|    altsvc_resolve.reset(curl_slist_append(nullptr, kAltSvcLoopbackResolve));
  364|      0|    if (altsvc_resolve != nullptr && curl_easy_setopt(easy.get(), CURLOPT_RESOLVE, altsvc_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 (364:9): [True: 0, False: 0]
  |  Branch (364:38): [True: 0, False: 0]
  ------------------
  365|      0|        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 (365:9): [True: 0, False: 0]
  ------------------
  366|       |      // CONNECT_TO wins before curl consults Alt-Svc. The wildcard DNS-cache
  367|       |      // entry keeps both the fixed origin and port-80 alternate destinations
  368|       |      // inside the socket callback; the resolver hook fails closed otherwise.
  369|      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)
  |  |  ------------------
  ------------------
  370|      0|    }
  371|      0|  }
  372|       |
  373|  3.74k|  if (mode == ScenarioRunMode::kResolverCoverage) {
  ------------------
  |  Branch (373:7): [True: 0, False: 3.74k]
  ------------------
  374|       |    // The normal CONNECT_TO baseline deliberately bypasses DNS. This lane
  375|       |    // removes only that override; OPENSOCKET still returns the in-process
  376|       |    // socketpair, so no resolved address can receive network traffic.
  377|      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)
  |  |  ------------------
  ------------------
  378|      0|  }
  379|       |
  380|  3.74k|  const curl::fuzzer::proto::ApiPlan* api_plan =
  381|  3.74k|      mode == ScenarioRunMode::kApiLifecycle && scenario.has_api_plan() ? &scenario.api_plan() : nullptr;
  ------------------
  |  Branch (381:7): [True: 0, False: 3.74k]
  |  Branch (381:49): [True: 0, False: 0]
  ------------------
  382|  3.74k|  if (api_plan != nullptr && api_plan->reset_easy()) {
  ------------------
  |  Branch (382:7): [True: 0, False: 3.74k]
  |  Branch (382:30): [True: 0, False: 0]
  ------------------
  383|       |    // Reset deliberately drops every pointer-valued option before its backing
  384|       |    // list is freed. Reapplying the exact scenario then lets the transfer
  385|       |    // populate post-reset state instead of turning reset coverage into a
  386|       |    // guaranteed malformed request.
  387|      0|    curl_easy_reset(easy.get());
  388|      0|    connect_to.reset();
  389|      0|    configure_easy();
  390|      0|  }
  391|       |
  392|  3.74k|  if (api_plan != nullptr) {
  ------------------
  |  Branch (392:7): [True: 0, False: 3.74k]
  ------------------
  393|      0|    api_lifecycle = std::make_unique<ApiLifecycle>(easy.get(), *api_plan, url);
  394|      0|  }
  395|       |
  396|  3.74k|  {
  397|       |    // HTTP headers, MIME bodies, TELNET options, and callback userdata are
  398|       |    // pointer-valued state that libcurl does not copy. Keep their owner around
  399|       |    // the entire multi-handle drive, then let it detach them while `easy` is
  400|       |    // still valid. This inner scope is deliberate: easy.reset() below must
  401|       |    // never run before the owner's destructor clears those options.
  402|  3.74k|    ScenarioRequestData request_data(easy.get(), scenario, mode == ScenarioRunMode::kResolverCoverage);
  403|  3.74k|    if (mode == ScenarioRunMode::kResolverCoverage && !request_data.resolve_entries_ready()) {
  ------------------
  |  Branch (403:9): [True: 0, False: 3.74k]
  |  Branch (403:55): [True: 0, False: 0]
  ------------------
  404|      0|      return 0;
  405|      0|    }
  406|  3.74k|    mock->ConfigureRequestData(&request_data);
  407|  3.74k|    const auto drive_mode = api_plan == nullptr ? curl::fuzzer::proto::API_DRIVE_MULTI_PERFORM : api_plan->drive_mode();
  ------------------
  |  Branch (407:29): [True: 3.74k, False: 0]
  ------------------
  408|  3.74k|    if (drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_PERFORM) {
  ------------------
  |  Branch (408:9): [True: 0, False: 3.74k]
  ------------------
  409|      0|      mock->DriveEasyScenario(easy.get(), scenario);
  410|  3.74k|    } else if (drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_EVENTS) {
  ------------------
  |  Branch (410:16): [True: 0, False: 3.74k]
  ------------------
  411|      0|      mock->DriveEasyScenario(easy.get(), scenario, true);
  412|  3.74k|    } else if (drive_mode == curl::fuzzer::proto::API_DRIVE_CONNECT_ONLY) {
  ------------------
  |  Branch (412:16): [True: 0, False: 3.74k]
  ------------------
  413|      0|      (void)mock->DriveConnectOnlyScenario(easy.get(), scenario);
  414|  3.74k|    } else {
  415|  3.74k|      mock->DriveScenario(
  416|  3.74k|          easy.get(), scenario,
  417|  3.74k|          mode == ScenarioRunMode::kHttp3Coverage || drive_mode == curl::fuzzer::proto::API_DRIVE_MULTI_SOCKET,
  ------------------
  |  Branch (417:11): [True: 0, False: 3.74k]
  |  Branch (417:54): [True: 0, False: 3.74k]
  ------------------
  418|  3.74k|          api_plan != nullptr && api_plan->wake_multi(), api_plan != nullptr && api_plan->pause_response_once());
  ------------------
  |  Branch (418:11): [True: 0, False: 3.74k]
  |  Branch (418:34): [True: 0, False: 0]
  |  Branch (418:58): [True: 0, False: 3.74k]
  |  Branch (418:81): [True: 0, False: 0]
  ------------------
  419|  3.74k|    }
  420|  3.74k|    if (api_lifecycle != nullptr) {
  ------------------
  |  Branch (420:9): [True: 0, False: 3.74k]
  ------------------
  421|      0|      const bool retains_internal_multi = drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_PERFORM ||
  ------------------
  |  Branch (421:43): [True: 0, False: 0]
  ------------------
  422|      0|                                          drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_EVENTS ||
  ------------------
  |  Branch (422:43): [True: 0, False: 0]
  ------------------
  423|      0|                                          drive_mode == curl::fuzzer::proto::API_DRIVE_CONNECT_ONLY;
  ------------------
  |  Branch (423:43): [True: 0, False: 0]
  ------------------
  424|      0|      api_lifecycle->ProbeTransferResults(retains_internal_multi);
  425|      0|      api_lifecycle->ProbeEasyDuplication();
  426|  3.74k|    } else if (mode != ScenarioRunMode::kFastProtocol) {
  ------------------
  |  Branch (426:16): [True: 0, False: 3.74k]
  ------------------
  427|      0|      ProbeTransferResults(easy.get());
  428|      0|    }
  429|  3.74k|  }
  430|       |
  431|       |  // Easy cleanup is the reliable share-detach boundary even if the bounded
  432|       |  // drive stopped with a connection attached. The lifecycle object—and thus
  433|       |  // lock callback userdata—outlives it, then releases share-owned caches.
  434|      0|  easy.reset();
  435|  3.74k|  connect_to.reset();
  436|  3.74k|  api_lifecycle.reset();
  437|  3.74k|  return 0;
  438|  3.74k|}
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_112SchemePrefixEN4curl6fuzzer5proto6SchemeE:
  177|  3.99k|const char* SchemePrefix(curl::fuzzer::proto::Scheme scheme) {
  178|  3.99k|  switch (scheme) {
  179|      0|    case curl::fuzzer::proto::SCHEME_HTTP:
  ------------------
  |  Branch (179:5): [True: 0, False: 3.99k]
  ------------------
  180|      0|      return "http";
  181|      0|    case curl::fuzzer::proto::SCHEME_HTTPS:
  ------------------
  |  Branch (181:5): [True: 0, False: 3.99k]
  ------------------
  182|      0|      return "https";
  183|      0|    case curl::fuzzer::proto::SCHEME_WS:
  ------------------
  |  Branch (183:5): [True: 0, False: 3.99k]
  ------------------
  184|      0|      return "ws";
  185|      0|    case curl::fuzzer::proto::SCHEME_WSS:
  ------------------
  |  Branch (185:5): [True: 0, False: 3.99k]
  ------------------
  186|      0|      return "wss";
  187|  3.99k|    case curl::fuzzer::proto::SCHEME_TELNET:
  ------------------
  |  Branch (187:5): [True: 3.99k, False: 0]
  ------------------
  188|  3.99k|      return "telnet";
  189|      0|    case curl::fuzzer::proto::SCHEME_FTP:
  ------------------
  |  Branch (189:5): [True: 0, False: 3.99k]
  ------------------
  190|      0|      return "ftp";
  191|      0|    case curl::fuzzer::proto::SCHEME_TFTP:
  ------------------
  |  Branch (191:5): [True: 0, False: 3.99k]
  ------------------
  192|      0|      return "tftp";
  193|      0|    case curl::fuzzer::proto::SCHEME_GOPHER:
  ------------------
  |  Branch (193:5): [True: 0, False: 3.99k]
  ------------------
  194|      0|      return "gopher";
  195|      0|    case curl::fuzzer::proto::SCHEME_GOPHERS:
  ------------------
  |  Branch (195:5): [True: 0, False: 3.99k]
  ------------------
  196|      0|      return "gophers";
  197|      0|    case curl::fuzzer::proto::SCHEME_UNSPECIFIED:
  ------------------
  |  Branch (197:5): [True: 0, False: 3.99k]
  ------------------
  198|      0|    default:
  ------------------
  |  Branch (198:5): [True: 0, False: 3.99k]
  ------------------
  199|      0|      return nullptr;
  200|  3.99k|  }
  201|  3.99k|}
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_125MakeMockServerForScenarioERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeE:
  209|  3.74k|                                                          ScenarioRunMode mode) {
  210|  3.74k|  if (mode == ScenarioRunMode::kHttp3Coverage) {
  ------------------
  |  Branch (210:7): [True: 0, False: 3.74k]
  ------------------
  211|       |#if defined(PROTO_FUZZER_HAS_HTTP3_MOCK_SERVER)
  212|       |    return std::make_unique<Http3MockServer>(scenario.tls_certificate_chain());
  213|       |#else
  214|      0|    return nullptr;
  215|      0|#endif
  216|      0|  }
  217|       |
  218|  3.74k|  if (mode == ScenarioRunMode::kH2ProxyCoverage) {
  ------------------
  |  Branch (218:7): [True: 0, False: 3.74k]
  ------------------
  219|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  220|      0|    return std::make_unique<H2ProxyMockServer>();
  221|       |#else
  222|       |    // MemorySanitizer builds deliberately omit OpenSSL. Keep the target
  223|       |    // binary available to OSS-Fuzz, but do not pretend a plaintext mock can
  224|       |    // negotiate the ALPN gate required to enter cf-h2-proxy.
  225|       |    return nullptr;
  226|       |#endif
  227|      0|  }
  228|       |
  229|  3.74k|  if (mode == ScenarioRunMode::kTlsHttp2Coverage) {
  ------------------
  |  Branch (229:7): [True: 0, False: 3.74k]
  ------------------
  230|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  231|      0|    return std::make_unique<H2OriginMockServer>(scenario.tls_certificate_chain());
  232|       |#else
  233|       |    // This target remains buildable under MemorySanitizer, whose curl build
  234|       |    // omits the OpenSSL server dependency required for TLS/ALPN h2.
  235|       |    return nullptr;
  236|       |#endif
  237|      0|  }
  238|       |
  239|  3.74k|  if (mode == ScenarioRunMode::kSocks4Coverage) {
  ------------------
  |  Branch (239:7): [True: 0, False: 3.74k]
  ------------------
  240|      0|    return std::make_unique<Socks4MockServer>(scenario.socks_proxy_mode());
  241|      0|  }
  242|       |
  243|  3.74k|  switch (scenario.scheme()) {
  244|      0|    case curl::fuzzer::proto::SCHEME_HTTP:
  ------------------
  |  Branch (244:5): [True: 0, False: 3.74k]
  ------------------
  245|      0|      return std::make_unique<MockServer>();
  246|      0|    case curl::fuzzer::proto::SCHEME_HTTPS:
  ------------------
  |  Branch (246:5): [True: 0, False: 3.74k]
  ------------------
  247|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  248|      0|      if (mode == ScenarioRunMode::kTlsCoverage) {
  ------------------
  |  Branch (248:11): [True: 0, False: 0]
  ------------------
  249|      0|        return std::make_unique<TlsMockServer>(scenario.tls_certificate_chain());
  250|      0|      }
  251|       |#else
  252|       |      (void)mode;
  253|       |#endif
  254|      0|      return std::make_unique<MockServer>();
  255|      0|    case curl::fuzzer::proto::SCHEME_GOPHER:
  ------------------
  |  Branch (255:5): [True: 0, False: 3.74k]
  ------------------
  256|      0|      return mode == ScenarioRunMode::kGopherCoverage ? std::make_unique<MockServer>() : nullptr;
  ------------------
  |  Branch (256:14): [True: 0, False: 0]
  ------------------
  257|      0|    case curl::fuzzer::proto::SCHEME_GOPHERS:
  ------------------
  |  Branch (257:5): [True: 0, False: 3.74k]
  ------------------
  258|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  259|      0|      if (mode == ScenarioRunMode::kGopherCoverage) {
  ------------------
  |  Branch (259:11): [True: 0, False: 0]
  ------------------
  260|      0|        return std::make_unique<TlsMockServer>(scenario.tls_certificate_chain());
  261|      0|      }
  262|      0|      return nullptr;
  263|       |#else
  264|       |      return nullptr;
  265|       |#endif
  266|      0|    case curl::fuzzer::proto::SCHEME_WS:
  ------------------
  |  Branch (266:5): [True: 0, False: 3.74k]
  ------------------
  267|      0|    case curl::fuzzer::proto::SCHEME_WSS:
  ------------------
  |  Branch (267:5): [True: 0, False: 3.74k]
  ------------------
  268|      0|      return std::make_unique<WebSocketMockServer>();
  269|  3.74k|    case curl::fuzzer::proto::SCHEME_TELNET:
  ------------------
  |  Branch (269:5): [True: 3.74k, False: 0]
  ------------------
  270|  3.74k|      return std::make_unique<TelnetMockServer>();
  271|      0|    case curl::fuzzer::proto::SCHEME_FTP:
  ------------------
  |  Branch (271:5): [True: 0, False: 3.74k]
  ------------------
  272|       |      // New numeric enum values may already occur in the historical mixed
  273|       |      // corpus as unknown fields. Only the fixed FTP profile may reinterpret
  274|       |      // one as a live two-channel protocol exchange.
  275|      0|      if (mode == ScenarioRunMode::kFtpCoverage) {
  ------------------
  |  Branch (275:11): [True: 0, False: 0]
  ------------------
  276|      0|        return std::make_unique<FtpMockServer>();
  277|      0|      }
  278|      0|      return nullptr;
  279|      0|    case curl::fuzzer::proto::SCHEME_TFTP:
  ------------------
  |  Branch (279:5): [True: 0, False: 3.74k]
  ------------------
  280|       |      // TFTP changes the callback transport from a preconnected stream to a
  281|       |      // real UDP endpoint, so compatibility inputs must not opt into it merely
  282|       |      // because this build learned a new enum value.
  283|      0|      if (mode == ScenarioRunMode::kTftpCoverage) {
  ------------------
  |  Branch (283:11): [True: 0, False: 0]
  ------------------
  284|      0|        return std::make_unique<TftpMockServer>();
  285|      0|      }
  286|      0|      return nullptr;
  287|      0|    case curl::fuzzer::proto::SCHEME_UNSPECIFIED:
  ------------------
  |  Branch (287:5): [True: 0, False: 3.74k]
  ------------------
  288|      0|    default:
  ------------------
  |  Branch (288:5): [True: 0, False: 3.74k]
  ------------------
  289|      0|      return nullptr;
  290|  3.74k|  }
  291|  3.74k|}
scenario_runner.cc:_ZZN12proto_fuzzer11RunScenarioERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeEENK3$_0clEv:
  342|  3.74k|  const auto configure_easy = [&] {
  343|  3.74k|    connect_to.reset(ApplyBaselineOptions(easy.get(), scenario.scheme(), scenario.trace_ids()));
  344|  3.74k|    curl_easy_setopt(easy.get(), CURLOPT_URL, url.c_str());
  ------------------
  |  | 3364|  3.74k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  3.74k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  345|  3.74k|    mock->Install(easy.get());
  346|       |
  347|  3.74k|    if (mode == ScenarioRunMode::kDeepHttpCoverage) {
  ------------------
  |  Branch (347:9): [True: 0, False: 3.74k]
  ------------------
  348|      0|      ApplyDeepHttpFileOptions(easy.get(), cookie_file, altsvc_file, hsts_file, netrc_file);
  349|  3.74k|    } else if (mode == ScenarioRunMode::kTlsCoverage) {
  ------------------
  |  Branch (349:16): [True: 0, False: 3.74k]
  ------------------
  350|      0|      ApplyTlsFileOptions(easy.get(), crl_file);
  351|      0|    }
  352|       |
  353|       |    // Compatibility inputs deliberately bypass the mutating postprocessor,
  354|       |    // so enforce the shared option prefix again at the runtime boundary. The
  355|       |    // helper still ignores individual CURLcodes: the fuzzer stresses curl
  356|       |    // rather than treating rejected combinations as harness failures.
  357|  3.74k|    (void)ApplyScenarioOptions(easy.get(), scenario);
  358|  3.74k|  };

_ZN12proto_fuzzer17ApplyTargetPolicyEPN4curl6fuzzer5proto8ScenarioENS_13TargetProfileE:
 1118|  3.99k|void ApplyTargetPolicy(curl::fuzzer::proto::Scenario* scenario, TargetProfile profile) {
 1119|  3.99k|  if (scenario == nullptr) {
  ------------------
  |  Branch (1119:7): [True: 0, False: 3.99k]
  ------------------
 1120|      0|    return;
 1121|      0|  }
 1122|       |
 1123|  3.99k|  if (profile == TargetProfile::kCompatibility) {
  ------------------
  |  Branch (1123:7): [True: 0, False: 3.99k]
  ------------------
 1124|       |    // The original target's existing corpus predates profile splitting. A
 1125|       |    // no-op here makes the type safe to pass around while its binary continues
 1126|       |    // to omit postprocessor registration altogether. The append-only FTP/TFTP
 1127|       |    // scheme values do not justify rewriting historical mixed-lane inputs.
 1128|      0|    return;
 1129|      0|  }
 1130|       |
 1131|       |  // Accepted server push adds a harness-owned easy handle and therefore
 1132|       |  // belongs only in the fixed-ALPN H2 origin lane. Compatibility remains a
 1133|       |  // no-op above so accumulated mixed corpus entries keep their wire meaning.
 1134|  3.99k|  if (profile != TargetProfile::kHttpsH2) {
  ------------------
  |  Branch (1134:7): [True: 3.99k, False: 0]
  ------------------
 1135|  3.99k|    scenario->clear_accept_h2_push();
 1136|  3.99k|  }
 1137|       |
 1138|       |  // Only the dedicated TLS and QUIC peers consume a certificate-chain
 1139|       |  // selector. Remove it before protocol-specific early returns so other fixed
 1140|       |  // targets do not spend mutations on inert TLS server state.
 1141|  3.99k|  if (profile != TargetProfile::kFastHttps && profile != TargetProfile::kHttpsH2 &&
  ------------------
  |  Branch (1141:7): [True: 3.99k, False: 0]
  |  Branch (1141:47): [True: 3.99k, False: 0]
  ------------------
 1142|  3.99k|      profile != TargetProfile::kFastHttp3) {
  ------------------
  |  Branch (1142:7): [True: 3.99k, False: 0]
  ------------------
 1143|  3.99k|    scenario->clear_tls_certificate_chain();
 1144|  3.99k|  }
 1145|       |
 1146|       |  // Field 13 is append-only so the compatibility target can round-trip it,
 1147|       |  // but every other fixed lane must discard work its peer cannot consume.
 1148|  3.99k|  if (profile != TargetProfile::kFastHttp3) {
  ------------------
  |  Branch (1148:7): [True: 3.99k, False: 0]
  ------------------
 1149|  3.99k|    scenario->clear_http3_plan();
 1150|  3.99k|  }
 1151|       |
 1152|  3.99k|  if (profile != TargetProfile::kSocks4) {
  ------------------
  |  Branch (1152:7): [True: 3.99k, False: 0]
  ------------------
 1153|  3.99k|    scenario->clear_socks_proxy_mode();
 1154|  3.99k|  }
 1155|       |
 1156|  3.99k|  if (profile != TargetProfile::kResolver) {
  ------------------
  |  Branch (1156:7): [True: 3.99k, False: 0]
  ------------------
 1157|  3.99k|    scenario->clear_resolve_entries();
 1158|  3.99k|  }
 1159|       |
 1160|       |  // Anonymous parser files add syscalls and line parsing that belong only in
 1161|       |  // the deep HTTP lane. Clear them before every protocol-specific early path
 1162|       |  // so fast targets never pay to normalize content they cannot consume.
 1163|  3.99k|  if (profile != TargetProfile::kDeepHttp) {
  ------------------
  |  Branch (1163:7): [True: 3.99k, False: 0]
  ------------------
 1164|  3.99k|    scenario->clear_cookie_file();
 1165|  3.99k|    scenario->clear_altsvc_file();
 1166|  3.99k|    scenario->clear_hsts_file();
 1167|  3.99k|    scenario->clear_netrc_file();
 1168|  3.99k|  }
 1169|       |
 1170|       |  // A CRL is useful only when the target completes a real origin TLS setup.
 1171|       |  // Keep malformed or oversized CRLs from turning every other lane into an
 1172|       |  // early TLS-option failure.
 1173|  3.99k|  if (profile != TargetProfile::kFastHttps) {
  ------------------
  |  Branch (1173:7): [True: 3.99k, False: 0]
  ------------------
 1174|  3.99k|    scenario->clear_crl_file();
 1175|  3.99k|  }
 1176|       |
 1177|  3.99k|  if (profile == TargetProfile::kFastHttp3) {
  ------------------
  |  Branch (1177:7): [True: 0, False: 3.99k]
  ------------------
 1178|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTPS);
 1179|      0|    RemoveIgnoredHttp3Shape(scenario);
 1180|      0|    RetainHttp3RequestOptions(scenario);
 1181|      0|    BoundScenarioShape(scenario);
 1182|       |    // BoundScenarioShape materializes an empty primary Connection while
 1183|       |    // sharing request-side limits. Do not retain that protocol-inert message.
 1184|      0|    scenario->clear_connection();
 1185|      0|    BoundHttp3PlanShape(scenario->mutable_http3_plan());
 1186|      0|    CanonicalizeTlsAuthority(scenario);
 1187|      0|    CanonicalizeTlsCertificateChain(scenario);
 1188|      0|    return;
 1189|      0|  }
 1190|       |
 1191|  3.99k|  if (profile == TargetProfile::kFastTelnet) {
  ------------------
  |  Branch (1191:7): [True: 3.99k, False: 0]
  ------------------
 1192|       |    // Set the scheme before general bounds so the TELNET-specific upload and
 1193|       |    // PAUSE budgets are selected rather than event-driven compatibility ones.
 1194|  3.99k|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_TELNET);
 1195|  3.99k|    RemoveApiOnlyShape(scenario);
 1196|  3.99k|    RemoveMultiOnlyShape(scenario);
 1197|  3.99k|    RemoveNonTelnetShape(scenario);
 1198|  3.99k|    RetainCheapTelnetOptions(scenario);
 1199|  3.99k|    BoundScenarioShape(scenario);
 1200|  3.99k|    BoundTelnetResponse(scenario->mutable_connection());
 1201|  3.99k|    return;
 1202|  3.99k|  }
 1203|       |
 1204|      0|  if (profile == TargetProfile::kFastHttp) {
  ------------------
  |  Branch (1204:7): [True: 0, False: 0]
  ------------------
 1205|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1206|      0|    RemoveApiOnlyShape(scenario);
 1207|      0|    RemoveMultiOnlyShape(scenario);
 1208|      0|    RemoveTelnetOnlyShape(scenario);
 1209|      0|    RemoveDeepHttpShape(scenario);
 1210|      0|    RetainCheapHttpOptions(scenario);
 1211|      0|    BoundScenarioShape(scenario);
 1212|      0|    return;
 1213|      0|  }
 1214|       |
 1215|      0|  if (profile == TargetProfile::kH2Proxy) {
  ------------------
  |  Branch (1215:7): [True: 0, False: 0]
  ------------------
 1216|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1217|      0|    RemoveApiOnlyShape(scenario);
 1218|      0|    RemoveMultiOnlyShape(scenario);
 1219|      0|    RemoveTelnetOnlyShape(scenario);
 1220|      0|    RemoveIgnoredH2ProxyShape(scenario);
 1221|      0|    RetainH2ProxyOriginOptions(scenario);
 1222|      0|    BoundScenarioShape(scenario);
 1223|      0|    CanonicalizeH2ProxyOriginAuthority(scenario);
 1224|      0|    return;
 1225|      0|  }
 1226|       |
 1227|      0|  if (profile == TargetProfile::kHttpsH2) {
  ------------------
  |  Branch (1227:7): [True: 0, False: 0]
  ------------------
 1228|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTPS);
 1229|      0|    RemoveApiOnlyShape(scenario);
 1230|      0|    RemoveMultiOnlyShape(scenario);
 1231|      0|    RemoveTelnetOnlyShape(scenario);
 1232|      0|    RemoveIgnoredH2ProxyShape(scenario);
 1233|      0|    RetainH2ProxyOriginOptions(scenario);
 1234|      0|    BoundScenarioShape(scenario);
 1235|      0|    CanonicalizeTlsAuthority(scenario);
 1236|      0|    CanonicalizeTlsCertificateChain(scenario);
 1237|      0|    return;
 1238|      0|  }
 1239|       |
 1240|      0|  if (profile == TargetProfile::kSocks4) {
  ------------------
  |  Branch (1240:7): [True: 0, False: 0]
  ------------------
 1241|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1242|      0|    if (scenario->socks_proxy_mode() != curl::fuzzer::proto::SOCKS_PROXY_SOCKS4A) {
  ------------------
  |  Branch (1242:9): [True: 0, False: 0]
  ------------------
 1243|      0|      scenario->set_socks_proxy_mode(curl::fuzzer::proto::SOCKS_PROXY_SOCKS4);
 1244|      0|    }
 1245|      0|    RemoveApiOnlyShape(scenario);
 1246|      0|    RemoveMultiOnlyShape(scenario);
 1247|      0|    RemoveTelnetOnlyShape(scenario);
 1248|      0|    RemoveDeepHttpShape(scenario);
 1249|      0|    RetainCheapHttpOptions(scenario);
 1250|      0|    scenario->mutable_connection()->clear_initial_response();
 1251|      0|    BoundScenarioShape(scenario);
 1252|      0|    CanonicalizeSocksAuthority(scenario);
 1253|      0|    return;
 1254|      0|  }
 1255|       |
 1256|      0|  if (profile == TargetProfile::kResolver) {
  ------------------
  |  Branch (1256:7): [True: 0, False: 0]
  ------------------
 1257|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1258|      0|    RemoveApiOnlyShape(scenario);
 1259|      0|    RemoveMultiOnlyShape(scenario);
 1260|      0|    RemoveTelnetOnlyShape(scenario);
 1261|      0|    RemoveDeepHttpShape(scenario);
 1262|      0|    RetainCheapHttpOptions(scenario);
 1263|      0|    BoundStringValues(scenario->mutable_resolve_entries(), scenario_limits::kMaxResolveEntries,
 1264|      0|                      scenario_limits::kMaxResolveEntryBytes);
 1265|      0|    BoundScenarioShape(scenario);
 1266|      0|    CanonicalizeResolverAuthority(scenario);
 1267|      0|    return;
 1268|      0|  }
 1269|       |
 1270|      0|  if (profile == TargetProfile::kFastFtp) {
  ------------------
  |  Branch (1270:7): [True: 0, False: 0]
  ------------------
 1271|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_FTP);
 1272|      0|    RemoveIgnoredFtpShape(scenario);
 1273|      0|    RetainFtpOptions(scenario);
 1274|      0|    CanonicalizeFtpOptionModes(scenario);
 1275|      0|    BoundScenarioShape(scenario);
 1276|      0|    CanonicalizeFtpAuthority(scenario);
 1277|      0|    return;
 1278|      0|  }
 1279|       |
 1280|      0|  if (profile == TargetProfile::kFastTftp) {
  ------------------
  |  Branch (1280:7): [True: 0, False: 0]
  ------------------
 1281|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_TFTP);
 1282|      0|    RemoveIgnoredTftpShape(scenario);
 1283|      0|    RetainTftpOptions(scenario);
 1284|      0|    CanonicalizeTftpOptionModes(scenario);
 1285|      0|    BoundScenarioShape(scenario);
 1286|      0|    CanonicalizeTftpAuthority(scenario);
 1287|      0|    return;
 1288|      0|  }
 1289|       |
 1290|      0|  if (profile == TargetProfile::kFastGopher) {
  ------------------
  |  Branch (1290:7): [True: 0, False: 0]
  ------------------
 1291|      0|    scenario->set_scheme(scenario->scheme() == curl::fuzzer::proto::SCHEME_GOPHERS
  ------------------
  |  Branch (1291:26): [True: 0, False: 0]
  ------------------
 1292|      0|                             ? curl::fuzzer::proto::SCHEME_GOPHERS
 1293|      0|                             : curl::fuzzer::proto::SCHEME_GOPHER);
 1294|      0|    RemoveIgnoredGopherShape(scenario);
 1295|      0|    RemoveFileTransferOnlyOptions(scenario);
 1296|      0|    BoundScenarioShape(scenario);
 1297|      0|    CanonicalizeTlsAuthority(scenario);
 1298|      0|    return;
 1299|      0|  }
 1300|       |
 1301|       |  // Select the lane's scheme before applying scheme-sensitive upload bounds.
 1302|       |  // The scheme field is itself mutable, so bounding first could accidentally
 1303|       |  // give an HTTP/WS case TELNET's smaller payload budget merely because that
 1304|       |  // was the input's pre-policy value.
 1305|      0|  switch (profile) {
  ------------------
  |  Branch (1305:11): [True: 0, False: 0]
  ------------------
 1306|      0|    case TargetProfile::kCompatibility:
  ------------------
  |  Branch (1306:5): [True: 0, False: 0]
  ------------------
 1307|      0|      return;
 1308|      0|    case TargetProfile::kDeepHttp:
  ------------------
  |  Branch (1308:5): [True: 0, False: 0]
  ------------------
 1309|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1310|      0|      break;
 1311|      0|    case TargetProfile::kApi:
  ------------------
  |  Branch (1311:5): [True: 0, False: 0]
  ------------------
 1312|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1313|      0|      break;
 1314|      0|    case TargetProfile::kMulti:
  ------------------
  |  Branch (1314:5): [True: 0, False: 0]
  ------------------
 1315|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 1316|      0|      break;
 1317|      0|    case TargetProfile::kFastHttps:
  ------------------
  |  Branch (1317:5): [True: 0, False: 0]
  ------------------
 1318|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTPS);
 1319|      0|      break;
 1320|      0|    case TargetProfile::kHttpsH2:
  ------------------
  |  Branch (1320:5): [True: 0, False: 0]
  ------------------
 1321|       |      // The protocol-specific early path fixes ALPN and prunes incompatible
 1322|       |      // response shapes while retaining the raw frame script.
 1323|      0|      return;
 1324|      0|    case TargetProfile::kFastHttp3:
  ------------------
  |  Branch (1324:5): [True: 0, False: 0]
  ------------------
 1325|       |      // The protocol-specific early path owns the QUIC response plan.
 1326|      0|      return;
 1327|      0|    case TargetProfile::kH2Proxy:
  ------------------
  |  Branch (1327:5): [True: 0, False: 0]
  ------------------
 1328|       |      // The early path removes proxy-incompatible fields before general
 1329|       |      // bounds, keeping raw frame mutation dense.
 1330|      0|      return;
 1331|      0|    case TargetProfile::kSocks4:
  ------------------
  |  Branch (1331:5): [True: 0, False: 0]
  ------------------
 1332|       |      // The early path fixes proxy routing and request-triggered replies.
 1333|      0|      return;
 1334|      0|    case TargetProfile::kResolver:
  ------------------
  |  Branch (1334:5): [True: 0, False: 0]
  ------------------
 1335|       |      // The early path fixes safe DNS/cache routing and bounds its slist.
 1336|      0|      return;
 1337|      0|    case TargetProfile::kFastWebSocket:
  ------------------
  |  Branch (1337:5): [True: 0, False: 0]
  ------------------
 1338|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_WS);
 1339|      0|      break;
 1340|      0|    case TargetProfile::kFastSecureWebSocket:
  ------------------
  |  Branch (1340:5): [True: 0, False: 0]
  ------------------
 1341|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_WSS);
 1342|      0|      break;
 1343|      0|    case TargetProfile::kTiming:
  ------------------
  |  Branch (1343:5): [True: 0, False: 0]
  ------------------
 1344|      0|      scenario->set_scheme(PlaintextScheme(scenario->scheme()));
 1345|      0|      break;
 1346|      0|    case TargetProfile::kFastHttp:
  ------------------
  |  Branch (1346:5): [True: 0, False: 0]
  ------------------
 1347|      0|    case TargetProfile::kFastTelnet:
  ------------------
  |  Branch (1347:5): [True: 0, False: 0]
  ------------------
 1348|      0|    case TargetProfile::kFastFtp:
  ------------------
  |  Branch (1348:5): [True: 0, False: 0]
  ------------------
 1349|      0|    case TargetProfile::kFastTftp:
  ------------------
  |  Branch (1349:5): [True: 0, False: 0]
  ------------------
 1350|      0|    case TargetProfile::kFastGopher:
  ------------------
  |  Branch (1350:5): [True: 0, False: 0]
  ------------------
 1351|       |      // Protocol-specific early-return paths selected their scheme above.
 1352|      0|      return;
 1353|      0|  }
 1354|       |
 1355|       |  // TELNET's retained slist and synchronous pause have no observable, safe
 1356|       |  // meaning in the fixed event-driven lanes. Clear them before walking the
 1357|       |  // general shape so only the compatibility and TELNET targets can retain
 1358|       |  // those values.
 1359|      0|  RemoveTelnetOnlyShape(scenario);
 1360|      0|  if (profile != TargetProfile::kApi) {
  ------------------
  |  Branch (1360:7): [True: 0, False: 0]
  ------------------
 1361|      0|    RemoveApiOnlyShape(scenario);
 1362|      0|  }
 1363|      0|  if (profile != TargetProfile::kMulti) {
  ------------------
  |  Branch (1363:7): [True: 0, False: 0]
  ------------------
 1364|      0|    RemoveMultiOnlyShape(scenario);
 1365|      0|  }
 1366|      0|  RemoveFileTransferOnlyOptions(scenario);
 1367|      0|  BoundScenarioShape(scenario);
 1368|       |
 1369|      0|  switch (profile) {
  ------------------
  |  Branch (1369:11): [True: 0, False: 0]
  ------------------
 1370|      0|    case TargetProfile::kCompatibility:
  ------------------
  |  Branch (1370:5): [True: 0, False: 0]
  ------------------
 1371|      0|      return;
 1372|      0|    case TargetProfile::kFastHttp:
  ------------------
  |  Branch (1372:5): [True: 0, False: 0]
  ------------------
 1373|       |      // Handled before the general bounds so discarded deep shapes are never
 1374|       |      // traversed on the fast path.
 1375|      0|      return;
 1376|       |
 1377|      0|    case TargetProfile::kDeepHttp:
  ------------------
  |  Branch (1377:5): [True: 0, False: 0]
  ------------------
 1378|      0|      ClearAllBackpressure(scenario);
 1379|      0|      if (!scenario->altsvc_file().empty()) {
  ------------------
  |  Branch (1379:11): [True: 0, False: 0]
  ------------------
 1380|      0|        CanonicalizeAltSvcAuthority(scenario);
 1381|      0|      }
 1382|      0|      return;
 1383|       |
 1384|      0|    case TargetProfile::kApi:
  ------------------
  |  Branch (1384:5): [True: 0, False: 0]
  ------------------
 1385|      0|      ClearAllBackpressure(scenario);
 1386|      0|      if (scenario->host_path().size() > scenario_limits::kMaxApiStringBytes) {
  ------------------
  |  Branch (1386:11): [True: 0, False: 0]
  ------------------
 1387|      0|        scenario->mutable_host_path()->resize(scenario_limits::kMaxApiStringBytes);
 1388|      0|      }
 1389|      0|      if (scenario->has_api_plan()) {
  ------------------
  |  Branch (1389:11): [True: 0, False: 0]
  ------------------
 1390|      0|        BoundApiPlanShape(scenario->mutable_api_plan());
 1391|      0|      }
 1392|      0|      return;
 1393|       |
 1394|      0|    case TargetProfile::kMulti: {
  ------------------
  |  Branch (1394:5): [True: 0, False: 0]
  ------------------
 1395|      0|      ClearAllBackpressure(scenario);
 1396|      0|      CanonicalizeMultiAuthority(scenario);
 1397|      0|      auto* plan = scenario->mutable_multi_plan();
 1398|      0|      BoundMultiPlanShape(plan);
 1399|      0|      TrimRepeated(scenario->mutable_subsequent_connections(), plan->transfer_count() - 1U);
 1400|      0|      return;
 1401|      0|    }
 1402|       |
 1403|      0|    case TargetProfile::kFastHttps:
  ------------------
  |  Branch (1403:5): [True: 0, False: 0]
  ------------------
 1404|      0|      ClearAllBackpressure(scenario);
 1405|      0|      CanonicalizeTlsAuthority(scenario);
 1406|      0|      CanonicalizeTlsCertificateChain(scenario);
 1407|      0|      return;
 1408|       |
 1409|      0|    case TargetProfile::kHttpsH2:
  ------------------
  |  Branch (1409:5): [True: 0, False: 0]
  ------------------
 1410|       |      // Handled by the raw HTTP/2 protocol-specific early path above.
 1411|      0|      return;
 1412|       |
 1413|      0|    case TargetProfile::kFastHttp3:
  ------------------
  |  Branch (1413:5): [True: 0, False: 0]
  ------------------
 1414|       |      // Handled before generic connection bounding because Http3Plan replaces
 1415|       |      // the stream-socket response script.
 1416|      0|      return;
 1417|       |
 1418|      0|    case TargetProfile::kH2Proxy:
  ------------------
  |  Branch (1418:5): [True: 0, False: 0]
  ------------------
 1419|       |      // Handled by the protocol-specific early path above.
 1420|      0|      return;
 1421|       |
 1422|      0|    case TargetProfile::kSocks4:
  ------------------
  |  Branch (1422:5): [True: 0, False: 0]
  ------------------
 1423|       |      // Handled by the protocol-specific early path above.
 1424|      0|      return;
 1425|       |
 1426|      0|    case TargetProfile::kResolver:
  ------------------
  |  Branch (1426:5): [True: 0, False: 0]
  ------------------
 1427|       |      // Handled by the resolver-specific early path above.
 1428|      0|      return;
 1429|       |
 1430|      0|    case TargetProfile::kFastWebSocket:
  ------------------
  |  Branch (1430:5): [True: 0, False: 0]
  ------------------
 1431|      0|      ClearAllBackpressure(scenario);
 1432|      0|      RemoveIgnoredWebSocketShape(scenario);
 1433|      0|      return;
 1434|       |
 1435|      0|    case TargetProfile::kFastSecureWebSocket:
  ------------------
  |  Branch (1435:5): [True: 0, False: 0]
  ------------------
 1436|      0|      ClearAllBackpressure(scenario);
 1437|      0|      RemoveIgnoredWebSocketShape(scenario);
 1438|      0|      return;
 1439|       |
 1440|      0|    case TargetProfile::kFastTelnet:
  ------------------
  |  Branch (1440:5): [True: 0, False: 0]
  ------------------
 1441|       |      // Handled before the general bounds so its protocol-specific limits are
 1442|       |      // selected from the start.
 1443|      0|      return;
 1444|       |
 1445|      0|    case TargetProfile::kFastFtp:
  ------------------
  |  Branch (1445:5): [True: 0, False: 0]
  ------------------
 1446|      0|    case TargetProfile::kFastTftp:
  ------------------
  |  Branch (1446:5): [True: 0, False: 0]
  ------------------
 1447|      0|    case TargetProfile::kFastGopher:
  ------------------
  |  Branch (1447:5): [True: 0, False: 0]
  ------------------
 1448|       |      // Their peers consume narrower raw-script shapes, pruned before general
 1449|       |      // bounds so ignored fields never tax these fast paths.
 1450|      0|      return;
 1451|       |
 1452|      0|    case TargetProfile::kTiming: {
  ------------------
  |  Branch (1452:5): [True: 0, False: 0]
  ------------------
 1453|      0|      if (scenario->scheme() == curl::fuzzer::proto::SCHEME_WS) {
  ------------------
  |  Branch (1453:11): [True: 0, False: 0]
  ------------------
 1454|      0|        RemoveIgnoredWebSocketShape(scenario);
 1455|      0|      }
 1456|      0|      auto* backpressure = scenario->mutable_connection()->mutable_backpressure();
 1457|      0|      if (backpressure->recv_buf_bytes() == 0) {
  ------------------
  |  Branch (1457:11): [True: 0, False: 0]
  ------------------
 1458|       |        // A drain limit alone cannot fill the default AF_UNIX buffer with the
 1459|       |        // harness's bounded upload. Always tighten the socket so this lane
 1460|       |        // represents real pressure, not merely selection of the timed loop.
 1461|      0|        backpressure->set_recv_buf_bytes(kDefaultBackpressureBufferBytes);
 1462|      0|      } else {
 1463|      0|        backpressure->set_recv_buf_bytes(CanonicalizeNonZero(backpressure->recv_buf_bytes(),
 1464|      0|                                                             kMinBackpressureBufferBytes, kMaxBackpressureBufferBytes));
 1465|      0|      }
 1466|      0|      backpressure->set_drain_limit(CanonicalizeNonZero(backpressure->drain_limit(), 1, kMaxDrainBytesPerIteration));
 1467|      0|      for (auto& connection : *scenario->mutable_subsequent_connections()) {
  ------------------
  |  Branch (1467:29): [True: 0, False: 0]
  ------------------
 1468|      0|        CanonicalizeOptionalBackpressure(&connection);
 1469|      0|      }
 1470|      0|      return;
 1471|      0|    }
 1472|      0|  }
 1473|      0|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_121RetainMatchingOptionsIPFbN4curl6fuzzer5proto12CurlOptionIdEEEEvPNS4_8ScenarioET_:
  692|  3.99k|void RetainMatchingOptions(curl::fuzzer::proto::Scenario* scenario, Predicate predicate) {
  693|  3.99k|  auto* options = scenario->mutable_options();
  694|  3.99k|  int retained = 0;
  695|  30.9k|  for (int index = 0; index < options->size(); ++index) {
  ------------------
  |  Branch (695:23): [True: 26.9k, False: 3.99k]
  ------------------
  696|  26.9k|    if (!predicate(options->Get(index).option_id())) {
  ------------------
  |  Branch (696:9): [True: 8.78k, False: 18.1k]
  ------------------
  697|  8.78k|      continue;
  698|  8.78k|    }
  699|  18.1k|    if (retained != index) {
  ------------------
  |  Branch (699:9): [True: 12.5k, False: 5.61k]
  ------------------
  700|  12.5k|      options->SwapElements(retained, index);
  701|  12.5k|    }
  702|  18.1k|    ++retained;
  703|  18.1k|  }
  704|  3.99k|  options->DeleteSubrange(retained, options->size() - retained);
  705|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_118BoundScenarioShapeEPN4curl6fuzzer5proto8ScenarioE:
  553|  3.99k|void BoundScenarioShape(curl::fuzzer::proto::Scenario* scenario) {
  554|  3.99k|  TrimRepeated(scenario->mutable_options(), scenario_limits::kMaxOptions);
  555|  6.43k|  for (auto& option : *scenario->mutable_options()) {
  ------------------
  |  Branch (555:21): [True: 6.43k, False: 3.99k]
  ------------------
  556|  6.43k|    if (option.value_case() == curl::fuzzer::proto::SetOption::kStringValue) {
  ------------------
  |  Branch (556:9): [True: 3.66k, False: 2.76k]
  ------------------
  557|  3.66k|      TrimMetadata(option.mutable_string_value());
  558|  3.66k|    }
  559|  6.43k|  }
  560|       |
  561|  3.99k|  BoundHeaderValues(scenario->mutable_request_headers(), scenario_limits::kMaxRequestHeaders);
  562|  3.99k|  BoundStringValues(scenario->mutable_telnet_options(), scenario_limits::kMaxTelnetOptions,
  563|  3.99k|                    scenario_limits::kMaxTelnetOptionBytes);
  564|  3.99k|  if (scenario->has_mime_post()) {
  ------------------
  |  Branch (564:7): [True: 0, False: 3.99k]
  ------------------
  565|      0|    BoundMimeShape(scenario->mutable_mime_post());
  566|      0|  }
  567|  3.99k|  if (scenario->has_upload()) {
  ------------------
  |  Branch (567:7): [True: 221, False: 3.77k]
  ------------------
  568|    221|    const bool telnet = scenario->scheme() == curl::fuzzer::proto::SCHEME_TELNET;
  569|    221|    const std::size_t data_limit = telnet ? scenario_limits::kMaxTelnetUploadBytes : scenario_limits::kMaxUploadBytes;
  ------------------
  |  Branch (569:36): [True: 221, False: 0]
  ------------------
  570|    221|    const std::size_t read_step_limit =
  571|    221|        telnet ? scenario_limits::kMaxTelnetUploadReadSteps : scenario_limits::kMaxUploadReadSteps;
  ------------------
  |  Branch (571:9): [True: 221, False: 0]
  ------------------
  572|    221|    const std::size_t read_size_limit =
  573|    221|        telnet ? scenario_limits::kMaxTelnetUploadReadSize : scenario_limits::kMaxUploadReadSize;
  ------------------
  |  Branch (573:9): [True: 221, False: 0]
  ------------------
  574|    221|    BoundUploadShape(scenario->mutable_upload(), data_limit, read_step_limit, read_size_limit);
  575|    221|  }
  576|       |
  577|  3.99k|  BoundConnectionShape(scenario->mutable_connection());
  578|  3.99k|  TrimRepeated(scenario->mutable_subsequent_connections(), scenario_limits::kMaxConnections - 1);
  579|  3.99k|  for (auto& connection : *scenario->mutable_subsequent_connections()) {
  ------------------
  |  Branch (579:25): [True: 0, False: 3.99k]
  ------------------
  580|      0|    BoundConnectionShape(&connection);
  581|      0|  }
  582|  3.99k|  BoundFileInputs(scenario);
  583|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto9SetOptionEEEEEvPT_m:
   38|  3.99k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   39|  3.99k|  const std::size_t size = static_cast<std::size_t>(field->size());
   40|  3.99k|  if (size > limit) {
  ------------------
  |  Branch (40:7): [True: 27, False: 3.97k]
  ------------------
   41|     27|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   42|     27|  }
   43|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimMetadataEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   48|  3.66k|void TrimMetadata(std::string* value) {
   49|  3.66k|  if (value->size() > scenario_limits::kMaxMetadataBytes) {
  ------------------
  |  Branch (49:7): [True: 0, False: 3.66k]
  ------------------
   50|      0|    value->resize(scenario_limits::kMaxMetadataBytes);
   51|      0|  }
   52|  3.66k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_117BoundHeaderValuesIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_m:
  193|  3.99k|void BoundHeaderValues(RepeatedBytes* headers, std::size_t limit) {
  194|  3.99k|  BoundStringValues(headers, limit, scenario_limits::kMaxMetadataBytes);
  195|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_116BoundUploadShapeEPN4curl6fuzzer5proto12UploadScriptEmmm:
  280|    221|                      std::size_t read_size_limit) {
  281|    221|  if (upload->data().size() > data_limit) {
  ------------------
  |  Branch (281:7): [True: 2, False: 219]
  ------------------
  282|      2|    upload->mutable_data()->resize(data_limit);
  283|      2|  }
  284|       |  // RepeatedField<uint32_t> lacks RepeatedPtrField's DeleteSubrange helper;
  285|       |  // removing the ignored suffix from the end is constant-time per element and
  286|       |  // preserves the mutation-significant prefix exactly.
  287|  7.39k|  while (static_cast<std::size_t>(upload->read_sizes_size()) > read_step_limit) {
  ------------------
  |  Branch (287:10): [True: 7.16k, False: 221]
  ------------------
  288|  7.16k|    upload->mutable_read_sizes()->RemoveLast();
  289|  7.16k|  }
  290|    361|  for (int i = 0; i < upload->read_sizes_size(); ++i) {
  ------------------
  |  Branch (290:19): [True: 140, False: 221]
  ------------------
  291|    140|    if (upload->read_sizes(i) > read_size_limit) {
  ------------------
  |  Branch (291:9): [True: 23, False: 117]
  ------------------
  292|     23|      upload->set_read_sizes(i, static_cast<std::uint32_t>(read_size_limit));
  293|     23|    }
  294|    140|  }
  295|    221|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_120BoundConnectionShapeEPN4curl6fuzzer5proto10ConnectionE:
  200|  3.99k|void BoundConnectionShape(curl::fuzzer::proto::Connection* connection) {
  201|  3.99k|  TrimRepeated(connection->mutable_on_readable(), scenario_limits::kMaxResponseChunks);
  202|  3.99k|  const std::size_t raw_count = static_cast<std::size_t>(connection->on_readable_size());
  203|  3.99k|  TrimRepeated(connection->mutable_server_frames(), scenario_limits::kMaxResponseChunks - raw_count);
  204|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_m:
   38|  11.9k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   39|  11.9k|  const std::size_t size = static_cast<std::size_t>(field->size());
   40|  11.9k|  if (size > limit) {
  ------------------
  |  Branch (40:7): [True: 29, False: 11.9k]
  ------------------
   41|     29|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   42|     29|  }
   43|  11.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto14WebSocketFrameEEEEEvPT_m:
   38|  3.99k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   39|  3.99k|  const std::size_t size = static_cast<std::size_t>(field->size());
   40|  3.99k|  if (size > limit) {
  ------------------
  |  Branch (40:7): [True: 0, False: 3.99k]
  ------------------
   41|      0|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   42|      0|  }
   43|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_115BoundFileInputsEPN4curl6fuzzer5proto8ScenarioE:
  216|  3.99k|void BoundFileInputs(curl::fuzzer::proto::Scenario* scenario) {
  217|  3.99k|  std::size_t remaining_bytes = scenario_limits::kMaxFileInputTotalBytes;
  218|  3.99k|  BoundFileInput(scenario->mutable_cookie_file(), &remaining_bytes);
  219|  3.99k|  BoundFileInput(scenario->mutable_altsvc_file(), &remaining_bytes);
  220|  3.99k|  BoundFileInput(scenario->mutable_hsts_file(), &remaining_bytes);
  221|  3.99k|  BoundFileInput(scenario->mutable_netrc_file(), &remaining_bytes);
  222|  3.99k|  BoundFileInput(scenario->mutable_crl_file(), &remaining_bytes);
  223|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_114BoundFileInputEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPm:
  208|  19.9k|void BoundFileInput(std::string* input, std::size_t* remaining_bytes) {
  209|  19.9k|  const std::size_t limit = std::min(scenario_limits::kMaxFileInputBytes, *remaining_bytes);
  210|  19.9k|  if (input->size() > limit) {
  ------------------
  |  Branch (210:7): [True: 0, False: 19.9k]
  ------------------
  211|      0|    input->resize(limit);
  212|      0|  }
  213|  19.9k|  *remaining_bytes -= input->size();
  214|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_118RemoveApiOnlyShapeEPN4curl6fuzzer5proto8ScenarioE:
  984|  3.99k|void RemoveApiOnlyShape(curl::fuzzer::proto::Scenario* scenario) { scenario->clear_api_plan(); }
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_120RemoveMultiOnlyShapeEPN4curl6fuzzer5proto8ScenarioE:
  988|  3.99k|void RemoveMultiOnlyShape(curl::fuzzer::proto::Scenario* scenario) { scenario->clear_multi_plan(); }
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_120RemoveNonTelnetShapeEPN4curl6fuzzer5proto8ScenarioE:
  960|  3.99k|void RemoveNonTelnetShape(curl::fuzzer::proto::Scenario* scenario) {
  961|  3.99k|  scenario->clear_subsequent_connections();
  962|  3.99k|  scenario->clear_request_headers();
  963|  3.99k|  scenario->clear_mime_post();
  964|       |
  965|  3.99k|  auto* connection = scenario->mutable_connection();
  966|  3.99k|  connection->clear_server_frames();
  967|  3.99k|  connection->clear_manual_probes();
  968|  3.99k|  connection->clear_backpressure();
  969|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_124RetainCheapTelnetOptionsEPN4curl6fuzzer5proto8ScenarioE:
  748|  3.99k|void RetainCheapTelnetOptions(curl::fuzzer::proto::Scenario* scenario) {
  749|  3.99k|  RetainMatchingOptions(scenario, &IsCheapTelnetOption);
  750|  3.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_119IsCheapTelnetOptionEN4curl6fuzzer5proto12CurlOptionIdE:
  730|  26.9k|bool IsCheapTelnetOption(curl::fuzzer::proto::CurlOptionId option_id) {
  731|  26.9k|  switch (option_id) {
  732|  9.96k|    case curl::fuzzer::proto::CURLOPT_CRLF:
  ------------------
  |  Branch (732:5): [True: 9.96k, False: 16.9k]
  ------------------
  733|  15.6k|    case curl::fuzzer::proto::CURLOPT_USERPWD:
  ------------------
  |  Branch (733:5): [True: 5.73k, False: 21.2k]
  ------------------
  734|  16.0k|    case curl::fuzzer::proto::CURLOPT_USERNAME:
  ------------------
  |  Branch (734:5): [True: 335, False: 26.6k]
  ------------------
  735|  17.3k|    case curl::fuzzer::proto::CURLOPT_PASSWORD:
  ------------------
  |  Branch (735:5): [True: 1.33k, False: 25.6k]
  ------------------
  736|  18.1k|    case curl::fuzzer::proto::CURLOPT_MAXFILESIZE_LARGE:
  ------------------
  |  Branch (736:5): [True: 803, False: 26.1k]
  ------------------
  737|  18.1k|      return true;
  738|       |
  739|  4.73k|    case curl::fuzzer::proto::CURL_OPTION_UNSPECIFIED:
  ------------------
  |  Branch (739:5): [True: 4.73k, False: 22.2k]
  ------------------
  740|  8.78k|    default:
  ------------------
  |  Branch (740:5): [True: 4.05k, False: 22.9k]
  ------------------
  741|  8.78k|      return false;
  742|  26.9k|  }
  743|  26.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_117BoundStringValuesIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_mm:
  183|  7.99k|void BoundStringValues(RepeatedBytes* values, std::size_t count_limit, std::size_t value_limit) {
  184|  7.99k|  TrimRepeated(values, count_limit);
  185|  7.99k|  for (std::string& value : *values) {
  ------------------
  |  Branch (185:27): [True: 944, False: 7.99k]
  ------------------
  186|    944|    if (value.size() > value_limit) {
  ------------------
  |  Branch (186:9): [True: 3, False: 941]
  ------------------
  187|      3|      value.resize(value_limit);
  188|      3|    }
  189|    944|  }
  190|  7.99k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto10ConnectionEEEEEvPT_m:
   38|  3.99k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   39|  3.99k|  const std::size_t size = static_cast<std::size_t>(field->size());
   40|  3.99k|  if (size > limit) {
  ------------------
  |  Branch (40:7): [True: 0, False: 3.99k]
  ------------------
   41|      0|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   42|      0|  }
   43|  3.99k|}

_ZN12proto_fuzzer10RunModeForENS_13TargetProfileE:
   95|  3.99k|constexpr ScenarioRunMode RunModeFor(TargetProfile profile) {
   96|  3.99k|  switch (profile) {
  ------------------
  |  Branch (96:11): [True: 3.99k, False: 0]
  ------------------
   97|      0|    case TargetProfile::kFastHttp:
  ------------------
  |  Branch (97:5): [True: 0, False: 3.99k]
  ------------------
   98|  3.99k|    case TargetProfile::kFastTelnet:
  ------------------
  |  Branch (98:5): [True: 3.99k, False: 0]
  ------------------
   99|  3.99k|      return ScenarioRunMode::kFastProtocol;
  100|       |
  101|      0|    case TargetProfile::kApi:
  ------------------
  |  Branch (101:5): [True: 0, False: 3.99k]
  ------------------
  102|      0|      return ScenarioRunMode::kApiLifecycle;
  103|       |
  104|      0|    case TargetProfile::kMulti:
  ------------------
  |  Branch (104:5): [True: 0, False: 3.99k]
  ------------------
  105|      0|      return ScenarioRunMode::kMultiTransfer;
  106|       |
  107|      0|    case TargetProfile::kFastHttps:
  ------------------
  |  Branch (107:5): [True: 0, False: 3.99k]
  ------------------
  108|      0|      return ScenarioRunMode::kTlsCoverage;
  109|       |
  110|      0|    case TargetProfile::kHttpsH2:
  ------------------
  |  Branch (110:5): [True: 0, False: 3.99k]
  ------------------
  111|      0|      return ScenarioRunMode::kTlsHttp2Coverage;
  112|       |
  113|      0|    case TargetProfile::kFastHttp3:
  ------------------
  |  Branch (113:5): [True: 0, False: 3.99k]
  ------------------
  114|      0|      return ScenarioRunMode::kHttp3Coverage;
  115|       |
  116|      0|    case TargetProfile::kH2Proxy:
  ------------------
  |  Branch (116:5): [True: 0, False: 3.99k]
  ------------------
  117|      0|      return ScenarioRunMode::kH2ProxyCoverage;
  118|       |
  119|      0|    case TargetProfile::kSocks4:
  ------------------
  |  Branch (119:5): [True: 0, False: 3.99k]
  ------------------
  120|      0|      return ScenarioRunMode::kSocks4Coverage;
  121|       |
  122|      0|    case TargetProfile::kResolver:
  ------------------
  |  Branch (122:5): [True: 0, False: 3.99k]
  ------------------
  123|      0|      return ScenarioRunMode::kResolverCoverage;
  124|       |
  125|      0|    case TargetProfile::kFastFtp:
  ------------------
  |  Branch (125:5): [True: 0, False: 3.99k]
  ------------------
  126|      0|      return ScenarioRunMode::kFtpCoverage;
  127|       |
  128|      0|    case TargetProfile::kFastTftp:
  ------------------
  |  Branch (128:5): [True: 0, False: 3.99k]
  ------------------
  129|      0|      return ScenarioRunMode::kTftpCoverage;
  130|       |
  131|      0|    case TargetProfile::kFastGopher:
  ------------------
  |  Branch (131:5): [True: 0, False: 3.99k]
  ------------------
  132|      0|      return ScenarioRunMode::kGopherCoverage;
  133|       |
  134|      0|    case TargetProfile::kCompatibility:
  ------------------
  |  Branch (134:5): [True: 0, False: 3.99k]
  ------------------
  135|      0|    case TargetProfile::kFastWebSocket:
  ------------------
  |  Branch (135:5): [True: 0, False: 3.99k]
  ------------------
  136|      0|    case TargetProfile::kFastSecureWebSocket:
  ------------------
  |  Branch (136:5): [True: 0, False: 3.99k]
  ------------------
  137|      0|    case TargetProfile::kTiming:
  ------------------
  |  Branch (137:5): [True: 0, False: 3.99k]
  ------------------
  138|      0|      return ScenarioRunMode::kProtocolCoverage;
  139|       |
  140|      0|    case TargetProfile::kDeepHttp:
  ------------------
  |  Branch (140:5): [True: 0, False: 3.99k]
  ------------------
  141|      0|      return ScenarioRunMode::kDeepHttpCoverage;
  142|  3.99k|  }
  143|      0|  return ScenarioRunMode::kProtocolCoverage;
  144|  3.99k|}

_ZN12proto_fuzzer16TelnetMockServerC2Ev:
   75|  3.74k|TelnetMockServer::TelnetMockServer() : scenario_(nullptr), socket_opened_(false) {}
_ZN12proto_fuzzer16TelnetMockServerD2Ev:
   78|  3.74k|TelnetMockServer::~TelnetMockServer() = default;
_ZN12proto_fuzzer16TelnetMockServer20ConfigureRequestDataEPNS_19ScenarioRequestDataE:
   80|  3.74k|void TelnetMockServer::ConfigureRequestData(ScenarioRequestData* request_data) {
   81|  3.74k|  if (request_data != nullptr) {
  ------------------
  |  Branch (81:7): [True: 3.74k, False: 0]
  ------------------
   82|  3.74k|    request_data->SetBeforeUploadReadCallback(&DrainBeforeUploadRead, this);
   83|  3.74k|  }
   84|  3.74k|}
_ZN12proto_fuzzer16TelnetMockServer21DrainBeforeUploadReadEPv:
   86|  1.20k|void TelnetMockServer::DrainBeforeUploadRead(void* userdata) {
   87|  1.20k|  auto* server = static_cast<TelnetMockServer*>(userdata);
   88|  1.20k|  if (server != nullptr && server->connection_) {
  ------------------
  |  Branch (88:7): [True: 1.20k, False: 0]
  |  Branch (88:28): [True: 1.20k, False: 0]
  ------------------
   89|  1.20k|    (void)server->connection_->DrainIncoming();
   90|  1.20k|  }
   91|  1.20k|}
_ZN12proto_fuzzer16TelnetMockServer16HandleOpenSocketE12curlsocktypeP13curl_sockaddr:
  105|  3.04k|curl_socket_t TelnetMockServer::HandleOpenSocket(curlsocktype purpose, struct curl_sockaddr* address) {
  106|  3.04k|  (void)purpose;
  107|  3.04k|  (void)address;
  108|  3.04k|  if (scenario_ == nullptr || socket_opened_) {
  ------------------
  |  Branch (108:7): [True: 0, False: 3.04k]
  |  Branch (108:31): [True: 0, False: 3.04k]
  ------------------
  109|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  110|      0|  }
  111|  3.04k|  socket_opened_ = true;
  112|       |
  113|  3.04k|  connection_ = std::make_unique<MockConnection>();
  114|  3.04k|  if (!connection_->ok()) {
  ------------------
  |  Branch (114:7): [True: 0, False: 3.04k]
  ------------------
  115|      0|    connection_.reset();
  116|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  117|      0|  }
  118|       |
  119|  3.04k|  if (!connection_->EnsureClientSendBufferSize(kMinClientSendBufferBytes)) {
  ------------------
  |  Branch (119:7): [True: 0, False: 3.04k]
  ------------------
  120|      0|    connection_.reset();
  121|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  122|      0|  }
  123|       |
  124|  3.04k|  const auto write_bytes = [this](const std::string& bytes) {
  125|  3.04k|    return bytes.empty() || connection_->WriteAll(reinterpret_cast<const unsigned char*>(bytes.data()), bytes.size());
  126|  3.04k|  };
  127|       |
  128|       |  // Compatibility corpus entries bypass the LPM postprocessor. Copy only the
  129|       |  // raw prefix TELNET can consume, then normalize it so direct replay gets the
  130|       |  // same byte/control budgets without traversing HTTP/WS-only fields.
  131|  3.04k|  const auto& source = scenario_->connection();
  132|  3.04k|  curl::fuzzer::proto::Connection script;
  133|  3.04k|  CopyTelnetResponsePrefix(source, &script);
  134|  3.04k|  BoundTelnetResponse(&script);
  135|  3.04k|  bool complete = write_bytes(script.initial_response());
  136|  3.04k|  const std::size_t chunk_count = static_cast<std::size_t>(script.on_readable_size());
  137|  3.97k|  for (std::size_t index = 0; complete && index < chunk_count; ++index) {
  ------------------
  |  Branch (137:31): [True: 3.97k, False: 0]
  |  Branch (137:43): [True: 934, False: 3.04k]
  ------------------
  138|    934|    complete = write_bytes(script.on_readable(static_cast<int>(index)));
  139|    934|  }
  140|  3.04k|  (void)complete;
  141|       |
  142|       |  // Do not apply BackpressureConfig here. curl's TELNET driver sends from
  143|       |  // inside its blocking protocol loop; tightening the socket would invalidate
  144|       |  // the minimum-capacity invariant used by the pre-read drain.
  145|  3.04k|  connection_->ShutdownWrite();
  146|  3.04k|  return connection_->take_client_fd();
  147|  3.04k|}
_ZN12proto_fuzzer16TelnetMockServer7RunLoopEPvS1_RKN4curl6fuzzer5proto8ScenarioE:
  156|  3.74k|void TelnetMockServer::RunLoop(CURLM* multi, CURL* easy, const curl::fuzzer::proto::Scenario& scenario) {
  157|  3.74k|  (void)easy;
  158|  3.74k|  scenario_ = &scenario;
  159|  3.74k|  socket_opened_ = false;
  160|  3.74k|  connection_.reset();
  161|       |
  162|  3.74k|  int still_running = 1;
  163|  7.48k|  for (int iteration = 0; still_running && iteration < kMaxIdleIterations; ++iteration) {
  ------------------
  |  Branch (163:27): [True: 3.74k, False: 3.74k]
  |  Branch (163:44): [True: 3.74k, False: 0]
  ------------------
  164|  3.74k|    const CURLMcode result = curl_multi_perform(multi, &still_running);
  165|  3.74k|    if (result != CURLM_OK) {
  ------------------
  |  Branch (165:9): [True: 0, False: 3.74k]
  ------------------
  166|      0|      break;
  167|      0|    }
  168|  3.74k|    if (connection_) {
  ------------------
  |  Branch (168:9): [True: 3.04k, False: 699]
  ------------------
  169|  3.04k|      (void)connection_->DrainIncoming();
  170|  3.04k|    }
  171|  3.74k|  }
  172|       |
  173|  3.74k|  scenario_ = nullptr;
  174|  3.74k|}
telnet_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_124CopyTelnetResponsePrefixERKN4curl6fuzzer5proto10ConnectionEPS4_:
   49|  3.04k|                              curl::fuzzer::proto::Connection* destination) {
   50|  3.04k|  std::size_t bytes_left = scenario_limits::kMaxTelnetResponseBytes;
   51|  3.04k|  const auto copy_fragment = [&bytes_left](const std::string& fragment, std::string* output) {
   52|  3.04k|    const std::size_t retained = std::min(fragment.size(), bytes_left);
   53|  3.04k|    output->assign(fragment.data(), retained);
   54|  3.04k|    bytes_left -= retained;
   55|  3.04k|    return retained == fragment.size();
   56|  3.04k|  };
   57|       |
   58|  3.04k|  if (!copy_fragment(source.initial_response(), destination->mutable_initial_response())) {
  ------------------
  |  Branch (58:7): [True: 0, False: 3.04k]
  ------------------
   59|      0|    return;
   60|      0|  }
   61|       |
   62|  3.04k|  const std::size_t chunk_count =
   63|  3.04k|      std::min<std::size_t>(scenario_limits::kMaxTelnetResponseChunks, source.on_readable_size());
   64|  3.97k|  for (std::size_t index = 0; index < chunk_count && bytes_left != 0; ++index) {
  ------------------
  |  Branch (64:31): [True: 934, False: 3.04k]
  |  Branch (64:54): [True: 934, False: 0]
  ------------------
   65|    934|    if (!copy_fragment(source.on_readable(static_cast<int>(index)), destination->add_on_readable())) {
  ------------------
  |  Branch (65:9): [True: 0, False: 934]
  ------------------
   66|      0|      break;
   67|      0|    }
   68|    934|  }
   69|  3.04k|}
telnet_mock_server.cc:_ZZN12proto_fuzzer12_GLOBAL__N_124CopyTelnetResponsePrefixERKN4curl6fuzzer5proto10ConnectionEPS4_ENK3$_0clERKNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEEPSF_:
   51|  3.97k|  const auto copy_fragment = [&bytes_left](const std::string& fragment, std::string* output) {
   52|  3.97k|    const std::size_t retained = std::min(fragment.size(), bytes_left);
   53|  3.97k|    output->assign(fragment.data(), retained);
   54|  3.97k|    bytes_left -= retained;
   55|  3.97k|    return retained == fragment.size();
   56|  3.97k|  };
telnet_mock_server.cc:_ZZN12proto_fuzzer16TelnetMockServer16HandleOpenSocketE12curlsocktypeP13curl_sockaddrENK3$_0clERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
  124|  3.97k|  const auto write_bytes = [this](const std::string& bytes) {
  125|  3.97k|    return bytes.empty() || connection_->WriteAll(reinterpret_cast<const unsigned char*>(bytes.data()), bytes.size());
  ------------------
  |  Branch (125:12): [True: 2.36k, False: 1.61k]
  |  Branch (125:29): [True: 1.61k, False: 0]
  ------------------
  126|  3.97k|  };

_ZN12proto_fuzzer19BoundTelnetResponseEPN4curl6fuzzer5proto10ConnectionE:
   53|  7.04k|void BoundTelnetResponse(curl::fuzzer::proto::Connection* connection) {
   54|  7.04k|  if (connection == nullptr) {
  ------------------
  |  Branch (54:7): [True: 0, False: 7.04k]
  ------------------
   55|      0|    return;
   56|      0|  }
   57|       |
   58|  7.04k|  TrimRepeated(connection->mutable_on_readable(), scenario_limits::kMaxTelnetResponseChunks);
   59|       |
   60|  7.04k|  std::size_t bytes_left = scenario_limits::kMaxTelnetResponseBytes;
   61|  7.04k|  std::size_t controls_left = scenario_limits::kMaxTelnetControlBytes;
   62|  7.04k|  if (!BoundTelnetFragment(connection->mutable_initial_response(), &bytes_left, &controls_left)) {
  ------------------
  |  Branch (62:7): [True: 1, False: 7.04k]
  ------------------
   63|      1|    connection->clear_on_readable();
   64|      1|    return;
   65|      1|  }
   66|       |
   67|  7.04k|  int retained_chunks = 0;
   68|  8.96k|  for (; retained_chunks < connection->on_readable_size(); ++retained_chunks) {
  ------------------
  |  Branch (68:10): [True: 1.94k, False: 7.02k]
  ------------------
   69|  1.94k|    std::string* fragment = connection->mutable_on_readable(retained_chunks);
   70|  1.94k|    if (!BoundTelnetFragment(fragment, &bytes_left, &controls_left)) {
  ------------------
  |  Branch (70:9): [True: 19, False: 1.92k]
  ------------------
   71|       |      // A genuinely partial prefix is observable and worth retaining. When a
   72|       |      // previous fragment exhausted the budget, however, keeping the empty
   73|       |      // truncation would give LPM a field curl can never distinguish.
   74|     19|      if (!fragment->empty()) {
  ------------------
  |  Branch (74:11): [True: 11, False: 8]
  ------------------
   75|     11|        ++retained_chunks;
   76|     11|      }
   77|     19|      break;
   78|     19|    }
   79|  1.94k|  }
   80|       |
   81|  7.04k|  auto* chunks = connection->mutable_on_readable();
   82|  7.04k|  if (retained_chunks < chunks->size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 7.02k]
  ------------------
   83|     15|    chunks->DeleteSubrange(retained_chunks, chunks->size() - retained_chunks);
   84|     15|  }
   85|  7.04k|}
telnet_scenario.cc:_ZN12proto_fuzzer12_GLOBAL__N_119BoundTelnetFragmentEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPmS9_:
   33|  8.98k|bool BoundTelnetFragment(std::string* fragment, std::size_t* bytes_left, std::size_t* controls_left) {
   34|  8.98k|  std::size_t retained = 0;
   35|   998k|  while (retained < fragment->size() && retained < *bytes_left) {
  ------------------
  |  Branch (35:10): [True: 989k, False: 8.96k]
  |  Branch (35:41): [True: 989k, False: 1]
  ------------------
   36|   989k|    if (static_cast<unsigned char>((*fragment)[retained]) == 0xff) {
  ------------------
  |  Branch (36:9): [True: 10.2k, False: 979k]
  ------------------
   37|  10.2k|      if (*controls_left == 0) {
  ------------------
  |  Branch (37:11): [True: 19, False: 10.1k]
  ------------------
   38|     19|        break;
   39|     19|      }
   40|  10.1k|      --*controls_left;
   41|  10.1k|    }
   42|   989k|    ++retained;
   43|   989k|  }
   44|       |
   45|  8.98k|  const bool complete = retained == fragment->size();
   46|  8.98k|  fragment->resize(retained);
   47|  8.98k|  *bytes_left -= retained;
   48|  8.98k|  return complete;
   49|  8.98k|}
telnet_scenario.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_m:
   23|  7.04k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   24|  7.04k|  const std::size_t size = static_cast<std::size_t>(field->size());
   25|  7.04k|  if (size > limit) {
  ------------------
  |  Branch (25:7): [True: 15, False: 7.02k]
  ------------------
   26|     15|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   27|     15|  }
   28|  7.04k|}

