af_gb_init:
   17|  1.08k|void af_gb_init() {
   18|  1.08k|  pointer_idx = 0;
   19|       |
   20|   109k|   for (int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |   10|   109k|#define GB_SIZE 100
  ------------------
  |  Branch (20:20): [True: 108k, False: 1.08k]
  ------------------
   21|   108k|     pointer_arr[i] = NULL;
   22|   108k|   }
   23|  1.08k|}
af_gb_cleanup:
   25|  1.08k|void af_gb_cleanup() {
   26|   109k|  for(int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |   10|   109k|#define GB_SIZE 100
  ------------------
  |  Branch (26:18): [True: 108k, False: 1.08k]
  ------------------
   27|   108k|    if (pointer_arr[i] != NULL) {
  ------------------
  |  Branch (27:9): [True: 2.15k, False: 106k]
  ------------------
   28|  2.15k|      free(pointer_arr[i]);
   29|  2.15k|    }
   30|   108k|  }
   31|  1.08k|}
af_get_null_terminated:
   33|  2.17k|char *af_get_null_terminated(const uint8_t **data, size_t *size) {
   34|  2.17k|#define STR_SIZE 75
   35|  2.17k|  if (*size < STR_SIZE || (int)*size < 0) {
  ------------------
  |  |   34|  4.35k|#define STR_SIZE 75
  ------------------
  |  Branch (35:7): [True: 28, False: 2.15k]
  |  Branch (35:27): [True: 0, False: 2.15k]
  ------------------
   36|     28|    return NULL;
   37|     28|  }
   38|       |
   39|  2.15k|  char *new_s = malloc(STR_SIZE + 1);
  ------------------
  |  |   34|  2.15k|#define STR_SIZE 75
  ------------------
   40|  2.15k|  memcpy(new_s, *data, STR_SIZE);
  ------------------
  |  |   34|  2.15k|#define STR_SIZE 75
  ------------------
   41|  2.15k|  new_s[STR_SIZE] = '\0';
  ------------------
  |  |   34|  2.15k|#define STR_SIZE 75
  ------------------
   42|       |
   43|  2.15k|  *data = *data+STR_SIZE;
  ------------------
  |  |   34|  2.15k|#define STR_SIZE 75
  ------------------
   44|  2.15k|  *size -= STR_SIZE;
  ------------------
  |  |   34|  2.15k|#define STR_SIZE 75
  ------------------
   45|  2.15k|  return new_s;
   46|  2.17k|}
af_gb_get_null_terminated:
   64|  2.17k|char *af_gb_get_null_terminated(const uint8_t **data, size_t *size) {
   65|       |
   66|  2.17k|  char *nstr = af_get_null_terminated(data, size);
   67|  2.17k|  if (nstr == NULL) {
  ------------------
  |  Branch (67:7): [True: 28, False: 2.15k]
  ------------------
   68|     28|    return NULL;
   69|     28|  }
   70|  2.15k|  pointer_arr[pointer_idx++] = (void*)nstr;
   71|  2.15k|  return nstr;
   72|  2.17k|}
af_get_short:
   90|  1.07k|short af_get_short(const uint8_t **data, size_t *size) {
   91|  1.07k|  if (*size <= 0) return 0;
  ------------------
  |  Branch (91:7): [True: 891, False: 183]
  ------------------
   92|    183|  short c = (short)(*data)[0];
   93|    183|  *data += 1;
   94|    183|  *size-=1;
   95|    183|  return c;
   96|  1.07k|}

hookfunc:
   40|  1.17k|                      apr_bucket_brigade *bb) {
   41|  1.17k|  return 0;
   42|  1.17k|}
LLVMFuzzerTestOneInput:
   44|  1.08k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   45|  1.08k|  af_gb_init();
   46|       |
   47|  1.08k|  const uint8_t *data2 = data;
   48|  1.08k|  size_t size2 = size;
   49|       |
   50|       |  /* get random data for the fuzzer */
   51|  1.08k|  char *new_str = af_gb_get_null_terminated(&data2, &size2);
   52|  1.08k|  char *new_str2 = af_gb_get_null_terminated(&data2, &size2);
   53|       |
   54|  1.08k|  if (new_str != NULL && new_str2 != NULL) {
  ------------------
  |  Branch (54:7): [True: 1.07k, False: 13]
  |  Branch (54:26): [True: 1.07k, False: 2]
  ------------------
   55|  1.07k|    apr_pool_initialize();
   56|  1.07k|    apr_pool_t *v = NULL;
   57|  1.07k|    apr_pool_create(&v, NULL);
  ------------------
  |  |  301|  1.07k|    apr_pool_create_ex(newpool, parent, NULL, NULL)
  ------------------
   58|       |
   59|  1.07k|    apr_bucket_alloc_t *bucket = apr_bucket_alloc_create(v);
   60|  1.07k|    apr_bucket_brigade *brigade = apr_brigade_create(v, bucket);
   61|  1.07k|    apr_brigade_write(brigade, NULL, NULL, new_str, strlen(new_str));
   62|       |
   63|  1.07k|    apreq_parser_t parser;
   64|  1.07k|    parser.content_type = new_str2;
   65|  1.07k|    parser.temp_dir = "/tmp/";
   66|  1.07k|    parser.brigade_limit = 10;
   67|  1.07k|    parser.pool = v;
   68|  1.07k|    parser.ctx = NULL;
   69|  1.07k|    parser.bucket_alloc = bucket;
   70|       |
   71|  1.07k|    parser.hook = apreq_hook_make(parser.pool, hookfunc, NULL, parser.ctx);
   72|       |
   73|  1.07k|    apr_table_t *table = apr_table_make(parser.pool, 10);
   74|  1.07k|    if (af_get_short(&data2, &size2) % 2 == 0) {
  ------------------
  |  Branch (74:9): [True: 914, False: 160]
  ------------------
   75|    914|      apreq_parse_multipart(&parser, table, brigade);
   76|    914|    } else {
   77|    160|      apreq_parse_urlencoded(&parser, table, brigade);
   78|    160|    }
   79|       |
   80|  1.07k|    apr_pool_terminate();
   81|  1.07k|  }
   82|  1.08k|  af_gb_cleanup();
   83|  1.08k|  return 0;
   84|  1.08k|}

apreq_parser_multipart.c:apreq_value_table_add:
  209|    238|void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
  210|    238|    apr_table_addn(t, v->name, v->data);
  211|    238|}
apreq_parser_urlencoded.c:apreq_value_table_add:
  209|    521|void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
  210|    521|    apr_table_addn(t, v->name, v->data);
  211|    521|}
apreq_parser_header.c:apreq_value_table_add:
  209|  1.30k|void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
  210|  1.30k|    apr_table_addn(t, v->name, v->data);
  211|  1.30k|}

apreq_parser_multipart.c:apreq_param_tainted_on:
   53|    651|void apreq_param_tainted_on(apreq_param_t *p) {
   54|    651|    APREQ_FLAGS_ON(p->flags, APREQ_TAINTED);
  ------------------
  |  |   77|    651|#define APREQ_FLAGS_ON(f, name)  ((f) |=  (name##_MASK << name##_BIT))
  ------------------
   55|    651|}
apreq_parser_multipart.c:apreq_param_charset_set:
   65|     54|apreq_charset_t apreq_param_charset_set(apreq_param_t *p, apreq_charset_t c) {
   66|     54|    apreq_charset_t old = (apreq_charset_t)
   67|     54|        APREQ_FLAGS_GET(p->flags, APREQ_CHARSET);
  ------------------
  |  |   81|     54|#define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
  ------------------
   68|     54|    APREQ_FLAGS_SET(p->flags, APREQ_CHARSET, c);
  ------------------
  |  |   89|     54|    ((f) = (((f) & ~(name##_MASK << name##_BIT))        \
  |  |   90|     54|            | ((name##_MASK & (value)) << name##_BIT)))
  ------------------
   69|     54|    return old;
   70|     54|}
apreq_parser_urlencoded.c:apreq_param_tainted_on:
   53|    521|void apreq_param_tainted_on(apreq_param_t *p) {
   54|    521|    APREQ_FLAGS_ON(p->flags, APREQ_TAINTED);
  ------------------
  |  |   77|    521|#define APREQ_FLAGS_ON(f, name)  ((f) |=  (name##_MASK << name##_BIT))
  ------------------
   55|    521|}
apreq_parser_urlencoded.c:apreq_param_charset_set:
   65|    521|apreq_charset_t apreq_param_charset_set(apreq_param_t *p, apreq_charset_t c) {
   66|    521|    apreq_charset_t old = (apreq_charset_t)
   67|    521|        APREQ_FLAGS_GET(p->flags, APREQ_CHARSET);
  ------------------
  |  |   81|    521|#define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
  ------------------
   68|    521|    APREQ_FLAGS_SET(p->flags, APREQ_CHARSET, c);
  ------------------
  |  |   89|    521|    ((f) = (((f) & ~(name##_MASK << name##_BIT))        \
  |  |   90|    521|            | ((name##_MASK & (value)) << name##_BIT)))
  ------------------
   69|    521|    return old;
   70|    521|}
apreq_parser_header.c:apreq_param_tainted_on:
   53|  1.30k|void apreq_param_tainted_on(apreq_param_t *p) {
   54|  1.30k|    APREQ_FLAGS_ON(p->flags, APREQ_TAINTED);
  ------------------
  |  |   77|  1.30k|#define APREQ_FLAGS_ON(f, name)  ((f) |=  (name##_MASK << name##_BIT))
  ------------------
   55|  1.30k|}

apreq_parser_multipart.c:apreq_parser_run:
  126|    992|{
  127|    992|    return psr->parser(psr, t, bb);
  128|    992|}
apreq_parser_multipart.c:apreq_hook_run:
  140|    651|{
  141|    651|    return h->hook(h, param, bb);
  142|    651|}
apreq_parser_urlencoded.c:apreq_hook_run:
  140|    521|{
  141|    521|    return h->hook(h, param, bb);
  142|    521|}

apreq_parser_multipart.c:apreq_brigade_setaside:
  311|  1.46k|{
  312|  1.46k|    apr_bucket *e;
  313|  2.24k|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|  1.46k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.46k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|  2.24k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  2.24k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|  2.24k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:37): [True: 779, False: 1.46k]
  ------------------
  314|  1.46k|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    779|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    779|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  315|    779|    {
  316|    779|        apr_status_t rv = apr_bucket_setaside(e, p);
  ------------------
  |  | 1167|    779|#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
  ------------------
  317|    779|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|    779|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:13): [True: 0, False: 779]
  ------------------
  318|      0|            return rv;
  319|    779|    }
  320|  1.46k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.46k|#define APR_SUCCESS 0
  ------------------
  321|  1.46k|}
apreq_parser_urlencoded.c:apreq_brigade_setaside:
  311|     92|{
  312|     92|    apr_bucket *e;
  313|    200|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|     92|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     92|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    200|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    200|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    200|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:37): [True: 108, False: 92]
  ------------------
  314|    108|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    108|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    108|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  315|    108|    {
  316|    108|        apr_status_t rv = apr_bucket_setaside(e, p);
  ------------------
  |  | 1167|    108|#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
  ------------------
  317|    108|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|    108|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:13): [True: 0, False: 108]
  ------------------
  318|      0|            return rv;
  319|    108|    }
  320|     92|    return APR_SUCCESS;
  ------------------
  |  |  225|     92|#define APR_SUCCESS 0
  ------------------
  321|     92|}
apreq_parser_header.c:apreq_brigade_setaside:
  311|     94|{
  312|     94|    apr_bucket *e;
  313|    276|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|     94|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     94|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    276|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    276|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    276|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:37): [True: 182, False: 94]
  ------------------
  314|    182|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    182|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    182|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  315|    182|    {
  316|    182|        apr_status_t rv = apr_bucket_setaside(e, p);
  ------------------
  |  | 1167|    182|#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
  ------------------
  317|    182|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|    182|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:13): [True: 0, False: 182]
  ------------------
  318|      0|            return rv;
  319|    182|    }
  320|     94|    return APR_SUCCESS;
  ------------------
  |  |  225|     94|#define APR_SUCCESS 0
  ------------------
  321|     94|}

apreq_param_make:
   34|  2.53k|{
   35|  2.53k|    apreq_param_t *param;
   36|  2.53k|    apreq_value_t *v;
   37|       |
   38|  2.53k|    param = apr_palloc(p, nlen + vlen + 1 + sizeof *param);
  ------------------
  |  |  425|  2.53k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  2.53k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  2.53k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  2.53k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   39|       |
   40|  2.53k|    if (param == NULL)
  ------------------
  |  Branch (40:9): [True: 0, False: 2.53k]
  ------------------
   41|      0|        return NULL;
   42|       |
   43|  2.53k|    param->info = NULL;
   44|  2.53k|    param->upload = NULL;
   45|  2.53k|    param->flags = 0;
   46|       |
   47|  2.53k|    *(const apreq_value_t **)&v = &param->v;
   48|       |
   49|  2.53k|    if (vlen && val != NULL)
  ------------------
  |  Branch (49:9): [True: 1.30k, False: 1.23k]
  |  Branch (49:17): [True: 4, False: 1.29k]
  ------------------
   50|      4|        memcpy(v->data, val, vlen);
   51|  2.53k|    v->data[vlen] = 0;
   52|  2.53k|    v->dlen = vlen;
   53|       |
   54|  2.53k|    v->name = v->data + vlen + 1;
   55|  2.53k|    if (nlen && name != NULL)
  ------------------
  |  Branch (55:9): [True: 1.96k, False: 578]
  |  Branch (55:17): [True: 73, False: 1.88k]
  ------------------
   56|     73|        memcpy(v->name, name, nlen);
   57|  2.53k|    v->name[nlen] = 0;
   58|  2.53k|    v->nlen = nlen;
   59|       |
   60|  2.53k|    return param;
   61|  2.53k|}

apreq_parser_make:
   42|    938|{
   43|    938|    apreq_parser_t *p = apr_palloc(pool, sizeof *p);
  ------------------
  |  |  425|    938|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    938|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    938|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    938|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|    938|    p->content_type = content_type;
   45|    938|    p->parser = pfn;
   46|    938|    p->hook = hook;
   47|    938|    p->pool = pool;
   48|    938|    p->bucket_alloc = ba;
   49|    938|    p->brigade_limit = brigade_limit;
   50|    938|    p->temp_dir = temp_dir;
   51|    938|    p->ctx = ctx;
   52|    938|    return p;
   53|    938|}
apreq_hook_make:
   59|  1.07k|{
   60|  1.07k|    apreq_hook_t *h = apr_palloc(pool, sizeof *h);
  ------------------
  |  |  425|  1.07k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.07k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.07k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.07k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|  1.07k|    h->hook = hook;
   62|  1.07k|    h->next = next;
   63|  1.07k|    h->pool = pool;
   64|  1.07k|    h->ctx = ctx;
   65|  1.07k|    return h;
   66|  1.07k|}

apreq_parse_headers:
  183|    919|{
  184|    919|    apr_pool_t *pool = parser->pool;
  185|    919|    apr_bucket *e;
  186|    919|    struct hdr_ctx *ctx;
  187|    919|    char ch;
  188|       |
  189|    919|    if (parser->ctx == NULL) {
  ------------------
  |  Branch (189:9): [True: 919, False: 0]
  ------------------
  190|    919|        ctx = apr_pcalloc(pool, sizeof *ctx);
  ------------------
  |  |  454|    919|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    919|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    919|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    919|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|    919|        ctx->bb = apr_brigade_create(pool, parser->bucket_alloc);
  192|    919|        parser->ctx = ctx;
  193|    919|        ctx->status = HDR_NAME;
  194|    919|    }
  195|      0|    else
  196|      0|        ctx = parser->ctx;
  197|       |
  198|    919|    PARSER_STATUS_CHECK(HDR);
  ------------------
  |  |   24|    919|#define PARSER_STATUS_CHECK(PREFIX)   do {         \
  |  |   25|    919|    if (ctx->status == PREFIX##_ERROR)             \
  |  |  ------------------
  |  |  |  Branch (25:9): [True: 0, False: 919]
  |  |  ------------------
  |  |   26|    919|        return APREQ_ERROR_GENERAL;                \
  |  |  ------------------
  |  |  |  |   53|      0|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  ------------------
  |  |  |  |  |  |  164|      0|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|    919|    else if (ctx->status == PREFIX##_COMPLETE)     \
  |  |  ------------------
  |  |  |  Branch (27:14): [True: 0, False: 919]
  |  |  ------------------
  |  |   28|    919|        return APR_SUCCESS;                        \
  |  |  ------------------
  |  |  |  |  225|      0|#define APR_SUCCESS 0
  |  |  ------------------
  |  |   29|    919|    else if (bb == NULL)                           \
  |  |  ------------------
  |  |  |  Branch (29:14): [True: 0, False: 919]
  |  |  ------------------
  |  |   30|    919|        return APR_INCOMPLETE;                     \
  |  |  ------------------
  |  |  |  |  458|      0|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   31|    919|} while (0);
  |  |  ------------------
  |  |  |  Branch (31:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  199|    919|    e = APR_BRIGADE_LAST(ctx->bb);
  ------------------
  |  |  359|    919|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    919|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
  200|    919|    APR_BRIGADE_CONCAT(ctx->bb, bb);
  ------------------
  |  |  388|    919|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    919|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    919|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    919|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    919|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    919|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    919|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    919|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 906, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  340|    906|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    906|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    906|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    906|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    906|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    906|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    906|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    906|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    906|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    906|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    906|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    906|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    906|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    906|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    906|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    906|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    906|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    906|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    906|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    906|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    906|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    906|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    906|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    906|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    906|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    906|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    906|    }                                                       \
  |  |  |  |  344|    919|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    919|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    919|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  201|       |
  202|       |    /* parse the brigade for CRLF_CRLF-terminated header block,
  203|       |     * each time starting from the front of the brigade.
  204|       |     */
  205|       |
  206|    919|    for (e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    919|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    919|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  207|  1.03k|         e != APR_BRIGADE_SENTINEL(ctx->bb);
  ------------------
  |  |  339|  1.03k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  1.03k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|  1.03k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (207:10): [True: 937, False: 94]
  ------------------
  208|    919|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    112|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    112|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  209|    937|    {
  210|    937|        apr_size_t off = 0, dlen;
  211|    937|        const char *data;
  212|    937|        apr_status_t s;
  213|    937|        apreq_param_t *param = NULL; /* silences gcc-4.0 warning */
  214|       |
  215|    937|        if (APR_BUCKET_IS_EOS(e)) {
  ------------------
  |  |  469|    937|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 937]
  |  |  ------------------
  ------------------
  216|      0|            ctx->status = HDR_COMPLETE;
  217|      0|            APR_BRIGADE_CONCAT(bb, ctx->bb);
  ------------------
  |  |  388|      0|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|      0|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|      0|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|      0|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|      0|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  340|      0|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|      0|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|      0|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|      0|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|      0|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|      0|    }                                                       \
  |  |  |  |  344|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|      0|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  218|      0|            return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  219|      0|        }
  220|       |
  221|    937|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|    937|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  222|    937|        if ( s != APR_SUCCESS ) {
  ------------------
  |  |  225|    937|#define APR_SUCCESS 0
  ------------------
  |  Branch (222:14): [True: 0, False: 937]
  ------------------
  223|      0|            ctx->status = HDR_ERROR;
  224|      0|            return s;
  225|      0|        }
  226|    937|        if (dlen == 0)
  ------------------
  |  Branch (226:13): [True: 0, False: 937]
  ------------------
  227|      0|            continue;
  228|       |
  229|  6.53k|    parse_hdr_bucket:
  230|       |
  231|       |        /*              gap           nlen = 13
  232|       |         *              vvv           glen =  3
  233|       |         * Sample-Header:  grape      vlen =  5
  234|       |         * ^^^^^^^^^^^^^   ^^^^^
  235|       |         *     name        value
  236|       |         */
  237|       |
  238|  6.53k|        switch (ctx->status) {
  239|       |
  240|  1.43k|        case HDR_NAME:
  ------------------
  |  Branch (240:9): [True: 1.43k, False: 5.09k]
  ------------------
  241|       |
  242|  11.6k|            while (off < dlen) {
  ------------------
  |  Branch (242:20): [True: 11.5k, False: 35]
  ------------------
  243|  11.5k|                ch = data[off++];
  244|  11.5k|                switch (ch) {
  245|  1.36k|                case ':':
  ------------------
  |  Branch (245:17): [True: 1.36k, False: 10.1k]
  ------------------
  246|  1.36k|                    if (!ctx->nlen) {
  ------------------
  |  Branch (246:25): [True: 2, False: 1.36k]
  ------------------
  247|      2|                        ctx->status = HDR_ERROR;
  248|      2|                        return APREQ_ERROR_BADHEADER;
  ------------------
  |  |   68|      2|#define APREQ_ERROR_BADHEADER      (APREQ_ERROR_BADDATA  +  4)
  |  |  ------------------
  |  |  |  |   60|      2|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      2|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      2|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      2|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      2|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      2|                    }
  250|  1.36k|                    e = split_header_line(e, &off, &data, &dlen);
  251|  1.36k|                    ++ctx->glen;
  252|  1.36k|                    ctx->status = HDR_GAP;
  253|  1.36k|                    goto parse_hdr_bucket;
  254|       |
  255|  10.1k|                default:
  ------------------
  |  Branch (255:17): [True: 10.1k, False: 1.36k]
  ------------------
  256|  10.1k|                    if (!IS_TOKEN_CHAR(ch)) {
  ------------------
  |  |  179|  10.1k|#define IS_TOKEN_CHAR(c) (apr_isalnum(c) \
  |  |  ------------------
  |  |  |  |  206|  20.3k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (206:24): [True: 8.95k, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|  10.1k|                          || ((c) && strchr("!#$%&'*+-.^_`|~", (c))))
  |  |  ------------------
  |  |  |  Branch (180:31): [True: 1.24k, False: 0]
  |  |  |  Branch (180:38): [True: 1.20k, False: 33]
  |  |  ------------------
  ------------------
  257|     33|                        ctx->status = HDR_ERROR;
  258|     33|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     33|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     33|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     33|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     33|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     33|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     33|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     33|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     33|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|     33|                    }
  260|  10.1k|                    ++ctx->nlen;
  261|  11.5k|                }
  262|  11.5k|            }
  263|     35|            break;
  264|       |
  265|       |
  266|  1.38k|        case HDR_GAP:
  ------------------
  |  Branch (266:9): [True: 1.38k, False: 5.15k]
  ------------------
  267|       |
  268|  2.02k|            while (off < dlen) {
  ------------------
  |  Branch (268:20): [True: 2.00k, False: 23]
  ------------------
  269|  2.00k|                ch = data[off++];
  270|  2.00k|                switch (ch) {
  271|    291|                case ' ':
  ------------------
  |  Branch (271:17): [True: 291, False: 1.71k]
  ------------------
  272|    644|                case '\t':
  ------------------
  |  Branch (272:17): [True: 353, False: 1.64k]
  ------------------
  273|    644|                    ++ctx->glen;
  274|    644|                    break;
  275|       |
  276|    382|                case '\n':
  ------------------
  |  Branch (276:17): [True: 382, False: 1.62k]
  ------------------
  277|    382|                    e = split_header_line(e, &off, &data, &dlen);
  278|    382|                    ctx->status = HDR_NEWLINE;
  279|    382|                    goto parse_hdr_bucket;
  280|       |
  281|    100|                case '\r':
  ------------------
  |  Branch (281:17): [True: 100, False: 1.90k]
  ------------------
  282|    100|                    e = split_header_line(e, &off, &data, &dlen);
  283|    100|                    ctx->status = HDR_ENDLINE;
  284|    100|                    goto parse_hdr_bucket;
  285|       |
  286|    876|                default:
  ------------------
  |  Branch (286:17): [True: 876, False: 1.12k]
  ------------------
  287|    876|                    if (apr_iscntrl(ch)) {
  ------------------
  |  |  210|    876|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (210:24): [True: 1, False: 875]
  |  |  ------------------
  ------------------
  288|      1|                        ctx->status = HDR_ERROR;
  289|      1|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      1|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      1|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      1|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      1|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      1|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      1|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      1|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      1|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|      1|                    }
  291|    875|                    e = split_header_line(e, &off, &data, &dlen);
  292|    875|                    ++ctx->vlen;
  293|    875|                    ctx->status = HDR_VALUE;
  294|    875|                    goto parse_hdr_bucket;
  295|  2.00k|                }
  296|  2.00k|            }
  297|     23|            break;
  298|       |
  299|       |
  300|  1.01k|        case HDR_VALUE:
  ------------------
  |  Branch (300:9): [True: 1.01k, False: 5.51k]
  ------------------
  301|       |
  302|  10.4k|            while (off < dlen) {
  ------------------
  |  Branch (302:20): [True: 10.4k, False: 18]
  ------------------
  303|  10.4k|                ch = data[off++];
  304|  10.4k|                switch (ch) {
  305|    804|                case '\n':
  ------------------
  |  Branch (305:17): [True: 804, False: 9.65k]
  ------------------
  306|    804|                    ctx->status = HDR_NEWLINE;
  307|    804|                    goto parse_hdr_bucket;
  308|       |
  309|    190|                case '\r':
  ------------------
  |  Branch (309:17): [True: 190, False: 10.2k]
  ------------------
  310|    190|                    ctx->status = HDR_ENDLINE;
  311|    190|                    goto parse_hdr_bucket;
  312|       |
  313|  9.46k|                default:
  ------------------
  |  Branch (313:17): [True: 9.46k, False: 994]
  ------------------
  314|  9.46k|                    if (apr_iscntrl(ch)) {
  ------------------
  |  |  210|  9.46k|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (210:24): [True: 3, False: 9.46k]
  |  |  ------------------
  ------------------
  315|      3|                        ctx->status = HDR_ERROR;
  316|      3|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      3|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      3|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      3|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      3|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      3|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      3|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      3|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      3|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|      3|                    }
  318|  9.46k|                    ++ctx->vlen;
  319|  10.4k|                }
  320|  10.4k|            }
  321|     18|            break;
  322|       |
  323|       |
  324|    368|        case HDR_ENDLINE:
  ------------------
  |  Branch (324:9): [True: 368, False: 6.16k]
  ------------------
  325|    575|        case HDR_LASTLINE:
  ------------------
  |  Branch (325:9): [True: 207, False: 6.32k]
  ------------------
  326|       |
  327|    575|            if (off == dlen)
  ------------------
  |  Branch (327:17): [True: 10, False: 565]
  ------------------
  328|     10|                break;
  329|       |
  330|    565|            if (data[off++] != '\n') {
  ------------------
  |  Branch (330:17): [True: 15, False: 550]
  ------------------
  331|     15|                ctx->status = HDR_ERROR;
  332|     15|                return APREQ_ERROR_BADHEADER;
  ------------------
  |  |   68|     15|#define APREQ_ERROR_BADHEADER      (APREQ_ERROR_BADDATA  +  4)
  |  |  ------------------
  |  |  |  |   60|     15|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     15|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     15|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     15|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     15|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     15|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     15|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  333|     15|            }
  334|       |
  335|    550|            if (ctx->status == HDR_LASTLINE) {
  ------------------
  |  Branch (335:17): [True: 198, False: 352]
  ------------------
  336|    198|                ctx->status = HDR_COMPLETE;
  337|    198|                goto parse_hdr_bucket;
  338|    198|            }
  339|       |
  340|       |            /* fall thru */
  341|    352|            ctx->status = HDR_NEWLINE;
  342|       |
  343|  1.71k|        case HDR_NEWLINE:
  ------------------
  |  Branch (343:9): [True: 1.36k, False: 5.17k]
  ------------------
  344|       |
  345|  1.71k|            if (off == dlen)
  ------------------
  |  Branch (345:17): [True: 13, False: 1.70k]
  ------------------
  346|     13|                break;
  347|       |
  348|  1.70k|            ch = data[off++];
  349|  1.70k|            switch (ch) {
  350|    215|            case ' ':
  ------------------
  |  Branch (350:13): [True: 215, False: 1.48k]
  ------------------
  351|    400|            case '\t':
  ------------------
  |  Branch (351:13): [True: 185, False: 1.51k]
  ------------------
  352|    400|                ++ctx->vlen;
  353|    400|                break;
  354|       |
  355|  1.30k|            default:
  ------------------
  |  Branch (355:13): [True: 1.30k, False: 400]
  ------------------
  356|  1.30k|                e = split_header_line(e, &off, &data, &dlen);
  357|       |
  358|       |                /* consume from splitted brigade now */
  359|  1.30k|                s = consume_header_line(&param, pool, ctx->bb,
  360|  1.30k|                                        ctx->nlen, ctx->glen, ctx->vlen);
  361|  1.30k|                if (parser->hook != NULL && s == APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (361:21): [True: 0, False: 1.30k]
  |  Branch (361:45): [True: 0, False: 0]
  ------------------
  362|      0|                    s = apreq_hook_run(parser->hook, param, NULL);
  363|  1.30k|                if (s != APR_SUCCESS) {
  ------------------
  |  |  225|  1.30k|#define APR_SUCCESS 0
  ------------------
  |  Branch (363:21): [True: 0, False: 1.30k]
  ------------------
  364|      0|                    ctx->status = HDR_ERROR;
  365|      0|                    return s;
  366|      0|                }
  367|  1.30k|                apreq_value_table_add(&param->v, t);
  368|  1.30k|                ctx->nlen = 0;
  369|  1.30k|                ctx->vlen = 0;
  370|  1.30k|                ctx->glen = 0;
  371|       |
  372|  1.30k|                switch (ch) {
  373|    561|                case '\n':
  ------------------
  |  Branch (373:17): [True: 561, False: 739]
  ------------------
  374|    561|                    ctx->status = HDR_COMPLETE;
  375|    561|                    break;
  376|       |
  377|    205|                case '\r':
  ------------------
  |  Branch (377:17): [True: 205, False: 1.09k]
  ------------------
  378|    205|                    ctx->status = HDR_LASTLINE;
  379|    205|                    break;
  380|       |
  381|    534|                default:
  ------------------
  |  Branch (381:17): [True: 534, False: 766]
  ------------------
  382|    534|                    if (!IS_TOKEN_CHAR(ch)) {
  ------------------
  |  |  179|    534|#define IS_TOKEN_CHAR(c) (apr_isalnum(c) \
  |  |  ------------------
  |  |  |  |  206|  1.06k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (206:24): [True: 346, False: 188]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|    534|                          || ((c) && strchr("!#$%&'*+-.^_`|~", (c))))
  |  |  ------------------
  |  |  |  Branch (180:31): [True: 188, False: 0]
  |  |  |  Branch (180:38): [True: 177, False: 11]
  |  |  ------------------
  ------------------
  383|     11|                        ctx->status = HDR_ERROR;
  384|     11|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     11|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     11|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     11|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     11|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     11|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     11|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     11|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     11|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  385|     11|                    }
  386|    523|                    ++ctx->nlen;
  387|    523|                    ctx->status = HDR_NAME;
  388|    523|                    break;
  389|  1.30k|                }
  390|  1.28k|                goto parse_hdr_bucket;
  391|  1.70k|            }
  392|       |
  393|       |            /* fall thru */
  394|    400|            ctx->status = HDR_FOLDLINE;
  395|       |
  396|    403|        case HDR_FOLDLINE:
  ------------------
  |  Branch (396:9): [True: 3, False: 6.52k]
  ------------------
  397|       |
  398|    855|            while (off < dlen) {
  ------------------
  |  Branch (398:20): [True: 842, False: 13]
  ------------------
  399|    842|                ch = data[off++];
  400|    842|                switch (ch) {
  401|    255|                case ' ':
  ------------------
  |  Branch (401:17): [True: 255, False: 587]
  ------------------
  402|    452|                case '\t':
  ------------------
  |  Branch (402:17): [True: 197, False: 645]
  ------------------
  403|    452|                    ++ctx->vlen;
  404|    452|                    break;
  405|       |
  406|    174|                case '\n':
  ------------------
  |  Branch (406:17): [True: 174, False: 668]
  ------------------
  407|    174|                    ctx->status = HDR_NEWLINE;
  408|    174|                    goto parse_hdr_bucket;
  409|       |
  410|     77|                case '\r':
  ------------------
  |  Branch (410:17): [True: 77, False: 765]
  ------------------
  411|     77|                    ctx->status = HDR_ENDLINE;
  412|     77|                    goto parse_hdr_bucket;
  413|       |
  414|    139|                default:
  ------------------
  |  Branch (414:17): [True: 139, False: 703]
  ------------------
  415|    139|                    if (apr_iscntrl(ch)) {
  ------------------
  |  |  210|    139|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (210:24): [True: 1, False: 138]
  |  |  ------------------
  ------------------
  416|      1|                        ctx->status = HDR_ERROR;
  417|      1|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      1|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      1|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      1|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      1|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      1|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      1|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      1|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      1|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  418|      1|                    }
  419|    138|                    ctx->status = HDR_VALUE;
  420|    138|                    ++ctx->vlen;
  421|    138|                    goto parse_hdr_bucket;
  422|    842|                }
  423|    842|            }
  424|     13|            break;
  425|       |
  426|       |
  427|    759|        case HDR_COMPLETE:
  ------------------
  |  Branch (427:9): [True: 759, False: 5.77k]
  ------------------
  428|       |
  429|    759|            if (off < dlen)
  ------------------
  |  Branch (429:17): [True: 753, False: 6]
  ------------------
  430|    753|                apr_bucket_split(e, off);
  ------------------
  |  | 1179|    753|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  431|       |
  432|    759|            e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    759|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    759|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  433|    761|            do {
  434|    761|                apr_bucket *f = APR_BRIGADE_FIRST(ctx->bb);
  ------------------
  |  |  353|    761|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    761|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  435|    761|                apr_bucket_delete(f);
  ------------------
  |  | 1086|    761|#define apr_bucket_delete(e) do {					\
  |  | 1087|    761|        apr_bucket *apr__b = (e);					\
  |  | 1088|    761|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|    761|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|    761|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|    761|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|    761|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|    761|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|    761|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|    761|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|    761|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|    761|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|    761|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|    761|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|    761|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|    761|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|    761|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|    761|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|    761|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|    761|        apr__d->free(apr__d);						\
  |  |  |  | 1073|    761|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|    761|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  436|    761|            } while (e != APR_BRIGADE_FIRST(ctx->bb));
  ------------------
  |  |  353|    761|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    761|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (436:22): [True: 2, False: 759]
  ------------------
  437|       |
  438|    759|            APR_BRIGADE_CONCAT(bb, ctx->bb);
  ------------------
  |  |  388|    759|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    759|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    759|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    759|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    759|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    759|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    759|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    759|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 754, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  340|    754|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    754|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    754|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    754|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    754|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    754|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    754|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    754|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    754|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    754|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    754|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    754|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    754|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    754|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    754|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    754|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    754|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    754|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    754|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    754|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    754|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    754|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    754|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    754|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    754|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    754|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    754|    }                                                       \
  |  |  |  |  344|    759|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    759|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    759|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  439|    759|            return APR_SUCCESS;
  ------------------
  |  |  225|    759|#define APR_SUCCESS 0
  ------------------
  440|       |
  441|       |
  442|      0|        default:
  ------------------
  |  Branch (442:9): [True: 0, False: 6.53k]
  ------------------
  443|      0|            assert(0); /* not reached */
  444|  6.53k|        }
  445|  6.53k|    }
  446|     94|    apreq_brigade_setaside(ctx->bb,pool);
  447|     94|    return APR_INCOMPLETE;
  ------------------
  |  |  458|     94|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     94|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     94|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     94|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  448|    919|}
apreq_parser_header.c:split_header_line:
   57|  4.02k|{
   58|  4.02k|    if (*off > 1) {
  ------------------
  |  Branch (58:9): [True: 4.01k, False: 8]
  ------------------
   59|  4.01k|        apr_bucket_split(e, *off - 1);
  ------------------
  |  | 1179|  4.01k|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
   60|  4.01k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  4.01k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  4.01k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
   61|  4.01k|        *dlen -= *off - 1;
   62|  4.01k|        *data += *off - 1;
   63|  4.01k|        *off = 1;
   64|  4.01k|    }
   65|  4.02k|    return e;
   66|  4.02k|}
apreq_parser_header.c:consume_header_line:
   74|  1.30k|{
   75|  1.30k|    apreq_param_t *param;
   76|  1.30k|    apreq_value_t *v;
   77|  1.30k|    apr_bucket *e, *f;
   78|  1.30k|    apr_status_t s;
   79|  1.30k|    struct iovec vec[APREQ_DEFAULT_NELTS], *iov;
   80|  1.30k|    apr_array_header_t arr;
   81|  1.30k|    char *dest;
   82|  1.30k|    const char *data;
   83|  1.30k|    apr_size_t dlen;
   84|  1.30k|    int i, eol = 0;
   85|       |
   86|  1.30k|    param = apreq_param_make(pool, NULL, nlen, NULL, vlen);
   87|  1.30k|    if (param == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 1.30k]
  ------------------
   88|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
   89|  1.30k|    *(const apreq_value_t **)&v = &param->v;
   90|       |
   91|  1.30k|    arr.pool     = pool;
   92|  1.30k|    arr.elt_size = sizeof(struct iovec);
   93|  1.30k|    arr.nelts    = 0;
   94|  1.30k|    arr.nalloc   = APREQ_DEFAULT_NELTS;
  ------------------
  |  |   66|  1.30k|#define APREQ_DEFAULT_NELTS              8
  ------------------
   95|  1.30k|    arr.elts     = (char *)vec;
   96|       |
   97|  1.30k|    e = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|  1.30k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.30k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
   98|       |
   99|       |    /* store name in a temporary iovec array */
  100|  1.30k|    do {
  101|  1.30k|        apr_size_t len;
  102|       |
  103|  1.30k|        assert(e != APR_BRIGADE_SENTINEL(bb));
  104|  1.30k|        iov = (struct iovec *)apr_array_push(&arr);
  105|  1.30k|        s = apr_bucket_read(e, (const char **)&iov->iov_base,
  ------------------
  |  | 1159|  1.30k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  106|  1.30k|                            &len, APR_BLOCK_READ);
  107|  1.30k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  1.30k|#define APR_SUCCESS 0
  ------------------
  |  Branch (107:13): [True: 0, False: 1.30k]
  ------------------
  108|      0|            return s;
  109|  1.30k|        iov->iov_len = len;
  110|       |
  111|  1.30k|        assert(nlen >= len);
  112|  1.30k|        nlen -= len;
  113|       |
  114|  1.30k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  1.30k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.30k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  115|  1.30k|    } while (nlen > 0);
  ------------------
  |  Branch (115:14): [True: 6, False: 1.30k]
  ------------------
  116|       |
  117|       |    /* skip gap */
  118|  1.30k|    do {
  119|  1.30k|        assert(e != APR_BRIGADE_SENTINEL(bb));
  120|  1.30k|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|  1.30k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  121|  1.30k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  1.30k|#define APR_SUCCESS 0
  ------------------
  |  Branch (121:13): [True: 0, False: 1.30k]
  ------------------
  122|      0|            return s;
  123|       |
  124|  1.30k|        assert(glen >= dlen);
  125|  1.30k|        glen -= dlen;
  126|       |
  127|  1.30k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  1.30k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.30k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  128|  1.30k|    } while (glen > 0);
  ------------------
  |  Branch (128:14): [True: 8, False: 1.30k]
  ------------------
  129|       |
  130|       |    /* copy value */
  131|  1.30k|    dest = v->data;
  132|  1.30k|    do {
  133|  1.30k|        apr_size_t off;
  134|       |
  135|  1.30k|        assert(e != APR_BRIGADE_SENTINEL(bb));
  136|  1.30k|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|  1.30k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  137|  1.30k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  1.30k|#define APR_SUCCESS 0
  ------------------
  |  Branch (137:13): [True: 0, False: 1.30k]
  ------------------
  138|      0|            return s;
  139|       |
  140|  13.4k|        for (off = 0; off < dlen; ++off) {
  ------------------
  |  Branch (140:23): [True: 12.1k, False: 1.30k]
  ------------------
  141|  12.1k|            const char ch = data[off];
  142|  12.1k|            if (ch == '\r' || ch == '\n') {
  ------------------
  |  Branch (142:17): [True: 271, False: 11.8k]
  |  Branch (142:31): [True: 1.47k, False: 10.3k]
  ------------------
  143|       |                /* Eat [CR]LF of continuation or end of line */
  144|  1.74k|                if (!vlen && ch == '\n')
  ------------------
  |  Branch (144:21): [True: 1.53k, False: 211]
  |  Branch (144:30): [True: 1.30k, False: 237]
  ------------------
  145|  1.30k|                    eol = 1; /* done */
  146|  1.74k|                continue;
  147|  1.74k|            }
  148|  10.3k|            assert(vlen > 0);
  149|  10.3k|            *dest = ch;
  150|  10.3k|            ++dest;
  151|  10.3k|            --vlen;
  152|  10.3k|        }
  153|       |
  154|  1.30k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  1.30k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.30k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  155|  1.30k|    } while (!eol);
  ------------------
  |  Branch (155:14): [True: 3, False: 1.30k]
  ------------------
  156|  1.30k|    v->dlen = dest - v->data;
  157|  1.30k|    *dest++ = 0;
  158|       |
  159|       |    /* write name */
  160|  1.30k|    v->name = dest;
  161|  2.60k|    for (i = 0; i < arr.nelts; ++i) {
  ------------------
  |  Branch (161:17): [True: 1.30k, False: 1.30k]
  ------------------
  162|  1.30k|        iov = &((struct iovec *)arr.elts)[i];
  163|  1.30k|        memcpy(dest, iov->iov_base, iov->iov_len);
  164|  1.30k|        dest += iov->iov_len;
  165|  1.30k|        ++iov;
  166|  1.30k|    }
  167|  1.30k|    v->nlen = dest - v->name;
  168|  1.30k|    *dest = 0;
  169|       |
  170|  5.21k|    while ((f = APR_BRIGADE_FIRST(bb)) != e)
  ------------------
  |  |  353|  5.21k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  5.21k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (170:12): [True: 3.91k, False: 1.30k]
  ------------------
  171|  3.91k|        apr_bucket_delete(f);
  ------------------
  |  | 1086|  5.21k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  3.91k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  3.91k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  3.91k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  3.91k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  3.91k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  3.91k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  3.91k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  3.91k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  3.91k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  3.91k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  3.91k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  3.91k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  3.91k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  3.91k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  3.91k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  3.91k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  3.91k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  3.91k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  3.91k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  3.91k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  3.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  172|       |
  173|  1.30k|    apreq_param_tainted_on(param);
  174|  1.30k|    *p = param;
  175|  1.30k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.30k|#define APR_SUCCESS 0
  ------------------
  176|       |
  177|  1.30k|}

apreq_parse_multipart:
  270|    987|{
  271|    987|    apr_pool_t *pool = parser->pool;
  272|    987|    apr_bucket_alloc_t *ba = parser->bucket_alloc;
  273|    987|    struct mfd_ctx *ctx = parser->ctx;
  274|    987|    apr_status_t s;
  275|       |
  276|    987|    if (ctx == NULL) {
  ------------------
  |  Branch (276:9): [True: 914, False: 73]
  ------------------
  277|    914|        ctx = create_multipart_context(parser->content_type,
  278|    914|                                       pool, ba,
  279|    914|                                       parser->brigade_limit,
  280|    914|                                       parser->temp_dir, 1);
  281|    914|        if (ctx == NULL)
  ------------------
  |  Branch (281:13): [True: 125, False: 789]
  ------------------
  282|    125|            return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|    125|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|    125|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    125|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|    125|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|    125|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    125|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|       |
  284|       |
  285|    789|        parser->ctx = ctx;
  286|    789|    }
  287|       |
  288|    862|    PARSER_STATUS_CHECK(MFD);
  ------------------
  |  |   30|    862|#define PARSER_STATUS_CHECK(PREFIX)   do {         \
  |  |   31|    862|    if (ctx->status == PREFIX##_ERROR)             \
  |  |  ------------------
  |  |  |  Branch (31:9): [True: 0, False: 862]
  |  |  ------------------
  |  |   32|    862|        return APREQ_ERROR_GENERAL;                \
  |  |  ------------------
  |  |  |  |   53|      0|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  ------------------
  |  |  |  |  |  |  164|      0|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   33|    862|    else if (ctx->status == PREFIX##_COMPLETE)     \
  |  |  ------------------
  |  |  |  Branch (33:14): [True: 0, False: 862]
  |  |  ------------------
  |  |   34|    862|        return APR_SUCCESS;                        \
  |  |  ------------------
  |  |  |  |  225|      0|#define APR_SUCCESS 0
  |  |  ------------------
  |  |   35|    862|    else if (bb == NULL)                           \
  |  |  ------------------
  |  |  |  Branch (35:14): [True: 0, False: 862]
  |  |  ------------------
  |  |   36|    862|        return APR_INCOMPLETE;                     \
  |  |  ------------------
  |  |  |  |  458|      0|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   37|    862|} while (0);
  |  |  ------------------
  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  289|    862|    APR_BRIGADE_CONCAT(ctx->in, bb);
  ------------------
  |  |  388|    862|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    862|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    862|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    862|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    862|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    862|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    862|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    862|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 862, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  340|    862|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    862|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    862|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    862|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    862|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    862|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    862|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    862|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    862|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    862|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    862|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    862|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    862|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    862|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    862|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    862|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    862|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    862|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    862|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    862|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    862|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    862|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    862|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    862|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    862|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    862|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    862|    }                                                       \
  |  |  |  |  344|    862|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    862|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    862|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  290|       |
  291|  1.85k| mfd_parse_brigade:
  292|       |
  293|  1.85k|    switch (ctx->status) {
  294|       |
  295|    924|    case MFD_INIT:
  ------------------
  |  Branch (295:5): [True: 924, False: 928]
  ------------------
  296|    924|        {
  297|    924|            s = split_on_bdry(ctx->bb, ctx->in, NULL, ctx->bdry + 2);
  298|    924|            if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    924|#define APR_SUCCESS 0
  ------------------
  |  Branch (298:17): [True: 96, False: 828]
  ------------------
  299|     96|                apreq_brigade_setaside(ctx->in, pool);
  300|     96|                apreq_brigade_setaside(ctx->bb, pool);
  301|     96|                return s;
  302|     96|            }
  303|    828|            ctx->status = MFD_NEXTLINE;
  304|       |            /* Be polite and return any preamble text to the caller. */
  305|    828|            APR_BRIGADE_CONCAT(bb, ctx->bb);
  ------------------
  |  |  388|    828|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    828|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    828|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    828|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    828|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    828|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    828|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    828|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 496, False: 332]
  |  |  |  |  ------------------
  |  |  |  |  340|    496|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    496|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    496|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    496|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    496|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    496|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    496|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    496|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    496|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    496|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    496|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    496|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    496|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    496|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    496|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    496|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    496|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    496|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    496|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    496|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    496|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    496|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    496|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    496|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    496|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    496|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    496|    }                                                       \
  |  |  |  |  344|    828|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    828|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    828|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  306|    828|        }
  307|       |
  308|       |        /* fall through */
  309|       |
  310|  1.06k|    case MFD_NEXTLINE:
  ------------------
  |  Branch (310:5): [True: 238, False: 1.61k]
  ------------------
  311|  1.06k|        {
  312|  1.06k|            s = split_on_bdry(ctx->bb, ctx->in, NULL, CRLF);
  ------------------
  |  |   25|  1.06k|#define CRLF    "\015\012"
  ------------------
  313|  1.06k|            if (s == APR_EOF) {
  ------------------
  |  |  467|  1.06k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|  1.06k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|  1.06k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  1.06k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:17): [True: 0, False: 1.06k]
  ------------------
  314|      0|                ctx->status = MFD_COMPLETE;
  315|      0|                return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  316|      0|            }
  317|  1.06k|            if (s != APR_SUCCESS) {
  ------------------
  |  |  225|  1.06k|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:17): [True: 75, False: 991]
  ------------------
  318|     75|                apreq_brigade_setaside(ctx->in, pool);
  319|     75|                apreq_brigade_setaside(ctx->bb, pool);
  320|     75|                return s;
  321|     75|            }
  322|    991|            if (!APR_BRIGADE_EMPTY(ctx->bb)) {
  ------------------
  |  |  346|    991|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|    991|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|    991|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    991|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|    991|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:17): [True: 550, False: 441]
  ------------------
  323|    550|                char *line;
  324|    550|                apr_size_t len;
  325|    550|                apr_brigade_pflatten(ctx->bb, &line, &len, pool);
  326|       |
  327|    550|                if (len >= 2 && strncmp(line, "--", 2) == 0) {
  ------------------
  |  Branch (327:21): [True: 336, False: 214]
  |  Branch (327:33): [True: 72, False: 264]
  ------------------
  328|     72|                    APR_BRIGADE_CONCAT(bb, ctx->in);
  ------------------
  |  |  388|     72|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|     72|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|     72|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|     72|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|     72|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     72|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     72|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     72|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 69, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  340|     69|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     69|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|     69|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     69|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     69|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     69|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|     69|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     69|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     69|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|     69|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     69|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|     69|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     69|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|     69|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|     69|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|     69|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|     69|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|     69|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     69|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     69|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     69|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|     69|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     69|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     69|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     69|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|     69|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|     69|    }                                                       \
  |  |  |  |  344|     72|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|     72|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|     72|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  329|     72|                    ctx->status = MFD_COMPLETE;
  330|     72|                    return APR_SUCCESS;
  ------------------
  |  |  225|     72|#define APR_SUCCESS 0
  ------------------
  331|     72|                }
  332|    478|                apr_brigade_cleanup(ctx->bb);
  333|    478|            }
  334|       |
  335|    919|            ctx->status = MFD_HEADER;
  336|    919|            ctx->info = NULL;
  337|    919|        }
  338|       |        /* fall through */
  339|       |
  340|    919|    case MFD_HEADER:
  ------------------
  |  Branch (340:5): [True: 0, False: 1.85k]
  ------------------
  341|    919|        {
  342|    919|            if (ctx->info == NULL) {
  ------------------
  |  Branch (342:17): [True: 919, False: 0]
  ------------------
  343|    919|                ctx->info = apr_table_make(pool, APREQ_DEFAULT_NELTS);
  ------------------
  |  |   66|    919|#define APREQ_DEFAULT_NELTS              8
  ------------------
  344|       |                /* flush out header parser internal structs for reuse */
  345|    919|                ctx->hdr_parser->ctx = NULL;
  346|    919|            }
  347|    919|            s = apreq_parser_run(ctx->hdr_parser, ctx->info, ctx->in);
  348|    919|            switch (s) {
  349|    759|            case APR_SUCCESS:
  ------------------
  |  |  225|    759|#define APR_SUCCESS 0
  ------------------
  |  Branch (349:13): [True: 759, False: 160]
  ------------------
  350|    759|                ctx->status = MFD_POST_HEADER;
  351|    759|                break;
  352|     94|            case APR_INCOMPLETE:
  ------------------
  |  |  458|     94|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     94|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     94|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     94|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (352:13): [True: 94, False: 825]
  ------------------
  353|     94|                apreq_brigade_setaside(ctx->in, pool);
  354|     94|                return APR_INCOMPLETE;
  ------------------
  |  |  458|     94|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     94|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     94|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     94|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|     66|            default:
  ------------------
  |  Branch (355:13): [True: 66, False: 853]
  ------------------
  356|     66|                ctx->status = MFD_ERROR;
  357|     66|                return s;
  358|    919|            }
  359|    919|        }
  360|       |        /* fall through */
  361|       |
  362|    759|    case MFD_POST_HEADER:
  ------------------
  |  Branch (362:5): [True: 0, False: 1.85k]
  ------------------
  363|    759|        {
  364|       |            /*  Must handle special case of missing CRLF (mainly
  365|       |             *  coming from empty file uploads). See RFC2065 S5.1.1:
  366|       |             *
  367|       |             *    body-part = MIME-part-header [CRLF *OCTET]
  368|       |             *
  369|       |             *  So the CRLF we already matched in MFD_HEADER may have been
  370|       |             *  part of the boundary string! Both Konqueror (v??) and
  371|       |             *  Mozilla-0.97 are known to emit such blocks.
  372|       |             *
  373|       |             *  Here we first check for this condition with
  374|       |             *  brigade_start_string, and prefix the brigade with
  375|       |             *  an additional CRLF bucket if necessary.
  376|       |             */
  377|       |
  378|    759|            const char *cd, *ct, *name, *filename;
  379|    759|            apr_size_t nlen, flen;
  380|    759|            apr_bucket *e;
  381|       |
  382|    759|            switch (brigade_start_string(ctx->in, ctx->bdry + 2)) {
  383|       |
  384|     10|            case APR_INCOMPLETE:
  ------------------
  |  |  458|     10|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     10|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     10|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     10|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (384:13): [True: 10, False: 749]
  ------------------
  385|     10|                apreq_brigade_setaside(ctx->in, pool);
  386|     10|                return APR_INCOMPLETE;
  ------------------
  |  |  458|     10|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     10|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     10|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     10|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  387|       |
  388|     10|            case APR_SUCCESS:
  ------------------
  |  |  225|     10|#define APR_SUCCESS 0
  ------------------
  |  Branch (388:13): [True: 10, False: 749]
  ------------------
  389|       |                /* part has no body- return CRLF to front */
  390|     10|                e = apr_bucket_immortal_create(CRLF, 2,
  ------------------
  |  |   25|     10|#define CRLF    "\015\012"
  ------------------
  391|     10|                                                ctx->bb->bucket_alloc);
  392|     10|                APR_BRIGADE_INSERT_HEAD(ctx->in, e);
  ------------------
  |  |  366|     10|#define APR_BRIGADE_INSERT_HEAD(b, e) do {				\
  |  |  367|     10|	apr_bucket *ap__b = (e);                                        \
  |  |  368|     10|	APR_RING_INSERT_HEAD(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  318|     10|    APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  286|     10|#define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  287|     10|    APR_RING_PREV((ep1), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     10|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     10|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     10|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  288|     10|    APR_RING_NEXT((epN), link) = APR_RING_FIRST((hp));        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     10|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_FIRST((hp));        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     10|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  289|     10|    APR_RING_PREV(APR_RING_FIRST((hp)), link) = (epN);        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     10|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  290|     10|    APR_RING_FIRST((hp)) = (ep1);                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     10|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     10|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|     10|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  370|     10|    } while (0)
  |  |  ------------------
  |  |  |  Branch (370:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  393|     10|                break;
  394|       |
  395|    739|            default:
  ------------------
  |  Branch (395:13): [True: 739, False: 20]
  ------------------
  396|    739|                ; /* has body, ok */
  397|    759|            }
  398|       |
  399|    749|            cd = apr_table_get(ctx->info, "Content-Disposition");
  400|       |
  401|       |            /*  First check to see if must descend into a new multipart
  402|       |             *  block.  If we do, create a new parser and pass control
  403|       |             *  to it.
  404|       |             */
  405|       |
  406|    749|            ct = apr_table_get(ctx->info, "Content-Type");
  407|       |
  408|    749|            if (ct != NULL && strncmp(ct, "multipart/", 10) == 0) {
  ------------------
  |  Branch (408:17): [True: 183, False: 566]
  |  Branch (408:31): [True: 79, False: 104]
  ------------------
  409|     79|                struct mfd_ctx *next_ctx;
  410|       |
  411|     79|                if (ctx->level >= MAX_LEVEL) {
  ------------------
  |  |   40|     79|#define MAX_LEVEL 8
  ------------------
  |  Branch (411:21): [True: 0, False: 79]
  ------------------
  412|      0|                    ctx->status = MFD_ERROR;
  413|      0|                    goto mfd_parse_brigade;
  414|      0|                }
  415|       |
  416|     79|                next_ctx = create_multipart_context(ct, pool, ba,
  417|     79|                                                    parser->brigade_limit,
  418|     79|                                                    parser->temp_dir,
  419|     79|                                                    ctx->level + 1);
  420|     79|                if (next_ctx == NULL) {
  ------------------
  |  Branch (420:21): [True: 3, False: 76]
  ------------------
  421|      3|                    ctx->status = MFD_ERROR;
  422|      3|                    goto mfd_parse_brigade;
  423|      3|                }
  424|       |
  425|     76|                if (cd != NULL) {
  ------------------
  |  Branch (425:21): [True: 8, False: 68]
  ------------------
  426|      8|                    s = apreq_header_attribute(cd, "name", 4,
  427|      8|                                               &name, &nlen);
  428|      8|                    if (s == APR_SUCCESS && nlen) {
  ------------------
  |  |  225|     16|#define APR_SUCCESS 0
  ------------------
  |  Branch (428:25): [True: 4, False: 4]
  |  Branch (428:45): [True: 3, False: 1]
  ------------------
  429|      3|                        next_ctx->param_name = apr_pstrmemdup(pool, name,
  430|      3|                                                              nlen);
  431|      3|                    }
  432|      5|                    else if (s != APREQ_ERROR_NOATTR) {
  ------------------
  |  |   77|      5|#define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  2)
  |  |  ------------------
  |  |  |  |   73|      5|#define APREQ_ERROR_NODATA         (APREQ_ERROR_GENERAL  + 20)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      5|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      5|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      5|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      5|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      5|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      5|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (432:30): [True: 3, False: 2]
  ------------------
  433|      3|                        ctx->status = MFD_ERROR;
  434|      3|                        goto mfd_parse_brigade;
  435|      3|                    }
  436|      8|                }
  437|     73|                if (!next_ctx->param_name) {
  ------------------
  |  Branch (437:21): [True: 70, False: 3]
  ------------------
  438|     70|                    const char *cid = apr_table_get(ctx->info,
  439|     70|                                                    "Content-ID");
  440|     70|                    if (cid) {
  ------------------
  |  Branch (440:25): [True: 2, False: 68]
  ------------------
  441|      2|                        next_ctx->param_name = apr_pstrdup(pool, cid);
  442|      2|                    }
  443|     68|                    else {
  444|     68|                        next_ctx->param_name = "";
  445|     68|                    }
  446|     70|                }
  447|       |
  448|     73|                ctx->next_parser = apreq_parser_make(pool, ba, ct,
  449|     73|                                                     apreq_parse_multipart,
  450|     73|                                                     parser->brigade_limit,
  451|     73|                                                     parser->temp_dir,
  452|     73|                                                     parser->hook,
  453|     73|                                                     next_ctx);
  454|     73|                ctx->status = MFD_MIXED;
  455|     73|                goto mfd_parse_brigade;
  456|       |
  457|     76|            }
  458|       |
  459|       |            /* Look for a normal form-data part. */
  460|       |
  461|    670|            if (cd != NULL && strncmp(cd, "form-data", 9) == 0) {
  ------------------
  |  Branch (461:17): [True: 173, False: 497]
  |  Branch (461:31): [True: 71, False: 102]
  ------------------
  462|     71|                s = apreq_header_attribute(cd, "name", 4, &name, &nlen);
  463|     71|                if (s != APR_SUCCESS || !nlen) {
  ------------------
  |  |  225|    142|#define APR_SUCCESS 0
  ------------------
  |  Branch (463:21): [True: 2, False: 69]
  |  Branch (463:41): [True: 2, False: 67]
  ------------------
  464|      4|                    ctx->status = MFD_ERROR;
  465|      4|                    goto mfd_parse_brigade;
  466|      4|                }
  467|       |
  468|     67|                s = apreq_header_attribute(cd, "filename",
  469|     67|                                           8, &filename, &flen);
  470|     67|                if (s == APR_SUCCESS && flen) {
  ------------------
  |  |  225|    134|#define APR_SUCCESS 0
  ------------------
  |  Branch (470:21): [True: 5, False: 62]
  |  Branch (470:41): [True: 4, False: 1]
  ------------------
  471|      4|                    apreq_param_t *param;
  472|       |
  473|      4|                    param = apreq_param_make(pool, name, nlen,
  474|      4|                                             filename, flen);
  475|      4|                    if (param == NULL)
  ------------------
  |  Branch (475:25): [True: 0, False: 4]
  ------------------
  476|      0|                        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  477|      4|                    apreq_param_tainted_on(param);
  478|      4|                    param->info = ctx->info;
  479|      4|                    param->upload
  480|      4|                        = apr_brigade_create(pool, ctx->bb->bucket_alloc);
  481|      4|                    ctx->upload = param;
  482|      4|                    ctx->status = MFD_UPLOAD;
  483|      4|                    goto mfd_parse_brigade;
  484|      4|                }
  485|     63|                else if (s != APREQ_ERROR_NOATTR) {
  ------------------
  |  |   77|     63|#define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  2)
  |  |  ------------------
  |  |  |  |   73|     63|#define APREQ_ERROR_NODATA         (APREQ_ERROR_GENERAL  + 20)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     63|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     63|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     63|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     63|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     63|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     63|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (485:26): [True: 4, False: 59]
  ------------------
  486|      4|                    ctx->status = MFD_ERROR;
  487|      4|                    goto mfd_parse_brigade;
  488|      4|                }
  489|     59|                else {
  490|     59|                    ctx->param_name = apr_pstrmemdup(pool, name, nlen);
  491|     59|                    ctx->status = MFD_PARAM;
  492|       |                    /* fall thru */
  493|     59|                }
  494|     67|            }
  495|       |
  496|       |            /* else check for a file part in a multipart section */
  497|    599|            else if (cd != NULL && strncmp(cd, "file", 4) == 0) {
  ------------------
  |  Branch (497:22): [True: 102, False: 497]
  |  Branch (497:36): [True: 6, False: 96]
  ------------------
  498|      6|                apreq_param_t *param;
  499|       |
  500|      6|                s = apreq_header_attribute(cd, "filename",
  501|      6|                                           8, &filename, &flen);
  502|      6|                if (s != APR_SUCCESS || !flen || !ctx->param_name) {
  ------------------
  |  |  225|     12|#define APR_SUCCESS 0
  ------------------
  |  Branch (502:21): [True: 3, False: 3]
  |  Branch (502:41): [True: 1, False: 2]
  |  Branch (502:50): [True: 2, False: 0]
  ------------------
  503|      6|                    ctx->status = MFD_ERROR;
  504|      6|                    goto mfd_parse_brigade;
  505|      6|                }
  506|      0|                name = ctx->param_name;
  507|      0|                nlen = strlen(name);
  508|      0|                param = apreq_param_make(pool, name, nlen,
  509|      0|                                         filename, flen);
  510|      0|                if (param == NULL)
  ------------------
  |  Branch (510:21): [True: 0, False: 0]
  ------------------
  511|      0|                    return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  512|      0|                apreq_param_tainted_on(param);
  513|      0|                param->info = ctx->info;
  514|      0|                param->upload = apr_brigade_create(pool,
  515|      0|                                                   ctx->bb->bucket_alloc);
  516|      0|                ctx->upload = param;
  517|      0|                ctx->status = MFD_UPLOAD;
  518|      0|                goto mfd_parse_brigade;
  519|      0|            }
  520|       |
  521|       |            /* otherwise look for Content-ID in multipart/mixed case */
  522|    593|            else {
  523|    593|                const char *cid = apr_table_get(ctx->info, "Content-ID");
  524|    593|                apreq_param_t *param;
  525|       |
  526|    593|                if (cid != NULL) {
  ------------------
  |  Branch (526:21): [True: 16, False: 577]
  ------------------
  527|     16|                    name = cid;
  528|     16|                    nlen = strlen(name);
  529|     16|                }
  530|    577|                else {
  531|    577|                    name = "";
  532|    577|                    nlen = 0;
  533|    577|                }
  534|       |
  535|    593|                filename = "";
  536|    593|                flen = 0;
  537|    593|                param = apreq_param_make(pool, name, nlen,
  538|    593|                                         filename, flen);
  539|    593|                if (param == NULL)
  ------------------
  |  Branch (539:21): [True: 0, False: 593]
  ------------------
  540|      0|                    return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  541|    593|                apreq_param_tainted_on(param);
  542|    593|                param->info = ctx->info;
  543|    593|                param->upload = apr_brigade_create(pool,
  544|    593|                                               ctx->bb->bucket_alloc);
  545|    593|                ctx->upload = param;
  546|    593|                ctx->status = MFD_UPLOAD;
  547|    593|                goto mfd_parse_brigade;
  548|    593|            }
  549|    670|        }
  550|       |        /* fall through */
  551|       |
  552|     59|    case MFD_PARAM:
  ------------------
  |  Branch (552:5): [True: 0, False: 1.85k]
  ------------------
  553|     59|        {
  554|     59|            apreq_param_t *param;
  555|     59|            apreq_value_t *v;
  556|     59|            apr_size_t len;
  557|     59|            apr_off_t off;
  558|       |
  559|     59|            s = split_on_bdry(ctx->bb, ctx->in, ctx->pattern, ctx->bdry);
  560|       |
  561|     59|            switch (s) {
  562|       |
  563|      5|            case APR_INCOMPLETE:
  ------------------
  |  |  458|      5|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      5|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      5|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      5|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (563:13): [True: 5, False: 54]
  ------------------
  564|      5|                apreq_brigade_setaside(ctx->in, pool);
  565|      5|                apreq_brigade_setaside(ctx->bb, pool);
  566|      5|                return s;
  567|       |
  568|     54|            case APR_SUCCESS:
  ------------------
  |  |  225|     54|#define APR_SUCCESS 0
  ------------------
  |  Branch (568:13): [True: 54, False: 5]
  ------------------
  569|     54|                s = apr_brigade_length(ctx->bb, 1, &off);
  570|     54|                if (s != APR_SUCCESS) {
  ------------------
  |  |  225|     54|#define APR_SUCCESS 0
  ------------------
  |  Branch (570:21): [True: 0, False: 54]
  ------------------
  571|      0|                    ctx->status = MFD_ERROR;
  572|      0|                    return s;
  573|      0|                }
  574|     54|                len = off;
  575|     54|                param = apreq_param_make(pool, ctx->param_name,
  576|     54|                                         strlen(ctx->param_name),
  577|     54|                                         NULL, len);
  578|     54|                if (param == NULL)
  ------------------
  |  Branch (578:21): [True: 0, False: 54]
  ------------------
  579|      0|                    return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  580|     54|                apreq_param_tainted_on(param);
  581|     54|                param->info = ctx->info;
  582|       |
  583|     54|                *(const apreq_value_t **)&v = &param->v;
  584|     54|                apr_brigade_flatten(ctx->bb, v->data, &len);
  585|     54|                v->data[len] = 0;
  586|       |
  587|     54|                if (parser->hook != NULL) {
  ------------------
  |  Branch (587:21): [True: 54, False: 0]
  ------------------
  588|     54|                    s = apreq_hook_run(parser->hook, param, NULL);
  589|     54|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|     54|#define APR_SUCCESS 0
  ------------------
  |  Branch (589:25): [True: 0, False: 54]
  ------------------
  590|      0|                        ctx->status = MFD_ERROR;
  591|      0|                        return s;
  592|      0|                    }
  593|     54|                }
  594|       |
  595|     54|                apreq_param_charset_set(param,
  596|     54|                                        apreq_charset_divine(v->data, len));
  597|     54|                apreq_value_table_add(v, t);
  598|     54|                ctx->status = MFD_NEXTLINE;
  599|     54|                ctx->param_name = NULL;
  600|     54|                apr_brigade_cleanup(ctx->bb);
  601|     54|                goto mfd_parse_brigade;
  602|       |
  603|      0|            default:
  ------------------
  |  Branch (603:13): [True: 0, False: 59]
  ------------------
  604|      0|                ctx->status = MFD_ERROR;
  605|      0|                return s;
  606|     59|            }
  607|       |
  608|       |
  609|     59|        }
  610|      0|        break;  /* not reached */
  611|       |
  612|    597|    case MFD_UPLOAD:
  ------------------
  |  Branch (612:5): [True: 597, False: 1.25k]
  ------------------
  613|    597|        {
  614|    597|            apreq_param_t *param = ctx->upload;
  615|       |
  616|    597|            s = split_on_bdry(ctx->bb, ctx->in, ctx->pattern, ctx->bdry);
  617|    597|            switch (s) {
  618|       |
  619|    413|            case APR_INCOMPLETE:
  ------------------
  |  |  458|    413|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|    413|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    413|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    413|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (619:13): [True: 413, False: 184]
  ------------------
  620|    413|                if (parser->hook != NULL) {
  ------------------
  |  Branch (620:21): [True: 413, False: 0]
  ------------------
  621|    413|                    s = apreq_hook_run(parser->hook, param, ctx->bb);
  622|    413|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    413|#define APR_SUCCESS 0
  ------------------
  |  Branch (622:25): [True: 0, False: 413]
  ------------------
  623|      0|                        ctx->status = MFD_ERROR;
  624|      0|                        return s;
  625|      0|                    }
  626|    413|                }
  627|    413|                apreq_brigade_setaside(ctx->bb, pool);
  628|    413|                apreq_brigade_setaside(ctx->in, pool);
  629|    413|                s = apreq_brigade_concat(pool, parser->temp_dir,
  630|    413|                                         parser->brigade_limit,
  631|    413|                                         param->upload, ctx->bb);
  632|    413|                return (s == APR_SUCCESS) ? APR_INCOMPLETE : s;
  ------------------
  |  |  225|    413|#define APR_SUCCESS 0
  ------------------
                              return (s == APR_SUCCESS) ? APR_INCOMPLETE : s;
  ------------------
  |  |  458|    413|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|    413|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    413|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    413|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (632:24): [True: 413, False: 0]
  ------------------
  633|       |
  634|    184|            case APR_SUCCESS:
  ------------------
  |  |  225|    184|#define APR_SUCCESS 0
  ------------------
  |  Branch (634:13): [True: 184, False: 413]
  ------------------
  635|    184|                if (parser->hook != NULL) {
  ------------------
  |  Branch (635:21): [True: 184, False: 0]
  ------------------
  636|    184|                    APR_BRIGADE_INSERT_TAIL(ctx->bb, ctx->eos);
  ------------------
  |  |  377|    184|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|    184|	apr_bucket *ap__b = (e);					\
  |  |  379|    184|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|    184|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    184|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    184|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    184|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    184|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    184|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    184|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    184|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    184|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    184|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    184|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    184|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    184|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    184|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|    184|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|    184|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  637|    184|                    s = apreq_hook_run(parser->hook, param, ctx->bb);
  638|    184|                    APR_BUCKET_REMOVE(ctx->eos);
  ------------------
  |  |  442|    184|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|    184|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|    184|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|    184|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    184|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|    184|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    184|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|    184|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    184|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|    184|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    184|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|    184|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  639|    184|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    184|#define APR_SUCCESS 0
  ------------------
  |  Branch (639:25): [True: 0, False: 184]
  ------------------
  640|      0|                        ctx->status = MFD_ERROR;
  641|      0|                        return s;
  642|      0|                    }
  643|    184|                }
  644|    184|                apreq_value_table_add(&param->v, t);
  645|    184|                apreq_brigade_setaside(ctx->bb, pool);
  646|    184|                s = apreq_brigade_concat(pool, parser->temp_dir,
  647|    184|                                         parser->brigade_limit,
  648|    184|                                         param->upload, ctx->bb);
  649|       |
  650|    184|                if (s != APR_SUCCESS)
  ------------------
  |  |  225|    184|#define APR_SUCCESS 0
  ------------------
  |  Branch (650:21): [True: 0, False: 184]
  ------------------
  651|      0|                    return s;
  652|       |
  653|    184|                ctx->status = MFD_NEXTLINE;
  654|    184|                goto mfd_parse_brigade;
  655|       |
  656|      0|            default:
  ------------------
  |  Branch (656:13): [True: 0, False: 597]
  ------------------
  657|      0|                ctx->status = MFD_ERROR;
  658|      0|                return s;
  659|    597|            }
  660|       |
  661|    597|        }
  662|      0|        break;  /* not reached */
  663|       |
  664|       |
  665|     73|    case MFD_MIXED:
  ------------------
  |  Branch (665:5): [True: 73, False: 1.77k]
  ------------------
  666|     73|        {
  667|     73|            s = apreq_parser_run(ctx->next_parser, t, ctx->in);
  668|     73|            switch (s) {
  669|     62|            case APR_SUCCESS:
  ------------------
  |  |  225|     62|#define APR_SUCCESS 0
  ------------------
  |  Branch (669:13): [True: 62, False: 11]
  ------------------
  670|     62|                ctx->status = MFD_INIT;
  671|     62|                ctx->param_name = NULL;
  672|     62|                goto mfd_parse_brigade;
  673|      9|            case APR_INCOMPLETE:
  ------------------
  |  |  458|      9|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      9|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      9|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      9|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (673:13): [True: 9, False: 64]
  ------------------
  674|      9|                APR_BRIGADE_CONCAT(bb, ctx->in);
  ------------------
  |  |  388|      9|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|      9|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|      9|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|      9|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      9|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|      9|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      9|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      9|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 2, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  340|      2|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      2|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      2|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      2|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      2|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      2|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      2|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      2|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      2|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      2|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      2|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      2|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      2|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|      2|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|      2|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      2|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|      2|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|      2|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      2|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      2|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      2|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      2|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      2|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      2|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      2|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|      2|    }                                                       \
  |  |  |  |  344|      9|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|      9|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|      9|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  675|      9|                return APR_INCOMPLETE;
  ------------------
  |  |  458|      9|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      9|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      9|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      9|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  676|      2|            default:
  ------------------
  |  Branch (676:13): [True: 2, False: 71]
  ------------------
  677|      2|                ctx->status = MFD_ERROR;
  678|      2|                return s;
  679|     73|            }
  680|       |
  681|     73|        }
  682|      0|        break; /* not reached */
  683|       |
  684|     20|    default:
  ------------------
  |  Branch (684:5): [True: 20, False: 1.83k]
  ------------------
  685|     20|        return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|     20|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|     20|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|     20|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|     20|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|     20|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     20|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  686|  1.85k|    }
  687|       |
  688|      0|    return APR_INCOMPLETE;
  ------------------
  |  |  458|      0|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  689|  1.85k|}
apreq_parser_multipart.c:create_multipart_context:
  220|    993|{
  221|    993|    apr_status_t s;
  222|    993|    apr_size_t blen;
  223|    993|    struct mfd_ctx *ctx;
  224|    993|    const char *attr;
  225|    993|    char *buf;
  226|       |
  227|    993|    attr = (content_type) ? strchr(content_type, ';') : NULL;
  ------------------
  |  Branch (227:12): [True: 993, False: 0]
  ------------------
  228|    993|    if (!attr)
  ------------------
  |  Branch (228:9): [True: 14, False: 979]
  ------------------
  229|     14|        return NULL; /* missing semicolon */
  230|       |
  231|    979|    ctx = apr_palloc(pool, sizeof *ctx);
  ------------------
  |  |  425|    979|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    979|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    979|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    979|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|       |
  233|    979|    attr++;
  234|    979|    blen = strlen(attr) + 1;
  235|    979|    buf = apr_palloc(pool, 4 + blen);
  ------------------
  |  |  425|    979|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    979|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    979|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    979|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|    979|    buf += 4;
  237|    979|    memcpy(buf, attr, blen);
  238|       |
  239|    979|    s = apreq_header_attribute(buf, "boundary", 8,
  240|    979|                               (const char **)&ctx->bdry, &blen);
  241|    979|    if (s != APR_SUCCESS || !blen)
  ------------------
  |  |  225|  1.95k|#define APR_SUCCESS 0
  ------------------
  |  Branch (241:9): [True: 108, False: 871]
  |  Branch (241:29): [True: 6, False: 865]
  ------------------
  242|    114|        return NULL; /* missing or empty boundary */
  243|       |
  244|    865|    ctx->bdry[blen] = 0;
  245|       |
  246|    865|    *--ctx->bdry = '-';
  247|    865|    *--ctx->bdry = '-';
  248|    865|    *--ctx->bdry = '\n';
  249|    865|    *--ctx->bdry = '\r';
  250|       |
  251|    865|    ctx->status = MFD_INIT;
  252|    865|    ctx->pattern = apr_strmatch_precompile(pool, ctx->bdry, 1);
  253|    865|    ctx->hdr_parser = apreq_parser_make(pool, ba, "",
  254|    865|                                        apreq_parse_headers,
  255|    865|                                        brigade_limit,
  256|    865|                                        temp_dir, NULL, NULL);
  257|    865|    ctx->info = NULL;
  258|    865|    ctx->bb = apr_brigade_create(pool, ba);
  259|    865|    ctx->in = apr_brigade_create(pool, ba);
  260|    865|    ctx->eos = apr_bucket_eos_create(ba);
  261|    865|    ctx->next_parser = NULL;
  262|    865|    ctx->param_name = NULL;
  263|    865|    ctx->upload = NULL;
  264|    865|    ctx->level = level;
  265|       |
  266|    865|    return ctx;
  267|    979|}
apreq_parser_multipart.c:split_on_bdry:
  116|  2.64k|{
  117|  2.64k|    apr_bucket *e = APR_BRIGADE_FIRST(in);
  ------------------
  |  |  353|  2.64k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  2.64k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  118|  2.64k|    apr_size_t blen = strlen(bdry), off = 0;
  119|       |
  120|  4.54k|    while ( e != APR_BRIGADE_SENTINEL(in) ) {
  ------------------
  |  |  339|  4.54k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  4.54k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|  4.54k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (120:13): [True: 3.95k, False: 589]
  ------------------
  121|  3.95k|        apr_ssize_t idx;
  122|  3.95k|        apr_size_t len;
  123|  3.95k|        const char *buf;
  124|  3.95k|        apr_status_t s;
  125|       |
  126|  3.95k|        if (APR_BUCKET_IS_EOS(e))
  ------------------
  |  |  469|  3.95k|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 3.95k]
  |  |  ------------------
  ------------------
  127|      0|            return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|       |
  129|  3.95k|        s = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ);
  ------------------
  |  | 1159|  3.95k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  130|  3.95k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  3.95k|#define APR_SUCCESS 0
  ------------------
  |  Branch (130:13): [True: 0, False: 3.95k]
  ------------------
  131|      0|            return s;
  132|       |
  133|  3.95k|        if (len == 0) {
  ------------------
  |  Branch (133:13): [True: 1, False: 3.95k]
  ------------------
  134|      1|            apr_bucket *f = e;
  135|      1|            e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|      1|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|      1|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  136|      1|            apr_bucket_delete(f);
  ------------------
  |  | 1086|      1|#define apr_bucket_delete(e) do {					\
  |  | 1087|      1|        apr_bucket *apr__b = (e);					\
  |  | 1088|      1|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|      1|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|      1|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|      1|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|      1|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|      1|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|      1|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|      1|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      1|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|      1|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|      1|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|      1|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|      1|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|      1|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|      1|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|      1|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|      1|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|      1|        apr__d->free(apr__d);						\
  |  |  |  | 1073|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  137|      1|            continue;
  138|      1|        }
  139|       |
  140|  3.96k|    look_for_boundary_up_front:
  141|  3.96k|        if (strncmp(bdry + off, buf, MIN(len, blen - off)) == 0) {
  ------------------
  |  |   28|  3.96k|#define MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (28:20): [True: 263, False: 3.70k]
  |  |  ------------------
  ------------------
  |  Branch (141:13): [True: 2.17k, False: 1.78k]
  ------------------
  142|  2.17k|            if ( len >= blen - off ) {
  ------------------
  |  Branch (142:18): [True: 2.05k, False: 122]
  ------------------
  143|       |                /* complete match */
  144|  2.05k|                if (len > blen - off)
  ------------------
  |  Branch (144:21): [True: 2.01k, False: 44]
  ------------------
  145|  2.01k|                    apr_bucket_split(e, blen - off);
  ------------------
  |  | 1179|  2.01k|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  146|  2.05k|                e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  2.05k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  2.05k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  147|       |
  148|  2.07k|                do {
  149|  2.07k|                    apr_bucket *f = APR_BRIGADE_FIRST(in);
  ------------------
  |  |  353|  2.07k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  2.07k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  150|  2.07k|                    apr_bucket_delete(f);
  ------------------
  |  | 1086|  2.07k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  2.07k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  2.07k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  2.07k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  2.07k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  2.07k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  2.07k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.07k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  2.07k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.07k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  2.07k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.07k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  2.07k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.07k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  2.07k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  2.07k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  2.07k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  2.07k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  2.07k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  2.07k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  2.07k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  2.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  151|  2.07k|                } while (APR_BRIGADE_FIRST(in) != e);
  ------------------
  |  |  353|  2.07k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  2.07k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (151:26): [True: 13, False: 2.05k]
  ------------------
  152|       |
  153|  2.05k|                return APR_SUCCESS;
  ------------------
  |  |  225|  2.05k|#define APR_SUCCESS 0
  ------------------
  154|  2.05k|            }
  155|       |            /* partial match */
  156|    122|            off += len;
  157|    122|            e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    122|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    122|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  158|    122|            continue;
  159|  2.17k|        }
  160|  1.78k|        else if (off > 0) {
  ------------------
  |  Branch (160:18): [True: 12, False: 1.77k]
  ------------------
  161|       |            /* prior (partial) strncmp failed,
  162|       |             * so we can move previous buckets across
  163|       |             * and retest buf against the full bdry.
  164|       |             */
  165|       |
  166|       |            /* give hints to GCC by making the brigade volatile, otherwise the
  167|       |             * loop below will end up being endless. See:
  168|       |             * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=193740
  169|       |             */
  170|     12|            apr_bucket_brigade * volatile in_v = in;
  171|       |
  172|     12|            do {
  173|     12|                apr_bucket *f = APR_BRIGADE_FIRST(in_v);
  ------------------
  |  |  353|     12|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     12|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  174|     12|                APR_BUCKET_REMOVE(f);
  ------------------
  |  |  442|     12|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|     12|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|     12|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|     12|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     12|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|     12|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     12|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|     12|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     12|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|     12|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     12|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|     12|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|     12|                APR_BRIGADE_INSERT_TAIL(out, f);
  ------------------
  |  |  377|     12|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|     12|	apr_bucket *ap__b = (e);					\
  |  |  379|     12|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|     12|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     12|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|     12|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     12|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     12|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     12|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|     12|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     12|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     12|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|     12|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     12|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|     12|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     12|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|     12|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|     12|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|     12|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  176|     12|            } while (e != APR_BRIGADE_FIRST(in_v));
  ------------------
  |  |  353|     12|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     12|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (176:22): [True: 0, False: 12]
  ------------------
  177|     12|            off = 0;
  178|     12|            goto look_for_boundary_up_front;
  179|     12|        }
  180|       |
  181|  1.77k|        if (pattern != NULL && len >= blen) {
  ------------------
  |  Branch (181:13): [True: 581, False: 1.19k]
  |  Branch (181:32): [True: 470, False: 111]
  ------------------
  182|    470|            const char *match = apr_strmatch(pattern, buf, len);
  ------------------
  |  |   64|    470|#define apr_strmatch(pattern, s, slen) (*((pattern)->compare))((pattern), (s), (slen))
  ------------------
  183|    470|            if (match != NULL)
  ------------------
  |  Branch (183:17): [True: 165, False: 305]
  ------------------
  184|    165|                idx = match - buf;
  185|    305|            else {
  186|    305|                idx = apreq_index(buf + len-blen, blen, bdry, blen,
  187|    305|                                  APREQ_MATCH_PARTIAL);
  188|    305|                if (idx >= 0)
  ------------------
  |  Branch (188:21): [True: 53, False: 252]
  ------------------
  189|     53|                    idx += len-blen;
  190|    305|            }
  191|    470|        }
  192|  1.30k|        else
  193|  1.30k|            idx = apreq_index(buf, len, bdry, blen, APREQ_MATCH_PARTIAL);
  194|       |
  195|       |        /* Theoretically idx should never be 0 here, because we
  196|       |         * already tested the front of the brigade for a potential match.
  197|       |         * However, it doesn't hurt to allow for the possibility,
  198|       |         * since this will just start the whole loop over again.
  199|       |         */
  200|  1.77k|        if (idx >= 0)
  ------------------
  |  Branch (200:13): [True: 1.29k, False: 475]
  ------------------
  201|  1.29k|            apr_bucket_split(e, idx);
  ------------------
  |  | 1179|  1.29k|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  202|       |
  203|  1.77k|        APR_BUCKET_REMOVE(e);
  ------------------
  |  |  442|  1.77k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|  1.77k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|  1.77k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|  1.77k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.77k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|  1.77k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.77k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|  1.77k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.77k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|  1.77k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.77k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|  1.77k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  1.77k|        APR_BRIGADE_INSERT_TAIL(out, e);
  ------------------
  |  |  377|  1.77k|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|  1.77k|	apr_bucket *ap__b = (e);					\
  |  |  379|  1.77k|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|  1.77k|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.77k|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|  1.77k|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.77k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|  1.77k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|  1.77k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|  1.77k|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.77k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.77k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|  1.77k|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.77k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|  1.77k|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.77k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|  1.77k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  1.77k|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|  1.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  205|  1.77k|        e = APR_BRIGADE_FIRST(in);
  ------------------
  |  |  353|  1.77k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.77k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  206|  1.77k|    }
  207|       |
  208|    589|    return APR_INCOMPLETE;
  ------------------
  |  |  458|    589|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|    589|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    589|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    589|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  2.64k|}
apreq_parser_multipart.c:brigade_start_string:
   73|    759|{
   74|    759|    apr_bucket *e;
   75|    759|    apr_size_t slen = strlen(start_string);
   76|       |
   77|    776|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|    759|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    759|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    776|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    776|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    776|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (77:37): [True: 766, False: 10]
  ------------------
   78|    759|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|     17|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|     17|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
   79|    766|    {
   80|    766|        const char *buf;
   81|    766|        apr_status_t s, bytes_to_check;
   82|    766|        apr_size_t blen;
   83|       |
   84|    766|        if (slen == 0)
  ------------------
  |  Branch (84:13): [True: 10, False: 756]
  ------------------
   85|     10|            return APR_SUCCESS;
  ------------------
  |  |  225|     10|#define APR_SUCCESS 0
  ------------------
   86|       |
   87|    756|        if (APR_BUCKET_IS_EOS(e))
  ------------------
  |  |  469|    756|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 756]
  |  |  ------------------
  ------------------
   88|      0|            return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|       |
   90|    756|        s = apr_bucket_read(e, &buf, &blen, APR_BLOCK_READ);
  ------------------
  |  | 1159|    756|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
   91|       |
   92|    756|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    756|#define APR_SUCCESS 0
  ------------------
  |  Branch (92:13): [True: 0, False: 756]
  ------------------
   93|      0|            return s;
   94|       |
   95|    756|        if (blen == 0)
  ------------------
  |  Branch (95:13): [True: 0, False: 756]
  ------------------
   96|      0|            continue;
   97|       |
   98|    756|        bytes_to_check = MIN(slen,blen);
  ------------------
  |  |   28|    756|#define MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (28:20): [True: 642, False: 114]
  |  |  ------------------
  ------------------
   99|       |
  100|    756|        if (strncmp(buf,start_string,bytes_to_check) != 0)
  ------------------
  |  Branch (100:13): [True: 739, False: 17]
  ------------------
  101|    739|            return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|    739|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|    739|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    739|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|    739|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|    739|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    739|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|       |
  103|     17|        slen -= bytes_to_check;
  104|     17|        start_string += bytes_to_check;
  105|     17|    }
  106|       |
  107|       |    /* slen > 0, so brigade isn't large enough yet */
  108|     10|    return APR_INCOMPLETE;
  ------------------
  |  |  458|     10|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     10|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     10|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     10|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|    759|}

apreq_parse_urlencoded:
  162|    160|{
  163|    160|    apr_pool_t *pool = parser->pool;
  164|    160|    apr_bucket *e;
  165|    160|    struct url_ctx *ctx;
  166|       |
  167|    160|    if (parser->ctx == NULL) {
  ------------------
  |  Branch (167:9): [True: 160, False: 0]
  ------------------
  168|    160|        ctx = apr_pcalloc(pool, sizeof *ctx);
  ------------------
  |  |  454|    160|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    160|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    160|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    160|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|    160|        ctx->bb = apr_brigade_create(pool, parser->bucket_alloc);
  170|    160|        parser->ctx = ctx;
  171|    160|        ctx->status = URL_NAME;
  172|    160|    }
  173|      0|    else
  174|      0|        ctx = parser->ctx;
  175|       |
  176|    160|    PARSER_STATUS_CHECK(URL);
  ------------------
  |  |   23|    160|#define PARSER_STATUS_CHECK(PREFIX)   do {         \
  |  |   24|    160|    if (ctx->status == PREFIX##_ERROR)             \
  |  |  ------------------
  |  |  |  Branch (24:9): [True: 0, False: 160]
  |  |  ------------------
  |  |   25|    160|        return APREQ_ERROR_GENERAL;                \
  |  |  ------------------
  |  |  |  |   53|      0|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  ------------------
  |  |  |  |  |  |  164|      0|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|    160|    else if (ctx->status == PREFIX##_COMPLETE)     \
  |  |  ------------------
  |  |  |  Branch (26:14): [True: 0, False: 160]
  |  |  ------------------
  |  |   27|    160|        return APR_SUCCESS;                        \
  |  |  ------------------
  |  |  |  |  225|      0|#define APR_SUCCESS 0
  |  |  ------------------
  |  |   28|    160|    else if (bb == NULL)                           \
  |  |  ------------------
  |  |  |  Branch (28:14): [True: 0, False: 160]
  |  |  ------------------
  |  |   29|    160|        return APR_INCOMPLETE;                     \
  |  |  ------------------
  |  |  |  |  458|      0|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|    160|} while (0);
  |  |  ------------------
  |  |  |  Branch (30:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  177|    160|    e = APR_BRIGADE_LAST(ctx->bb);
  ------------------
  |  |  359|    160|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    160|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
  178|    160|    APR_BRIGADE_CONCAT(ctx->bb, bb);
  ------------------
  |  |  388|    160|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    160|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    160|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    160|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    160|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    160|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    160|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    160|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 160, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  340|    160|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    160|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    160|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    160|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    160|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    160|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    160|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    160|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    160|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    160|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    160|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    160|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    160|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    160|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    160|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    160|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    160|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    160|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    160|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    160|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    160|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    160|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    160|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    160|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    160|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    160|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    160|    }                                                       \
  |  |  |  |  344|    160|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    160|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    160|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  179|       |
  180|    681| parse_url_brigade:
  181|       |
  182|    681|    for (e  = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    681|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    681|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  183|    773|         e != APR_BRIGADE_SENTINEL(ctx->bb);
  ------------------
  |  |  339|    773|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    773|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    773|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (183:10): [True: 681, False: 92]
  ------------------
  184|    681|         e  = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|     92|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|     92|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  185|    681|    {
  186|    681|        apreq_param_t *param;
  187|    681|        apr_size_t off = 0, dlen;
  188|    681|        const char *data;
  189|    681|        apr_status_t s;
  190|       |
  191|    681|        if (APR_BUCKET_IS_EOS(e)) {
  ------------------
  |  |  469|    681|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 681]
  |  |  ------------------
  ------------------
  192|      0|            if (ctx->status == URL_NAME) {
  ------------------
  |  Branch (192:17): [True: 0, False: 0]
  ------------------
  193|      0|                s = APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  194|      0|            }
  195|      0|            else {
  196|      0|                s = split_urlword(&param, pool, ctx->bb, ctx->nlen, ctx->vlen);
  197|      0|                if (parser->hook != NULL && s == APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (197:21): [True: 0, False: 0]
  |  Branch (197:45): [True: 0, False: 0]
  ------------------
  198|      0|                    s = apreq_hook_run(parser->hook, param, NULL);
  199|       |
  200|      0|                if (s == APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (200:21): [True: 0, False: 0]
  ------------------
  201|      0|                    apreq_value_table_add(&param->v, t);
  202|      0|                    ctx->status = URL_COMPLETE;
  203|      0|                }
  204|      0|                else {
  205|      0|                    ctx->status = URL_ERROR;
  206|      0|                }
  207|      0|            }
  208|       |
  209|      0|            APR_BRIGADE_CONCAT(bb, ctx->bb);
  ------------------
  |  |  388|      0|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|      0|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|      0|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|      0|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|      0|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  340|      0|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|      0|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|      0|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|      0|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|      0|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|      0|    }                                                       \
  |  |  |  |  344|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|      0|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  210|      0|            return s;
  211|      0|        }
  212|       |
  213|    681|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|    681|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  214|    681|        if ( s != APR_SUCCESS ) {
  ------------------
  |  |  225|    681|#define APR_SUCCESS 0
  ------------------
  |  Branch (214:14): [True: 0, False: 681]
  ------------------
  215|      0|            ctx->status = URL_ERROR;
  216|      0|            return s;
  217|      0|        }
  218|       |
  219|  1.28k|    parse_url_bucket:
  220|       |
  221|  1.28k|        switch (ctx->status) {
  222|       |
  223|    681|        case URL_NAME:
  ------------------
  |  Branch (223:9): [True: 681, False: 605]
  ------------------
  224|  6.21k|            while (off < dlen) {
  ------------------
  |  Branch (224:20): [True: 6.13k, False: 76]
  ------------------
  225|  6.13k|                switch (data[off++]) {
  226|    605|                case '=':
  ------------------
  |  Branch (226:17): [True: 605, False: 5.53k]
  ------------------
  227|    605|                    apr_bucket_split(e, off);
  ------------------
  |  | 1179|    605|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  228|    605|                    dlen -= off;
  229|    605|                    data += off;
  230|    605|                    off = 0;
  231|    605|                    e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    605|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    605|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  232|    605|                    ctx->status = URL_VALUE;
  233|    605|                    goto parse_url_bucket;
  234|  5.53k|                default:
  ------------------
  |  Branch (234:17): [True: 5.53k, False: 605]
  ------------------
  235|  5.53k|                    ++ctx->nlen;
  236|  6.13k|                }
  237|  6.13k|            }
  238|     76|            break;
  239|       |
  240|    605|        case URL_VALUE:
  ------------------
  |  Branch (240:9): [True: 605, False: 681]
  ------------------
  241|  3.27k|            while (off < dlen) {
  ------------------
  |  Branch (241:20): [True: 3.26k, False: 16]
  ------------------
  242|       |
  243|  3.26k|                switch (data[off++]) {
  244|    128|                case '&':
  ------------------
  |  Branch (244:17): [True: 128, False: 3.13k]
  ------------------
  245|    589|                case ';':
  ------------------
  |  Branch (245:17): [True: 461, False: 2.79k]
  ------------------
  246|    589|                    apr_bucket_split(e, off);
  ------------------
  |  | 1179|    589|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  247|    589|                    s = split_urlword(&param, pool, ctx->bb,
  248|    589|                                      ctx->nlen, ctx->vlen);
  249|    589|                    if (parser->hook != NULL && s == APR_SUCCESS)
  ------------------
  |  |  225|    589|#define APR_SUCCESS 0
  ------------------
  |  Branch (249:25): [True: 589, False: 0]
  |  Branch (249:49): [True: 521, False: 68]
  ------------------
  250|    521|                        s = apreq_hook_run(parser->hook, param, NULL);
  251|       |
  252|    589|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    589|#define APR_SUCCESS 0
  ------------------
  |  Branch (252:25): [True: 68, False: 521]
  ------------------
  253|     68|                        ctx->status = URL_ERROR;
  254|     68|                        return s;
  255|     68|                    }
  256|       |
  257|    521|                    apreq_value_table_add(&param->v, t);
  258|    521|                    ctx->status = URL_NAME;
  259|    521|                    ctx->nlen = 0;
  260|    521|                    ctx->vlen = 0;
  261|    521|                    e = APR_BRIGADE_SENTINEL(ctx->bb);
  ------------------
  |  |  339|    521|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    521|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    521|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|    521|                    goto parse_url_brigade;
  263|       |
  264|  2.67k|                default:
  ------------------
  |  Branch (264:17): [True: 2.67k, False: 589]
  ------------------
  265|  2.67k|                    ++ctx->vlen;
  266|  3.26k|                }
  267|  3.26k|            }
  268|     16|            break;
  269|     16|        default:
  ------------------
  |  Branch (269:9): [True: 0, False: 1.28k]
  ------------------
  270|      0|            ; /* not reached */
  271|  1.28k|        }
  272|  1.28k|    }
  273|     92|    apreq_brigade_setaside(ctx->bb, pool);
  274|     92|    return APR_INCOMPLETE;
  ------------------
  |  |  458|     92|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     92|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     92|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     92|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  275|    681|}
apreq_parser_urlencoded.c:split_urlword:
   53|    589|{
   54|    589|    apreq_param_t *param;
   55|    589|    apreq_value_t *v;
   56|    589|    apr_bucket *e, *f;
   57|    589|    apr_status_t s;
   58|    589|    struct iovec vec[APREQ_DEFAULT_NELTS];
   59|    589|    apr_array_header_t arr;
   60|    589|    apr_size_t mark;
   61|    589|    apreq_charset_t charset;
   62|       |
   63|    589|    if (nlen == 0)
  ------------------
  |  Branch (63:9): [True: 2, False: 587]
  ------------------
   64|      2|        return APR_EBADARG;
  ------------------
  |  |   49|      2|#define APR_EBADARG                APR_BADARG   /* XXX: don't use APR_BADARG */
  |  |  ------------------
  |  |  |  |  465|      2|#define APR_BADARG         (APR_OS_START_STATUS + 13)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      2|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|      2|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|       |
   66|    587|    param = apreq_param_make(pool, NULL, nlen, NULL, vlen);
   67|    587|    if (param == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 587]
  ------------------
   68|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
   69|    587|    *(const apreq_value_t **)&v = &param->v;
   70|       |
   71|    587|    arr.pool     = pool;
   72|    587|    arr.elt_size = sizeof(struct iovec);
   73|    587|    arr.nelts    = 0;
   74|    587|    arr.nalloc   = APREQ_DEFAULT_NELTS;
  ------------------
  |  |   66|    587|#define APREQ_DEFAULT_NELTS              8
  ------------------
   75|    587|    arr.elts     = (char *)vec;
   76|       |
   77|    587|    ++nlen, ++vlen;
   78|    587|    e = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|    587|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    587|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
   79|       |
   80|    587|    while (!APR_BUCKET_IS_EOS(e)) {
  ------------------
  |  |  469|    587|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  ------------------
  |  Branch (80:12): [True: 587, False: 0]
  ------------------
   81|    587|        struct iovec *iov = apr_array_push(&arr);
   82|    587|        apr_size_t len;
   83|    587|        s = apr_bucket_read(e, (const char **)&iov->iov_base,
  ------------------
  |  | 1159|    587|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
   84|    587|                            &len, APR_BLOCK_READ);
   85|    587|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    587|#define APR_SUCCESS 0
  ------------------
  |  Branch (85:13): [True: 0, False: 587]
  ------------------
   86|      0|            return s;
   87|       |
   88|    587|        iov->iov_len = len;
   89|    587|        nlen -= len;
   90|       |
   91|    587|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    587|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    587|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
   92|       |
   93|    587|        if (nlen == 0) {
  ------------------
  |  Branch (93:13): [True: 587, False: 0]
  ------------------
   94|    587|            iov->iov_len--;
   95|    587|            break;
   96|    587|        }
   97|    587|    }
   98|       |
   99|    587|    mark = arr.nelts;
  100|       |
  101|    587|    while (!APR_BUCKET_IS_EOS(e)) {
  ------------------
  |  |  469|    587|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  ------------------
  |  Branch (101:12): [True: 587, False: 0]
  ------------------
  102|    587|        struct iovec *iov = apr_array_push(&arr);
  103|    587|        apr_size_t len;
  104|    587|        s = apr_bucket_read(e, (const char **)&iov->iov_base,
  ------------------
  |  | 1159|    587|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  105|    587|                            &len, APR_BLOCK_READ);
  106|    587|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    587|#define APR_SUCCESS 0
  ------------------
  |  Branch (106:13): [True: 0, False: 587]
  ------------------
  107|      0|            return s;
  108|       |
  109|    587|        iov->iov_len = len;
  110|    587|        vlen -= len;
  111|       |
  112|    587|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    587|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    587|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  113|       |
  114|    587|        if (vlen == 0) {
  ------------------
  |  Branch (114:13): [True: 587, False: 0]
  ------------------
  115|    587|            iov->iov_len--;
  116|    587|            break;
  117|    587|        }
  118|       |
  119|    587|    }
  120|       |
  121|    587|    s = apreq_decodev(v->data, &vlen,
  122|    587|                      (struct iovec *)arr.elts + mark, arr.nelts - mark);
  123|    587|    if (s != APR_SUCCESS)
  ------------------
  |  |  225|    587|#define APR_SUCCESS 0
  ------------------
  |  Branch (123:9): [True: 26, False: 561]
  ------------------
  124|     26|        return s;
  125|       |
  126|    561|    charset = apreq_charset_divine(v->data, vlen);
  127|       |
  128|    561|    v->name = v->data + vlen + 1;
  129|    561|    v->dlen = vlen;
  130|       |
  131|    561|    s = apreq_decodev(v->name, &nlen, (struct iovec *)arr.elts, mark);
  132|    561|    if (s != APR_SUCCESS)
  ------------------
  |  |  225|    561|#define APR_SUCCESS 0
  ------------------
  |  Branch (132:9): [True: 40, False: 521]
  ------------------
  133|     40|        return s;
  134|       |
  135|    521|    switch (apreq_charset_divine(v->name, nlen)) {
  ------------------
  |  Branch (135:13): [True: 0, False: 521]
  ------------------
  136|     77|    case APREQ_CHARSET_UTF8:
  ------------------
  |  Branch (136:5): [True: 77, False: 444]
  ------------------
  137|     77|        if (charset == APREQ_CHARSET_ASCII)
  ------------------
  |  Branch (137:13): [True: 46, False: 31]
  ------------------
  138|     46|            charset = APREQ_CHARSET_UTF8;
  139|    255|    case APREQ_CHARSET_ASCII:
  ------------------
  |  Branch (139:5): [True: 178, False: 343]
  ------------------
  140|    255|        break;
  141|       |
  142|    183|    case APREQ_CHARSET_LATIN1:
  ------------------
  |  Branch (142:5): [True: 183, False: 338]
  ------------------
  143|    183|        if (charset != APREQ_CHARSET_CP1252)
  ------------------
  |  Branch (143:13): [True: 157, False: 26]
  ------------------
  144|    157|            charset = APREQ_CHARSET_LATIN1;
  145|    183|        break;
  146|     83|    case APREQ_CHARSET_CP1252:
  ------------------
  |  Branch (146:5): [True: 83, False: 438]
  ------------------
  147|     83|        charset = APREQ_CHARSET_CP1252;
  148|    521|    }
  149|       |
  150|    521|    v->nlen = nlen;
  151|       |
  152|  1.56k|    while ((f = APR_BRIGADE_FIRST(bb)) != e)
  ------------------
  |  |  353|  1.56k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.56k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (152:12): [True: 1.04k, False: 521]
  ------------------
  153|  1.04k|        apr_bucket_delete(f);
  ------------------
  |  | 1086|  1.56k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  1.04k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  1.04k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  1.04k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  1.04k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  1.04k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  1.04k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  1.04k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  1.04k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  1.04k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  1.04k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  1.04k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  1.04k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  1.04k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  1.04k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  1.04k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  1.04k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  1.04k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  1.04k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  1.04k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  1.04k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  1.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  154|       |
  155|    521|    apreq_param_tainted_on(param);
  156|    521|    apreq_param_charset_set(param, charset);
  157|    521|    *p = param;
  158|    521|    return APR_SUCCESS;
  ------------------
  |  |  225|    521|#define APR_SUCCESS 0
  ------------------
  159|    521|}

apreq_index:
   95|  1.60k|{
   96|  1.60k|    apr_size_t len = hlen;
   97|  1.60k|    const char *end = hay + hlen;
   98|  1.60k|    const char *begin = hay;
   99|       |
  100|  5.15k|    while ( (hay = memchr(hay, ndl[0], len)) ) {
  ------------------
  |  Branch (100:13): [True: 4.67k, False: 475]
  ------------------
  101|  4.67k|        len = end - hay;
  102|       |
  103|       |        /* done if matches up to capacity of buffer */
  104|  4.67k|        if ( memcmp(hay, ndl, MIN(nlen, len)) == 0 ) {
  ------------------
  |  |   27|  4.67k|#define MIN(a,b) ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (27:20): [True: 3.74k, False: 938]
  |  |  ------------------
  ------------------
  |  Branch (104:14): [True: 1.13k, False: 3.54k]
  ------------------
  105|  1.13k|            if (type == APREQ_MATCH_FULL && len < nlen)
  ------------------
  |  Branch (105:17): [True: 0, False: 1.13k]
  |  Branch (105:45): [True: 0, False: 0]
  ------------------
  106|      0|                hay = NULL;     /* insufficient room for match */
  107|  1.13k|            break;
  108|  1.13k|        }
  109|  3.54k|        --len;
  110|  3.54k|        ++hay;
  111|  3.54k|    }
  112|       |
  113|  1.60k|    return hay ? hay - begin : -1;
  ------------------
  |  Branch (113:12): [True: 1.13k, False: 475]
  ------------------
  114|  1.60k|}
apreq_charset_divine:
  243|  1.13k|{
  244|  1.13k|    apreq_charset_t rv = APREQ_CHARSET_ASCII;
  245|  1.13k|    register unsigned char trail = 0, saw_cntrl = 0, mask = 0;
  246|  1.13k|    register const unsigned char *s = (const unsigned char *)src;
  247|  1.13k|    const unsigned char *end = s + slen;
  248|       |
  249|  5.01k|    for (; s < end; ++s) {
  ------------------
  |  Branch (249:12): [True: 4.05k, False: 966]
  ------------------
  250|  4.05k|        if (trail) {
  ------------------
  |  Branch (250:13): [True: 667, False: 3.38k]
  ------------------
  251|    667|            if ((*s & 0xC0) == 0x80 && (mask == 0 || (mask & *s))) {
  ------------------
  |  Branch (251:17): [True: 511, False: 156]
  |  Branch (251:41): [True: 398, False: 113]
  |  Branch (251:54): [True: 88, False: 25]
  ------------------
  252|    486|                mask = 0;
  253|    486|                --trail;
  254|       |
  255|    486|                if ((*s & 0xE0) == 0x80) {
  ------------------
  |  Branch (255:21): [True: 231, False: 255]
  ------------------
  256|    231|                    saw_cntrl = 1;
  257|    231|                }
  258|    486|            }
  259|    181|            else {
  260|    181|                trail = 0;
  261|    181|                if (saw_cntrl)
  ------------------
  |  Branch (261:21): [True: 51, False: 130]
  ------------------
  262|     51|                    return APREQ_CHARSET_CP1252;
  263|    130|                rv = APREQ_CHARSET_LATIN1;
  264|    130|            }
  265|    667|        }
  266|  3.38k|        else if (*s < 0x80) {
  ------------------
  |  Branch (266:18): [True: 2.11k, False: 1.27k]
  ------------------
  267|       |            /* do nothing */
  268|  2.11k|        }
  269|  1.27k|        else if (*s < 0xA0) {
  ------------------
  |  Branch (269:18): [True: 91, False: 1.17k]
  ------------------
  270|     91|            return APREQ_CHARSET_CP1252;
  271|     91|        }
  272|  1.17k|        else if (*s < 0xC0) {
  ------------------
  |  Branch (272:18): [True: 125, False: 1.05k]
  ------------------
  273|    125|            if (saw_cntrl)
  ------------------
  |  Branch (273:17): [True: 13, False: 112]
  ------------------
  274|     13|                return APREQ_CHARSET_CP1252;
  275|    112|            rv = APREQ_CHARSET_LATIN1;
  276|    112|        }
  277|  1.05k|        else if (rv == APREQ_CHARSET_LATIN1) {
  ------------------
  |  Branch (277:18): [True: 209, False: 845]
  ------------------
  278|       |            /* do nothing */
  279|    209|        }
  280|       |
  281|       |        /* utf8 cases */
  282|       |
  283|    845|        else if (*s < 0xE0) {
  ------------------
  |  Branch (283:18): [True: 177, False: 668]
  ------------------
  284|    177|            if (*s & 0x1E) {
  ------------------
  |  Branch (284:17): [True: 125, False: 52]
  ------------------
  285|    125|                rv = APREQ_CHARSET_UTF8;
  286|    125|                trail = 1;
  287|    125|                mask = 0;
  288|    125|            }
  289|     52|            else if (saw_cntrl)
  ------------------
  |  Branch (289:22): [True: 15, False: 37]
  ------------------
  290|     15|                return APREQ_CHARSET_CP1252;
  291|     37|            else
  292|     37|                rv = APREQ_CHARSET_LATIN1;
  293|    177|        }
  294|    668|        else if (*s < 0xF0) {
  ------------------
  |  Branch (294:18): [True: 156, False: 512]
  ------------------
  295|    156|            mask = (*s & 0x0F) ? 0 : 0x20;
  ------------------
  |  Branch (295:20): [True: 117, False: 39]
  ------------------
  296|    156|            rv = APREQ_CHARSET_UTF8;
  297|    156|            trail = 2;
  298|    156|        }
  299|    512|        else if (*s < 0xF8) {
  ------------------
  |  Branch (299:18): [True: 107, False: 405]
  ------------------
  300|    107|            mask = (*s & 0x07) ? 0 : 0x30;
  ------------------
  |  Branch (300:20): [True: 84, False: 23]
  ------------------
  301|    107|            rv = APREQ_CHARSET_UTF8;
  302|    107|            trail = 3;
  303|    107|        }
  304|    405|        else if (*s < 0xFC) {
  ------------------
  |  Branch (304:18): [True: 84, False: 321]
  ------------------
  305|     84|            mask = (*s & 0x03) ? 0 : 0x38;
  ------------------
  |  Branch (305:20): [True: 57, False: 27]
  ------------------
  306|     84|            rv = APREQ_CHARSET_UTF8;
  307|     84|            trail = 4;
  308|     84|        }
  309|    321|        else if (*s < 0xFE) {
  ------------------
  |  Branch (309:18): [True: 109, False: 212]
  ------------------
  310|    109|            mask = (*s & 0x01) ? 0 : 0x3C;
  ------------------
  |  Branch (310:20): [True: 33, False: 76]
  ------------------
  311|    109|            rv = APREQ_CHARSET_UTF8;
  312|    109|            trail = 5;
  313|    109|        }
  314|    212|        else {
  315|    212|            rv = APREQ_CHARSET_UTF8;
  316|    212|        }
  317|  4.05k|    }
  318|       |
  319|    966|    return trail ? saw_cntrl ?
  ------------------
  |  Branch (319:12): [True: 181, False: 785]
  |  Branch (319:20): [True: 1, False: 180]
  ------------------
  320|    785|        APREQ_CHARSET_CP1252 : APREQ_CHARSET_LATIN1 : rv;
  321|  1.13k|}
apreq_decodev:
  455|  1.14k|{
  456|  1.14k|    apr_status_t status = APR_SUCCESS;
  ------------------
  |  |  225|  1.14k|#define APR_SUCCESS 0
  ------------------
  457|  1.14k|    int n = 0;
  458|       |
  459|  1.14k|    *dlen = 0;
  460|       |
  461|  2.23k|    while (n < nelts) {
  ------------------
  |  Branch (461:12): [True: 1.14k, False: 1.08k]
  ------------------
  462|  1.14k|        apr_size_t slen, len;
  463|       |
  464|  1.14k|        slen = v[n].iov_len;
  465|  1.14k|        switch (status = url_decode(d, &len, v[n].iov_base, &slen)) {
  466|       |
  467|  1.08k|        case APR_SUCCESS:
  ------------------
  |  |  225|  1.08k|#define APR_SUCCESS 0
  ------------------
  |  Branch (467:9): [True: 1.08k, False: 66]
  ------------------
  468|  1.08k|            d += len;
  469|  1.08k|            *dlen += len;
  470|  1.08k|            ++n;
  471|  1.08k|            continue;
  472|       |
  473|      6|        case APR_INCOMPLETE:
  ------------------
  |  |  458|      6|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      6|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      6|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      6|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (473:9): [True: 6, False: 1.14k]
  ------------------
  474|      6|            d += len;
  475|      6|            *dlen += len;
  476|      6|            slen = v[n].iov_len - slen;
  477|       |
  478|      6|            if (++n == nelts) {
  ------------------
  |  Branch (478:17): [True: 6, False: 0]
  ------------------
  479|      6|                return status;
  480|      6|            }
  481|      0|            memcpy(d + slen, v[n].iov_base, v[n].iov_len);
  482|      0|            v[n].iov_len += slen;
  483|      0|            v[n].iov_base = d;
  484|      0|            continue;
  485|       |
  486|     60|        default:
  ------------------
  |  Branch (486:9): [True: 60, False: 1.08k]
  ------------------
  487|     60|            *dlen += len;
  488|     60|            return status;
  489|  1.14k|        }
  490|  1.14k|    }
  491|       |
  492|  1.08k|    return status;
  493|  1.14k|}
apreq_file_mktemp:
  802|    326|{
  803|    326|    apr_status_t rc;
  804|    326|    char *tmpl;
  805|    326|    struct cleanup_data *data;
  806|    326|    apr_int32_t flag;
  807|       |
  808|    326|    if (path == NULL) {
  ------------------
  |  Branch (808:9): [True: 0, False: 326]
  ------------------
  809|      0|        rc = apr_temp_dir_get(&path, pool);
  810|      0|        if (rc != APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (810:13): [True: 0, False: 0]
  ------------------
  811|      0|            return rc;
  812|      0|    }
  813|    326|    rc = apr_filepath_merge(&tmpl, path, "apreqXXXXXX",
  814|    326|                            APR_FILEPATH_NOTRELATIVE, pool);
  ------------------
  |  |  298|    326|#define APR_FILEPATH_NOTRELATIVE    0x04
  ------------------
  815|       |
  816|    326|    if (rc != APR_SUCCESS)
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (816:9): [True: 0, False: 326]
  ------------------
  817|      0|        return rc;
  818|       |
  819|    326|    data = apr_palloc(pool, sizeof *data);
  ------------------
  |  |  425|    326|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    326|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    326|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    326|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  820|       |    /* cleanups are LIFO, so this one will run just after
  821|       |       the cleanup set by mktemp */
  822|    326|    apr_pool_cleanup_register(pool, data,
  823|    326|                              apreq_file_cleanup, apreq_file_cleanup);
  824|       |
  825|       |    /* NO APR_DELONCLOSE! see comment above */
  826|    326|    flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  102|    326|#define APR_CREATE           APR_FOPEN_CREATE     /**< @deprecated @see APR_FOPEN_CREATE */
  |  |  ------------------
  |  |  |  |   56|    326|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  100|    326|#define APR_READ             APR_FOPEN_READ       /**< @deprecated @see APR_FOPEN_READ */
  |  |  ------------------
  |  |  |  |   54|    326|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  101|    326|#define APR_WRITE            APR_FOPEN_WRITE      /**< @deprecated @see APR_FOPEN_WRITE */
  |  |  ------------------
  |  |  |  |   55|    326|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  106|    326|#define APR_EXCL             APR_FOPEN_EXCL       /**< @deprecated @see APR_FOPEN_EXCL */
  |  |  ------------------
  |  |  |  |   63|    326|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  105|    326|#define APR_BINARY           APR_FOPEN_BINARY     /**< @deprecated @see APR_FOPEN_BINARY */
  |  |  ------------------
  |  |  |  |   60|    326|#define APR_FOPEN_BINARY     0x00020  /**< Open the file in binary mode
  |  |  ------------------
  ------------------
  827|       |
  828|    326|    rc = apr_file_mktemp(fp, tmpl, flag, pool);
  829|       |
  830|    326|    if (rc == APR_SUCCESS) {
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (830:9): [True: 326, False: 0]
  ------------------
  831|    326|        apr_file_name_get(&data->fname, *fp);
  832|    326|        data->pool = pool;
  833|    326|    }
  834|      0|    else {
  835|      0|        apr_pool_cleanup_kill(pool, data, apreq_file_cleanup);
  836|      0|    }
  837|       |
  838|    326|    return rc;
  839|    326|}
apreq_header_attribute:
  850|  1.13k|{
  851|  1.13k|    int done = 0;
  852|       |
  853|  1.13k|    if (!nlen)
  ------------------
  |  Branch (853:9): [True: 0, False: 1.13k]
  ------------------
  854|      0|        return APREQ_ERROR_NOATTR;
  ------------------
  |  |   77|      0|#define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  2)
  |  |  ------------------
  |  |  |  |   73|      0|#define APREQ_ERROR_NODATA         (APREQ_ERROR_GENERAL  + 20)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      0|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  855|       |
  856|  1.75k|    do {
  857|  1.75k|        const char *hde, *v;
  858|  1.75k|        apr_size_t tail = 0;
  859|       |
  860|       |        /* Parse the name => [hdr:hde[ */
  861|  1.75k|        hde = hdr;
  862|  12.4k|    look_for_end_name:
  863|  12.4k|        switch (*hde) {
  864|     18|        case 0:
  ------------------
  |  Branch (864:9): [True: 18, False: 12.4k]
  ------------------
  865|     21|        case '\r':
  ------------------
  |  Branch (865:9): [True: 3, False: 12.4k]
  ------------------
  866|     23|        case '\n':
  ------------------
  |  Branch (866:9): [True: 2, False: 12.4k]
  ------------------
  867|     23|            done = 1;
  868|  1.27k|        case '=':
  ------------------
  |  Branch (868:9): [True: 1.25k, False: 11.2k]
  ------------------
  869|  1.45k|        case ';':
  ------------------
  |  Branch (869:9): [True: 179, False: 12.3k]
  ------------------
  870|  1.72k|        case ',':
  ------------------
  |  Branch (870:9): [True: 264, False: 12.2k]
  ------------------
  871|  1.72k|            v = hde;
  872|  1.72k|            hde -= tail;
  873|  1.72k|            break;
  874|    209|        case ' ':
  ------------------
  |  Branch (874:9): [True: 209, False: 12.2k]
  ------------------
  875|    357|        case '\t':
  ------------------
  |  Branch (875:9): [True: 148, False: 12.3k]
  ------------------
  876|    357|            if (hde == hdr)
  ------------------
  |  Branch (876:17): [True: 168, False: 189]
  ------------------
  877|    168|                ++hdr;
  878|    189|            else
  879|    189|                ++tail;
  880|    357|            ++hde;
  881|    357|            goto look_for_end_name;
  882|  10.4k|        default:
  ------------------
  |  Branch (882:9): [True: 10.4k, False: 2.07k]
  ------------------
  883|       |            /* The name is a token */
  884|  10.4k|            if (!IS_TOKEN_CHAR(*hde))
  ------------------
  |  |  843|  10.4k|#define IS_TOKEN_CHAR(c) (apr_isalnum(c) \
  |  |  ------------------
  |  |  |  |  206|  20.8k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (206:24): [True: 9.94k, False: 471]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  844|  10.4k|                          || ((c) && strchr("!#$%&'*+-.^_`|~", (c))))
  |  |  ------------------
  |  |  |  Branch (844:31): [True: 471, False: 0]
  |  |  |  Branch (844:38): [True: 440, False: 31]
  |  |  ------------------
  ------------------
  885|     31|                return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     31|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     31|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     31|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     31|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     31|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     31|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     31|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     31|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  886|       |            /* Nothing after the tail */
  887|  10.3k|            if (tail)
  ------------------
  |  Branch (887:17): [True: 2, False: 10.3k]
  ------------------
  888|      2|                return APREQ_ERROR_BADATTR;
  ------------------
  |  |   66|      2|#define APREQ_ERROR_BADATTR        (APREQ_ERROR_BADDATA  +  3)
  |  |  ------------------
  |  |  |  |   60|      2|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      2|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      2|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      2|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      2|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|  10.3k|            ++hde;
  890|  10.3k|            goto look_for_end_name;
  891|  12.4k|        }
  892|       |
  893|       |        /* Parse the value => (*val, *vlen) */
  894|  1.72k|        if (*v == '=') {
  ------------------
  |  Branch (894:13): [True: 1.25k, False: 466]
  ------------------
  895|  1.25k|            if (hde == hdr) {
  ------------------
  |  Branch (895:17): [True: 2, False: 1.25k]
  ------------------
  896|       |                /* The name can't be empty */
  897|      2|                return APREQ_ERROR_BADATTR;
  ------------------
  |  |   66|      2|#define APREQ_ERROR_BADATTR        (APREQ_ERROR_BADDATA  +  3)
  |  |  ------------------
  |  |  |  |   60|      2|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      2|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      2|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      2|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      2|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  898|      2|            }
  899|       |
  900|  1.25k|            ++v;
  901|  1.81k|            while (IS_SPACE_CHAR(*v))
  ------------------
  |  |  842|  1.81k|#define IS_SPACE_CHAR(c) ((c) == '\t' || (c) == ' ')
  |  |  ------------------
  |  |  |  Branch (842:27): [True: 168, False: 1.64k]
  |  |  |  Branch (842:42): [True: 391, False: 1.25k]
  |  |  ------------------
  ------------------
  902|    559|                ++v;
  903|       |
  904|       |            /* Quoted string ? */
  905|  1.25k|            if (*v == '"') {
  ------------------
  |  Branch (905:17): [True: 15, False: 1.23k]
  ------------------
  906|     15|                *val = ++v;
  907|       |
  908|       |                /* XXX: the interface does not permit unescaping,
  909|       |                 *      it should have pool to allocate from.
  910|       |                 * The caller can't know whether a returned '\\' is
  911|       |                 * a quoted-char or not..
  912|       |                 */
  913|    265|            look_for_end_quote:
  914|    265|                switch (*v) {
  915|      7|                case 0:
  ------------------
  |  Branch (915:17): [True: 7, False: 258]
  ------------------
  916|     10|                case '\r':
  ------------------
  |  Branch (916:17): [True: 3, False: 262]
  ------------------
  917|     11|                case '\n':
  ------------------
  |  Branch (917:17): [True: 1, False: 264]
  ------------------
  918|     11|                    return APREQ_ERROR_BADSEQ;
  ------------------
  |  |   64|     11|#define APREQ_ERROR_BADSEQ         (APREQ_ERROR_BADDATA  +  2)
  |  |  ------------------
  |  |  |  |   60|     11|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     11|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     11|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     11|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     11|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     11|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     11|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  919|      2|                case '"':
  ------------------
  |  Branch (919:17): [True: 2, False: 263]
  ------------------
  920|      2|                    *vlen = v - *val;
  921|      2|                    break;
  922|     90|                case '\\':
  ------------------
  |  Branch (922:17): [True: 90, False: 175]
  ------------------
  923|     90|                    if (v[1] != 0)
  ------------------
  |  Branch (923:25): [True: 89, False: 1]
  ------------------
  924|     89|                        ++v;
  925|     90|                    ++v;
  926|     90|                    goto look_for_end_quote;
  927|    162|                default:
  ------------------
  |  Branch (927:17): [True: 162, False: 103]
  ------------------
  928|    162|                    if (apr_iscntrl(*v))
  ------------------
  |  |  210|    162|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (210:24): [True: 2, False: 160]
  |  |  ------------------
  ------------------
  929|      2|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      2|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      2|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      2|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      2|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      2|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      2|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|    160|                    ++v;
  931|    160|                    goto look_for_end_quote;
  932|    265|                }
  933|       |
  934|      2|            look_for_after_quote:
  935|      2|                switch (*v) {
  936|      0|                case 0:
  ------------------
  |  Branch (936:17): [True: 0, False: 2]
  ------------------
  937|      0|                case '\r':
  ------------------
  |  Branch (937:17): [True: 0, False: 2]
  ------------------
  938|      0|                case '\n':
  ------------------
  |  Branch (938:17): [True: 0, False: 2]
  ------------------
  939|      0|                    done = 1;
  940|      0|                case ';':
  ------------------
  |  Branch (940:17): [True: 0, False: 2]
  ------------------
  941|      0|                case ',':
  ------------------
  |  Branch (941:17): [True: 0, False: 2]
  ------------------
  942|      0|                    break;
  943|      0|                case ' ':
  ------------------
  |  Branch (943:17): [True: 0, False: 2]
  ------------------
  944|      0|                case '\t':
  ------------------
  |  Branch (944:17): [True: 0, False: 2]
  ------------------
  945|      0|                    goto look_for_after_quote;
  946|      2|                default:
  ------------------
  |  Branch (946:17): [True: 2, False: 0]
  ------------------
  947|      2|                    if (apr_iscntrl(*v))
  ------------------
  |  |  210|      2|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (210:24): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  948|      0|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      0|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      0|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      0|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  949|      2|                    return APREQ_ERROR_BADSEQ;
  ------------------
  |  |   64|      2|#define APREQ_ERROR_BADSEQ         (APREQ_ERROR_BADDATA  +  2)
  |  |  ------------------
  |  |  |  |   60|      2|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      2|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      2|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      2|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      2|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      2|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  950|      2|                }
  951|      2|            }
  952|  1.23k|            else {
  953|  1.23k|                *val = v;
  954|  1.23k|                tail = 0;
  955|       |
  956|  8.12k|            look_for_end_value:
  957|  8.12k|                switch (*v) {
  958|    706|                case 0:
  ------------------
  |  Branch (958:17): [True: 706, False: 7.41k]
  ------------------
  959|    856|                case '\r':
  ------------------
  |  Branch (959:17): [True: 150, False: 7.97k]
  ------------------
  960|    961|                case '\n':
  ------------------
  |  Branch (960:17): [True: 105, False: 8.01k]
  ------------------
  961|    961|                    done = 1;
  962|  1.10k|                case ';':
  ------------------
  |  Branch (962:17): [True: 144, False: 7.97k]
  ------------------
  963|  1.22k|                case ',':
  ------------------
  |  Branch (963:17): [True: 118, False: 8.00k]
  ------------------
  964|  1.22k|                    *vlen = v - *val - tail;
  965|  1.22k|                    break;
  966|    362|                case ' ':
  ------------------
  |  Branch (966:17): [True: 362, False: 7.75k]
  ------------------
  967|    625|                case '\t':
  ------------------
  |  Branch (967:17): [True: 263, False: 7.85k]
  ------------------
  968|    625|                    if (*val == v)
  ------------------
  |  Branch (968:25): [True: 0, False: 625]
  ------------------
  969|      0|                        ++*val;
  970|    625|                    else
  971|    625|                        ++tail;
  972|    625|                    ++v;
  973|    625|                    goto look_for_end_value;
  974|  6.27k|                default:
  ------------------
  |  Branch (974:17): [True: 6.27k, False: 1.84k]
  ------------------
  975|  6.27k|                    if (apr_iscntrl(*v))
  ------------------
  |  |  210|  6.27k|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (210:24): [True: 14, False: 6.25k]
  |  |  ------------------
  ------------------
  976|     14|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     14|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     14|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     14|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     14|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     14|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     14|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     14|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     14|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  977|  6.25k|                    ++v;
  978|  6.25k|                    tail = 0;
  979|  6.25k|                    goto look_for_end_value;
  980|  8.12k|                }
  981|  8.12k|            }
  982|  1.25k|        }
  983|    466|        else {
  984|    466|            *val = NULL;
  985|    466|            *vlen = 0;
  986|    466|        }
  987|       |
  988|  1.68k|        if (hdr + nlen == hde && strncasecmp(hdr, name, nlen) == 0) {
  ------------------
  |  Branch (988:13): [True: 1.02k, False: 666]
  |  Branch (988:34): [True: 952, False: 71]
  ------------------
  989|    952|            return APR_SUCCESS;
  ------------------
  |  |  225|    952|#define APR_SUCCESS 0
  ------------------
  990|    952|        }
  991|       |
  992|    737|        hdr = v + 1;
  993|    737|    } while (!done);
  ------------------
  |  Branch (993:14): [True: 622, False: 115]
  ------------------
  994|       |
  995|    115|    return APREQ_ERROR_NOATTR;
  ------------------
  |  |   77|    115|#define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  2)
  |  |  ------------------
  |  |  |  |   73|    115|#define APREQ_ERROR_NODATA         (APREQ_ERROR_GENERAL  + 20)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|    115|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|    115|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    115|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|    115|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|    115|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|    115|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  996|  1.13k|}
apreq_brigade_concat:
 1063|    597|{
 1064|    597|    apr_status_t s;
 1065|    597|    apr_bucket_file *f;
 1066|    597|    apr_off_t wlen;
 1067|    597|    apr_file_t *file;
 1068|    597|    apr_off_t in_len, out_len;
 1069|    597|    apr_bucket *last_in, *last_out;
 1070|       |
 1071|    597|    last_out = APR_BRIGADE_LAST(out);
  ------------------
  |  |  359|    597|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    597|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
 1072|       |
 1073|    597|    if (APR_BUCKET_IS_EOS(last_out))
  ------------------
  |  |  469|    597|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 597]
  |  |  ------------------
  ------------------
 1074|      0|        return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1075|       |
 1076|    597|    s = apr_brigade_length(out, 0, &out_len);
 1077|    597|    if (s != APR_SUCCESS)
  ------------------
  |  |  225|    597|#define APR_SUCCESS 0
  ------------------
  |  Branch (1077:9): [True: 0, False: 597]
  ------------------
 1078|      0|        return s;
 1079|       |
 1080|       |    /* This cast, when out_len = -1, is intentional */
 1081|    597|    if ((apr_uint64_t)out_len < heap_limit) {
  ------------------
  |  Branch (1081:9): [True: 597, False: 0]
  ------------------
 1082|       |
 1083|    597|        s = apr_brigade_length(in, 0, &in_len);
 1084|    597|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    597|#define APR_SUCCESS 0
  ------------------
  |  Branch (1084:13): [True: 0, False: 597]
  ------------------
 1085|      0|            return s;
 1086|       |
 1087|       |        /* This cast, when in_len = -1, is intentional */
 1088|    597|        if ((apr_uint64_t)in_len < heap_limit - (apr_uint64_t)out_len) {
  ------------------
  |  Branch (1088:13): [True: 271, False: 326]
  ------------------
 1089|    271|            APR_BRIGADE_CONCAT(out, in);
  ------------------
  |  |  388|    271|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    271|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    271|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    271|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    271|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    271|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    271|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    271|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 190, False: 81]
  |  |  |  |  ------------------
  |  |  |  |  340|    190|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    190|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    190|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    190|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    190|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    190|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    190|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    190|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    190|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    190|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    190|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    190|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    190|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    190|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    190|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    190|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    190|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    190|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    190|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    190|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    190|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    190|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    190|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    190|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    190|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    190|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    190|    }                                                       \
  |  |  |  |  344|    271|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    271|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    271|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1090|    271|            return APR_SUCCESS;
  ------------------
  |  |  225|    271|#define APR_SUCCESS 0
  ------------------
 1091|    271|        }
 1092|    597|    }
 1093|       |
 1094|    326|    if (!BUCKET_IS_SPOOL(last_out)) {
  ------------------
  |  | 1000|    326|#define BUCKET_IS_SPOOL(e) ((e)->type == &spool_bucket_type)
  ------------------
  |  Branch (1094:9): [True: 326, False: 0]
  ------------------
 1095|       |
 1096|    326|        s = apreq_file_mktemp(&file, pool, temp_dir);
 1097|    326|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (1097:13): [True: 0, False: 326]
  ------------------
 1098|      0|            return s;
 1099|       |
 1100|    326|        s = apreq_brigade_fwrite(file, &wlen, out);
 1101|       |
 1102|    326|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (1102:13): [True: 0, False: 326]
  ------------------
 1103|      0|            return s;
 1104|       |
 1105|    326|        apr_brigade_cleanup(out);
 1106|    326|        last_out = apr_bucket_file_create(file, 0, wlen,
 1107|    326|                                          out->p, out->bucket_alloc);
 1108|    326|        last_out->type = &spool_bucket_type;
 1109|    326|        APR_BRIGADE_INSERT_TAIL(out, last_out);
  ------------------
  |  |  377|    326|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|    326|	apr_bucket *ap__b = (e);					\
  |  |  379|    326|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|    326|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    326|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    326|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    326|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    326|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|    326|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    326|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    326|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    326|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    326|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    326|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    326|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    326|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    326|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|    326|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|    326|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1110|    326|        f = last_out->data;
 1111|    326|    }
 1112|      0|    else {
 1113|      0|        f = last_out->data;
 1114|       |        /* Need to seek here, just in case our spool bucket
 1115|       |         * was read from between apreq_brigade_concat calls.
 1116|       |         */
 1117|      0|        wlen = last_out->start + last_out->length;
 1118|      0|        s = apr_file_seek(f->fd, APR_SET, &wlen);
  ------------------
  |  |  152|      0|#define APR_SET SEEK_SET
  ------------------
 1119|      0|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (1119:13): [True: 0, False: 0]
  ------------------
 1120|      0|            return s;
 1121|      0|    }
 1122|       |
 1123|    326|    if (in == out)
  ------------------
  |  Branch (1123:9): [True: 0, False: 326]
  ------------------
 1124|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1125|       |
 1126|    326|    last_in = APR_BRIGADE_LAST(in);
  ------------------
  |  |  359|    326|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    326|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
 1127|       |
 1128|    326|    if (APR_BUCKET_IS_EOS(last_in))
  ------------------
  |  |  469|    326|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 326]
  |  |  ------------------
  ------------------
 1129|    326|        APR_BUCKET_REMOVE(last_in);
  ------------------
  |  |  442|    326|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|      0|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|      0|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|      0|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|      0|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|      0|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|      0|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1130|       |
 1131|    326|    s = apreq_brigade_fwrite(f->fd, &wlen, in);
 1132|       |
 1133|    326|    if (s == APR_SUCCESS) {
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (1133:9): [True: 326, False: 0]
  ------------------
 1134|       |
 1135|       |        /* We have to deal with the possibility that the new
 1136|       |         * data may be too large to be represented by a single
 1137|       |         * temp_file bucket.
 1138|       |         */
 1139|       |
 1140|    326|        while ((apr_uint64_t)wlen > FILE_BUCKET_LIMIT - last_out->length) {
  ------------------
  |  | 1001|    326|#define FILE_BUCKET_LIMIT      ((apr_size_t)-1 - 1)
  ------------------
  |  Branch (1140:16): [True: 0, False: 326]
  ------------------
 1141|      0|            apr_bucket *e;
 1142|       |
 1143|      0|            apr_bucket_copy(last_out, &e);
  ------------------
  |  | 1186|      0|#define apr_bucket_copy(e,c) (e)->type->copy(e, c)
  ------------------
 1144|      0|            e->length = 0;
 1145|      0|            e->start = last_out->start + FILE_BUCKET_LIMIT;
  ------------------
  |  | 1001|      0|#define FILE_BUCKET_LIMIT      ((apr_size_t)-1 - 1)
  ------------------
 1146|      0|            wlen -= FILE_BUCKET_LIMIT - last_out->length;
  ------------------
  |  | 1001|      0|#define FILE_BUCKET_LIMIT      ((apr_size_t)-1 - 1)
  ------------------
 1147|      0|            last_out->length = FILE_BUCKET_LIMIT;
  ------------------
  |  | 1001|      0|#define FILE_BUCKET_LIMIT      ((apr_size_t)-1 - 1)
  ------------------
 1148|       |
 1149|       |            /* Copying makes the bucket types exactly the
 1150|       |             * opposite of what we need here.
 1151|       |             */
 1152|      0|            last_out->type = &apr_bucket_type_file;
 1153|      0|            e->type = &spool_bucket_type;
 1154|       |
 1155|      0|            APR_BRIGADE_INSERT_TAIL(out, e);
  ------------------
  |  |  377|      0|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|      0|	apr_bucket *ap__b = (e);					\
  |  |  379|      0|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|      0|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1156|      0|            last_out = e;
 1157|      0|        }
 1158|       |
 1159|    326|        last_out->length += wlen;
 1160|       |
 1161|    326|        if (APR_BUCKET_IS_EOS(last_in))
  ------------------
  |  |  469|    326|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 326]
  |  |  ------------------
  ------------------
 1162|      0|            APR_BRIGADE_INSERT_TAIL(out, last_in);
  ------------------
  |  |  377|      0|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|      0|	apr_bucket *ap__b = (e);					\
  |  |  379|      0|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|      0|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1163|       |
 1164|    326|    }
 1165|      0|    else if (APR_BUCKET_IS_EOS(last_in))
  ------------------
  |  |  469|      0|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1166|      0|        APR_BRIGADE_INSERT_TAIL(in, last_in);
  ------------------
  |  |  377|      0|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|      0|	apr_bucket *ap__b = (e);					\
  |  |  379|      0|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|      0|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1167|       |
 1168|    326|    apr_brigade_cleanup(in);
 1169|    326|    return s;
 1170|    326|}
apreq_brigade_fwrite:
 1175|    652|{
 1176|    652|    struct iovec v[APREQ_DEFAULT_NELTS];
 1177|    652|    apr_status_t s;
 1178|    652|    apr_bucket *e, *first;
 1179|    652|    int n = 0;
 1180|    652|    apr_bucket_brigade *tmp = bb;
 1181|    652|    *wlen = 0;
 1182|       |
 1183|    652|    if (BUCKET_IS_SPOOL(APR_BRIGADE_LAST(bb))) {
  ------------------
  |  | 1000|    652|#define BUCKET_IS_SPOOL(e) ((e)->type == &spool_bucket_type)
  |  |  ------------------
  |  |  |  Branch (1000:28): [True: 0, False: 652]
  |  |  ------------------
  ------------------
 1184|      0|        tmp = apr_brigade_create(bb->p, bb->bucket_alloc);
 1185|       |
 1186|      0|        s = apreq_brigade_copy(tmp, bb);
 1187|      0|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (1187:13): [True: 0, False: 0]
  ------------------
 1188|      0|            return s;
 1189|      0|    }
 1190|       |
 1191|    988|    for (e = APR_BRIGADE_FIRST(tmp); e != APR_BRIGADE_SENTINEL(tmp);
  ------------------
  |  |  353|    652|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    652|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(tmp); e != APR_BRIGADE_SENTINEL(tmp);
  ------------------
  |  |  339|    988|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    988|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    988|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1191:38): [True: 336, False: 652]
  ------------------
 1192|    652|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    336|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    336|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
 1193|    336|    {
 1194|    336|        apr_size_t len;
 1195|    336|        if (n == APREQ_DEFAULT_NELTS) {
  ------------------
  |  |   66|    336|#define APREQ_DEFAULT_NELTS              8
  ------------------
  |  Branch (1195:13): [True: 0, False: 336]
  ------------------
 1196|      0|            s = apreq_fwritev(f, v, &n, &len);
 1197|      0|            if (s != APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (1197:17): [True: 0, False: 0]
  ------------------
 1198|      0|                return s;
 1199|       |
 1200|      0|            if (tmp != bb) {
  ------------------
  |  Branch (1200:17): [True: 0, False: 0]
  ------------------
 1201|      0|                while ((first = APR_BRIGADE_FIRST(tmp)) != e)
  ------------------
  |  |  353|      0|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|      0|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (1201:24): [True: 0, False: 0]
  ------------------
 1202|      0|                    apr_bucket_delete(first);
  ------------------
  |  | 1086|      0|#define apr_bucket_delete(e) do {					\
  |  | 1087|      0|        apr_bucket *apr__b = (e);					\
  |  | 1088|      0|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|      0|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|      0|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|      0|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|      0|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|      0|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|      0|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|      0|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|      0|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|      0|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|      0|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|      0|        apr__d->free(apr__d);						\
  |  |  |  | 1073|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1203|      0|            }
 1204|       |
 1205|      0|            *wlen += len;
 1206|      0|        }
 1207|    336|        s = apr_bucket_read(e, (const char **)&(v[n].iov_base),
  ------------------
  |  | 1159|    336|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
 1208|    336|                            &len, APR_BLOCK_READ);
 1209|    336|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    336|#define APR_SUCCESS 0
  ------------------
  |  Branch (1209:13): [True: 0, False: 336]
  ------------------
 1210|      0|            return s;
 1211|       |
 1212|    336|        v[n++].iov_len = len;
 1213|    336|    }
 1214|       |
 1215|    978|    while (n > 0) {
  ------------------
  |  Branch (1215:12): [True: 326, False: 652]
  ------------------
 1216|    326|        apr_size_t len;
 1217|    326|        s = apreq_fwritev(f, v, &n, &len);
 1218|    326|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (1218:13): [True: 0, False: 326]
  ------------------
 1219|      0|            return s;
 1220|    326|        *wlen += len;
 1221|       |
 1222|    326|        if (tmp != bb) {
  ------------------
  |  Branch (1222:13): [True: 0, False: 326]
  ------------------
 1223|      0|            while ((first = APR_BRIGADE_FIRST(tmp)) != e)
  ------------------
  |  |  353|      0|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|      0|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (1223:20): [True: 0, False: 0]
  ------------------
 1224|      0|                apr_bucket_delete(first);
  ------------------
  |  | 1086|      0|#define apr_bucket_delete(e) do {					\
  |  | 1087|      0|        apr_bucket *apr__b = (e);					\
  |  | 1088|      0|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|      0|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|      0|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|      0|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|      0|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|      0|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|      0|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|      0|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|      0|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|      0|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|      0|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|      0|        apr__d->free(apr__d);						\
  |  |  |  | 1073|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1225|      0|        }
 1226|    326|    }
 1227|    652|    return APR_SUCCESS;
  ------------------
  |  |  225|    652|#define APR_SUCCESS 0
  ------------------
 1228|    652|}
apreq_util.c:url_decode:
  354|  1.14k|{
  355|  1.14k|    register const char *s = src;
  356|  1.14k|    unsigned char *start = (unsigned char *)dest;
  357|  1.14k|    register unsigned char *d = (unsigned char *)dest;
  358|  1.14k|    const char *end = src + *slen;
  359|       |
  360|  4.52k|    for (; s < end; ++d, ++s) {
  ------------------
  |  Branch (360:12): [True: 3.44k, False: 1.08k]
  ------------------
  361|  3.44k|        switch (*s) {
  362|       |
  363|    122|        case '+':
  ------------------
  |  Branch (363:9): [True: 122, False: 3.32k]
  ------------------
  364|    122|            *d = ' ';
  365|    122|            break;
  366|       |
  367|    977|        case '%':
  ------------------
  |  Branch (367:9): [True: 977, False: 2.46k]
  ------------------
  368|    977|            if (s + 2 < end && apr_isxdigit(s[1]) && apr_isxdigit(s[2])) {
  ------------------
  |  |  232|  1.94k|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 697, False: 273]
  |  |  ------------------
  ------------------
                          if (s + 2 < end && apr_isxdigit(s[1]) && apr_isxdigit(s[2])) {
  ------------------
  |  |  232|    697|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 691, False: 6]
  |  |  ------------------
  ------------------
  |  Branch (368:17): [True: 970, False: 7]
  ------------------
  369|    691|                *d = hex2_to_char(s + 1);
  370|    691|                s += 2;
  371|    691|            }
  372|    286|            else if (s + 5 < end && (s[1] == 'u' || s[1] == 'U') &&
  ------------------
  |  Branch (372:22): [True: 259, False: 27]
  |  Branch (372:38): [True: 108, False: 151]
  |  Branch (372:53): [True: 129, False: 22]
  ------------------
  373|    286|                     apr_isxdigit(s[2]) && apr_isxdigit(s[3]) &&
  ------------------
  |  |  232|    523|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 236, False: 1]
  |  |  ------------------
  ------------------
                                   apr_isxdigit(s[2]) && apr_isxdigit(s[3]) &&
  ------------------
  |  |  232|    522|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 234, False: 2]
  |  |  ------------------
  ------------------
  374|    286|                     apr_isxdigit(s[4]) && apr_isxdigit(s[5]))
  ------------------
  |  |  232|    520|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 233, False: 1]
  |  |  ------------------
  ------------------
                                   apr_isxdigit(s[4]) && apr_isxdigit(s[5]))
  ------------------
  |  |  232|    233|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 232, False: 1]
  |  |  ------------------
  ------------------
  375|    232|            {
  376|    232|                apr_uint16_t c = hex4_to_bmp(s+2);
  377|       |
  378|    232|                if (c < 0x80) {
  ------------------
  |  Branch (378:21): [True: 39, False: 193]
  ------------------
  379|     39|                    *d = c;
  380|     39|                }
  381|    193|                else if (c < 0x800) {
  ------------------
  |  Branch (381:26): [True: 61, False: 132]
  ------------------
  382|     61|                    *d++ = 0xC0 | (c >> 6);
  383|     61|                    *d   = 0x80 | (c & 0x3F);
  384|     61|                }
  385|    132|                else {
  386|    132|                    *d++ = 0xE0 | (c >> 12);
  387|    132|                    *d++ = 0x80 | ((c >> 6) & 0x3F);
  388|    132|                    *d   = 0x80 | (c & 0x3F);
  389|    132|                }
  390|    232|                s += 5;
  391|    232|            }
  392|     54|            else {
  393|     54|                *dlen = d - start;
  394|     54|                *slen = s - src;
  395|     54|                if (s + 5 < end
  ------------------
  |  Branch (395:21): [True: 27, False: 27]
  ------------------
  396|     54|                    || (s + 2 < end && !apr_isxdigit(s[2]))
  ------------------
  |  |  232|     20|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (396:25): [True: 20, False: 7]
  |  Branch (396:40): [True: 2, False: 18]
  ------------------
  397|     54|                    || (s + 1 < end && !apr_isxdigit(s[1])
  ------------------
  |  |  232|     49|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (397:25): [True: 24, False: 1]
  |  Branch (397:40): [True: 22, False: 2]
  ------------------
  398|     25|                        && s[1] != 'u' && s[1] != 'U'))
  ------------------
  |  Branch (398:28): [True: 21, False: 1]
  |  Branch (398:43): [True: 19, False: 2]
  ------------------
  399|     48|                {
  400|     48|                    *d = 0;
  401|     48|                    return APREQ_ERROR_BADSEQ;
  ------------------
  |  |   64|     48|#define APREQ_ERROR_BADSEQ         (APREQ_ERROR_BADDATA  +  2)
  |  |  ------------------
  |  |  |  |   60|     48|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     48|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     48|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     48|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     48|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     48|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     48|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|     48|                }
  403|       |
  404|      6|                memmove(d, s, end - s);
  405|      6|                d[end - s] = 0;
  406|      6|                return APR_INCOMPLETE;
  ------------------
  |  |  458|      6|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      6|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      6|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      6|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  407|     54|            }
  408|    923|            break;
  409|       |
  410|  2.34k|        default:
  ------------------
  |  Branch (410:9): [True: 2.34k, False: 1.09k]
  ------------------
  411|  2.34k|            if (*s > 0) {
  ------------------
  |  Branch (411:17): [True: 2.33k, False: 12]
  ------------------
  412|  2.33k|                *d = *s;
  413|  2.33k|            }
  414|     12|            else {
  415|     12|                *d = 0;
  416|     12|                *dlen = d - start;
  417|     12|                *slen = s - src;
  418|     12|                return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     12|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     12|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     12|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     12|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     12|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     12|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     12|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     12|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  419|     12|            }
  420|  3.44k|        }
  421|  3.44k|    }
  422|       |
  423|  1.08k|    *d = 0;
  424|  1.08k|    *dlen = d - start;
  425|  1.08k|    *slen = s - src;
  426|  1.08k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.08k|#define APR_SUCCESS 0
  ------------------
  427|  1.14k|}
apreq_util.c:hex2_to_char:
  119|    691|{
  120|    691|    register unsigned char digit;
  121|       |
  122|    691|#if !APR_CHARSET_EBCDIC
  123|    691|    digit  = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
  ------------------
  |  Branch (123:15): [True: 487, False: 204]
  ------------------
  124|    691|    digit *= 16;
  125|    691|    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0'));
  ------------------
  |  Branch (125:15): [True: 283, False: 408]
  ------------------
  126|       |#else /*APR_CHARSET_EBCDIC*/
  127|       |    char xstr[5];
  128|       |    xstr[0]='0';
  129|       |    xstr[1]='x';
  130|       |    xstr[2]=what[0];
  131|       |    xstr[3]=what[1];
  132|       |    xstr[4]='\0';
  133|       |    digit = apr_xlate_conv_byte(ap_hdrs_from_ascii, 0xFF & strtol(xstr, NULL, 16));
  134|       |#endif /*APR_CHARSET_EBCDIC*/
  135|    691|    return (digit);
  136|    691|}
apreq_util.c:hex4_to_bmp:
  325|    232|{
  326|    232|    register apr_uint16_t digit = 0;
  327|       |
  328|    232|#if !APR_CHARSET_EBCDIC
  329|    232|    digit  = (what[0] >= 'A' ? ((what[0] & 0xDF)-'A') + 10 : (what[0]-'0'));
  ------------------
  |  Branch (329:15): [True: 58, False: 174]
  ------------------
  330|    232|    digit *= 16;
  331|    232|    digit += (what[1] >= 'A' ? ((what[1] & 0xDF)-'A') + 10 : (what[1]-'0'));
  ------------------
  |  Branch (331:15): [True: 47, False: 185]
  ------------------
  332|    232|    digit *= 16;
  333|    232|    digit += (what[2] >= 'A' ? ((what[2] & 0xDF)-'A') + 10 : (what[2]-'0'));
  ------------------
  |  Branch (333:15): [True: 91, False: 141]
  ------------------
  334|    232|    digit *= 16;
  335|    232|    digit += (what[3] >= 'A' ? ((what[3] & 0xDF)-'A') + 10 : (what[3]-'0'));
  ------------------
  |  Branch (335:15): [True: 87, False: 145]
  ------------------
  336|       |
  337|       |#else /*APR_CHARSET_EBCDIC*/
  338|       |    char xstr[7];
  339|       |    xstr[0]='0';
  340|       |    xstr[1]='x';
  341|       |    xstr[2]=what[0];
  342|       |    xstr[3]=what[1];
  343|       |    xstr[4]=what[2];
  344|       |    xstr[5]=what[3];
  345|       |    xstr[6]='\0';
  346|       |    digit = apr_xlate_conv_byte(ap_hdrs_from_ascii, 0xFFFF & strtol(xstr, NULL, 16));
  347|       |#endif /*APR_CHARSET_EBCDIC*/
  348|    232|    return (digit);
  349|    232|}
apreq_util.c:apreq_file_cleanup:
  783|    326|{
  784|    326|    struct cleanup_data *data = d;
  785|    326|    return apr_file_remove(data->fname, data->pool);
  786|    326|}
apreq_util.c:spool_bucket_destroy:
 1005|    326|{
 1006|    326|    apr_bucket_type_file.destroy(data);
 1007|    326|}
apreq_util.c:apreq_fwritev:
  704|    326|{
  705|    326|    apr_size_t len;
  706|    326|    int n;
  707|    326|    apr_status_t s;
  708|       |
  709|    326|    *bytes_written = 0;
  710|       |
  711|    326|    while (1) {
  ------------------
  |  Branch (711:12): [Folded - Ignored]
  ------------------
  712|       |        /* try to write */
  713|    326|        s = apr_file_writev(f, v, *nelts, &len);
  714|       |
  715|    326|        *bytes_written += len;
  716|       |
  717|    326|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (717:13): [True: 0, False: 326]
  ------------------
  718|      0|            return s;
  719|       |
  720|       |        /* see how far we've come */
  721|    326|        n = 0;
  722|       |
  723|       |#ifdef SOLARIS2
  724|       |# ifdef __GNUC__
  725|       |        /*
  726|       |         * iovec.iov_len is a long here
  727|       |         * which causes a comparison between 
  728|       |         * signed(long) and unsigned(apr_size_t)
  729|       |         *
  730|       |         */
  731|       |        while (n < *nelts && len >= (apr_size_t)v[n].iov_len)
  732|       |# else
  733|       |          /*
  734|       |           * Sun C however defines this as size_t which is unsigned
  735|       |           * 
  736|       |           */
  737|       |        while (n < *nelts && len >= v[n].iov_len)
  738|       |# endif /* !__GNUC__ */
  739|       |#else
  740|       |          /*
  741|       |           * Hopefully everything else does this
  742|       |           * (this was the default for years)
  743|       |           */
  744|    662|        while (n < *nelts && len >= v[n].iov_len)
  ------------------
  |  Branch (744:16): [True: 336, False: 326]
  |  Branch (744:30): [True: 336, False: 0]
  ------------------
  745|    336|#endif
  746|    336|            len -= v[n++].iov_len;
  747|       |
  748|    326|        if (n == *nelts) {
  ------------------
  |  Branch (748:13): [True: 326, False: 0]
  ------------------
  749|       |            /* nothing left to write, report success */
  750|    326|            *nelts = 0;
  751|    326|            return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  752|    326|        }
  753|       |
  754|       |        /* incomplete write: must shift v */
  755|      0|        v[n].iov_len -= len;
  756|      0|        v[n].iov_base = (char *)(v[n].iov_base) + len;
  757|       |
  758|      0|        if (n > 0) {
  ------------------
  |  Branch (758:13): [True: 0, False: 0]
  ------------------
  759|       |            /* we're satisfied for now if we can remove one iovec from
  760|       |               the "v" array */
  761|      0|            (*nelts) -= n;
  762|      0|            memmove(v, v + n, sizeof(*v) * *nelts);
  763|       |
  764|      0|            return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  765|      0|        }
  766|       |
  767|       |        /* we're still in the first iovec - check for endless loop,
  768|       |           and then try again */
  769|      0|        if (len == 0)
  ------------------
  |  Branch (769:13): [True: 0, False: 0]
  ------------------
  770|      0|            return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|      0|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|      0|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  771|      0|    }
  772|    326|}

apr_atomic_init:
   29|  1.07k|{
   30|       |#if defined (USE_ATOMICS_GENERIC64)
   31|       |    return apr__atomic_generic64_init(p);
   32|       |#else
   33|  1.07k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
   34|  1.07k|#endif
   35|  1.07k|}

apr_brigade_cleanup:
   38|  5.66k|{
   39|  5.66k|    apr_bucket_brigade *b = data;
   40|       |
   41|  5.66k|#ifndef APR_BUCKET_DEBUG
   42|  8.55k|    while (!APR_BRIGADE_EMPTY(b)) {
  ------------------
  |  |  346|  8.55k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  8.55k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  8.55k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  8.55k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  8.55k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (42:12): [True: 2.89k, False: 5.66k]
  ------------------
   43|  2.89k|        apr_bucket_delete(APR_BRIGADE_FIRST(b));
  ------------------
  |  | 1086|  2.89k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  2.89k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  2.89k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  2.89k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  2.89k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  2.89k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  2.89k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.89k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  2.89k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.89k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  2.89k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.89k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  2.89k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.89k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  2.89k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  2.89k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  2.89k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  2.89k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  2.89k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  2.89k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  2.89k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  2.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   44|  2.89k|    }
   45|       |#else
   46|       |    /* Debugging version with checks which will only trigger if the
   47|       |     * bucket list becomes corrupt. */
   48|       |    apr_bucket *e;
   49|       |    apr_bucket *prev = NULL;
   50|       |
   51|       |    APR_BRIGADE_CHECK_CONSISTENCY(b);
   52|       |
   53|       |    while (!APR_BRIGADE_EMPTY(b)) {
   54|       |        e = APR_BRIGADE_FIRST(b);
   55|       |        assert(e != prev);
   56|       |        prev = e;
   57|       |        apr_bucket_delete(e);
   58|       |    }
   59|       |#endif
   60|       |
   61|       |    /* We don't need to free(bb) because it's allocated from a pool. */
   62|  5.66k|    return APR_SUCCESS;
  ------------------
  |  |  225|  5.66k|#define APR_SUCCESS 0
  ------------------
   63|  5.66k|}
apr_brigade_create:
   87|  4.48k|{
   88|  4.48k|    apr_bucket_brigade *b;
   89|       |
   90|  4.48k|    b = apr_palloc(p, sizeof(*b));
  ------------------
  |  |  425|  4.48k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.48k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  4.48k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  4.48k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|  4.48k|    b->p = p;
   92|  4.48k|    b->bucket_alloc = list;
   93|       |
   94|  4.48k|    APR_RING_INIT(&b->list, apr_bucket, link);
  ------------------
  |  |  192|  4.48k|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  193|  4.48k|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  166|  4.48k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  160|  4.48k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|  4.48k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  194|  4.48k|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  171|  4.48k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  160|  4.48k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|  4.48k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  195|  4.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   95|       |
   96|  4.48k|    apr_pool_cleanup_register(b->p, b, brigade_cleanup, apr_pool_cleanup_null);
   97|  4.48k|    return b;
   98|  4.48k|}
apr_brigade_length:
  221|  1.79k|{
  222|  1.79k|    apr_off_t total = 0;
  223|  1.79k|    apr_bucket *bkt;
  224|  1.79k|    apr_status_t status = APR_SUCCESS;
  ------------------
  |  |  225|  1.79k|#define APR_SUCCESS 0
  ------------------
  225|       |
  226|  1.79k|    for (bkt = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|  1.79k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.79k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  227|  2.93k|         bkt != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|  2.93k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  2.93k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|  2.93k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (227:10): [True: 1.14k, False: 1.79k]
  ------------------
  228|  1.79k|         bkt = APR_BUCKET_NEXT(bkt))
  ------------------
  |  |  430|  1.14k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.14k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  229|  1.14k|    {
  230|  1.14k|        if (bkt->length == (apr_size_t)(-1)) {
  ------------------
  |  Branch (230:13): [True: 0, False: 1.14k]
  ------------------
  231|      0|            const char *ignore;
  232|      0|            apr_size_t len;
  233|       |
  234|      0|            if (!read_all) {
  ------------------
  |  Branch (234:17): [True: 0, False: 0]
  ------------------
  235|      0|                total = -1;
  236|      0|                break;
  237|      0|            }
  238|       |
  239|      0|            if ((status = apr_bucket_read(bkt, &ignore, &len,
  ------------------
  |  | 1159|      0|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  |  Branch (239:17): [True: 0, False: 0]
  ------------------
  240|      0|                                          APR_BLOCK_READ)) != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  241|      0|                break;
  242|      0|            }
  243|      0|        }
  244|       |
  245|  1.14k|        total += bkt->length;
  246|  1.14k|    }
  247|       |
  248|  1.79k|    *length = total;
  249|  1.79k|    return status;
  250|  1.79k|}
apr_brigade_flatten:
  254|    604|{
  255|    604|    apr_size_t actual = 0;
  256|    604|    apr_bucket *b;
  257|       |
  258|    604|    for (b = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|    604|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    604|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  259|    615|         b != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    615|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    615|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|    615|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (259:10): [True: 614, False: 1]
  ------------------
  260|    604|         b = APR_BUCKET_NEXT(b))
  ------------------
  |  |  430|     11|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|     11|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  261|    614|    {
  262|    614|        const char *str;
  263|    614|        apr_size_t str_len;
  264|    614|        apr_status_t status;
  265|       |
  266|    614|        status = apr_bucket_read(b, &str, &str_len, APR_BLOCK_READ);
  ------------------
  |  | 1159|    614|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  267|    614|        if (status != APR_SUCCESS) {
  ------------------
  |  |  225|    614|#define APR_SUCCESS 0
  ------------------
  |  Branch (267:13): [True: 0, False: 614]
  ------------------
  268|      0|            return status;
  269|      0|        }
  270|       |
  271|       |        /* If we would overflow. */
  272|    614|        if (str_len + actual > *len) {
  ------------------
  |  Branch (272:13): [True: 0, False: 614]
  ------------------
  273|      0|            str_len = *len - actual;
  274|      0|        }
  275|       |
  276|       |        /* XXX: It appears that overflow of the final bucket
  277|       |         * is DISCARDED without any warning to the caller.
  278|       |         *
  279|       |         * No, we only copy the data up to their requested size.  -- jre
  280|       |         */
  281|    614|        if (str_len) {
  ------------------
  |  Branch (281:13): [True: 614, False: 0]
  ------------------
  282|    614|            memcpy(c, str, str_len);
  283|    614|        }
  284|       |
  285|    614|        c += str_len;
  286|    614|        actual += str_len;
  287|       |
  288|       |        /* This could probably be actual == *len, but be safe from stray
  289|       |         * photons. */
  290|    614|        if (actual >= *len) {
  ------------------
  |  Branch (290:13): [True: 603, False: 11]
  ------------------
  291|    603|            break;
  292|    603|        }
  293|    614|    }
  294|       |
  295|    604|    *len = actual;
  296|    604|    return APR_SUCCESS;
  ------------------
  |  |  225|    604|#define APR_SUCCESS 0
  ------------------
  297|    604|}
apr_brigade_pflatten:
  303|    550|{
  304|    550|    apr_off_t actual;
  305|    550|    apr_size_t total;
  306|    550|    apr_status_t rv;
  307|       |
  308|    550|    apr_brigade_length(bb, 1, &actual);
  309|       |
  310|       |    /* XXX: This is dangerous beyond belief.  At least in the
  311|       |     * apr_brigade_flatten case, the user explicitly stated their
  312|       |     * buffer length - so we don't up and palloc 4GB for a single
  313|       |     * file bucket.  This API must grow a useful max boundry,
  314|       |     * either compiled-in or preset via the *len value.
  315|       |     *
  316|       |     * Shouldn't both fn's grow an additional return value for
  317|       |     * the case that the brigade couldn't be flattened into the
  318|       |     * provided or allocated buffer (such as APR_EMOREDATA?)
  319|       |     * Not a failure, simply an advisory result.
  320|       |     */
  321|    550|    total = (apr_size_t)actual;
  322|       |
  323|    550|    *c = apr_palloc(pool, total);
  ------------------
  |  |  425|    550|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    550|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    550|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    550|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  324|       |
  325|    550|    rv = apr_brigade_flatten(bb, *c, &total);
  326|       |
  327|    550|    if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|    550|#define APR_SUCCESS 0
  ------------------
  |  Branch (327:9): [True: 0, False: 550]
  ------------------
  328|      0|        return rv;
  329|      0|    }
  330|       |
  331|    550|    *len = total;
  332|    550|    return APR_SUCCESS;
  ------------------
  |  |  225|    550|#define APR_SUCCESS 0
  ------------------
  333|    550|}
apr_brigade_write:
  773|  1.07k|{
  774|  1.07k|    apr_bucket *e = APR_BRIGADE_LAST(b);
  ------------------
  |  |  359|  1.07k|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|  1.07k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
  775|  1.07k|    apr_size_t remaining = APR_BUCKET_BUFF_SIZE;
  ------------------
  |  |   54|  1.07k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  776|  1.07k|    char *buf = NULL;
  777|       |
  778|       |    /*
  779|       |     * If the last bucket is a heap bucket and its buffer is not shared with
  780|       |     * another bucket, we may write into that bucket.
  781|       |     */
  782|  1.07k|    if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
  ------------------
  |  |  346|  1.07k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  2.14k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  1.07k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.07k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  1.07k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
  ------------------
  |  |  493|  1.07k|#define APR_BUCKET_IS_HEAP(e)        ((e)->type == &apr_bucket_type_heap)
  |  |  ------------------
  |  |  |  Branch (493:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (782:9): [True: 0, False: 1.07k]
  ------------------
  783|  1.07k|        && ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) {
  ------------------
  |  Branch (783:12): [True: 0, False: 0]
  ------------------
  784|      0|        apr_bucket_heap *h = e->data;
  785|       |
  786|       |        /* HEAP bucket start offsets are always in-memory, safe to cast */
  787|      0|        remaining = h->alloc_len - (e->length + (apr_size_t)e->start);
  788|      0|        buf = h->base + e->start + e->length;
  789|      0|    }
  790|       |
  791|  1.07k|    if (nbyte > remaining) {
  ------------------
  |  Branch (791:9): [True: 0, False: 1.07k]
  ------------------
  792|       |        /* either a buffer bucket exists but is full,
  793|       |         * or no buffer bucket exists and the data is too big
  794|       |         * to buffer.  In either case, we should flush.  */
  795|      0|        if (flush) {
  ------------------
  |  Branch (795:13): [True: 0, False: 0]
  ------------------
  796|      0|            e = apr_bucket_transient_create(str, nbyte, b->bucket_alloc);
  797|      0|            APR_BRIGADE_INSERT_TAIL(b, e);
  ------------------
  |  |  377|      0|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|      0|	apr_bucket *ap__b = (e);					\
  |  |  379|      0|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|      0|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  798|      0|            return flush(b, ctx);
  799|      0|        }
  800|      0|        else {
  801|      0|            e = apr_bucket_heap_create(str, nbyte, NULL, b->bucket_alloc);
  802|      0|            APR_BRIGADE_INSERT_TAIL(b, e);
  ------------------
  |  |  377|      0|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|      0|	apr_bucket *ap__b = (e);					\
  |  |  379|      0|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|      0|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|      0|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|      0|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|      0|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|      0|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      0|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|      0|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  803|      0|            return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  804|      0|        }
  805|      0|    }
  806|  1.07k|    else if (!buf) {
  ------------------
  |  Branch (806:14): [True: 1.07k, False: 0]
  ------------------
  807|       |        /* we don't have a buffer, but the data is small enough
  808|       |         * that we don't mind making a new buffer */
  809|  1.07k|        buf = apr_bucket_alloc(APR_BUCKET_BUFF_SIZE, b->bucket_alloc);
  ------------------
  |  |   54|  1.07k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  810|  1.07k|        e = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE,
  ------------------
  |  |   54|  1.07k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  811|  1.07k|                                   apr_bucket_free, b->bucket_alloc);
  812|  1.07k|        APR_BRIGADE_INSERT_TAIL(b, e);
  ------------------
  |  |  377|  1.07k|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|  1.07k|	apr_bucket *ap__b = (e);					\
  |  |  379|  1.07k|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|  1.07k|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.07k|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|  1.07k|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.07k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|  1.07k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|  1.07k|#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|  1.07k|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.07k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.07k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|  1.07k|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.07k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|  1.07k|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.07k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|  1.07k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  1.07k|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|  1.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  813|  1.07k|        e->length = 0;   /* We are writing into the brigade, and
  814|       |                          * allocating more memory than we need.  This
  815|       |                          * ensures that the bucket thinks it is empty just
  816|       |                          * after we create it.  We'll fix the length
  817|       |                          * once we put data in it below.
  818|       |                          */
  819|  1.07k|    }
  820|       |
  821|       |    /* there is a sufficiently big buffer bucket available now */
  822|  1.07k|    memcpy(buf, str, nbyte);
  823|  1.07k|    e->length += nbyte;
  824|       |
  825|  1.07k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
  826|  1.07k|}
apr_brigade.c:brigade_cleanup:
   33|  4.48k|{
   34|  4.48k|    return apr_brigade_cleanup(data);
   35|  4.48k|}

apr_bucket_setaside_noop:
   21|  1.06k|{
   22|  1.06k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.06k|#define APR_SUCCESS 0
  ------------------
   23|  1.06k|}
apr_bucket_destroy_noop:
   44|     10|{
   45|     10|    return;
   46|     10|}

apr_bucket_alloc_create:
   70|  1.07k|{
   71|  1.07k|    apr_allocator_t *allocator = apr_pool_allocator_get(p);
   72|  1.07k|    apr_bucket_alloc_t *list;
   73|       |
   74|  1.07k|#if APR_POOL_DEBUG
   75|       |    /* may be NULL for debug mode. */
   76|  1.07k|    if (allocator == NULL) {
  ------------------
  |  Branch (76:9): [True: 1.07k, False: 0]
  ------------------
   77|  1.07k|        if (apr_allocator_create(&allocator) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
  |  Branch (77:13): [True: 0, False: 1.07k]
  ------------------
   78|      0|            apr_abortfunc_t fn = apr_pool_abort_get(p);
   79|      0|            if (fn)
  ------------------
  |  Branch (79:17): [True: 0, False: 0]
  ------------------
   80|      0|                (fn)(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
   81|      0|            abort();
   82|      0|        }
   83|  1.07k|    }
   84|  1.07k|#endif
   85|  1.07k|    list = apr_bucket_alloc_create_ex(allocator);
   86|  1.07k|    if (list == NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 1.07k]
  ------------------
   87|      0|            apr_abortfunc_t fn = apr_pool_abort_get(p);
   88|      0|            if (fn)
  ------------------
  |  Branch (88:17): [True: 0, False: 0]
  ------------------
   89|      0|                (fn)(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
   90|      0|            abort();
   91|      0|    }
   92|  1.07k|    list->pool = p;
   93|  1.07k|    apr_pool_cleanup_register(list->pool, list, alloc_cleanup,
   94|  1.07k|                              apr_pool_cleanup_null);
   95|       |
   96|  1.07k|    return list;
   97|  1.07k|}
apr_bucket_alloc_create_ex:
  101|  1.07k|{
  102|  1.07k|    apr_bucket_alloc_t *list;
  103|  1.07k|    apr_memnode_t *block;
  104|       |
  105|  1.07k|    block = apr_allocator_alloc(allocator, ALLOC_AMT);
  ------------------
  |  |   23|  1.07k|#define ALLOC_AMT (8192 - APR_MEMNODE_T_SIZE)
  |  |  ------------------
  |  |  |  |   64|  1.07k|#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  1.07k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  1.07k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|  1.07k|    if (!block) {
  ------------------
  |  Branch (106:9): [True: 0, False: 1.07k]
  ------------------
  107|      0|        return NULL;
  108|      0|    }
  109|  1.07k|    list = (apr_bucket_alloc_t *)block->first_avail;
  110|  1.07k|    list->pool = NULL;
  111|  1.07k|    list->allocator = allocator;
  112|  1.07k|    list->freelist = NULL;
  113|  1.07k|    list->blocks = block;
  114|  1.07k|    block->first_avail += APR_ALIGN_DEFAULT(sizeof(*list));
  ------------------
  |  |  150|  1.07k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  ------------------
  |  |  |  |  147|  1.07k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  ------------------
  ------------------
  115|  1.07k|    APR_VALGRIND_NOACCESS(block->first_avail,
  116|  1.07k|                          block->endp - block->first_avail);
  117|  1.07k|    return list;
  118|  1.07k|}
apr_bucket_alloc:
  157|  14.0k|{
  158|  14.0k|    node_header_t *node;
  159|  14.0k|    apr_memnode_t *active = list->blocks;
  160|  14.0k|    char *endp;
  161|  14.0k|    apr_size_t size;
  162|       |
  163|  14.0k|    size = in_size + SIZEOF_NODE_HEADER_T;
  ------------------
  |  |   32|  14.0k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  ------------------
  |  |  |  |  150|  14.0k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  14.0k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|  14.0k|    if (size <= SMALL_NODE_SIZE) {
  ------------------
  |  |   33|  14.0k|#define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |  658|  14.0k|#define APR_BUCKET_ALLOC_SIZE  APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  14.0k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  14.0k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |   32|  14.0k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  14.0k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  14.0k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (164:9): [True: 12.9k, False: 1.07k]
  ------------------
  165|  12.9k|        if (list->freelist) {
  ------------------
  |  Branch (165:13): [True: 6.96k, False: 5.98k]
  ------------------
  166|  6.96k|            node = list->freelist;
  167|  6.96k|            list->freelist = node->next;
  168|  6.96k|            APR_VALGRIND_UNDEFINED((char *)node + SIZEOF_NODE_HEADER_T,
  169|  6.96k|                                   SMALL_NODE_SIZE - SIZEOF_NODE_HEADER_T);
  170|  6.96k|        }
  171|  5.98k|        else {
  172|  5.98k|            endp = active->first_avail + SMALL_NODE_SIZE;
  ------------------
  |  |   33|  5.98k|#define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |  658|  5.98k|#define APR_BUCKET_ALLOC_SIZE  APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  5.98k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  5.98k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |   32|  5.98k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  5.98k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  5.98k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  5.98k|            if (endp >= active->endp) {
  ------------------
  |  Branch (173:17): [True: 0, False: 5.98k]
  ------------------
  174|      0|                list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT);
  ------------------
  |  |   23|      0|#define ALLOC_AMT (8192 - APR_MEMNODE_T_SIZE)
  |  |  ------------------
  |  |  |  |   64|      0|#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|      0|                if (!list->blocks) {
  ------------------
  |  Branch (175:21): [True: 0, False: 0]
  ------------------
  176|      0|                    list->blocks = active;
  177|      0|                    return NULL;
  178|      0|                }
  179|      0|                list->blocks->next = active;
  180|      0|                active = list->blocks;
  181|      0|                endp = active->first_avail + SMALL_NODE_SIZE;
  ------------------
  |  |   33|      0|#define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |  658|      0|#define APR_BUCKET_ALLOC_SIZE  APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |   32|      0|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|      0|                APR_VALGRIND_NOACCESS(active->first_avail,
  183|      0|                                      active->endp - active->first_avail);
  184|      0|            }
  185|  5.98k|            node = (node_header_t *)active->first_avail;
  186|  5.98k|            APR_VALGRIND_UNDEFINED(node, SMALL_NODE_SIZE);
  187|  5.98k|            node->alloc = list;
  188|  5.98k|            node->memnode = active;
  189|  5.98k|            node->size = SMALL_NODE_SIZE;
  ------------------
  |  |   33|  5.98k|#define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |  658|  5.98k|#define APR_BUCKET_ALLOC_SIZE  APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  5.98k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  5.98k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |   32|  5.98k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  5.98k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  5.98k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  5.98k|            active->first_avail = endp;
  191|  5.98k|        }
  192|  12.9k|    }
  193|  1.07k|    else {
  194|  1.07k|        apr_memnode_t *memnode = apr_allocator_alloc(list->allocator, size);
  195|  1.07k|        if (!memnode) {
  ------------------
  |  Branch (195:13): [True: 0, False: 1.07k]
  ------------------
  196|      0|            return NULL;
  197|      0|        }
  198|  1.07k|        node = (node_header_t *)memnode->first_avail;
  199|  1.07k|        node->alloc = list;
  200|  1.07k|        node->memnode = memnode;
  201|  1.07k|        node->size = size;
  202|  1.07k|    }
  203|  14.0k|    return ((char *)node) + SIZEOF_NODE_HEADER_T;
  ------------------
  |  |   32|  14.0k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  ------------------
  |  |  |  |  150|  14.0k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  14.0k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  14.0k|}
apr_bucket_free:
  227|  13.1k|{
  228|  13.1k|    node_header_t *node = (node_header_t *)((char *)mem - SIZEOF_NODE_HEADER_T);
  ------------------
  |  |   32|  13.1k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  ------------------
  |  |  |  |  150|  13.1k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  13.1k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  13.1k|    apr_bucket_alloc_t *list = node->alloc;
  230|       |
  231|  13.1k|    if (node->size == SMALL_NODE_SIZE) {
  ------------------
  |  |   33|  13.1k|#define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |  658|  13.1k|#define APR_BUCKET_ALLOC_SIZE  APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  13.1k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  13.1k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SMALL_NODE_SIZE       (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T)
  |  |  ------------------
  |  |  |  |   32|  13.1k|#define SIZEOF_NODE_HEADER_T  APR_ALIGN_DEFAULT(sizeof(node_header_t))
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  13.1k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|  13.1k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (231:9): [True: 12.0k, False: 1.07k]
  ------------------
  232|  12.0k|        check_not_already_free(node);
  233|  12.0k|        node->next = list->freelist;
  234|  12.0k|        list->freelist = node;
  235|  12.0k|        APR_VALGRIND_NOACCESS(mem, SMALL_NODE_SIZE - SIZEOF_NODE_HEADER_T);
  236|  12.0k|    }
  237|  1.07k|    else {
  238|  1.07k|        apr_allocator_free(list->allocator, node->memnode);
  239|  1.07k|    }
  240|  13.1k|}
apr_buckets_alloc.c:alloc_cleanup:
   46|  1.07k|{
   47|  1.07k|    apr_bucket_alloc_t *list = data;
   48|  1.07k|#if APR_POOL_DEBUG
   49|  1.07k|    apr_allocator_t *allocator = NULL;
   50|  1.07k|#endif
   51|       |
   52|  1.07k|#if APR_POOL_DEBUG
   53|  1.07k|    if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) {
  ------------------
  |  Branch (53:9): [True: 1.07k, False: 0]
  |  Branch (53:23): [True: 1.07k, False: 0]
  ------------------
   54|  1.07k|        allocator = list->allocator;
   55|  1.07k|    }
   56|  1.07k|#endif
   57|       |
   58|  1.07k|    apr_allocator_free(list->allocator, list->blocks);
   59|       |
   60|  1.07k|#if APR_POOL_DEBUG
   61|  1.07k|    if (allocator) {
  ------------------
  |  Branch (61:9): [True: 1.07k, False: 0]
  ------------------
   62|  1.07k|        apr_allocator_destroy(allocator);
   63|  1.07k|    }
   64|  1.07k|#endif
   65|       |
   66|  1.07k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
   67|  1.07k|}

apr_bucket_eos_make:
   28|    865|{
   29|    865|    b->length      = 0;
   30|    865|    b->start       = 0;
   31|    865|    b->data        = NULL;
   32|    865|    b->type        = &apr_bucket_type_eos;
   33|       |
   34|    865|    return b;
   35|    865|}
apr_bucket_eos_create:
   38|    865|{
   39|    865|    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
   40|       |
   41|    865|    APR_BUCKET_INIT(b);
  ------------------
  |  |  448|    865|#define APR_BUCKET_INIT(e)	APR_RING_ELEM_INIT((e), link)
  |  |  ------------------
  |  |  |  |  212|    865|#define APR_RING_ELEM_INIT(ep, link) do {                \
  |  |  |  |  213|    865|    APR_RING_NEXT((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|    865|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  ------------------
  |  |  |  |  214|    865|    APR_RING_PREV((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|    865|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  ------------------
  |  |  |  |  215|    865|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (215:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|    865|    b->free = apr_bucket_free;
   43|    865|    b->list = list;
   44|    865|    return apr_bucket_eos_make(b);
   45|    865|}

apr_bucket_file_make:
  157|    326|{
  158|    326|    apr_bucket_file *f;
  159|       |
  160|    326|    f = apr_bucket_alloc(sizeof(*f), b->list);
  161|    326|    f->fd = fd;
  162|    326|    f->readpool = p;
  163|    326|#if APR_HAS_MMAP
  164|    326|    f->can_mmap = 1;
  165|    326|#endif
  166|    326|    f->read_size = APR_BUCKET_BUFF_SIZE;
  ------------------
  |  |   54|    326|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  167|       |
  168|    326|    b = apr_bucket_shared_make(b, f, offset, len);
  169|    326|    b->type = &apr_bucket_type_file;
  170|       |
  171|    326|    return b;
  172|    326|}
apr_bucket_file_create:
  178|    326|{
  179|    326|    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
  180|       |
  181|    326|    APR_BUCKET_INIT(b);
  ------------------
  |  |  448|    326|#define APR_BUCKET_INIT(e)	APR_RING_ELEM_INIT((e), link)
  |  |  ------------------
  |  |  |  |  212|    326|#define APR_RING_ELEM_INIT(ep, link) do {                \
  |  |  |  |  213|    326|    APR_RING_NEXT((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|    326|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  ------------------
  |  |  |  |  214|    326|    APR_RING_PREV((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|    326|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  ------------------
  |  |  |  |  215|    326|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (215:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|    326|    b->free = apr_bucket_free;
  183|    326|    b->list = list;
  184|    326|    return apr_bucket_file_make(b, fd, offset, len, p);
  185|    326|}
apr_buckets_file.c:file_bucket_destroy:
   33|    326|{
   34|    326|    apr_bucket_file *f = data;
   35|       |
   36|    326|    if (apr_bucket_shared_destroy(f)) {
  ------------------
  |  Branch (36:9): [True: 326, False: 0]
  ------------------
   37|       |        /* no need to close the file here; it will get
   38|       |         * done automatically when the pool gets cleaned up */
   39|    326|        apr_bucket_free(f);
   40|    326|    }
   41|    326|}

apr_bucket_heap_make:
   46|  1.07k|{
   47|  1.07k|    apr_bucket_heap *h;
   48|       |
   49|  1.07k|    h = apr_bucket_alloc(sizeof(*h), b->list);
   50|       |
   51|  1.07k|    if (!free_func) {
  ------------------
  |  Branch (51:9): [True: 0, False: 1.07k]
  ------------------
   52|      0|        h->alloc_len = length;
   53|      0|        h->base = apr_bucket_alloc(h->alloc_len, b->list);
   54|      0|        if (h->base == NULL) {
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|            apr_bucket_free(h);
   56|      0|            return NULL;
   57|      0|        }
   58|      0|        h->free_func = apr_bucket_free;
   59|      0|        memcpy(h->base, buf, length);
   60|      0|    }
   61|  1.07k|    else {
   62|       |        /* XXX: we lose the const qualifier here which indicates
   63|       |         * there's something screwy with the API...
   64|       |         */
   65|  1.07k|        h->base = (char *) buf;
   66|  1.07k|        h->alloc_len = length;
   67|  1.07k|        h->free_func = free_func;
   68|  1.07k|    }
   69|       |
   70|  1.07k|    b = apr_bucket_shared_make(b, h, 0, length);
   71|  1.07k|    b->type = &apr_bucket_type_heap;
   72|       |
   73|  1.07k|    return b;
   74|  1.07k|}
apr_bucket_heap_create:
   80|  1.07k|{
   81|  1.07k|    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
   82|       |
   83|  1.07k|    APR_BUCKET_INIT(b);
  ------------------
  |  |  448|  1.07k|#define APR_BUCKET_INIT(e)	APR_RING_ELEM_INIT((e), link)
  |  |  ------------------
  |  |  |  |  212|  1.07k|#define APR_RING_ELEM_INIT(ep, link) do {                \
  |  |  |  |  213|  1.07k|    APR_RING_NEXT((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  1.07k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  ------------------
  |  |  |  |  214|  1.07k|    APR_RING_PREV((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|  1.07k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  ------------------
  |  |  |  |  215|  1.07k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (215:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|  1.07k|    b->free = apr_bucket_free;
   85|  1.07k|    b->list = list;
   86|  1.07k|    return apr_bucket_heap_make(b, buf, length, free_func);
   87|  1.07k|}
apr_buckets_heap.c:heap_bucket_destroy:
   32|  10.3k|{
   33|  10.3k|    apr_bucket_heap *h = data;
   34|       |
   35|  10.3k|    if (apr_bucket_shared_destroy(h)) {
  ------------------
  |  Branch (35:9): [True: 1.07k, False: 9.27k]
  ------------------
   36|  1.07k|        (*h->free_func)(h->base);
   37|  1.07k|        apr_bucket_free(h);
   38|  1.07k|    }
   39|  10.3k|}
apr_buckets_heap.c:heap_bucket_read:
   23|  12.3k|{
   24|  12.3k|    apr_bucket_heap *h = b->data;
   25|       |
   26|  12.3k|    *str = h->base + b->start;
   27|  12.3k|    *len = b->length;
   28|  12.3k|    return APR_SUCCESS;
  ------------------
  |  |  225|  12.3k|#define APR_SUCCESS 0
  ------------------
   29|  12.3k|}

apr_bucket_shared_split:
   21|  9.27k|{
   22|  9.27k|    apr_bucket_refcount *r = a->data;
   23|  9.27k|    apr_status_t rv;
   24|       |
   25|  9.27k|    if ((rv = apr_bucket_simple_split(a, point)) != APR_SUCCESS) {
  ------------------
  |  |  225|  9.27k|#define APR_SUCCESS 0
  ------------------
  |  Branch (25:9): [True: 0, False: 9.27k]
  ------------------
   26|      0|        return rv;
   27|      0|    }
   28|  9.27k|    r->refcount++;
   29|       |
   30|  9.27k|    return APR_SUCCESS;
  ------------------
  |  |  225|  9.27k|#define APR_SUCCESS 0
  ------------------
   31|  9.27k|}
apr_bucket_shared_destroy:
   44|  10.6k|{
   45|  10.6k|    apr_bucket_refcount *r = data;
   46|  10.6k|    r->refcount--;
   47|  10.6k|    return (r->refcount == 0);
   48|  10.6k|}
apr_bucket_shared_make:
   53|  1.40k|{
   54|  1.40k|    apr_bucket_refcount *r = data;
   55|       |
   56|  1.40k|    b->data   = r;
   57|  1.40k|    b->start  = start;
   58|  1.40k|    b->length = length;
   59|       |    /* caller initializes the type field */
   60|  1.40k|    r->refcount = 1;
   61|       |
   62|  1.40k|    return b;
   63|  1.40k|}

apr_bucket_simple_copy:
   21|  9.27k|{
   22|  9.27k|    *b = apr_bucket_alloc(sizeof(**b), a->list); /* XXX: check for failure? */
   23|  9.27k|    **b = *a;
   24|       |
   25|  9.27k|    return APR_SUCCESS;
  ------------------
  |  |  225|  9.27k|#define APR_SUCCESS 0
  ------------------
   26|  9.27k|}
apr_bucket_simple_split:
   30|  9.27k|{
   31|  9.27k|    apr_bucket *b;
   32|       |
   33|  9.27k|    if (point > a->length) {
  ------------------
  |  Branch (33:9): [True: 0, False: 9.27k]
  ------------------
   34|      0|        return APR_EINVAL;
  ------------------
  |  |  715|      0|#define APR_EINVAL EINVAL
  ------------------
   35|      0|    }
   36|       |
   37|  9.27k|    apr_bucket_simple_copy(a, &b);
   38|       |
   39|  9.27k|    a->length  = point;
   40|  9.27k|    b->length -= point;
   41|  9.27k|    b->start  += point;
   42|       |
   43|  9.27k|    APR_BUCKET_INSERT_AFTER(a, b);
  ------------------
  |  |  419|  9.27k|#define APR_BUCKET_INSERT_AFTER(a, b) do {				\
  |  |  420|  9.27k|	apr_bucket *ap__a = (a), *ap__b = (b);				\
  |  |  421|  9.27k|	APR_RING_INSERT_AFTER(ap__a, ap__b, link);			\
  |  |  ------------------
  |  |  |  |  274|  9.27k|    APR_RING_SPLICE_AFTER((lep), (nep), (nep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  245|  9.27k|#define APR_RING_SPLICE_AFTER(lep, ep1, epN, link) do {         \
  |  |  |  |  |  |  246|  9.27k|    APR_RING_PREV((ep1), link) = (lep);                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  9.27k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  247|  9.27k|    APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  9.27k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  9.27k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  248|  9.27k|    APR_RING_PREV(APR_RING_NEXT((lep), link), link) = (epN);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  9.27k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  249|  9.27k|    APR_RING_NEXT((lep), link) = (ep1);                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  9.27k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  250|  9.27k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (250:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  422|  9.27k|        APR_BUCKET_CHECK_CONSISTENCY(ap__a);				\
  |  |  423|  9.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (423:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   44|       |
   45|  9.27k|    return APR_SUCCESS;
  ------------------
  |  |  225|  9.27k|#define APR_SUCCESS 0
  ------------------
   46|  9.27k|}
apr_bucket_immortal_make:
   59|     10|{
   60|     10|    b->data   = (char *)buf;
   61|     10|    b->length = length;
   62|     10|    b->start  = 0;
   63|     10|    b->type   = &apr_bucket_type_immortal;
   64|       |
   65|     10|    return b;
   66|     10|}
apr_bucket_immortal_create:
   71|     10|{
   72|     10|    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
   73|       |
   74|     10|    APR_BUCKET_INIT(b);
  ------------------
  |  |  448|     10|#define APR_BUCKET_INIT(e)	APR_RING_ELEM_INIT((e), link)
  |  |  ------------------
  |  |  |  |  212|     10|#define APR_RING_ELEM_INIT(ep, link) do {                \
  |  |  |  |  213|     10|    APR_RING_NEXT((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|     10|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  ------------------
  |  |  |  |  214|     10|    APR_RING_PREV((ep), link) = (ep);                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|     10|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  ------------------
  |  |  |  |  215|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (215:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   75|     10|    b->free = apr_bucket_free;
   76|     10|    b->list = list;
   77|     10|    return apr_bucket_immortal_make(b, buf, length);
   78|     10|}
apr_buckets_simple.c:simple_bucket_read:
   50|     10|{
   51|     10|    *str = (char *)b->data + b->start;
   52|     10|    *len = b->length;
   53|     10|    return APR_SUCCESS;
  ------------------
  |  |  225|     10|#define APR_SUCCESS 0
  ------------------
   54|     10|}

apr_file_name_get:
   24|    326|{
   25|    326|    *fname = thefile->fname;
   26|    326|    return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
   27|    326|}

apr_filepath_merge:
   86|    326|{
   87|    326|    char *path;
   88|    326|    apr_size_t rootlen; /* is the length of the src rootpath */
   89|    326|    apr_size_t maxlen;  /* maximum total path length */
   90|    326|    apr_size_t keptlen; /* is the length of the retained rootpath */
   91|    326|    apr_size_t pathlen; /* is the length of the result path */
   92|    326|    apr_size_t seglen;  /* is the end of the current segment */
   93|    326|    apr_status_t rv;
   94|       |
   95|       |    /* Treat null as an empty path.
   96|       |     */
   97|    326|    if (!addpath)
  ------------------
  |  Branch (97:9): [True: 0, False: 326]
  ------------------
   98|      0|        addpath = "";
   99|       |
  100|    326|    if (addpath[0] == '/') {
  ------------------
  |  Branch (100:9): [True: 0, False: 326]
  ------------------
  101|       |        /* If addpath is rooted, then rootpath is unused.
  102|       |         * This violates any APR_FILEPATH_SECUREROOTTEST and
  103|       |         * APR_FILEPATH_NOTABSOLUTE flags specified.
  104|       |         */
  105|      0|        if (flags & APR_FILEPATH_SECUREROOTTEST)
  ------------------
  |  |  290|      0|#define APR_FILEPATH_SECUREROOTTEST 0x02
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            return APR_EABOVEROOT;
  ------------------
  |  |  330|      0|#define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  107|      0|        if (flags & APR_FILEPATH_NOTABSOLUTE)
  ------------------
  |  |  301|      0|#define APR_FILEPATH_NOTABSOLUTE    0x08
  ------------------
  |  Branch (107:13): [True: 0, False: 0]
  ------------------
  108|      0|            return APR_EABSOLUTE;
  ------------------
  |  |  324|      0|#define APR_EABSOLUTE      (APR_OS_START_ERROR + 20)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  109|       |
  110|       |        /* If APR_FILEPATH_NOTABOVEROOT wasn't specified,
  111|       |         * we won't test the root again, it's ignored.
  112|       |         * Waste no CPU retrieving the working path.
  113|       |         */
  114|      0|        if (!rootpath && !(flags & APR_FILEPATH_NOTABOVEROOT))
  ------------------
  |  |  287|      0|#define APR_FILEPATH_NOTABOVEROOT   0x01
  ------------------
  |  Branch (114:13): [True: 0, False: 0]
  |  Branch (114:26): [True: 0, False: 0]
  ------------------
  115|      0|            rootpath = "";
  116|      0|    }
  117|    326|    else {
  118|       |        /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller
  119|       |         * requires a relative result.  If the rootpath is
  120|       |         * ommitted, we do not retrieve the working path,
  121|       |         * if rootpath was supplied as absolute then fail.
  122|       |         */
  123|    326|        if (flags & APR_FILEPATH_NOTABSOLUTE) {
  ------------------
  |  |  301|    326|#define APR_FILEPATH_NOTABSOLUTE    0x08
  ------------------
  |  Branch (123:13): [True: 0, False: 326]
  ------------------
  124|      0|            if (!rootpath)
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  ------------------
  125|      0|                rootpath = "";
  126|      0|            else if (rootpath[0] == '/')
  ------------------
  |  Branch (126:22): [True: 0, False: 0]
  ------------------
  127|      0|                return APR_EABSOLUTE;
  ------------------
  |  |  324|      0|#define APR_EABSOLUTE      (APR_OS_START_ERROR + 20)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  128|      0|        }
  129|    326|    }
  130|       |
  131|    326|    if (!rootpath) {
  ------------------
  |  Branch (131:9): [True: 0, False: 326]
  ------------------
  132|       |        /* Start with the current working path.  This is bass akwards,
  133|       |         * but required since the compiler (at least vc) doesn't like
  134|       |         * passing the address of a char const* for a char** arg.
  135|       |         */
  136|      0|        char *getpath;
  137|      0|        rv = apr_filepath_get(&getpath, flags, p);
  138|      0|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (138:13): [True: 0, False: 0]
  ------------------
  139|      0|            return errno;
  140|       |
  141|      0|        rootpath = getpath;
  142|       |        /* XXX: Any kernel subject to goofy, uncanonical results
  143|       |         * must run the rootpath against the user's given flags.
  144|       |         * Simplest would be a recursive call to apr_filepath_merge
  145|       |         * with an empty (not null) rootpath and addpath of the cwd.
  146|       |         */
  147|      0|    }
  148|       |
  149|    326|    rootlen = strlen(rootpath);
  150|    326|    maxlen = rootlen + strlen(addpath) + 4; /* 4 for slashes at start, after
  151|       |                                             * root, and at end, plus trailing
  152|       |                                             * null */
  153|    326|    if (maxlen > APR_PATH_MAX) {
  ------------------
  |  |  678|    326|#define APR_PATH_MAX       PATH_MAX
  ------------------
  |  Branch (153:9): [True: 0, False: 326]
  ------------------
  154|      0|        return APR_ENAMETOOLONG;
  ------------------
  |  |  659|      0|#define APR_ENAMETOOLONG ENAMETOOLONG
  ------------------
  155|      0|    }
  156|    326|    path = (char *)apr_palloc(p, maxlen);
  ------------------
  |  |  425|    326|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    326|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    326|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    326|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|       |
  158|    326|    if (addpath[0] == '/') {
  ------------------
  |  Branch (158:9): [True: 0, False: 326]
  ------------------
  159|       |        /* Ignore the given root path, strip off leading
  160|       |         * '/'s to a single leading '/' from the addpath,
  161|       |         * and leave addpath at the first non-'/' character.
  162|       |         */
  163|      0|        keptlen = 0;
  164|      0|        while (addpath[0] == '/')
  ------------------
  |  Branch (164:16): [True: 0, False: 0]
  ------------------
  165|      0|            ++addpath;
  166|      0|        path[0] = '/';
  167|      0|        pathlen = 1;
  168|      0|    }
  169|    326|    else {
  170|       |        /* If both paths are relative, fail early
  171|       |         */
  172|    326|        if (rootpath[0] != '/' && (flags & APR_FILEPATH_NOTRELATIVE))
  ------------------
  |  |  298|      0|#define APR_FILEPATH_NOTRELATIVE    0x04
  ------------------
  |  Branch (172:13): [True: 0, False: 326]
  |  Branch (172:35): [True: 0, False: 0]
  ------------------
  173|      0|            return APR_ERELATIVE;
  ------------------
  |  |  326|      0|#define APR_ERELATIVE      (APR_OS_START_ERROR + 21)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  174|       |
  175|       |        /* Base the result path on the rootpath
  176|       |         */
  177|    326|        keptlen = rootlen;
  178|    326|        memcpy(path, rootpath, rootlen);
  179|       |
  180|       |        /* Always '/' terminate the given root path
  181|       |         */
  182|    326|        if (keptlen && path[keptlen - 1] != '/') {
  ------------------
  |  Branch (182:13): [True: 326, False: 0]
  |  Branch (182:24): [True: 0, False: 326]
  ------------------
  183|      0|            path[keptlen++] = '/';
  184|      0|        }
  185|    326|        pathlen = keptlen;
  186|    326|    }
  187|       |
  188|    652|    while (*addpath) {
  ------------------
  |  Branch (188:12): [True: 326, False: 326]
  ------------------
  189|       |        /* Parse each segment, find the closing '/'
  190|       |         */
  191|    326|        const char *next = addpath;
  192|  3.91k|        while (*next && (*next != '/')) {
  ------------------
  |  Branch (192:16): [True: 3.58k, False: 326]
  |  Branch (192:25): [True: 3.58k, False: 0]
  ------------------
  193|  3.58k|            ++next;
  194|  3.58k|        }
  195|    326|        seglen = next - addpath;
  196|       |
  197|    326|        if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) {
  ------------------
  |  Branch (197:13): [True: 0, False: 326]
  |  Branch (197:29): [True: 0, False: 326]
  |  Branch (197:44): [True: 0, False: 0]
  ------------------
  198|       |            /* noop segment (/ or ./) so skip it
  199|       |             */
  200|      0|        }
  201|    326|        else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') {
  ------------------
  |  Branch (201:18): [True: 0, False: 326]
  |  Branch (201:33): [True: 0, False: 0]
  |  Branch (201:54): [True: 0, False: 0]
  ------------------
  202|       |            /* backpath (../) */
  203|      0|            if (pathlen == 1 && path[0] == '/') {
  ------------------
  |  Branch (203:17): [True: 0, False: 0]
  |  Branch (203:33): [True: 0, False: 0]
  ------------------
  204|       |                /* Attempt to move above root.  Always die if the
  205|       |                 * APR_FILEPATH_SECUREROOTTEST flag is specified.
  206|       |                 */
  207|      0|                if (flags & APR_FILEPATH_SECUREROOTTEST) {
  ------------------
  |  |  290|      0|#define APR_FILEPATH_SECUREROOTTEST 0x02
  ------------------
  |  Branch (207:21): [True: 0, False: 0]
  ------------------
  208|      0|                    return APR_EABOVEROOT;
  ------------------
  |  |  330|      0|#define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  209|      0|                }
  210|       |
  211|       |                /* Otherwise this is simply a noop, above root is root.
  212|       |                 * Flag that rootpath was entirely replaced.
  213|       |                 */
  214|      0|                keptlen = 0;
  215|      0|            }
  216|      0|            else if (pathlen == 0
  ------------------
  |  Branch (216:22): [True: 0, False: 0]
  ------------------
  217|      0|                     || (pathlen == 3
  ------------------
  |  Branch (217:26): [True: 0, False: 0]
  ------------------
  218|      0|                         && !memcmp(path + pathlen - 3, "../", 3))
  ------------------
  |  Branch (218:29): [True: 0, False: 0]
  ------------------
  219|      0|                     || (pathlen  > 3
  ------------------
  |  Branch (219:26): [True: 0, False: 0]
  ------------------
  220|      0|                         && !memcmp(path + pathlen - 4, "/../", 4))) {
  ------------------
  |  Branch (220:29): [True: 0, False: 0]
  ------------------
  221|       |                /* Path is already backpathed or empty, if the
  222|       |                 * APR_FILEPATH_SECUREROOTTEST.was given die now.
  223|       |                 */
  224|      0|                if (flags & APR_FILEPATH_SECUREROOTTEST) {
  ------------------
  |  |  290|      0|#define APR_FILEPATH_SECUREROOTTEST 0x02
  ------------------
  |  Branch (224:21): [True: 0, False: 0]
  ------------------
  225|      0|                    return APR_EABOVEROOT;
  ------------------
  |  |  330|      0|#define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  226|      0|                }
  227|       |
  228|       |                /* Otherwise append another backpath, including
  229|       |                 * trailing slash if present.
  230|       |                 */
  231|      0|                memcpy(path + pathlen, "../", *next ? 3 : 2);
  ------------------
  |  Branch (231:47): [True: 0, False: 0]
  ------------------
  232|      0|                pathlen += *next ? 3 : 2;
  ------------------
  |  Branch (232:28): [True: 0, False: 0]
  ------------------
  233|      0|            }
  234|      0|            else {
  235|       |                /* otherwise crop the prior segment
  236|       |                 */
  237|      0|                do {
  238|      0|                    --pathlen;
  239|      0|                } while (pathlen && path[pathlen - 1] != '/');
  ------------------
  |  Branch (239:26): [True: 0, False: 0]
  |  Branch (239:37): [True: 0, False: 0]
  ------------------
  240|      0|            }
  241|       |
  242|       |            /* Now test if we are above where we started and back up
  243|       |             * the keptlen offset to reflect the added/altered path.
  244|       |             */
  245|      0|            if (pathlen < keptlen) {
  ------------------
  |  Branch (245:17): [True: 0, False: 0]
  ------------------
  246|      0|                if (flags & APR_FILEPATH_SECUREROOTTEST) {
  ------------------
  |  |  290|      0|#define APR_FILEPATH_SECUREROOTTEST 0x02
  ------------------
  |  Branch (246:21): [True: 0, False: 0]
  ------------------
  247|      0|                    return APR_EABOVEROOT;
  ------------------
  |  |  330|      0|#define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  248|      0|                }
  249|      0|                keptlen = pathlen;
  250|      0|            }
  251|      0|        }
  252|    326|        else {
  253|       |            /* An actual segment, append it to the destination path
  254|       |             */
  255|    326|            if (*next) {
  ------------------
  |  Branch (255:17): [True: 0, False: 326]
  ------------------
  256|      0|                seglen++;
  257|      0|            }
  258|    326|            memcpy(path + pathlen, addpath, seglen);
  259|    326|            pathlen += seglen;
  260|    326|        }
  261|       |
  262|       |        /* Skip over trailing slash to the next segment
  263|       |         */
  264|    326|        if (*next) {
  ------------------
  |  Branch (264:13): [True: 0, False: 326]
  ------------------
  265|      0|            ++next;
  266|      0|        }
  267|       |
  268|    326|        addpath = next;
  269|    326|    }
  270|    326|    path[pathlen] = '\0';
  271|       |
  272|       |    /* keptlen will be the rootlen unless the addpath contained
  273|       |     * backpath elements.  If so, and APR_FILEPATH_NOTABOVEROOT
  274|       |     * is specified (APR_FILEPATH_SECUREROOTTEST was caught above),
  275|       |     * compare the original root to assure the result path is
  276|       |     * still within given root path.
  277|       |     */
  278|    326|    if ((flags & APR_FILEPATH_NOTABOVEROOT) && keptlen < rootlen) {
  ------------------
  |  |  287|    326|#define APR_FILEPATH_NOTABOVEROOT   0x01
  ------------------
  |  Branch (278:9): [True: 0, False: 326]
  |  Branch (278:48): [True: 0, False: 0]
  ------------------
  279|      0|        if (strncmp(rootpath, path, rootlen)) {
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|            return APR_EABOVEROOT;
  ------------------
  |  |  330|      0|#define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  281|      0|        }
  282|      0|        if (rootpath[rootlen - 1] != '/'
  ------------------
  |  Branch (282:13): [True: 0, False: 0]
  ------------------
  283|      0|            && path[rootlen] && path[rootlen] != '/') {
  ------------------
  |  Branch (283:16): [True: 0, False: 0]
  |  Branch (283:33): [True: 0, False: 0]
  ------------------
  284|      0|            return APR_EABOVEROOT;
  ------------------
  |  |  330|      0|#define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
  |  |  ------------------
  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
  285|      0|        }
  286|      0|    }
  287|       |
  288|    326|    *newpath = path;
  289|    326|    return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  290|    326|}

apr_file_mktemp:
  187|    326|{
  188|    326|#ifdef HAVE_MKSTEMP
  189|    326|    int fd;
  190|    326|#endif
  191|    326|    flags = (!flags) ? APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL |
  ------------------
  |  |   56|      0|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  ------------------
                  flags = (!flags) ? APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL |
  ------------------
  |  |   54|      0|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
                  flags = (!flags) ? APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL |
  ------------------
  |  |   55|      0|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  ------------------
                  flags = (!flags) ? APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL |
  ------------------
  |  |   63|      0|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  ------------------
  |  Branch (191:13): [True: 0, False: 326]
  ------------------
  192|    326|                       APR_FOPEN_DELONCLOSE : flags;
  ------------------
  |  |   66|      0|#define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
  ------------------
  193|       |#ifndef HAVE_MKSTEMP
  194|       |    return gettemp(template, fp, flags, p);
  195|       |#else
  196|       |
  197|    326|    fd = wrap_mkostemp(template,
  ------------------
  |  |  179|    652|#define wrap_mkostemp(t, f) mkostemp(t, (f))
  |  |  ------------------
  |  |  |  Branch (179:42): [True: 0, False: 326]
  |  |  ------------------
  ------------------
  198|    326|                       (flags & APR_FOPEN_NOCLEANUP) ? 0 : O_CLOEXEC);
  199|    326|    if (fd == -1) {
  ------------------
  |  Branch (199:9): [True: 0, False: 326]
  ------------------
  200|      0|        return errno;
  201|      0|    }
  202|       |    /* XXX: We must reset several flags values as passed-in, since
  203|       |     * mkstemp didn't subscribe to our preference flags.
  204|       |     *
  205|       |     * We either have to unset the flags, or fix up the fd and other
  206|       |     * xthread and inherit bits appropriately.  Since gettemp() above
  207|       |     * calls apr_file_open, our flags are respected in that code path.
  208|       |     */
  209|    326|    apr_os_file_put(fp, &fd, flags, p);
  210|    326|    (*fp)->fname = apr_pstrdup(p, template);
  211|       |
  212|    326|    if (!(flags & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|    326|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (212:9): [True: 326, False: 0]
  ------------------
  213|       |#if !defined(HAVE_MKOSTEMP64) && !defined(HAVE_MKOSTEMP)
  214|       |        int flags;
  215|       |
  216|       |        if ((flags = fcntl(fd, F_GETFD)) == -1)
  217|       |            return errno;
  218|       |
  219|       |        flags |= FD_CLOEXEC;
  220|       |        if (fcntl(fd, F_SETFD, flags) == -1)
  221|       |            return errno;
  222|       |#endif
  223|       |
  224|    326|        apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
  225|    326|                                  apr_unix_file_cleanup,
  226|    326|                                  apr_unix_child_file_cleanup);
  227|       |
  228|       |        /* Clear APR_FOPEN_NOCLEANUP set by apr_os_file_put() */
  229|    326|        (*fp)->flags &= ~APR_FOPEN_NOCLEANUP;
  ------------------
  |  |   74|    326|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  230|    326|     }
  231|    326|#endif
  232|    326|    return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  233|    326|}

apr_unix_file_cleanup:
   73|    326|{
   74|    326|    apr_file_t *file = thefile;
   75|    326|    apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
                  apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
   76|       |
   77|    326|    if (file->buffered) {
  ------------------
  |  Branch (77:9): [True: 0, False: 326]
  ------------------
   78|      0|        flush_rv = apr_file_flush(file);
   79|      0|    }
   80|       |
   81|    326|    rv = file_cleanup(file, 0);
   82|       |
   83|    326|    return rv != APR_SUCCESS ? rv : flush_rv;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (83:12): [True: 0, False: 326]
  ------------------
   84|    326|}
apr_file_remove:
  285|    326|{
  286|    326|    if (unlink(path) == 0) {
  ------------------
  |  Branch (286:9): [True: 326, False: 0]
  ------------------
  287|    326|        return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  288|    326|    }
  289|      0|    else {
  290|      0|        return errno;
  291|      0|    }
  292|    326|}
apr_os_file_put:
  314|    326|{
  315|    326|    int *dafile = thefile;
  316|       |
  317|    326|    (*file) = apr_pcalloc(pool, sizeof(apr_file_t));
  ------------------
  |  |  454|    326|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    326|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    326|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    326|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|    326|    (*file)->pool = pool;
  319|    326|    (*file)->eof_hit = 0;
  320|    326|    (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */
  321|    326|    (*file)->timeout = -1;
  322|    326|    (*file)->ungetchar = -1; /* no char avail */
  323|    326|    (*file)->filedes = *dafile;
  324|    326|    (*file)->flags = flags | APR_FOPEN_NOCLEANUP;
  ------------------
  |  |   74|    326|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  325|    326|    (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0;
  ------------------
  |  |   65|    326|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
  326|       |
  327|       |#ifndef WAITIO_USES_POLL
  328|       |    /* Start out with no pollset.  apr_wait_for_io_or_timeout() will
  329|       |     * initialize the pollset if needed.
  330|       |     */
  331|       |    (*file)->pollset = NULL;
  332|       |#endif
  333|       |
  334|    326|    if ((*file)->buffered) {
  ------------------
  |  Branch (334:9): [True: 0, False: 326]
  ------------------
  335|      0|        (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
  ------------------
  |  |  425|      0|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  336|      0|        (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
  ------------------
  |  |   91|      0|#define APR_FILE_DEFAULT_BUFSIZE 4096
  ------------------
  337|      0|#if APR_HAS_THREADS
  338|      0|        if ((*file)->flags & APR_FOPEN_XTHREAD) {
  ------------------
  |  |   67|      0|#define APR_FOPEN_XTHREAD    0x00200  /**< Platform dependent tag to open
  ------------------
  |  Branch (338:13): [True: 0, False: 0]
  ------------------
  339|      0|            apr_status_t rv;
  340|      0|            rv = apr_thread_mutex_create(&((*file)->thlock),
  341|      0|                                         APR_THREAD_MUTEX_DEFAULT, pool);
  ------------------
  |  |   43|      0|#define APR_THREAD_MUTEX_DEFAULT  0x0   /**< platform-optimal lock behavior */
  ------------------
  342|      0|            if (rv) {
  ------------------
  |  Branch (342:17): [True: 0, False: 0]
  ------------------
  343|      0|                return rv;
  344|      0|            }
  345|      0|        }
  346|      0|#endif
  347|      0|    }
  348|    326|    return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  349|    326|}
open.c:file_cleanup:
   31|    326|{
   32|    326|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
   33|    326|    int fd = file->filedes;
   34|       |
   35|       |    /* Set file descriptor to -1 before close(), so that there is no
   36|       |     * chance of returning an already closed FD from apr_os_file_get().
   37|       |     */
   38|    326|    file->filedes = -1;
   39|       |
   40|    326|    if (close(fd) == 0) {
  ------------------
  |  Branch (40:9): [True: 326, False: 0]
  ------------------
   41|       |        /* Only the parent process should delete the file! */
   42|    326|        if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) {
  ------------------
  |  |   66|    326|#define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
  ------------------
  |  Branch (42:13): [True: 326, False: 0]
  |  Branch (42:26): [True: 0, False: 326]
  ------------------
   43|      0|            unlink(file->fname);
   44|      0|        }
   45|    326|#if APR_HAS_THREADS
   46|    326|        if (file->thlock) {
  ------------------
  |  Branch (46:13): [True: 0, False: 326]
  ------------------
   47|      0|            rv = apr_thread_mutex_destroy(file->thlock);
   48|      0|        }
   49|    326|#endif
   50|    326|    }
   51|      0|    else {
   52|       |        /* Restore, close() was not successful. */
   53|      0|        file->filedes = fd;
   54|       |
   55|       |        /* Are there any error conditions other than EINTR or EBADF? */
   56|      0|        rv = errno;
   57|      0|    }
   58|       |#ifndef WAITIO_USES_POLL
   59|       |    if (file->pollset != NULL) {
   60|       |        apr_status_t pollset_rv = apr_pollset_destroy(file->pollset);
   61|       |        /* If the file close failed, return its error value,
   62|       |         * not apr_pollset_destroy()'s.
   63|       |         */
   64|       |        if (rv == APR_SUCCESS) {
   65|       |            rv = pollset_rv;
   66|       |        }
   67|       |    }
   68|       |#endif /* !WAITIO_USES_POLL */
   69|    326|    return rv;
   70|    326|}

apr_file_writev:
  313|    326|{
  314|    326|#ifdef HAVE_WRITEV
  315|    326|    apr_status_t rv;
  316|    326|    apr_ssize_t bytes;
  317|       |
  318|    326|    if (thefile->buffered) {
  ------------------
  |  Branch (318:9): [True: 0, False: 326]
  ------------------
  319|      0|        file_lock(thefile);
  ------------------
  |  |  133|      0|#define file_lock(f)   do { \
  |  |  134|      0|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (134:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|      0|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  136|      0|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (136:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  320|       |
  321|      0|        rv = apr_file_flush_locked(thefile);
  322|      0|        if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (322:13): [True: 0, False: 0]
  ------------------
  323|      0|            file_unlock(thefile);
  ------------------
  |  |  137|      0|#define file_unlock(f) do { \
  |  |  138|      0|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (138:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  140|      0|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (140:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  324|      0|            return rv;
  325|      0|        }
  326|      0|        if (thefile->direction == 0) {
  ------------------
  |  Branch (326:13): [True: 0, False: 0]
  ------------------
  327|       |            /* Position file pointer for writing at the offset we are
  328|       |             * logically reading from
  329|       |             */
  330|      0|            apr_int64_t offset = thefile->filePtr - thefile->dataRead +
  331|      0|                                 thefile->bufpos;
  332|      0|            if (offset != thefile->filePtr) {
  ------------------
  |  Branch (332:17): [True: 0, False: 0]
  ------------------
  333|      0|                thefile->filePtr = lseek(thefile->filedes, offset, SEEK_SET);
  334|      0|                if (thefile->filePtr == -1) rv = errno;
  ------------------
  |  Branch (334:21): [True: 0, False: 0]
  ------------------
  335|      0|            }
  336|      0|            thefile->bufpos = thefile->dataRead = 0;
  337|      0|        }
  338|       |
  339|      0|        file_unlock(thefile);
  ------------------
  |  |  137|      0|#define file_unlock(f) do { \
  |  |  138|      0|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (138:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  140|      0|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (140:33): [Folded - Ignored]
  |  |  ------------------
  ------------------
  340|      0|        if (rv) return rv;
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|    }
  342|       |
  343|    326|    rv = file_rotating_check(thefile);
  344|    326|    if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  |  Branch (344:9): [True: 0, False: 326]
  ------------------
  345|      0|        return rv;
  346|      0|    }
  347|       |
  348|    326|    if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
  ------------------
  |  Branch (348:9): [True: 0, False: 326]
  ------------------
  349|      0|        *nbytes = 0;
  350|      0|        rv = errno;
  351|      0|    }
  352|    326|    else {
  353|    326|        *nbytes = bytes;
  354|    326|        rv = APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  355|    326|    }
  356|    326|    return rv;
  357|       |#else
  358|       |    /**
  359|       |     * The problem with trying to output the entire iovec is that we cannot
  360|       |     * maintain the behaviour that a real writev would have.  If we iterate
  361|       |     * over the iovec one at a time, we lose the atomic properties of
  362|       |     * writev().  The other option is to combine the entire iovec into one
  363|       |     * buffer that we could then send in one call to write().  This is not
  364|       |     * reasonable since we do not know how much data an iovec could contain.
  365|       |     *
  366|       |     * The only reasonable option, that maintains the semantics of a real
  367|       |     * writev(), is to only write the first iovec.  Callers of file_writev()
  368|       |     * must deal with partial writes as they normally would. If you want to
  369|       |     * ensure an entire iovec is written, use apr_file_writev_full().
  370|       |     */
  371|       |
  372|       |    *nbytes = vec[0].iov_len;
  373|       |    return apr_file_write(thefile, vec[0].iov_base, nbytes);
  374|       |#endif
  375|    326|}
readwrite.c:file_rotating_check:
  201|    326|{
  202|    326|    if (thefile->rotating && thefile->rotating->manual == 0) {
  ------------------
  |  Branch (202:9): [True: 0, False: 326]
  |  Branch (202:30): [True: 0, False: 0]
  ------------------
  203|      0|        apr_time_t now = apr_time_sec(apr_time_now());
  ------------------
  |  |   63|      0|#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|      0|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|      0|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|      0|        return do_rotating_check(thefile, now);
  205|      0|    }
  206|    326|    return APR_SUCCESS;
  ------------------
  |  |  225|    326|#define APR_SUCCESS 0
  ------------------
  207|    326|}

apr_thread_mutex_create:
   40|  1.07k|{
   41|  1.07k|    apr_thread_mutex_t *new_mutex;
   42|  1.07k|    apr_status_t rv;
   43|       |
   44|       |#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE
   45|       |    if (flags & APR_THREAD_MUTEX_NESTED) {
   46|       |        return APR_ENOTIMPL;
   47|       |    }
   48|       |#endif
   49|       |
   50|  1.07k|    new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
  ------------------
  |  |  454|  1.07k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.07k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.07k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.07k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|  1.07k|    new_mutex->pool = pool;
   52|       |
   53|  1.07k|#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE
   54|  1.07k|    if (flags & APR_THREAD_MUTEX_NESTED) {
  ------------------
  |  |   44|  1.07k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
  |  Branch (54:9): [True: 1.07k, False: 0]
  ------------------
   55|  1.07k|        pthread_mutexattr_t mattr;
   56|       |
   57|  1.07k|        rv = pthread_mutexattr_init(&mattr);
   58|  1.07k|        if (rv) return rv;
  ------------------
  |  Branch (58:13): [True: 0, False: 1.07k]
  ------------------
   59|       |
   60|  1.07k|        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
   61|  1.07k|        if (rv) {
  ------------------
  |  Branch (61:13): [True: 0, False: 1.07k]
  ------------------
   62|      0|            pthread_mutexattr_destroy(&mattr);
   63|      0|            return rv;
   64|      0|        }
   65|       |
   66|  1.07k|        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   67|       |
   68|  1.07k|        pthread_mutexattr_destroy(&mattr);
   69|  1.07k|    } else
   70|      0|#endif
   71|      0|    {
   72|       |#if defined(APR_THREAD_DEBUG)
   73|       |        pthread_mutexattr_t mattr;
   74|       |
   75|       |        rv = pthread_mutexattr_init(&mattr);
   76|       |        if (rv) return rv;
   77|       |
   78|       |        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ERRORCHECK);
   79|       |        if (rv) {
   80|       |            pthread_mutexattr_destroy(&mattr);
   81|       |            return rv;
   82|       |        }
   83|       |
   84|       |        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   85|       |
   86|       |        pthread_mutexattr_destroy(&mattr);
   87|       |#else
   88|      0|        rv = pthread_mutex_init(&new_mutex->mutex, NULL);
   89|      0|#endif
   90|      0|    }
   91|       |
   92|  1.07k|    if (rv) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1.07k]
  ------------------
   93|       |#ifdef HAVE_ZOS_PTHREADS
   94|       |        rv = errno;
   95|       |#endif
   96|      0|        return rv;
   97|      0|    }
   98|       |
   99|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  100|       |    if (flags & APR_THREAD_MUTEX_TIMED) {
  101|       |        rv = apr_thread_cond_create(&new_mutex->cond, pool);
  102|       |        if (rv) {
  103|       |#ifdef HAVE_ZOS_PTHREADS
  104|       |            rv = errno;
  105|       |#endif
  106|       |            pthread_mutex_destroy(&new_mutex->mutex);
  107|       |            return rv;
  108|       |        }
  109|       |    }
  110|       |#endif
  111|       |
  112|  1.07k|    apr_pool_cleanup_register(new_mutex->pool,
  113|  1.07k|                              new_mutex, thread_mutex_cleanup,
  114|  1.07k|                              apr_pool_cleanup_null);
  115|       |
  116|  1.07k|    *mutex = new_mutex;
  117|  1.07k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
  118|  1.07k|}
apr_thread_mutex_lock:
  121|  1.07k|{
  122|  1.07k|    apr_status_t rv;
  123|       |
  124|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  125|       |    if (mutex->cond) {
  126|       |        apr_status_t rv2;
  127|       |
  128|       |        rv = pthread_mutex_lock(&mutex->mutex);
  129|       |        if (rv) {
  130|       |#ifdef HAVE_ZOS_PTHREADS
  131|       |            rv = errno;
  132|       |#endif
  133|       |            return rv;
  134|       |        }
  135|       |
  136|       |        if (mutex->locked) {
  137|       |            mutex->num_waiters++;
  138|       |            rv = apr_thread_cond_wait(mutex->cond, mutex);
  139|       |            mutex->num_waiters--;
  140|       |        }
  141|       |        else {
  142|       |            mutex->locked = 1;
  143|       |        }
  144|       |
  145|       |        rv2 = pthread_mutex_unlock(&mutex->mutex);
  146|       |        if (rv2 && !rv) {
  147|       |#ifdef HAVE_ZOS_PTHREADS
  148|       |            rv = errno;
  149|       |#else
  150|       |            rv = rv2;
  151|       |#endif
  152|       |        }
  153|       |
  154|       |        return rv;
  155|       |    }
  156|       |#endif
  157|       |
  158|  1.07k|    rv = pthread_mutex_lock(&mutex->mutex);
  159|       |#ifdef HAVE_ZOS_PTHREADS
  160|       |    if (rv) {
  161|       |        rv = errno;
  162|       |    }
  163|       |#endif
  164|       |
  165|  1.07k|    return rv;
  166|  1.07k|}
apr_thread_mutex_unlock:
  302|  1.07k|{
  303|  1.07k|    apr_status_t status;
  304|       |
  305|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  306|       |    if (mutex->cond) {
  307|       |        status = pthread_mutex_lock(&mutex->mutex);
  308|       |        if (status) {
  309|       |#ifdef HAVE_ZOS_PTHREADS
  310|       |            status = errno;
  311|       |#endif
  312|       |            return status;
  313|       |        }
  314|       |
  315|       |        if (!mutex->locked) {
  316|       |            status = APR_EINVAL;
  317|       |        }
  318|       |        else if (mutex->num_waiters) {
  319|       |            status = apr_thread_cond_signal(mutex->cond);
  320|       |        }
  321|       |        if (status) {
  322|       |            pthread_mutex_unlock(&mutex->mutex);
  323|       |            return status;
  324|       |        }
  325|       |
  326|       |        mutex->locked = 0;
  327|       |    }
  328|       |#endif
  329|       |
  330|  1.07k|    status = pthread_mutex_unlock(&mutex->mutex);
  331|       |#ifdef HAVE_ZOS_PTHREADS
  332|       |    if (status) {
  333|       |        status = errno;
  334|       |    }
  335|       |#endif
  336|       |
  337|  1.07k|    return status;
  338|  1.07k|}
thread_mutex.c:thread_mutex_cleanup:
   24|  1.07k|{
   25|  1.07k|    apr_thread_mutex_t *mutex = data;
   26|  1.07k|    apr_status_t rv;
   27|       |
   28|  1.07k|    rv = pthread_mutex_destroy(&mutex->mutex);
   29|       |#ifdef HAVE_ZOS_PTHREADS
   30|       |    if (rv) {
   31|       |        rv = errno;
   32|       |    }
   33|       |#endif
   34|  1.07k|    return rv;
   35|  1.07k|}

apr_allocator_create:
  173|  1.07k|{
  174|  1.07k|    apr_allocator_t *new_allocator;
  175|       |
  176|  1.07k|    *allocator = NULL;
  177|       |
  178|  1.07k|    if ((new_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL)
  ------------------
  |  |  147|  1.07k|#define SIZEOF_ALLOCATOR_T  APR_ALIGN_DEFAULT(sizeof(apr_allocator_t))
  |  |  ------------------
  |  |  |  |  150|  1.07k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.07k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (178:9): [True: 0, False: 1.07k]
  ------------------
  179|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  180|       |
  181|  1.07k|    memset(new_allocator, 0, SIZEOF_ALLOCATOR_T);
  ------------------
  |  |  147|  1.07k|#define SIZEOF_ALLOCATOR_T  APR_ALIGN_DEFAULT(sizeof(apr_allocator_t))
  |  |  ------------------
  |  |  |  |  150|  1.07k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.07k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.07k|    new_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
  ------------------
  |  |   67|  1.07k|#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
  ------------------
  183|       |
  184|  1.07k|    *allocator = new_allocator;
  185|       |
  186|  1.07k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
  187|  1.07k|}
apr_allocator_destroy:
  190|  1.07k|{
  191|  1.07k|    apr_size_t index;
  192|  1.07k|    apr_memnode_t *node, **ref;
  193|       |
  194|  23.6k|    for (index = 0; index <= MAX_INDEX; index++) {
  ------------------
  |  |   70|  23.6k|#define MAX_INDEX   20
  ------------------
  |  Branch (194:21): [True: 22.5k, False: 1.07k]
  ------------------
  195|  22.5k|        ref = &allocator->free[index];
  196|  24.7k|        while ((node = *ref) != NULL) {
  ------------------
  |  Branch (196:16): [True: 2.14k, False: 22.5k]
  ------------------
  197|  2.14k|            *ref = node->next;
  198|       |#if APR_ALLOCATOR_USES_MMAP
  199|       |            munmap((char *)node - GUARDPAGE_SIZE,
  200|       |                   2 * GUARDPAGE_SIZE + ((node->index+1) << BOUNDARY_INDEX));
  201|       |#else
  202|  2.14k|            free(node);
  203|  2.14k|#endif
  204|  2.14k|        }
  205|  22.5k|    }
  206|       |
  207|  1.07k|    free(allocator);
  208|  1.07k|}
apr_allocator_alloc:
  496|  2.14k|{
  497|  2.14k|    return allocator_alloc(allocator, size);
  498|  2.14k|}
apr_allocator_free:
  502|  2.14k|{
  503|  2.14k|    allocator_free(allocator, node);
  504|  2.14k|}
apr_pool_initialize:
 1674|  1.07k|{
 1675|  1.07k|    apr_status_t rv;
 1676|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1677|       |    char *logpath;
 1678|       |    apr_file_t *debug_log = NULL;
 1679|       |#endif
 1680|       |
 1681|  1.07k|    if (apr_pools_initialized++)
  ------------------
  |  Branch (1681:9): [True: 0, False: 1.07k]
  ------------------
 1682|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1683|       |
 1684|  1.07k|#if defined(_SC_PAGESIZE)
 1685|  1.07k|    boundary_size = sysconf(_SC_PAGESIZE);
 1686|       |#elif defined(WIN32)
 1687|       |    {
 1688|       |        SYSTEM_INFO si;
 1689|       |        GetSystemInfo(&si);
 1690|       |        boundary_size = si.dwPageSize;
 1691|       |    }
 1692|       |#endif
 1693|  1.07k|    boundary_index = 12;
 1694|  1.07k|    while ( (1 << boundary_index) < boundary_size)
  ------------------
  |  Branch (1694:13): [True: 0, False: 1.07k]
  ------------------
 1695|      0|        boundary_index++;
 1696|  1.07k|    boundary_size = (1 << boundary_index);
 1697|       |
 1698|       |    /* Since the debug code works a bit differently then the
 1699|       |     * regular pools code, we ask for a lock here.  The regular
 1700|       |     * pools code has got this lock embedded in the global
 1701|       |     * allocator, a concept unknown to debug mode.
 1702|       |     */
 1703|  1.07k|    if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL,
  ------------------
  |  |  247|  1.07k|    apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
  |  |  248|  1.07k|                             APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.07k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.07k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.07k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1703:9): [True: 0, False: 1.07k]
  ------------------
 1704|  1.07k|                                 NULL)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
 1705|      0|        return rv;
 1706|      0|    }
 1707|       |
 1708|  1.07k|    apr_pool_tag(global_pool, "APR global pool");
 1709|       |
 1710|  1.07k|    apr_pools_initialized = 1;
 1711|       |
 1712|       |    /* This has to happen here because mutexes might be backed by
 1713|       |     * atomics.  It used to be snug and safe in apr_initialize().
 1714|       |     */
 1715|  1.07k|    if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1715:9): [True: 0, False: 1.07k]
  ------------------
 1716|      0|        return rv;
 1717|      0|    }
 1718|       |
 1719|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1720|       |    rv = apr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool);
 1721|       |
 1722|       |    /* Don't pass file_stderr directly to apr_file_open() here, since
 1723|       |     * apr_file_open() can call back to apr_pool_log_event() and that
 1724|       |     * may attempt to use then then non-NULL but partially set up file
 1725|       |     * object. */
 1726|       |    if (rv == APR_SUCCESS) {
 1727|       |        apr_file_open(&debug_log, logpath,
 1728|       |                      APR_FOPEN_APPEND|APR_FOPEN_WRITE|APR_FOPEN_CREATE,
 1729|       |                      APR_FPROT_OS_DEFAULT, global_pool);
 1730|       |    }
 1731|       |    else {
 1732|       |        apr_file_open_stderr(&debug_log, global_pool);
 1733|       |    }
 1734|       |
 1735|       |    /* debug_log is now a file handle. */
 1736|       |    file_stderr = debug_log;
 1737|       |
 1738|       |    if (file_stderr) {
 1739|       |        apr_file_printf(file_stderr,
 1740|       |            "POOL DEBUG: [PID"
 1741|       |#if APR_HAS_THREADS
 1742|       |            "/TID"
 1743|       |#endif /* APR_HAS_THREADS */
 1744|       |            "] ACTION  (SIZE      /POOL SIZE /TOTAL SIZE) "
 1745|       |            "POOL       \"TAG\" <__FILE__:__LINE__> PARENT     (ALLOCS/TOTAL ALLOCS/CLEARS)\n");
 1746|       |
 1747|       |        apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0);
 1748|       |
 1749|       |        /* Add a cleanup handler that sets the debug log file handle
 1750|       |         * to NULL, otherwise we'll try to log the global pool
 1751|       |         * destruction event with predictably disastrous results. */
 1752|       |        apr_pool_cleanup_register(global_pool, NULL,
 1753|       |                                  apr_pool_cleanup_file_stderr,
 1754|       |                                  apr_pool_cleanup_null);
 1755|       |    }
 1756|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1757|       |
 1758|  1.07k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
 1759|  1.07k|}
apr_pool_terminate:
 1762|  1.07k|{
 1763|  1.07k|    if (!apr_pools_initialized)
  ------------------
  |  Branch (1763:9): [True: 0, False: 1.07k]
  ------------------
 1764|      0|        return;
 1765|       |
 1766|  1.07k|    if (--apr_pools_initialized)
  ------------------
  |  Branch (1766:9): [True: 0, False: 1.07k]
  ------------------
 1767|      0|        return;
 1768|       |
 1769|  1.07k|    apr_pool_destroy(global_pool); /* This will also destroy the mutex */
  ------------------
  |  |  388|  1.07k|    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.07k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.07k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.07k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1770|  1.07k|    global_pool = NULL;
 1771|       |
 1772|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1773|       |    file_stderr = NULL;
 1774|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1775|  1.07k|}
apr_palloc_debug:
 1823|  25.6k|{
 1824|  25.6k|    void *mem;
 1825|       |
 1826|  25.6k|    apr_pool_check_integrity(pool);
 1827|       |
 1828|  25.6k|    mem = pool_alloc(pool, size);
 1829|       |
 1830|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC)
 1831|       |    apr_pool_log_event(pool, "PALLOC", file_line, 1);
 1832|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */
 1833|       |
 1834|  25.6k|    return mem;
 1835|  25.6k|}
apr_pcalloc_debug:
 1839|  2.47k|{
 1840|  2.47k|    void *mem;
 1841|       |
 1842|  2.47k|    apr_pool_check_integrity(pool);
 1843|       |
 1844|  2.47k|    mem = pool_alloc(pool, size);
 1845|  2.47k|    memset(mem, 0, size);
 1846|       |
 1847|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC)
 1848|       |    apr_pool_log_event(pool, "PCALLOC", file_line, 1);
 1849|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */
 1850|       |
 1851|  2.47k|    return mem;
 1852|  2.47k|}
apr_pool_destroy_debug:
 1985|  1.07k|{
 1986|  1.07k|#if APR_HAS_THREADS
 1987|  1.07k|    apr_thread_mutex_t *mutex;
 1988|  1.07k|#endif
 1989|       |
 1990|  1.07k|    apr_pool_check_lifetime(pool);
 1991|       |
 1992|  1.07k|    if (pool->joined) {
  ------------------
  |  Branch (1992:9): [True: 0, False: 1.07k]
  ------------------
 1993|       |        /* Joined pools must not be explicitly destroyed; the caller
 1994|       |         * has broken the guarantee. */
 1995|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1996|       |        apr_pool_log_event(pool, "LIFE",
 1997|       |                           __FILE__ ":apr_pool_destroy abort on joined", 0);
 1998|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1999|       |
 2000|      0|        abort();
 2001|      0|    }
 2002|       |
 2003|  1.07k|#if APR_HAS_THREADS
 2004|       |    /* Lock the parent mutex before destroying so that it's not accessed
 2005|       |     * concurrently by apr_pool_walk_tree.
 2006|       |     */
 2007|  1.07k|    mutex = parent_lock(pool);
 2008|  1.07k|#endif
 2009|       |
 2010|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 2011|       |    apr_pool_log_event(pool, "DESTROY", file_line, 1);
 2012|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 2013|       |
 2014|  1.07k|    pool_destroy_debug(pool, file_line);
 2015|       |
 2016|  1.07k|#if APR_HAS_THREADS
 2017|       |    /* Unlock the mutex we obtained above */
 2018|  1.07k|    parent_unlock(mutex);
 2019|  1.07k|#endif /* APR_HAS_THREADS */
 2020|  1.07k|}
apr_pool_create_ex_debug:
 2027|  2.14k|{
 2028|  2.14k|    apr_pool_t *pool;
 2029|       |
 2030|  2.14k|    *newpool = NULL;
 2031|       |
 2032|  2.14k|    if (!parent) {
  ------------------
  |  Branch (2032:9): [True: 2.14k, False: 0]
  ------------------
 2033|  2.14k|        parent = global_pool;
 2034|  2.14k|    }
 2035|      0|    else {
 2036|      0|       apr_pool_check_lifetime(parent);
 2037|       |
 2038|      0|       if (!allocator)
  ------------------
  |  Branch (2038:12): [True: 0, False: 0]
  ------------------
 2039|      0|           allocator = parent->allocator;
 2040|      0|    }
 2041|       |
 2042|  2.14k|    if (!abort_fn && parent)
  ------------------
  |  Branch (2042:9): [True: 2.14k, False: 0]
  |  Branch (2042:22): [True: 1.07k, False: 1.07k]
  ------------------
 2043|  1.07k|        abort_fn = parent->abort_fn;
 2044|       |
 2045|  2.14k|    if ((pool = malloc(SIZEOF_POOL_T)) == NULL) {
  ------------------
  |  |  618|  2.14k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  150|  2.14k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.14k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2045:9): [True: 0, False: 2.14k]
  ------------------
 2046|      0|        if (abort_fn)
  ------------------
  |  Branch (2046:13): [True: 0, False: 0]
  ------------------
 2047|      0|            abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2048|       |
 2049|      0|         return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2050|      0|    }
 2051|       |
 2052|  2.14k|    memset(pool, 0, SIZEOF_POOL_T);
  ------------------
  |  |  618|  2.14k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  150|  2.14k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.14k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2053|       |
 2054|  2.14k|    pool->allocator = allocator;
 2055|  2.14k|    pool->abort_fn = abort_fn;
 2056|  2.14k|    pool->tag = file_line;
 2057|  2.14k|    pool->file_line = file_line;
 2058|       |
 2059|  2.14k|#if APR_HAS_THREADS
 2060|  2.14k|    pool->owner = apr_os_thread_current();
 2061|  2.14k|#endif /* APR_HAS_THREADS */
 2062|       |#ifdef NETWARE
 2063|       |    pool->owner_proc = (apr_os_proc_t)getnlmhandle();
 2064|       |#endif /* defined(NETWARE) */
 2065|       |
 2066|  2.14k|#if APR_HAS_THREADS
 2067|  2.14k|    if (parent == NULL || parent->allocator != allocator) {
  ------------------
  |  Branch (2067:9): [True: 1.07k, False: 1.07k]
  |  Branch (2067:27): [True: 0, False: 1.07k]
  ------------------
 2068|  1.07k|        apr_status_t rv;
 2069|       |
 2070|       |        /* No matter what the creation flags say, always create
 2071|       |         * a lock.  Without it integrity_check and apr_pool_num_bytes
 2072|       |         * blow up (because they traverse pools child lists that
 2073|       |         * possibly belong to another thread, in combination with
 2074|       |         * the pool having no lock).  However, this might actually
 2075|       |         * hide problems like creating a child pool of a pool
 2076|       |         * belonging to another thread.
 2077|       |         */
 2078|  1.07k|        if ((rv = apr_thread_mutex_create(&pool->mutex,
  ------------------
  |  Branch (2078:13): [True: 0, False: 1.07k]
  ------------------
 2079|  1.07k|                APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |   44|  1.07k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
                              APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.07k|#define APR_SUCCESS 0
  ------------------
 2080|      0|            free(pool);
 2081|      0|            return rv;
 2082|      0|        }
 2083|  1.07k|    }
 2084|  1.07k|    else {
 2085|  1.07k|        pool->mutex = parent->mutex;
 2086|  1.07k|    }
 2087|  2.14k|#endif /* APR_HAS_THREADS */
 2088|       |
 2089|  2.14k|    if ((pool->parent = parent) != NULL) {
  ------------------
  |  Branch (2089:9): [True: 1.07k, False: 1.07k]
  ------------------
 2090|  1.07k|        pool_lock(parent);
 2091|       |
 2092|  1.07k|        if ((pool->sibling = parent->child) != NULL)
  ------------------
  |  Branch (2092:13): [True: 0, False: 1.07k]
  ------------------
 2093|      0|            pool->sibling->ref = &pool->sibling;
 2094|       |
 2095|  1.07k|        parent->child = pool;
 2096|  1.07k|        pool->ref = &parent->child;
 2097|       |
 2098|  1.07k|        pool_unlock(parent);
 2099|  1.07k|    }
 2100|  1.07k|    else {
 2101|  1.07k|        pool->sibling = NULL;
 2102|  1.07k|        pool->ref = NULL;
 2103|  1.07k|    }
 2104|       |
 2105|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 2106|       |    apr_pool_log_event(pool, "CREATE", file_line, 1);
 2107|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 2108|       |
 2109|  2.14k|    *newpool = pool;
 2110|       |
 2111|  2.14k|    return APR_SUCCESS;
  ------------------
  |  |  225|  2.14k|#define APR_SUCCESS 0
  ------------------
 2112|  2.14k|}
apr_pool_allocator_get:
 2409|  2.14k|{
 2410|  2.14k|    return pool->allocator;
 2411|  2.14k|}
apr_pool_tag:
 2440|  1.07k|{
 2441|  1.07k|    pool->tag = tag;
 2442|  1.07k|}
apr_pool_cleanup_register:
 2530|  7.28k|{
 2531|  7.28k|    cleanup_t *c = NULL;
 2532|       |
 2533|  7.28k|#if APR_POOL_DEBUG
 2534|  7.28k|    apr_pool_check_integrity(p);
 2535|  7.28k|#endif /* APR_POOL_DEBUG */
 2536|       |
 2537|  7.28k|    if (p != NULL) {
  ------------------
  |  Branch (2537:9): [True: 7.28k, False: 0]
  ------------------
 2538|  7.28k|        if (p->free_cleanups) {
  ------------------
  |  Branch (2538:13): [True: 0, False: 7.28k]
  ------------------
 2539|       |            /* reuse a cleanup structure */
 2540|      0|            c = p->free_cleanups;
 2541|      0|            p->free_cleanups = c->next;
 2542|  7.28k|        } else {
 2543|  7.28k|            c = apr_palloc(p, sizeof(cleanup_t));
  ------------------
  |  |  425|  7.28k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  7.28k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  7.28k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  7.28k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2544|  7.28k|        }
 2545|  7.28k|        c->data = data;
 2546|  7.28k|        c->plain_cleanup_fn = plain_cleanup_fn;
 2547|  7.28k|        c->child_cleanup_fn = child_cleanup_fn;
 2548|  7.28k|        c->next = p->cleanups;
 2549|  7.28k|        p->cleanups = c;
 2550|  7.28k|    }
 2551|       |
 2552|  7.28k|#if APR_POOL_DEBUG
 2553|  7.28k|    if (!c || !c->plain_cleanup_fn || !c->child_cleanup_fn) {
  ------------------
  |  Branch (2553:9): [True: 0, False: 7.28k]
  |  Branch (2553:15): [True: 0, False: 7.28k]
  |  Branch (2553:39): [True: 0, False: 7.28k]
  ------------------
 2554|      0|        abort();
 2555|      0|    }
 2556|  7.28k|#endif /* APR_POOL_DEBUG */
 2557|  7.28k|}
apr_pool_create_ex:
 2979|  1.07k|{
 2980|  1.07k|    return apr_pool_create_ex_debug(newpool, parent,
 2981|  1.07k|                                    abort_fn, allocator,
 2982|  1.07k|                                    "undefined");
 2983|  1.07k|}
apr_pools.c:allocator_lock:
  156|  2.14k|{
  157|  2.14k|#if APR_HAS_THREADS
  158|  2.14k|    if (allocator->mutex)
  ------------------
  |  Branch (158:9): [True: 0, False: 2.14k]
  ------------------
  159|      0|        apr_thread_mutex_lock(allocator->mutex);
  160|  2.14k|#endif /* APR_HAS_THREADS */
  161|  2.14k|}
apr_pools.c:allocator_unlock:
  165|  2.14k|{
  166|  2.14k|#if APR_HAS_THREADS
  167|  2.14k|    if (allocator->mutex)
  ------------------
  |  Branch (167:9): [True: 0, False: 2.14k]
  ------------------
  168|      0|        apr_thread_mutex_unlock(allocator->mutex);
  169|  2.14k|#endif /* APR_HAS_THREADS */
  170|  2.14k|}
apr_pools.c:allocator_align:
  255|  2.14k|{
  256|  2.14k|    apr_size_t size = in_size;
  257|       |
  258|       |    /* Round up the block size to the next boundary, but always
  259|       |     * allocate at least a certain size (MIN_ALLOC).
  260|       |     */
  261|  2.14k|    size = APR_ALIGN(size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE);
  ------------------
  |  |  147|  2.14k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  ------------------
  262|  2.14k|    if (size < in_size) {
  ------------------
  |  Branch (262:9): [True: 0, False: 2.14k]
  ------------------
  263|      0|        return 0;
  264|      0|    }
  265|  2.14k|    if (size < MIN_ALLOC) {
  ------------------
  |  |   73|  2.14k|#define MIN_ALLOC   (BOUNDARY_SIZE << min_order)
  |  |  ------------------
  |  |  |  |   82|  2.14k|#define BOUNDARY_SIZE   boundary_size
  |  |  ------------------
  ------------------
  |  Branch (265:9): [True: 0, False: 2.14k]
  ------------------
  266|      0|        size = MIN_ALLOC;
  ------------------
  |  |   73|      0|#define MIN_ALLOC   (BOUNDARY_SIZE << min_order)
  |  |  ------------------
  |  |  |  |   82|      0|#define BOUNDARY_SIZE   boundary_size
  |  |  ------------------
  ------------------
  267|      0|    }
  268|       |
  269|  2.14k|    return size;
  270|  2.14k|}
apr_pools.c:allocator_alloc:
  281|  2.14k|{
  282|  2.14k|    apr_memnode_t *node, **ref;
  283|  2.14k|    apr_size_t max_index, upper_index;
  284|  2.14k|    apr_size_t size, i, index;
  285|       |
  286|       |    /* Round up the block size to the next boundary, but always
  287|       |     * allocate at least a certain size (MIN_ALLOC).
  288|       |     */
  289|  2.14k|    size = allocator_align(in_size);
  290|  2.14k|    if (!size) {
  ------------------
  |  Branch (290:9): [True: 0, False: 2.14k]
  ------------------
  291|      0|        return NULL;
  292|      0|    }
  293|       |
  294|       |    /* Find the index for this node size by
  295|       |     * dividing its size by the boundary size
  296|       |     */
  297|  2.14k|    index = (size >> BOUNDARY_INDEX) - 1;
  ------------------
  |  |   81|  2.14k|#define BOUNDARY_INDEX  boundary_index
  ------------------
  298|       |
  299|  2.14k|    if (index > APR_UINT32_MAX) {
  ------------------
  |  |  449|  2.14k|#define APR_UINT32_MAX  UINT32_MAX
  ------------------
  |  Branch (299:9): [True: 0, False: 2.14k]
  ------------------
  300|      0|        return NULL;
  301|      0|    }
  302|       |
  303|       |    /* First see if there are any nodes in the area we know
  304|       |     * our node will fit into.
  305|       |     */
  306|  2.14k|    if (index <= allocator->max_index) {
  ------------------
  |  Branch (306:9): [True: 0, False: 2.14k]
  ------------------
  307|      0|        allocator_lock(allocator);
  308|       |
  309|       |        /* Walk the free list to see if there are
  310|       |         * any nodes on it of the requested size
  311|       |         *
  312|       |         * If there is no exact match, look for nodes
  313|       |         * of up to twice the requested size, so we
  314|       |         * won't unnecessarily allocate more memory
  315|       |         * nor waste too much of what we have.
  316|       |         *
  317|       |         * NOTE: an optimization would be to check
  318|       |         * allocator->free[index] first and if no
  319|       |         * node is present, directly use
  320|       |         * allocator->free[max_index].  This seems
  321|       |         * like overkill though and could cause
  322|       |         * memory waste.
  323|       |         */
  324|      0|        max_index = allocator->max_index;
  325|      0|        upper_index = 2 * index < max_index ? 2 * index : max_index;
  ------------------
  |  Branch (325:23): [True: 0, False: 0]
  ------------------
  326|      0|        ref = &allocator->free[index];
  327|      0|        i = index;
  328|      0|        while (*ref == NULL && i < upper_index) {
  ------------------
  |  Branch (328:16): [True: 0, False: 0]
  |  Branch (328:32): [True: 0, False: 0]
  ------------------
  329|      0|           ref++;
  330|      0|           i++;
  331|      0|        }
  332|       |
  333|      0|        if ((node = *ref) != NULL) {
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|       |            /* If we have found a node and it doesn't have any
  335|       |             * nodes waiting in line behind it _and_ we are on
  336|       |             * the highest available index, find the new highest
  337|       |             * available index
  338|       |             */
  339|      0|            if ((*ref = node->next) == NULL && i >= max_index) {
  ------------------
  |  Branch (339:17): [True: 0, False: 0]
  |  Branch (339:48): [True: 0, False: 0]
  ------------------
  340|      0|                do {
  341|      0|                    ref--;
  342|      0|                    max_index--;
  343|      0|                }
  344|      0|                while (*ref == NULL && max_index);
  ------------------
  |  Branch (344:24): [True: 0, False: 0]
  |  Branch (344:40): [True: 0, False: 0]
  ------------------
  345|       |
  346|      0|                allocator->max_index = max_index;
  347|      0|            }
  348|       |
  349|      0|            allocator->current_free_index += node->index + 1;
  350|      0|            if (allocator->current_free_index > allocator->max_free_index)
  ------------------
  |  Branch (350:17): [True: 0, False: 0]
  ------------------
  351|      0|                allocator->current_free_index = allocator->max_free_index;
  352|       |
  353|      0|            allocator_unlock(allocator);
  354|       |
  355|      0|            goto have_node;
  356|      0|        }
  357|       |
  358|      0|        allocator_unlock(allocator);
  359|      0|    }
  360|       |
  361|       |    /* If we found nothing, seek the sink (at index MAX_INDEX), if
  362|       |     * it is not empty.
  363|       |     */
  364|  2.14k|    else if (allocator->free[MAX_INDEX]) {
  ------------------
  |  |   70|  2.14k|#define MAX_INDEX   20
  ------------------
  |  Branch (364:14): [True: 0, False: 2.14k]
  ------------------
  365|      0|        allocator_lock(allocator);
  366|       |
  367|       |        /* Walk the free list to see if there are
  368|       |         * any nodes on it of the requested size
  369|       |         */
  370|      0|        ref = &allocator->free[MAX_INDEX];
  ------------------
  |  |   70|      0|#define MAX_INDEX   20
  ------------------
  371|      0|        while ((node = *ref) != NULL && index > node->index)
  ------------------
  |  Branch (371:16): [True: 0, False: 0]
  |  Branch (371:41): [True: 0, False: 0]
  ------------------
  372|      0|            ref = &node->next;
  373|       |
  374|      0|        if (node) {
  ------------------
  |  Branch (374:13): [True: 0, False: 0]
  ------------------
  375|      0|            *ref = node->next;
  376|       |
  377|      0|            allocator->current_free_index += node->index + 1;
  378|      0|            if (allocator->current_free_index > allocator->max_free_index)
  ------------------
  |  Branch (378:17): [True: 0, False: 0]
  ------------------
  379|      0|                allocator->current_free_index = allocator->max_free_index;
  380|       |
  381|      0|            allocator_unlock(allocator);
  382|       |
  383|      0|            goto have_node;
  384|      0|        }
  385|       |
  386|      0|        allocator_unlock(allocator);
  387|      0|    }
  388|       |
  389|       |    /* If we haven't got a suitable node, malloc a new one
  390|       |     * and initialize it.
  391|       |     */
  392|       |#if APR_ALLOCATOR_GUARD_PAGES
  393|       |    if ((node = mmap(NULL, size + 2 * GUARDPAGE_SIZE, PROT_NONE,
  394|       |                     MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED)
  395|       |#elif APR_ALLOCATOR_USES_MMAP
  396|       |    if ((node = mmap(NULL, size, PROT_READ|PROT_WRITE,
  397|       |                     MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED)
  398|       |#else
  399|  2.14k|    if ((node = malloc(size)) == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 2.14k]
  ------------------
  400|      0|#endif
  401|      0|        return NULL;
  402|       |
  403|       |#if APR_ALLOCATOR_GUARD_PAGES
  404|       |    node = (apr_memnode_t *)((char *)node + GUARDPAGE_SIZE);
  405|       |    if (mprotect(node, size, PROT_READ|PROT_WRITE) != 0) {
  406|       |        munmap((char *)node - GUARDPAGE_SIZE, size + 2 * GUARDPAGE_SIZE);
  407|       |        return NULL;
  408|       |    }
  409|       |#endif
  410|  2.14k|    node->index = (apr_uint32_t)index;
  411|  2.14k|    node->endp = (char *)node + size;
  412|       |
  413|  2.14k|have_node:
  414|  2.14k|    node->next = NULL;
  415|  2.14k|    node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
  ------------------
  |  |   64|  2.14k|#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
  |  |  ------------------
  |  |  |  |  150|  2.14k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.14k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  416|       |
  417|  2.14k|    APR_VALGRIND_UNDEFINED(node->first_avail, size - APR_MEMNODE_T_SIZE);
  418|       |
  419|  2.14k|    return node;
  420|  2.14k|}
apr_pools.c:allocator_free:
  424|  2.14k|{
  425|  2.14k|    apr_memnode_t *next, *freelist = NULL;
  426|  2.14k|    apr_size_t index, max_index;
  427|  2.14k|    apr_size_t max_free_index, current_free_index;
  428|       |
  429|  2.14k|    allocator_lock(allocator);
  430|       |
  431|  2.14k|    max_index = allocator->max_index;
  432|  2.14k|    max_free_index = allocator->max_free_index;
  433|  2.14k|    current_free_index = allocator->current_free_index;
  434|       |
  435|       |    /* Walk the list of submitted nodes and free them one by one,
  436|       |     * shoving them in the right 'size' buckets as we go.
  437|       |     */
  438|  2.14k|    do {
  439|  2.14k|        next = node->next;
  440|  2.14k|        index = node->index;
  441|       |
  442|  2.14k|        APR_VALGRIND_NOACCESS((char *)node + APR_MEMNODE_T_SIZE,
  443|  2.14k|                              (node->index+1) << BOUNDARY_INDEX);
  444|       |
  445|  2.14k|        if (max_free_index != APR_ALLOCATOR_MAX_FREE_UNLIMITED
  ------------------
  |  |   67|  4.29k|#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
  ------------------
  |  Branch (445:13): [True: 0, False: 2.14k]
  ------------------
  446|  2.14k|            && index + 1 > current_free_index) {
  ------------------
  |  Branch (446:16): [True: 0, False: 0]
  ------------------
  447|      0|            node->next = freelist;
  448|      0|            freelist = node;
  449|      0|        }
  450|  2.14k|        else if (index < MAX_INDEX) {
  ------------------
  |  |   70|  2.14k|#define MAX_INDEX   20
  ------------------
  |  Branch (450:18): [True: 2.14k, False: 0]
  ------------------
  451|       |            /* Add the node to the appropriate 'size' bucket.  Adjust
  452|       |             * the max_index when appropriate.
  453|       |             */
  454|  2.14k|            if ((node->next = allocator->free[index]) == NULL
  ------------------
  |  Branch (454:17): [True: 1.07k, False: 1.07k]
  ------------------
  455|  2.14k|                && index > max_index) {
  ------------------
  |  Branch (455:20): [True: 1.07k, False: 0]
  ------------------
  456|  1.07k|                max_index = index;
  457|  1.07k|            }
  458|  2.14k|            allocator->free[index] = node;
  459|  2.14k|            if (current_free_index >= index + 1)
  ------------------
  |  Branch (459:17): [True: 0, False: 2.14k]
  ------------------
  460|      0|                current_free_index -= index + 1;
  461|  2.14k|            else
  462|  2.14k|                current_free_index = 0;
  463|  2.14k|        }
  464|      0|        else {
  465|       |            /* This node is too large to keep in a specific size bucket,
  466|       |             * just add it to the sink (at index MAX_INDEX).
  467|       |             */
  468|      0|            node->next = allocator->free[MAX_INDEX];
  ------------------
  |  |   70|      0|#define MAX_INDEX   20
  ------------------
  469|      0|            allocator->free[MAX_INDEX] = node;
  ------------------
  |  |   70|      0|#define MAX_INDEX   20
  ------------------
  470|      0|            if (current_free_index >= index + 1)
  ------------------
  |  Branch (470:17): [True: 0, False: 0]
  ------------------
  471|      0|                current_free_index -= index + 1;
  472|      0|            else
  473|      0|                current_free_index = 0;
  474|      0|        }
  475|  2.14k|    } while ((node = next) != NULL);
  ------------------
  |  Branch (475:14): [True: 0, False: 2.14k]
  ------------------
  476|       |
  477|  2.14k|    allocator->max_index = max_index;
  478|  2.14k|    allocator->current_free_index = current_free_index;
  479|       |
  480|  2.14k|    allocator_unlock(allocator);
  481|       |
  482|  2.14k|    while (freelist != NULL) {
  ------------------
  |  Branch (482:12): [True: 0, False: 2.14k]
  ------------------
  483|      0|        node = freelist;
  484|      0|        freelist = node->next;
  485|       |#if APR_ALLOCATOR_USES_MMAP
  486|       |        munmap((char *)node - GUARDPAGE_SIZE,
  487|       |               2 * GUARDPAGE_SIZE + ((node->index+1) << BOUNDARY_INDEX));
  488|       |#else
  489|      0|        free(node);
  490|      0|#endif
  491|      0|    }
  492|  2.14k|}
apr_pools.c:apr_pool_check_integrity:
 1657|  35.3k|{
 1658|  35.3k|    apr_pool_check_lifetime(pool);
 1659|  35.3k|    apr_pool_check_owner(pool);
 1660|  35.3k|}
apr_pools.c:apr_pool_check_owner:
 1642|  37.5k|{
 1643|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER)
 1644|       |#if APR_HAS_THREADS
 1645|       |    if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) {
 1646|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1647|       |        apr_pool_log_event(pool, "THREAD",
 1648|       |                           __FILE__ ":apr_pool_integrity check [owner]", 0);
 1649|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1650|       |        abort();
 1651|       |    }
 1652|       |#endif /* APR_HAS_THREADS */
 1653|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) */
 1654|  37.5k|}
apr_pools.c:pool_alloc:
 1783|  28.0k|{
 1784|  28.0k|    debug_node_t *node;
 1785|  28.0k|    void *mem;
 1786|       |
 1787|  28.0k|    if ((mem = malloc(size)) == NULL) {
  ------------------
  |  Branch (1787:9): [True: 0, False: 28.0k]
  ------------------
 1788|      0|        if (pool->abort_fn)
  ------------------
  |  Branch (1788:13): [True: 0, False: 0]
  ------------------
 1789|      0|            pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 1790|       |
 1791|      0|        return NULL;
 1792|      0|    }
 1793|       |
 1794|  28.0k|    node = pool->nodes;
 1795|  28.0k|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (1795:9): [True: 2.14k, False: 25.9k]
  |  Branch (1795:25): [True: 6, False: 25.9k]
  ------------------
 1796|  2.15k|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|  2.15k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.15k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.15k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1796:13): [True: 0, False: 2.15k]
  ------------------
 1797|      0|            free(mem);
 1798|      0|            if (pool->abort_fn)
  ------------------
  |  Branch (1798:17): [True: 0, False: 0]
  ------------------
 1799|      0|                pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 1800|       |
 1801|      0|            return NULL;
 1802|      0|        }
 1803|       |
 1804|  2.15k|        memset(node, 0, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.15k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.15k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.15k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1805|       |
 1806|  2.15k|        node->next = pool->nodes;
 1807|  2.15k|        pool->nodes = node;
 1808|  2.15k|        node->index = 0;
 1809|  2.15k|    }
 1810|       |
 1811|  28.0k|    node->beginp[node->index] = mem;
 1812|  28.0k|    node->endp[node->index] = (char *)mem + size;
 1813|  28.0k|    node->index++;
 1814|       |
 1815|  28.0k|    pool->stat_alloc++;
 1816|  28.0k|    pool->stat_total_alloc++;
 1817|       |
 1818|  28.0k|    return mem;
 1819|  28.0k|}
apr_pools.c:apr_pool_check_lifetime:
 1616|  36.4k|{
 1617|       |    /* Rule of thumb: use of the global pool is always
 1618|       |     * ok, since the only user is apr_pools.c.  Unless
 1619|       |     * people have searched for the top level parent and
 1620|       |     * started to use that...
 1621|       |     */
 1622|  36.4k|    if (pool == global_pool || global_pool == NULL)
  ------------------
  |  Branch (1622:9): [True: 1.07k, False: 35.3k]
  |  Branch (1622:32): [True: 3.22k, False: 32.1k]
  ------------------
 1623|  4.29k|        return;
 1624|       |
 1625|       |    /* Lifetime
 1626|       |     * This basically checks to see if the pool being used is still
 1627|       |     * a relative to the global pool.  If not it was previously
 1628|       |     * destroyed, in which case we abort().
 1629|       |     */
 1630|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME)
 1631|       |    if (!apr_pool_is_child_of(pool, global_pool)) {
 1632|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1633|       |        apr_pool_log_event(pool, "LIFE",
 1634|       |                           __FILE__ ":apr_pool_integrity check [lifetime]", 0);
 1635|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1636|       |        abort();
 1637|       |    }
 1638|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */
 1639|  36.4k|}
apr_pools.c:parent_lock:
 1491|  1.07k|{
 1492|  1.07k|    if (pool->parent) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 1.07k]
  ------------------
 1493|      0|        apr_thread_mutex_lock(pool->parent->mutex);
 1494|      0|        return pool->parent->mutex;
 1495|      0|    }
 1496|  1.07k|    return NULL;
 1497|  1.07k|}
apr_pools.c:pool_clear_debug:
 1862|  2.14k|{
 1863|  2.14k|    debug_node_t *node;
 1864|  2.14k|    apr_size_t index;
 1865|       |
 1866|       |    /* Run pre destroy cleanups */
 1867|  2.14k|    run_cleanups(&pool->pre_cleanups);
 1868|  2.14k|    pool->pre_cleanups = NULL;
 1869|       |
 1870|       |    /*
 1871|       |     * Now that we have given the pre cleanups the chance to kill of any
 1872|       |     * threads using the pool, the owner must be correct.
 1873|       |     */
 1874|  2.14k|    apr_pool_check_owner(pool);
 1875|       |
 1876|       |    /* Destroy the subpools.  The subpools will detach themselves from
 1877|       |     * this pool thus this loop is safe and easy.
 1878|       |     */
 1879|  3.22k|    while (pool->child)
  ------------------
  |  Branch (1879:12): [True: 1.07k, False: 2.14k]
  ------------------
 1880|  1.07k|        pool_destroy_debug(pool->child, file_line);
 1881|       |
 1882|       |    /* Run cleanups */
 1883|  2.14k|    run_cleanups(&pool->cleanups);
 1884|  2.14k|    pool->free_cleanups = NULL;
 1885|  2.14k|    pool->cleanups = NULL;
 1886|       |
 1887|       |    /* If new child pools showed up, this is a reason to raise a flag */
 1888|  2.14k|    if (pool->child)
  ------------------
  |  Branch (1888:9): [True: 0, False: 2.14k]
  ------------------
 1889|      0|        abort();
 1890|       |
 1891|       |    /* Free subprocesses */
 1892|  2.14k|    free_proc_chain(pool->subprocesses);
 1893|  2.14k|    pool->subprocesses = NULL;
 1894|       |
 1895|       |    /* Clear the user data. */
 1896|  2.14k|    pool->user_data = NULL;
 1897|       |
 1898|       |    /* Free the blocks, scribbling over them first to help highlight
 1899|       |     * use-after-free issues. */
 1900|  4.30k|    while ((node = pool->nodes) != NULL) {
  ------------------
  |  Branch (1900:12): [True: 2.15k, False: 2.14k]
  ------------------
 1901|  2.15k|        pool->nodes = node->next;
 1902|       |
 1903|  30.2k|        for (index = 0; index < node->index; index++) {
  ------------------
  |  Branch (1903:25): [True: 28.0k, False: 2.15k]
  ------------------
 1904|  28.0k|            memset(node->beginp[index], POOL_POISON_BYTE,
  ------------------
  |  | 1859|  28.0k|#define POOL_POISON_BYTE 'A'
  ------------------
 1905|  28.0k|                   (char *)node->endp[index] - (char *)node->beginp[index]);
 1906|  28.0k|            free(node->beginp[index]);
 1907|  28.0k|        }
 1908|       |
 1909|  2.15k|        memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  | 1859|  2.15k|#define POOL_POISON_BYTE 'A'
  ------------------
                      memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.15k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.15k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.15k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1910|  2.15k|        free(node);
 1911|  2.15k|    }
 1912|       |
 1913|  2.14k|    pool->stat_alloc = 0;
 1914|  2.14k|    pool->stat_clear++;
 1915|       |
 1916|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 1917|       |    apr_pool_log_event(pool, "CLEARED", file_line, 1);
 1918|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 1919|  2.14k|}
apr_pools.c:run_cleanups:
 2684|  4.29k|{
 2685|  4.29k|    cleanup_t *c = *cref;
 2686|       |
 2687|  11.5k|    while (c) {
  ------------------
  |  Branch (2687:12): [True: 7.28k, False: 4.29k]
  ------------------
 2688|  7.28k|        *cref = c->next;
 2689|  7.28k|        (*c->plain_cleanup_fn)((void *)c->data);
 2690|  7.28k|        c = *cref;
 2691|  7.28k|    }
 2692|  4.29k|}
apr_pools.c:free_proc_chain:
 2764|  2.14k|{
 2765|       |    /* Dispose of the subprocesses we've spawned off in the course of
 2766|       |     * whatever it was we're cleaning up now.  This may involve killing
 2767|       |     * some of them off...
 2768|       |     */
 2769|  2.14k|    struct process_chain *pc;
 2770|  2.14k|    int need_timeout = 0;
 2771|  2.14k|    apr_time_t timeout_interval;
 2772|       |
 2773|  2.14k|    if (!procs)
  ------------------
  |  Branch (2773:9): [True: 2.14k, False: 0]
  ------------------
 2774|  2.14k|        return; /* No work.  Whew! */
 2775|       |
 2776|       |    /* First, check to see if we need to do the SIGTERM, sleep, SIGKILL
 2777|       |     * dance with any of the processes we're cleaning up.  If we've got
 2778|       |     * any kill-on-sight subprocesses, ditch them now as well, so they
 2779|       |     * don't waste any more cycles doing whatever it is that they shouldn't
 2780|       |     * be doing anymore.
 2781|       |     */
 2782|       |
 2783|      0|#ifndef NEED_WAITPID
 2784|       |    /* Pick up all defunct processes */
 2785|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2785:22): [True: 0, False: 0]
  ------------------
 2786|      0|        if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE)
  ------------------
  |  |  454|      0|#define APR_CHILD_NOTDONE  (APR_OS_START_STATUS + 6)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2786:13): [True: 0, False: 0]
  ------------------
 2787|      0|            pc->kill_how = APR_KILL_NEVER;
 2788|      0|    }
 2789|      0|#endif /* !defined(NEED_WAITPID) */
 2790|       |
 2791|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2791:22): [True: 0, False: 0]
  ------------------
 2792|      0|#ifndef WIN32
 2793|      0|        if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT)
  ------------------
  |  Branch (2793:13): [True: 0, False: 0]
  ------------------
 2794|      0|            || (pc->kill_how == APR_KILL_ONLY_ONCE)) {
  ------------------
  |  Branch (2794:16): [True: 0, False: 0]
  ------------------
 2795|       |            /*
 2796|       |             * Subprocess may be dead already.  Only need the timeout if not.
 2797|       |             * Note: apr_proc_kill on Windows is TerminateProcess(), which is
 2798|       |             * similar to a SIGKILL, so always give the process a timeout
 2799|       |             * under Windows before killing it.
 2800|       |             */
 2801|      0|            if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (2801:17): [True: 0, False: 0]
  ------------------
 2802|      0|                need_timeout = 1;
 2803|      0|        }
 2804|      0|        else if (pc->kill_how == APR_KILL_ALWAYS) {
  ------------------
  |  Branch (2804:18): [True: 0, False: 0]
  ------------------
 2805|       |#else /* WIN32 knows only one fast, clean method of killing processes today */
 2806|       |        if (pc->kill_how != APR_KILL_NEVER) {
 2807|       |            need_timeout = 1;
 2808|       |            pc->kill_how = APR_KILL_ALWAYS;
 2809|       |#endif
 2810|      0|            apr_proc_kill(pc->proc, SIGKILL);
 2811|      0|        }
 2812|      0|    }
 2813|       |
 2814|       |    /* Sleep only if we have to. The sleep algorithm grows
 2815|       |     * by a factor of two on each iteration. TIMEOUT_INTERVAL
 2816|       |     * is equal to TIMEOUT_USECS / 64.
 2817|       |     */
 2818|      0|    if (need_timeout) {
  ------------------
  |  Branch (2818:9): [True: 0, False: 0]
  ------------------
 2819|      0|        timeout_interval = TIMEOUT_INTERVAL;
  ------------------
  |  |  106|      0|#define TIMEOUT_INTERVAL   46875
  ------------------
 2820|      0|        apr_sleep(timeout_interval);
 2821|       |
 2822|      0|        do {
 2823|       |            /* check the status of the subprocesses */
 2824|      0|            need_timeout = 0;
 2825|      0|            for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2825:30): [True: 0, False: 0]
  ------------------
 2826|      0|                if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) {
  ------------------
  |  Branch (2826:21): [True: 0, False: 0]
  ------------------
 2827|      0|                    if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT)
  ------------------
  |  Branch (2827:25): [True: 0, False: 0]
  ------------------
 2828|      0|                            == APR_CHILD_NOTDONE)
  ------------------
  |  |  454|      0|#define APR_CHILD_NOTDONE  (APR_OS_START_STATUS + 6)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2829|      0|                        need_timeout = 1;		/* subprocess is still active */
 2830|      0|                    else
 2831|      0|                        pc->kill_how = APR_KILL_NEVER;	/* subprocess has exited */
 2832|      0|                }
 2833|      0|            }
 2834|      0|            if (need_timeout) {
  ------------------
  |  Branch (2834:17): [True: 0, False: 0]
  ------------------
 2835|      0|                if (timeout_interval >= TIMEOUT_USECS) {
  ------------------
  |  |  105|      0|#define TIMEOUT_USECS    3000000
  ------------------
  |  Branch (2835:21): [True: 0, False: 0]
  ------------------
 2836|      0|                    break;
 2837|      0|                }
 2838|      0|                apr_sleep(timeout_interval);
 2839|      0|                timeout_interval *= 2;
 2840|      0|            }
 2841|      0|        } while (need_timeout);
  ------------------
  |  Branch (2841:18): [True: 0, False: 0]
  ------------------
 2842|      0|    }
 2843|       |
 2844|       |    /* OK, the scripts we just timed out for have had a chance to clean up
 2845|       |     * --- now, just get rid of them, and also clean up the system accounting
 2846|       |     * goop...
 2847|       |     */
 2848|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2848:22): [True: 0, False: 0]
  ------------------
 2849|      0|        if (pc->kill_how == APR_KILL_AFTER_TIMEOUT)
  ------------------
  |  Branch (2849:13): [True: 0, False: 0]
  ------------------
 2850|      0|            apr_proc_kill(pc->proc, SIGKILL);
 2851|      0|    }
 2852|       |
 2853|       |    /* Now wait for all the signaled processes to die */
 2854|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2854:22): [True: 0, False: 0]
  ------------------
 2855|      0|        if (pc->kill_how != APR_KILL_NEVER)
  ------------------
  |  Branch (2855:13): [True: 0, False: 0]
  ------------------
 2856|      0|            (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT);
 2857|      0|    }
 2858|      0|}
apr_pools.c:parent_unlock:
 1501|  1.07k|{
 1502|  1.07k|    if (mutex) {
  ------------------
  |  Branch (1502:9): [True: 0, False: 1.07k]
  ------------------
 1503|      0|        apr_thread_mutex_unlock(mutex);
 1504|      0|    }
 1505|  1.07k|}
apr_pools.c:pool_destroy_debug:
 1964|  2.14k|{
 1965|  2.14k|    pool_clear_debug(pool, file_line);
 1966|       |
 1967|       |    /* Remove the pool from the parent's child list */
 1968|  2.14k|    if (pool->parent != NULL
  ------------------
  |  Branch (1968:9): [True: 1.07k, False: 1.07k]
  ------------------
 1969|  2.14k|        && (*pool->ref = pool->sibling) != NULL) {
  ------------------
  |  Branch (1969:12): [True: 0, False: 1.07k]
  ------------------
 1970|      0|        pool->sibling->ref = pool->ref;
 1971|      0|    }
 1972|       |
 1973|       |    /* Destroy the allocator if the pool owns it */
 1974|  2.14k|    if (pool->allocator != NULL
  ------------------
  |  Branch (1974:9): [True: 0, False: 2.14k]
  ------------------
 1975|  2.14k|        && apr_allocator_owner_get(pool->allocator) == pool) {
  ------------------
  |  Branch (1975:12): [True: 0, False: 0]
  ------------------
 1976|      0|        apr_allocator_destroy(pool->allocator);
 1977|      0|    }
 1978|       |
 1979|       |    /* Free the pool itself */
 1980|  2.14k|    free(pool);
 1981|  2.14k|}
apr_pools.c:pool_lock:
 1474|  1.07k|{
 1475|  1.07k|#if APR_HAS_THREADS
 1476|  1.07k|    apr_thread_mutex_lock(pool->mutex);
 1477|  1.07k|#endif /* APR_HAS_THREADS */
 1478|  1.07k|}
apr_pools.c:pool_unlock:
 1482|  1.07k|{
 1483|  1.07k|#if APR_HAS_THREADS
 1484|  1.07k|    apr_thread_mutex_unlock(pool->mutex);
 1485|  1.07k|#endif /* APR_HAS_THREADS */
 1486|  1.07k|}

apr_pstrdup:
   70|    328|{
   71|    328|    char *res;
   72|    328|    apr_size_t len;
   73|       |
   74|    328|    if (s == NULL) {
  ------------------
  |  Branch (74:9): [True: 0, False: 328]
  ------------------
   75|      0|        return NULL;
   76|      0|    }
   77|    328|    len = strlen(s) + 1;
   78|    328|    res = apr_pmemdup(a, s, len);
   79|    328|    return res;
   80|    328|}
apr_pstrmemdup:
  100|     62|{
  101|     62|    char *res;
  102|       |
  103|     62|    if (s == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 62]
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|     62|    res = apr_palloc(a, n + 1);
  ------------------
  |  |  425|     62|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     62|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|     62|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|     62|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|     62|    memcpy(res, s, n);
  108|     62|    res[n] = '\0';
  109|     62|    return res;
  110|     62|}
apr_pmemdup:
  113|    328|{
  114|    328|    void *res;
  115|       |
  116|    328|    if (m == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 328]
  ------------------
  117|      0|	return NULL;
  118|    328|    res = apr_palloc(a, n);
  ------------------
  |  |  425|    328|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    328|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    328|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    328|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|    328|    memcpy(res, m, n);
  120|    328|    return res;
  121|    328|}

apr_strmatch_precompile:
   85|    865|{
   86|    865|    apr_strmatch_pattern *pattern;
   87|    865|    apr_size_t i;
   88|    865|    apr_size_t *shift;
   89|       |
   90|    865|    pattern = apr_palloc(p, sizeof(*pattern));
  ------------------
  |  |  425|    865|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    865|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    865|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    865|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|    865|    pattern->pattern = s;
   92|    865|    pattern->length = strlen(s);
   93|    865|    if (pattern->length == 0) {
  ------------------
  |  Branch (93:9): [True: 0, False: 865]
  ------------------
   94|      0|        pattern->compare = match_no_op;
   95|      0|        pattern->context = NULL;
   96|      0|        return pattern;
   97|      0|    }
   98|       |
   99|    865|    shift = (apr_size_t *)apr_palloc(p, sizeof(apr_size_t) * NUM_CHARS);
  ------------------
  |  |  425|    865|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    865|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    865|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    865|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|   222k|    for (i = 0; i < NUM_CHARS; i++) {
  ------------------
  |  |   23|   222k|#define NUM_CHARS  256
  ------------------
  |  Branch (100:17): [True: 221k, False: 865]
  ------------------
  101|   221k|        shift[i] = pattern->length;
  102|   221k|    }
  103|    865|    if (case_sensitive) {
  ------------------
  |  Branch (103:9): [True: 865, False: 0]
  ------------------
  104|    865|        pattern->compare = match_boyer_moore_horspool;
  105|  8.76k|        for (i = 0; i < pattern->length - 1; i++) {
  ------------------
  |  Branch (105:21): [True: 7.89k, False: 865]
  ------------------
  106|  7.89k|            shift[(unsigned char)s[i]] = pattern->length - i - 1;
  107|  7.89k|        }
  108|    865|    }
  109|      0|    else {
  110|      0|        pattern->compare = match_boyer_moore_horspool_nocase;
  111|      0|        for (i = 0; i < pattern->length - 1; i++) {
  ------------------
  |  Branch (111:21): [True: 0, False: 0]
  ------------------
  112|      0|            shift[(unsigned char)apr_tolower(s[i])] = pattern->length - i - 1;
  ------------------
  |  |  234|      0|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  113|      0|        }
  114|      0|    }
  115|    865|    pattern->context = shift;
  116|       |
  117|    865|    return pattern;
  118|    865|}
apr_strmatch.c:match_boyer_moore_horspool:
   37|    470|{
   38|    470|    const char *s_end = s + slen;
   39|    470|    apr_size_t *shift = (apr_size_t *)(this_pattern->context);
   40|    470|    const char *s_next = s + this_pattern->length - 1;
   41|    470|    const char *p_start = this_pattern->pattern;
   42|    470|    const char *p_end = p_start + this_pattern->length - 1;
   43|  2.51k|    while (s_next < s_end) {
  ------------------
  |  Branch (43:12): [True: 2.20k, False: 305]
  ------------------
   44|  2.20k|        const char *s_tmp = s_next;
   45|  2.20k|        const char *p_tmp = p_end;
   46|  4.87k|        while (*s_tmp == *p_tmp) {
  ------------------
  |  Branch (46:16): [True: 2.83k, False: 2.04k]
  ------------------
   47|  2.83k|            p_tmp--;
   48|  2.83k|            if (p_tmp < p_start) {
  ------------------
  |  Branch (48:17): [True: 165, False: 2.67k]
  ------------------
   49|    165|                return s_tmp;
   50|    165|            }
   51|  2.67k|            s_tmp--;
   52|  2.67k|        }
   53|  2.04k|        s_next += shift[(int)*((const unsigned char *)s_next)];
   54|  2.04k|    }
   55|    305|    return NULL;
   56|    470|}

apr_array_push:
  112|  2.48k|{
  113|  2.48k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (113:9): [True: 0, False: 2.48k]
  ------------------
  114|      0|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (114:24): [True: 0, False: 0]
  ------------------
  115|      0|        char *new_data;
  116|       |
  117|      0|        new_data = apr_palloc(arr->pool, arr->elt_size * new_size);
  ------------------
  |  |  425|      0|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  118|       |
  119|      0|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  120|      0|        memset(new_data + arr->nalloc * arr->elt_size, 0,
  121|      0|               arr->elt_size * (new_size - arr->nalloc));
  122|      0|        arr->elts = new_data;
  123|      0|        arr->nalloc = new_size;
  124|      0|    }
  125|       |
  126|  2.48k|    ++arr->nelts;
  127|  2.48k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  128|  2.48k|}
apr_table_make:
  405|  1.99k|{
  406|  1.99k|    apr_table_t *t = apr_palloc(p, sizeof(apr_table_t));
  ------------------
  |  |  425|  1.99k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.99k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.99k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.99k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  407|       |
  408|  1.99k|    make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t), 0);
  409|       |#ifdef MAKE_TABLE_PROFILE
  410|       |    t->creator = __builtin_return_address(0);
  411|       |#endif
  412|  1.99k|    t->index_initialized = 0;
  413|  1.99k|    return t;
  414|  1.99k|}
apr_table_get:
  476|  2.16k|{
  477|  2.16k|    apr_table_entry_t *next_elt;
  478|  2.16k|    apr_table_entry_t *end_elt;
  479|  2.16k|    apr_uint32_t checksum;
  480|  2.16k|    int hash;
  481|       |
  482|  2.16k|    if (key == NULL) {
  ------------------
  |  Branch (482:9): [True: 0, False: 2.16k]
  ------------------
  483|      0|	return NULL;
  484|      0|    }
  485|       |
  486|  2.16k|    hash = TABLE_HASH(key);
  ------------------
  |  |  302|  2.16k|#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
  |  |  ------------------
  |  |  |  |  301|  2.16k|#define TABLE_INDEX_MASK 0x1f
  |  |  ------------------
  ------------------
  487|  2.16k|    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
  ------------------
  |  |  303|  2.16k|#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
  ------------------
  |  Branch (487:9): [True: 534, False: 1.62k]
  ------------------
  488|    534|        return NULL;
  489|    534|    }
  490|  1.62k|    COMPUTE_KEY_CHECKSUM(key, checksum);
  ------------------
  |  |  312|  1.62k|#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
  |  |  313|  1.62k|{                                              \
  |  |  314|  1.62k|    const char *k = (key);                     \
  |  |  315|  1.62k|    apr_uint32_t c = (apr_uint32_t)*k;         \
  |  |  316|  1.62k|    (checksum) = c;                            \
  |  |  317|  1.62k|    (checksum) <<= 8;                          \
  |  |  318|  1.62k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (318:9): [True: 1.62k, False: 0]
  |  |  ------------------
  |  |  319|  1.62k|        c = (apr_uint32_t)*++k;                \
  |  |  320|  1.62k|        checksum |= c;                         \
  |  |  321|  1.62k|    }                                          \
  |  |  322|  1.62k|    (checksum) <<= 8;                          \
  |  |  323|  1.62k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (323:9): [True: 1.62k, False: 0]
  |  |  ------------------
  |  |  324|  1.62k|        c = (apr_uint32_t)*++k;                \
  |  |  325|  1.62k|        checksum |= c;                         \
  |  |  326|  1.62k|    }                                          \
  |  |  327|  1.62k|    (checksum) <<= 8;                          \
  |  |  328|  1.62k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (328:9): [True: 1.62k, False: 0]
  |  |  ------------------
  |  |  329|  1.62k|        c = (apr_uint32_t)*++k;                \
  |  |  330|  1.62k|        checksum |= c;                         \
  |  |  331|  1.62k|    }                                          \
  |  |  332|  1.62k|    checksum &= CASE_MASK;                     \
  |  |  ------------------
  |  |  |  |  297|  1.62k|#define CASE_MASK 0xdfdfdfdf
  |  |  ------------------
  |  |  333|  1.62k|}
  ------------------
  491|  1.62k|    next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];;
  492|  1.62k|    end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash];
  493|       |
  494|  3.43k|    for (; next_elt <= end_elt; next_elt++) {
  ------------------
  |  Branch (494:12): [True: 2.18k, False: 1.24k]
  ------------------
  495|  2.18k|	if ((checksum == next_elt->key_checksum) &&
  ------------------
  |  Branch (495:6): [True: 1.51k, False: 677]
  ------------------
  496|  2.18k|            !strcasecmp(next_elt->key, key)) {
  ------------------
  |  Branch (496:13): [True: 382, False: 1.12k]
  ------------------
  497|    382|	    return next_elt->val;
  498|    382|	}
  499|  2.18k|    }
  500|       |
  501|  1.24k|    return NULL;
  502|  1.62k|}
apr_table_addn:
  816|  2.05k|{
  817|  2.05k|    apr_table_entry_t *elts;
  818|  2.05k|    apr_uint32_t checksum;
  819|  2.05k|    int hash;
  820|       |
  821|       |#if APR_TABLE_POOL_DEBUG
  822|       |    {
  823|       |	if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) {
  824|       |	    fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n");
  825|       |	    abort();
  826|       |	}
  827|       |	if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) {
  828|       |	    fprintf(stderr, "apr_table_addn: val not in ancestor pool of t\n");
  829|       |	    abort();
  830|       |	}
  831|       |    }
  832|       |#endif
  833|       |
  834|  2.05k|    hash = TABLE_HASH(key);
  ------------------
  |  |  302|  2.05k|#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
  |  |  ------------------
  |  |  |  |  301|  2.05k|#define TABLE_INDEX_MASK 0x1f
  |  |  ------------------
  ------------------
  835|  2.05k|    t->index_last[hash] = t->a.nelts;
  836|  2.05k|    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
  ------------------
  |  |  303|  2.05k|#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
  ------------------
  |  Branch (836:9): [True: 1.41k, False: 641]
  ------------------
  837|  1.41k|        t->index_first[hash] = t->a.nelts;
  838|  1.41k|        TABLE_SET_INDEX_INITIALIZED(t, hash);
  ------------------
  |  |  304|  1.41k|#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1u << (i)))
  ------------------
  839|  1.41k|    }
  840|  2.05k|    COMPUTE_KEY_CHECKSUM(key, checksum);
  ------------------
  |  |  312|  2.05k|#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
  |  |  313|  2.05k|{                                              \
  |  |  314|  2.05k|    const char *k = (key);                     \
  |  |  315|  2.05k|    apr_uint32_t c = (apr_uint32_t)*k;         \
  |  |  316|  2.05k|    (checksum) = c;                            \
  |  |  317|  2.05k|    (checksum) <<= 8;                          \
  |  |  318|  2.05k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (318:9): [True: 1.87k, False: 189]
  |  |  ------------------
  |  |  319|  1.87k|        c = (apr_uint32_t)*++k;                \
  |  |  320|  1.87k|        checksum |= c;                         \
  |  |  321|  1.87k|    }                                          \
  |  |  322|  2.05k|    (checksum) <<= 8;                          \
  |  |  323|  2.05k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (323:9): [True: 1.10k, False: 950]
  |  |  ------------------
  |  |  324|  1.10k|        c = (apr_uint32_t)*++k;                \
  |  |  325|  1.10k|        checksum |= c;                         \
  |  |  326|  1.10k|    }                                          \
  |  |  327|  2.05k|    (checksum) <<= 8;                          \
  |  |  328|  2.05k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (328:9): [True: 915, False: 1.14k]
  |  |  ------------------
  |  |  329|    915|        c = (apr_uint32_t)*++k;                \
  |  |  330|    915|        checksum |= c;                         \
  |  |  331|    915|    }                                          \
  |  |  332|  2.05k|    checksum &= CASE_MASK;                     \
  |  |  ------------------
  |  |  |  |  297|  2.05k|#define CASE_MASK 0xdfdfdfdf
  |  |  ------------------
  |  |  333|  2.05k|}
  ------------------
  841|  2.05k|    elts = (apr_table_entry_t *) table_push(t);
  ------------------
  |  |  391|  2.05k|#define table_push(t)	((apr_table_entry_t *) apr_array_push_noclear(&(t)->a))
  ------------------
  842|  2.05k|    elts->key = (char *)key;
  843|  2.05k|    elts->val = (char *)val;
  844|  2.05k|    elts->key_checksum = checksum;
  845|  2.05k|}
apr_tables.c:make_array_core:
   60|  1.99k|{
   61|       |    /*
   62|       |     * Assure sanity if someone asks for
   63|       |     * array of zero elts.
   64|       |     */
   65|  1.99k|    if (nelts < 1) {
  ------------------
  |  Branch (65:9): [True: 0, False: 1.99k]
  ------------------
   66|      0|        nelts = 1;
   67|      0|    }
   68|       |
   69|  1.99k|    if (clear) {
  ------------------
  |  Branch (69:9): [True: 0, False: 1.99k]
  ------------------
   70|      0|        res->elts = apr_pcalloc(p, nelts * elt_size);
  ------------------
  |  |  454|      0|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|      0|    }
   72|  1.99k|    else {
   73|  1.99k|        res->elts = apr_palloc(p, nelts * elt_size);
  ------------------
  |  |  425|  1.99k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.99k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.99k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.99k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   74|  1.99k|    }
   75|       |
   76|  1.99k|    res->pool = p;
   77|  1.99k|    res->elt_size = elt_size;
   78|  1.99k|    res->nelts = 0;		/* No active elements yet... */
   79|  1.99k|    res->nalloc = nelts;	/* ...but this many allocated */
   80|  1.99k|}
apr_tables.c:apr_array_push_noclear:
  131|  2.05k|{
  132|  2.05k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (132:9): [True: 29, False: 2.03k]
  ------------------
  133|     29|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (133:24): [True: 0, False: 29]
  ------------------
  134|     29|        char *new_data;
  135|       |
  136|     29|        new_data = apr_palloc(arr->pool, arr->elt_size * new_size);
  ------------------
  |  |  425|     29|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     29|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|     29|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|     29|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|       |
  138|     29|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  139|     29|        arr->elts = new_data;
  140|     29|        arr->nalloc = new_size;
  141|     29|    }
  142|       |
  143|  2.05k|    ++arr->nelts;
  144|  2.05k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  145|  2.05k|}

apr_os_thread_current:
  340|  2.14k|{
  341|  2.14k|    return pthread_self();
  342|  2.14k|}

