af_gb_init:
   15|  1.12k|void af_gb_init() {
   16|  1.12k|  pointer_idx = 0;
   17|       |
   18|   113k|   for (int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |    8|   113k|#define GB_SIZE 100
  ------------------
  |  Branch (18:20): [True: 112k, False: 1.12k]
  ------------------
   19|   112k|     pointer_arr[i] = NULL;
   20|   112k|   }
   21|  1.12k|}
af_gb_cleanup:
   23|  1.12k|void af_gb_cleanup() {
   24|   113k|  for(int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |    8|   113k|#define GB_SIZE 100
  ------------------
  |  Branch (24:18): [True: 112k, False: 1.12k]
  ------------------
   25|   112k|    if (pointer_arr[i] != NULL) {
  ------------------
  |  Branch (25:9): [True: 2.21k, False: 110k]
  ------------------
   26|  2.21k|      free(pointer_arr[i]);
   27|  2.21k|    }
   28|   112k|  }
   29|  1.12k|}
af_get_null_terminated:
   31|  2.24k|char *af_get_null_terminated(const uint8_t **data, size_t *size) {
   32|  2.24k|#define STR_SIZE 75
   33|  2.24k|  if (*size < STR_SIZE || (int)*size < 0) {
  ------------------
  |  |   32|  4.49k|#define STR_SIZE 75
  ------------------
  |  Branch (33:7): [True: 28, False: 2.21k]
  |  Branch (33:27): [True: 0, False: 2.21k]
  ------------------
   34|     28|    return NULL;
   35|     28|  }
   36|       |
   37|  2.21k|  char *new_s = malloc(STR_SIZE + 1);
  ------------------
  |  |   32|  2.21k|#define STR_SIZE 75
  ------------------
   38|  2.21k|  memcpy(new_s, *data, STR_SIZE);
  ------------------
  |  |   32|  2.21k|#define STR_SIZE 75
  ------------------
   39|  2.21k|  new_s[STR_SIZE] = '\0';
  ------------------
  |  |   32|  2.21k|#define STR_SIZE 75
  ------------------
   40|       |
   41|  2.21k|  *data = *data+STR_SIZE;
  ------------------
  |  |   32|  2.21k|#define STR_SIZE 75
  ------------------
   42|  2.21k|  *size -= STR_SIZE;
  ------------------
  |  |   32|  2.21k|#define STR_SIZE 75
  ------------------
   43|  2.21k|  return new_s;
   44|  2.24k|}
af_gb_get_null_terminated:
   62|  2.24k|char *af_gb_get_null_terminated(const uint8_t **data, size_t *size) {
   63|       |
   64|  2.24k|  char *nstr = af_get_null_terminated(data, size);
   65|  2.24k|  if (nstr == NULL) {
  ------------------
  |  Branch (65:7): [True: 28, False: 2.21k]
  ------------------
   66|     28|    return NULL;
   67|     28|  }
   68|  2.21k|  pointer_arr[pointer_idx++] = (void*)nstr;
   69|  2.21k|  return nstr;
   70|  2.24k|}
af_get_short:
   88|  1.10k|short af_get_short(const uint8_t **data, size_t *size) {
   89|  1.10k|  if (*size <= 0) return 0;
  ------------------
  |  Branch (89:7): [True: 917, False: 191]
  ------------------
   90|    191|  short c = (short)(*data)[0];
   91|    191|  *data += 1;
   92|    191|  *size-=1;
   93|    191|  return c;
   94|  1.10k|}

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

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

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

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

apreq_parser_multipart.c:apreq_brigade_setaside:
  311|  1.53k|{
  312|  1.53k|    apr_bucket *e;
  313|  2.39k|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|  1.53k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.53k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|  2.39k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  2.39k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  2.39k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:37): [True: 863, False: 1.53k]
  ------------------
  314|  1.53k|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    863|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    863|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  315|    863|    {
  316|    863|        apr_status_t rv = apr_bucket_setaside(e, p);
  ------------------
  |  | 1167|    863|#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
  ------------------
  317|    863|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|    863|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:13): [True: 0, False: 863]
  ------------------
  318|      0|            return rv;
  319|    863|    }
  320|  1.53k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.53k|#define APR_SUCCESS 0
  ------------------
  321|  1.53k|}
apreq_parser_urlencoded.c:apreq_brigade_setaside:
  311|     95|{
  312|     95|    apr_bucket *e;
  313|    211|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|     95|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     95|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    211|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    211|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    211|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:37): [True: 116, False: 95]
  ------------------
  314|    116|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    116|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    116|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  315|    116|    {
  316|    116|        apr_status_t rv = apr_bucket_setaside(e, p);
  ------------------
  |  | 1167|    116|#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
  ------------------
  317|    116|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|    116|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:13): [True: 0, False: 116]
  ------------------
  318|      0|            return rv;
  319|    116|    }
  320|     95|    return APR_SUCCESS;
  ------------------
  |  |  225|     95|#define APR_SUCCESS 0
  ------------------
  321|     95|}
apreq_parser_header.c:apreq_brigade_setaside:
  311|     80|{
  312|     80|    apr_bucket *e;
  313|    233|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|     80|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     80|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    233|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    233|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    233|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:37): [True: 153, False: 80]
  ------------------
  314|    153|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    153|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    153|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  315|    153|    {
  316|    153|        apr_status_t rv = apr_bucket_setaside(e, p);
  ------------------
  |  | 1167|    153|#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
  ------------------
  317|    153|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|    153|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:13): [True: 0, False: 153]
  ------------------
  318|      0|            return rv;
  319|    153|    }
  320|     80|    return APR_SUCCESS;
  ------------------
  |  |  225|     80|#define APR_SUCCESS 0
  ------------------
  321|     80|}

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

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

apreq_parse_headers:
  183|    961|{
  184|    961|    apr_pool_t *pool = parser->pool;
  185|    961|    apr_bucket *e;
  186|    961|    struct hdr_ctx *ctx;
  187|    961|    char ch;
  188|       |
  189|    961|    if (parser->ctx == NULL) {
  ------------------
  |  Branch (189:9): [True: 961, False: 0]
  ------------------
  190|    961|        ctx = apr_pcalloc(pool, sizeof *ctx);
  ------------------
  |  |  454|    961|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    961|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    961|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    961|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|    961|        ctx->bb = apr_brigade_create(pool, parser->bucket_alloc);
  192|    961|        parser->ctx = ctx;
  193|    961|        ctx->status = HDR_NAME;
  194|    961|    }
  195|      0|    else
  196|      0|        ctx = parser->ctx;
  197|       |
  198|    961|    PARSER_STATUS_CHECK(HDR);
  ------------------
  |  |   24|    961|#define PARSER_STATUS_CHECK(PREFIX)   do {         \
  |  |   25|    961|    if (ctx->status == PREFIX##_ERROR)             \
  |  |  ------------------
  |  |  |  Branch (25:9): [True: 0, False: 961]
  |  |  ------------------
  |  |   26|    961|        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|    961|    else if (ctx->status == PREFIX##_COMPLETE)     \
  |  |  ------------------
  |  |  |  Branch (27:14): [True: 0, False: 961]
  |  |  ------------------
  |  |   28|    961|        return APR_SUCCESS;                        \
  |  |  ------------------
  |  |  |  |  225|      0|#define APR_SUCCESS 0
  |  |  ------------------
  |  |   29|    961|    else if (bb == NULL)                           \
  |  |  ------------------
  |  |  |  Branch (29:14): [True: 0, False: 961]
  |  |  ------------------
  |  |   30|    961|        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|    961|} while (0);
  |  |  ------------------
  |  |  |  Branch (31:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  199|    961|    e = APR_BRIGADE_LAST(ctx->bb);
  ------------------
  |  |  359|    961|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    961|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
  200|    961|    APR_BRIGADE_CONCAT(ctx->bb, bb);
  ------------------
  |  |  388|    961|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    961|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    961|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    961|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    961|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    961|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    961|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    961|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 949, False: 12]
  |  |  |  |  ------------------
  |  |  |  |  340|    949|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    949|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    949|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    949|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    949|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    949|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    949|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    949|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    949|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    949|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    949|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    949|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    949|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    949|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    949|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    949|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    949|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    949|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    949|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    949|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    949|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    949|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    949|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    949|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    949|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    949|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    949|    }                                                       \
  |  |  |  |  344|    961|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    961|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    961|    } 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|    961|    for (e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    961|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    961|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  207|  1.05k|         e != APR_BRIGADE_SENTINEL(ctx->bb);
  ------------------
  |  |  339|  1.05k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  1.05k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.05k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (207:10): [True: 979, False: 80]
  ------------------
  208|    961|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|     98|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|     98|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  209|    979|    {
  210|    979|        apr_size_t off = 0, dlen;
  211|    979|        const char *data;
  212|    979|        apr_status_t s;
  213|    979|        apreq_param_t *param = NULL; /* silences gcc-4.0 warning */
  214|       |
  215|    979|        if (APR_BUCKET_IS_EOS(e)) {
  ------------------
  |  |  469|    979|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 979]
  |  |  ------------------
  ------------------
  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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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|    979|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|    979|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  222|    979|        if ( s != APR_SUCCESS ) {
  ------------------
  |  |  225|    979|#define APR_SUCCESS 0
  ------------------
  |  Branch (222:14): [True: 0, False: 979]
  ------------------
  223|      0|            ctx->status = HDR_ERROR;
  224|      0|            return s;
  225|      0|        }
  226|    979|        if (dlen == 0)
  ------------------
  |  Branch (226:13): [True: 0, False: 979]
  ------------------
  227|      0|            continue;
  228|       |
  229|  6.70k|    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.70k|        switch (ctx->status) {
  239|       |
  240|  1.52k|        case HDR_NAME:
  ------------------
  |  Branch (240:9): [True: 1.52k, False: 5.17k]
  ------------------
  241|       |
  242|  11.6k|            while (off < dlen) {
  ------------------
  |  Branch (242:20): [True: 11.6k, False: 31]
  ------------------
  243|  11.6k|                ch = data[off++];
  244|  11.6k|                switch (ch) {
  245|  1.46k|                case ':':
  ------------------
  |  Branch (245:17): [True: 1.46k, False: 10.1k]
  ------------------
  246|  1.46k|                    if (!ctx->nlen) {
  ------------------
  |  Branch (246:25): [True: 7, False: 1.45k]
  ------------------
  247|      7|                        ctx->status = HDR_ERROR;
  248|      7|                        return APREQ_ERROR_BADHEADER;
  ------------------
  |  |   68|      7|#define APREQ_ERROR_BADHEADER      (APREQ_ERROR_BADDATA  +  4)
  |  |  ------------------
  |  |  |  |   60|      7|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      7|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      7|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      7|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      7|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      7|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      7|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      7|                    }
  250|  1.45k|                    e = split_header_line(e, &off, &data, &dlen);
  251|  1.45k|                    ++ctx->glen;
  252|  1.45k|                    ctx->status = HDR_GAP;
  253|  1.45k|                    goto parse_hdr_bucket;
  254|       |
  255|  10.1k|                default:
  ------------------
  |  Branch (255:17): [True: 10.1k, False: 1.46k]
  ------------------
  256|  10.1k|                    if (!IS_TOKEN_CHAR(ch)) {
  ------------------
  |  |  179|  10.1k|#define IS_TOKEN_CHAR(c) (apr_isalnum(c) \
  |  |  ------------------
  |  |  |  |  203|  20.2k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (203:24): [True: 8.83k, False: 1.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|  10.1k|                          || ((c) && strchr("!#$%&'*+-.^_`|~", (c))))
  |  |  ------------------
  |  |  |  Branch (180:31): [True: 1.30k, False: 0]
  |  |  |  Branch (180:38): [True: 1.27k, False: 34]
  |  |  ------------------
  ------------------
  257|     34|                        ctx->status = HDR_ERROR;
  258|     34|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     34|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     34|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     34|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     34|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     34|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     34|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     34|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     34|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|     34|                    }
  260|  10.1k|                    ++ctx->nlen;
  261|  11.6k|                }
  262|  11.6k|            }
  263|     31|            break;
  264|       |
  265|       |
  266|  1.46k|        case HDR_GAP:
  ------------------
  |  Branch (266:9): [True: 1.46k, False: 5.23k]
  ------------------
  267|       |
  268|  2.12k|            while (off < dlen) {
  ------------------
  |  Branch (268:20): [True: 2.10k, False: 21]
  ------------------
  269|  2.10k|                ch = data[off++];
  270|  2.10k|                switch (ch) {
  271|    344|                case ' ':
  ------------------
  |  Branch (271:17): [True: 344, False: 1.75k]
  ------------------
  272|    657|                case '\t':
  ------------------
  |  Branch (272:17): [True: 313, False: 1.78k]
  ------------------
  273|    657|                    ++ctx->glen;
  274|    657|                    break;
  275|       |
  276|    532|                case '\n':
  ------------------
  |  Branch (276:17): [True: 532, False: 1.57k]
  ------------------
  277|    532|                    e = split_header_line(e, &off, &data, &dlen);
  278|    532|                    ctx->status = HDR_NEWLINE;
  279|    532|                    goto parse_hdr_bucket;
  280|       |
  281|     80|                case '\r':
  ------------------
  |  Branch (281:17): [True: 80, False: 2.02k]
  ------------------
  282|     80|                    e = split_header_line(e, &off, &data, &dlen);
  283|     80|                    ctx->status = HDR_ENDLINE;
  284|     80|                    goto parse_hdr_bucket;
  285|       |
  286|    833|                default:
  ------------------
  |  Branch (286:17): [True: 833, False: 1.26k]
  ------------------
  287|    833|                    if (apr_iscntrl(ch)) {
  ------------------
  |  |  207|    833|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (207:24): [True: 2, False: 831]
  |  |  ------------------
  ------------------
  288|      2|                        ctx->status = HDR_ERROR;
  289|      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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|      2|                    }
  291|    831|                    e = split_header_line(e, &off, &data, &dlen);
  292|    831|                    ++ctx->vlen;
  293|    831|                    ctx->status = HDR_VALUE;
  294|    831|                    goto parse_hdr_bucket;
  295|  2.10k|                }
  296|  2.10k|            }
  297|     21|            break;
  298|       |
  299|       |
  300|    959|        case HDR_VALUE:
  ------------------
  |  Branch (300:9): [True: 959, False: 5.74k]
  ------------------
  301|       |
  302|  11.2k|            while (off < dlen) {
  ------------------
  |  Branch (302:20): [True: 11.2k, False: 18]
  ------------------
  303|  11.2k|                ch = data[off++];
  304|  11.2k|                switch (ch) {
  305|    757|                case '\n':
  ------------------
  |  Branch (305:17): [True: 757, False: 10.4k]
  ------------------
  306|    757|                    ctx->status = HDR_NEWLINE;
  307|    757|                    goto parse_hdr_bucket;
  308|       |
  309|    175|                case '\r':
  ------------------
  |  Branch (309:17): [True: 175, False: 11.0k]
  ------------------
  310|    175|                    ctx->status = HDR_ENDLINE;
  311|    175|                    goto parse_hdr_bucket;
  312|       |
  313|  10.3k|                default:
  ------------------
  |  Branch (313:17): [True: 10.3k, False: 932]
  ------------------
  314|  10.3k|                    if (apr_iscntrl(ch)) {
  ------------------
  |  |  207|  10.3k|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (207:24): [True: 9, False: 10.3k]
  |  |  ------------------
  ------------------
  315|      9|                        ctx->status = HDR_ERROR;
  316|      9|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      9|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      9|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      9|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      9|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  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
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      9|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|      9|                    }
  318|  10.3k|                    ++ctx->vlen;
  319|  11.2k|                }
  320|  11.2k|            }
  321|     18|            break;
  322|       |
  323|       |
  324|    316|        case HDR_ENDLINE:
  ------------------
  |  Branch (324:9): [True: 316, False: 6.38k]
  ------------------
  325|    494|        case HDR_LASTLINE:
  ------------------
  |  Branch (325:9): [True: 178, False: 6.52k]
  ------------------
  326|       |
  327|    494|            if (off == dlen)
  ------------------
  |  Branch (327:17): [True: 10, False: 484]
  ------------------
  328|     10|                break;
  329|       |
  330|    484|            if (data[off++] != '\n') {
  ------------------
  |  Branch (330:17): [True: 12, False: 472]
  ------------------
  331|     12|                ctx->status = HDR_ERROR;
  332|     12|                return APREQ_ERROR_BADHEADER;
  ------------------
  |  |   68|     12|#define APREQ_ERROR_BADHEADER      (APREQ_ERROR_BADDATA  +  4)
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  333|     12|            }
  334|       |
  335|    472|            if (ctx->status == HDR_LASTLINE) {
  ------------------
  |  Branch (335:17): [True: 174, False: 298]
  ------------------
  336|    174|                ctx->status = HDR_COMPLETE;
  337|    174|                goto parse_hdr_bucket;
  338|    174|            }
  339|       |
  340|       |            /* fall thru */
  341|    298|            ctx->status = HDR_NEWLINE;
  342|       |
  343|  1.74k|        case HDR_NEWLINE:
  ------------------
  |  Branch (343:9): [True: 1.44k, False: 5.25k]
  ------------------
  344|       |
  345|  1.74k|            if (off == dlen)
  ------------------
  |  Branch (345:17): [True: 11, False: 1.73k]
  ------------------
  346|     11|                break;
  347|       |
  348|  1.73k|            ch = data[off++];
  349|  1.73k|            switch (ch) {
  350|    230|            case ' ':
  ------------------
  |  Branch (350:13): [True: 230, False: 1.50k]
  ------------------
  351|    346|            case '\t':
  ------------------
  |  Branch (351:13): [True: 116, False: 1.61k]
  ------------------
  352|    346|                ++ctx->vlen;
  353|    346|                break;
  354|       |
  355|  1.38k|            default:
  ------------------
  |  Branch (355:13): [True: 1.38k, False: 346]
  ------------------
  356|  1.38k|                e = split_header_line(e, &off, &data, &dlen);
  357|       |
  358|       |                /* consume from splitted brigade now */
  359|  1.38k|                s = consume_header_line(&param, pool, ctx->bb,
  360|  1.38k|                                        ctx->nlen, ctx->glen, ctx->vlen);
  361|  1.38k|                if (parser->hook != NULL && s == APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (361:21): [True: 0, False: 1.38k]
  |  Branch (361:45): [True: 0, False: 0]
  ------------------
  362|      0|                    s = apreq_hook_run(parser->hook, param, NULL);
  363|  1.38k|                if (s != APR_SUCCESS) {
  ------------------
  |  |  225|  1.38k|#define APR_SUCCESS 0
  ------------------
  |  Branch (363:21): [True: 0, False: 1.38k]
  ------------------
  364|      0|                    ctx->status = HDR_ERROR;
  365|      0|                    return s;
  366|      0|                }
  367|  1.38k|                apreq_value_table_add(&param->v, t);
  368|  1.38k|                ctx->nlen = 0;
  369|  1.38k|                ctx->vlen = 0;
  370|  1.38k|                ctx->glen = 0;
  371|       |
  372|  1.38k|                switch (ch) {
  373|    634|                case '\n':
  ------------------
  |  Branch (373:17): [True: 634, False: 753]
  ------------------
  374|    634|                    ctx->status = HDR_COMPLETE;
  375|    634|                    break;
  376|       |
  377|    177|                case '\r':
  ------------------
  |  Branch (377:17): [True: 177, False: 1.21k]
  ------------------
  378|    177|                    ctx->status = HDR_LASTLINE;
  379|    177|                    break;
  380|       |
  381|    576|                default:
  ------------------
  |  Branch (381:17): [True: 576, False: 811]
  ------------------
  382|    576|                    if (!IS_TOKEN_CHAR(ch)) {
  ------------------
  |  |  179|    576|#define IS_TOKEN_CHAR(c) (apr_isalnum(c) \
  |  |  ------------------
  |  |  |  |  203|  1.15k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (203:24): [True: 295, False: 281]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|    576|                          || ((c) && strchr("!#$%&'*+-.^_`|~", (c))))
  |  |  ------------------
  |  |  |  Branch (180:31): [True: 281, False: 0]
  |  |  |  Branch (180:38): [True: 273, False: 8]
  |  |  ------------------
  ------------------
  383|      8|                        ctx->status = HDR_ERROR;
  384|      8|                        return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|      8|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|      8|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      8|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|      8|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      8|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|      8|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|      8|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|      8|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  385|      8|                    }
  386|    568|                    ++ctx->nlen;
  387|    568|                    ctx->status = HDR_NAME;
  388|    568|                    break;
  389|  1.38k|                }
  390|  1.37k|                goto parse_hdr_bucket;
  391|  1.73k|            }
  392|       |
  393|       |            /* fall thru */
  394|    346|            ctx->status = HDR_FOLDLINE;
  395|       |
  396|    349|        case HDR_FOLDLINE:
  ------------------
  |  Branch (396:9): [True: 3, False: 6.70k]
  ------------------
  397|       |
  398|    734|            while (off < dlen) {
  ------------------
  |  Branch (398:20): [True: 727, False: 7]
  ------------------
  399|    727|                ch = data[off++];
  400|    727|                switch (ch) {
  401|    260|                case ' ':
  ------------------
  |  Branch (401:17): [True: 260, False: 467]
  ------------------
  402|    385|                case '\t':
  ------------------
  |  Branch (402:17): [True: 125, False: 602]
  ------------------
  403|    385|                    ++ctx->vlen;
  404|    385|                    break;
  405|       |
  406|    156|                case '\n':
  ------------------
  |  Branch (406:17): [True: 156, False: 571]
  ------------------
  407|    156|                    ctx->status = HDR_NEWLINE;
  408|    156|                    goto parse_hdr_bucket;
  409|       |
  410|     60|                case '\r':
  ------------------
  |  Branch (410:17): [True: 60, False: 667]
  ------------------
  411|     60|                    ctx->status = HDR_ENDLINE;
  412|     60|                    goto parse_hdr_bucket;
  413|       |
  414|    126|                default:
  ------------------
  |  Branch (414:17): [True: 126, False: 601]
  ------------------
  415|    126|                    if (apr_iscntrl(ch)) {
  ------------------
  |  |  207|    126|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (207:24): [True: 1, False: 125]
  |  |  ------------------
  ------------------
  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|    125|                    ctx->status = HDR_VALUE;
  420|    125|                    ++ctx->vlen;
  421|    125|                    goto parse_hdr_bucket;
  422|    727|                }
  423|    727|            }
  424|      7|            break;
  425|       |
  426|       |
  427|    808|        case HDR_COMPLETE:
  ------------------
  |  Branch (427:9): [True: 808, False: 5.89k]
  ------------------
  428|       |
  429|    808|            if (off < dlen)
  ------------------
  |  Branch (429:17): [True: 803, False: 5]
  ------------------
  430|    803|                apr_bucket_split(e, off);
  ------------------
  |  | 1179|    803|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  431|       |
  432|    808|            e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    808|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    808|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  433|    809|            do {
  434|    809|                apr_bucket *f = APR_BRIGADE_FIRST(ctx->bb);
  ------------------
  |  |  353|    809|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    809|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  435|    809|                apr_bucket_delete(f);
  ------------------
  |  | 1086|    809|#define apr_bucket_delete(e) do {					\
  |  | 1087|    809|        apr_bucket *apr__b = (e);					\
  |  | 1088|    809|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|    809|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|    809|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|    809|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|    809|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|    809|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|    809|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|    809|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|    809|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|    809|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|    809|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|    809|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|    809|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|    809|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|    809|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|    809|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|    809|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|    809|        apr__d->free(apr__d);						\
  |  |  |  | 1073|    809|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|    809|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  436|    809|            } while (e != APR_BRIGADE_FIRST(ctx->bb));
  ------------------
  |  |  353|    809|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    809|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (436:22): [True: 1, False: 808]
  ------------------
  437|       |
  438|    808|            APR_BRIGADE_CONCAT(bb, ctx->bb);
  ------------------
  |  |  388|    808|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    808|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    808|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    808|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    808|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    808|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    808|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    808|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 804, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  340|    804|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    804|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    804|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    804|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    804|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    804|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    804|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    804|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    804|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    804|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    804|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    804|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    804|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    804|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    804|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    804|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    804|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    804|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    804|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    804|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    804|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    804|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    804|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    804|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    804|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    804|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    804|    }                                                       \
  |  |  |  |  344|    808|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    808|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    808|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  439|    808|            return APR_SUCCESS;
  ------------------
  |  |  225|    808|#define APR_SUCCESS 0
  ------------------
  440|       |
  441|       |
  442|      0|        default:
  ------------------
  |  Branch (442:9): [True: 0, False: 6.70k]
  ------------------
  443|      0|            assert(0); /* not reached */
  444|  6.70k|        }
  445|  6.70k|    }
  446|     80|    apreq_brigade_setaside(ctx->bb,pool);
  447|     80|    return APR_INCOMPLETE;
  ------------------
  |  |  458|     80|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     80|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     80|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     80|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  448|    961|}
apreq_parser_header.c:split_header_line:
   57|  4.28k|{
   58|  4.28k|    if (*off > 1) {
  ------------------
  |  Branch (58:9): [True: 4.28k, False: 5]
  ------------------
   59|  4.28k|        apr_bucket_split(e, *off - 1);
  ------------------
  |  | 1179|  4.28k|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
   60|  4.28k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  4.28k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  4.28k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
   61|  4.28k|        *dlen -= *off - 1;
   62|  4.28k|        *data += *off - 1;
   63|  4.28k|        *off = 1;
   64|  4.28k|    }
   65|  4.28k|    return e;
   66|  4.28k|}
apreq_parser_header.c:consume_header_line:
   74|  1.38k|{
   75|  1.38k|    apreq_param_t *param;
   76|  1.38k|    apreq_value_t *v;
   77|  1.38k|    apr_bucket *e, *f;
   78|  1.38k|    apr_status_t s;
   79|  1.38k|    struct iovec vec[APREQ_DEFAULT_NELTS], *iov;
   80|  1.38k|    apr_array_header_t arr;
   81|  1.38k|    char *dest;
   82|  1.38k|    const char *data;
   83|  1.38k|    apr_size_t dlen;
   84|  1.38k|    int i, eol = 0;
   85|       |
   86|  1.38k|    param = apreq_param_make(pool, NULL, nlen, NULL, vlen);
   87|  1.38k|    if (param == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 1.38k]
  ------------------
   88|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
   89|  1.38k|    *(const apreq_value_t **)&v = &param->v;
   90|       |
   91|  1.38k|    arr.pool     = pool;
   92|  1.38k|    arr.elt_size = sizeof(struct iovec);
   93|  1.38k|    arr.nelts    = 0;
   94|  1.38k|    arr.nalloc   = APREQ_DEFAULT_NELTS;
  ------------------
  |  |   66|  1.38k|#define APREQ_DEFAULT_NELTS              8
  ------------------
   95|  1.38k|    arr.elts     = (char *)vec;
   96|       |
   97|  1.38k|    e = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|  1.38k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.38k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
   98|       |
   99|       |    /* store name in a temporary iovec array */
  100|  1.39k|    do {
  101|  1.39k|        apr_size_t len;
  102|       |
  103|  1.39k|        assert(e != APR_BRIGADE_SENTINEL(bb));
  104|  1.39k|        iov = (struct iovec *)apr_array_push(&arr);
  105|  1.39k|        s = apr_bucket_read(e, (const char **)&iov->iov_base,
  ------------------
  |  | 1159|  1.39k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  106|  1.39k|                            &len, APR_BLOCK_READ);
  107|  1.39k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  1.39k|#define APR_SUCCESS 0
  ------------------
  |  Branch (107:13): [True: 0, False: 1.39k]
  ------------------
  108|      0|            return s;
  109|  1.39k|        iov->iov_len = len;
  110|       |
  111|  1.39k|        assert(nlen >= len);
  112|  1.39k|        nlen -= len;
  113|       |
  114|  1.39k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  1.39k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.39k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  115|  1.39k|    } while (nlen > 0);
  ------------------
  |  Branch (115:14): [True: 9, False: 1.38k]
  ------------------
  116|       |
  117|       |    /* skip gap */
  118|  1.39k|    do {
  119|  1.39k|        assert(e != APR_BRIGADE_SENTINEL(bb));
  120|  1.39k|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|  1.39k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  121|  1.39k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  1.39k|#define APR_SUCCESS 0
  ------------------
  |  Branch (121:13): [True: 0, False: 1.39k]
  ------------------
  122|      0|            return s;
  123|       |
  124|  1.39k|        assert(glen >= dlen);
  125|  1.39k|        glen -= dlen;
  126|       |
  127|  1.39k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  1.39k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.39k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  128|  1.39k|    } while (glen > 0);
  ------------------
  |  Branch (128:14): [True: 7, False: 1.38k]
  ------------------
  129|       |
  130|       |    /* copy value */
  131|  1.38k|    dest = v->data;
  132|  1.39k|    do {
  133|  1.39k|        apr_size_t off;
  134|       |
  135|  1.39k|        assert(e != APR_BRIGADE_SENTINEL(bb));
  136|  1.39k|        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
  ------------------
  |  | 1159|  1.39k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  137|  1.39k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  1.39k|#define APR_SUCCESS 0
  ------------------
  |  Branch (137:13): [True: 0, False: 1.39k]
  ------------------
  138|      0|            return s;
  139|       |
  140|  14.4k|        for (off = 0; off < dlen; ++off) {
  ------------------
  |  Branch (140:23): [True: 13.1k, False: 1.39k]
  ------------------
  141|  13.1k|            const char ch = data[off];
  142|  13.1k|            if (ch == '\r' || ch == '\n') {
  ------------------
  |  Branch (142:17): [True: 242, False: 12.8k]
  |  Branch (142:31): [True: 1.56k, False: 11.2k]
  ------------------
  143|       |                /* Eat [CR]LF of continuation or end of line */
  144|  1.81k|                if (!vlen && ch == '\n')
  ------------------
  |  Branch (144:21): [True: 1.59k, False: 219]
  |  Branch (144:30): [True: 1.38k, False: 205]
  ------------------
  145|  1.38k|                    eol = 1; /* done */
  146|  1.81k|                continue;
  147|  1.81k|            }
  148|  11.2k|            assert(vlen > 0);
  149|  11.2k|            *dest = ch;
  150|  11.2k|            ++dest;
  151|  11.2k|            --vlen;
  152|  11.2k|        }
  153|       |
  154|  1.39k|        e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  1.39k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.39k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  155|  1.39k|    } while (!eol);
  ------------------
  |  Branch (155:14): [True: 3, False: 1.38k]
  ------------------
  156|  1.38k|    v->dlen = dest - v->data;
  157|  1.38k|    *dest++ = 0;
  158|       |
  159|       |    /* write name */
  160|  1.38k|    v->name = dest;
  161|  2.78k|    for (i = 0; i < arr.nelts; ++i) {
  ------------------
  |  Branch (161:17): [True: 1.39k, False: 1.38k]
  ------------------
  162|  1.39k|        iov = &((struct iovec *)arr.elts)[i];
  163|  1.39k|        memcpy(dest, iov->iov_base, iov->iov_len);
  164|  1.39k|        dest += iov->iov_len;
  165|  1.39k|        ++iov;
  166|  1.39k|    }
  167|  1.38k|    v->nlen = dest - v->name;
  168|  1.38k|    *dest = 0;
  169|       |
  170|  5.56k|    while ((f = APR_BRIGADE_FIRST(bb)) != e)
  ------------------
  |  |  353|  5.56k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  5.56k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (170:12): [True: 4.18k, False: 1.38k]
  ------------------
  171|  4.18k|        apr_bucket_delete(f);
  ------------------
  |  | 1086|  5.56k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  4.18k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  4.18k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  4.18k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  4.18k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  4.18k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  4.18k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  4.18k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  4.18k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  4.18k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  4.18k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  4.18k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  4.18k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  4.18k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  4.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  4.18k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  4.18k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  4.18k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  4.18k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  4.18k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  4.18k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  4.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  172|       |
  173|  1.38k|    apreq_param_tainted_on(param);
  174|  1.38k|    *p = param;
  175|  1.38k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.38k|#define APR_SUCCESS 0
  ------------------
  176|       |
  177|  1.38k|}

apreq_parse_multipart:
  270|  1.02k|{
  271|  1.02k|    apr_pool_t *pool = parser->pool;
  272|  1.02k|    apr_bucket_alloc_t *ba = parser->bucket_alloc;
  273|  1.02k|    struct mfd_ctx *ctx = parser->ctx;
  274|  1.02k|    apr_status_t s;
  275|       |
  276|  1.02k|    if (ctx == NULL) {
  ------------------
  |  Branch (276:9): [True: 940, False: 84]
  ------------------
  277|    940|        ctx = create_multipart_context(parser->content_type,
  278|    940|                                       pool, ba,
  279|    940|                                       parser->brigade_limit,
  280|    940|                                       parser->temp_dir, 1);
  281|    940|        if (ctx == NULL)
  ------------------
  |  Branch (281:13): [True: 126, False: 814]
  ------------------
  282|    126|            return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|    126|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|    126|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    126|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|    126|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|    126|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    126|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|       |
  284|       |
  285|    814|        parser->ctx = ctx;
  286|    814|    }
  287|       |
  288|    898|    PARSER_STATUS_CHECK(MFD);
  ------------------
  |  |   30|    898|#define PARSER_STATUS_CHECK(PREFIX)   do {         \
  |  |   31|    898|    if (ctx->status == PREFIX##_ERROR)             \
  |  |  ------------------
  |  |  |  Branch (31:9): [True: 0, False: 898]
  |  |  ------------------
  |  |   32|    898|        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|    898|    else if (ctx->status == PREFIX##_COMPLETE)     \
  |  |  ------------------
  |  |  |  Branch (33:14): [True: 0, False: 898]
  |  |  ------------------
  |  |   34|    898|        return APR_SUCCESS;                        \
  |  |  ------------------
  |  |  |  |  225|      0|#define APR_SUCCESS 0
  |  |  ------------------
  |  |   35|    898|    else if (bb == NULL)                           \
  |  |  ------------------
  |  |  |  Branch (35:14): [True: 0, False: 898]
  |  |  ------------------
  |  |   36|    898|        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|    898|} while (0);
  |  |  ------------------
  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
  289|    898|    APR_BRIGADE_CONCAT(ctx->in, bb);
  ------------------
  |  |  388|    898|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    898|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    898|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    898|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    898|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    898|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    898|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    898|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 898, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  340|    898|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    898|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    898|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    898|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    898|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    898|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    898|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    898|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    898|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    898|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    898|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    898|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    898|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    898|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    898|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    898|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    898|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    898|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    898|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    898|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    898|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    898|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    898|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    898|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    898|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    898|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    898|    }                                                       \
  |  |  |  |  344|    898|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    898|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    898|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  290|       |
  291|  1.97k| mfd_parse_brigade:
  292|       |
  293|  1.97k|    switch (ctx->status) {
  294|       |
  295|    971|    case MFD_INIT:
  ------------------
  |  Branch (295:5): [True: 971, False: 1.00k]
  ------------------
  296|    971|        {
  297|    971|            s = split_on_bdry(ctx->bb, ctx->in, NULL, ctx->bdry + 2);
  298|    971|            if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    971|#define APR_SUCCESS 0
  ------------------
  |  Branch (298:17): [True: 110, False: 861]
  ------------------
  299|    110|                apreq_brigade_setaside(ctx->in, pool);
  300|    110|                apreq_brigade_setaside(ctx->bb, pool);
  301|    110|                return s;
  302|    110|            }
  303|    861|            ctx->status = MFD_NEXTLINE;
  304|       |            /* Be polite and return any preamble text to the caller. */
  305|    861|            APR_BRIGADE_CONCAT(bb, ctx->bb);
  ------------------
  |  |  388|    861|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    861|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    861|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    861|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    861|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    861|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    861|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    861|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 452, False: 409]
  |  |  |  |  ------------------
  |  |  |  |  340|    452|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    452|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    452|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    452|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    452|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    452|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    452|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    452|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    452|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    452|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    452|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    452|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    452|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    452|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    452|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    452|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    452|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    452|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    452|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    452|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    452|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    452|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    452|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    452|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    452|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    452|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    452|    }                                                       \
  |  |  |  |  344|    861|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    861|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    861|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  306|    861|        }
  307|       |
  308|       |        /* fall through */
  309|       |
  310|  1.12k|    case MFD_NEXTLINE:
  ------------------
  |  Branch (310:5): [True: 263, False: 1.71k]
  ------------------
  311|  1.12k|        {
  312|  1.12k|            s = split_on_bdry(ctx->bb, ctx->in, NULL, CRLF);
  ------------------
  |  |   25|  1.12k|#define CRLF    "\015\012"
  ------------------
  313|  1.12k|            if (s == APR_EOF) {
  ------------------
  |  |  467|  1.12k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|  1.12k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|  1.12k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  1.12k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (313:17): [True: 0, False: 1.12k]
  ------------------
  314|      0|                ctx->status = MFD_COMPLETE;
  315|      0|                return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  316|      0|            }
  317|  1.12k|            if (s != APR_SUCCESS) {
  ------------------
  |  |  225|  1.12k|#define APR_SUCCESS 0
  ------------------
  |  Branch (317:17): [True: 86, False: 1.03k]
  ------------------
  318|     86|                apreq_brigade_setaside(ctx->in, pool);
  319|     86|                apreq_brigade_setaside(ctx->bb, pool);
  320|     86|                return s;
  321|     86|            }
  322|  1.03k|            if (!APR_BRIGADE_EMPTY(ctx->bb)) {
  ------------------
  |  |  346|  1.03k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  1.03k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  1.03k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.03k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  1.03k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:17): [True: 426, False: 612]
  ------------------
  323|    426|                char *line;
  324|    426|                apr_size_t len;
  325|    426|                apr_brigade_pflatten(ctx->bb, &line, &len, pool);
  326|       |
  327|    426|                if (len >= 2 && strncmp(line, "--", 2) == 0) {
  ------------------
  |  Branch (327:21): [True: 266, False: 160]
  |  Branch (327:33): [True: 77, False: 189]
  ------------------
  328|     77|                    APR_BRIGADE_CONCAT(bb, ctx->in);
  ------------------
  |  |  388|     77|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|     77|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|     77|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|     77|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|     77|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     77|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     77|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|     77|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 72, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  340|     72|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     72|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|     72|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     72|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     72|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|     72|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|     72|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     72|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     72|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|     72|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     72|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|     72|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     72|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|     72|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|     72|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|     72|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|     72|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|     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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|     72|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|     72|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     72|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     72|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|     72|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|     72|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|     72|    }                                                       \
  |  |  |  |  344|     77|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|     77|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|     77|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  329|     77|                    ctx->status = MFD_COMPLETE;
  330|     77|                    return APR_SUCCESS;
  ------------------
  |  |  225|     77|#define APR_SUCCESS 0
  ------------------
  331|     77|                }
  332|    349|                apr_brigade_cleanup(ctx->bb);
  333|    349|            }
  334|       |
  335|    961|            ctx->status = MFD_HEADER;
  336|    961|            ctx->info = NULL;
  337|    961|        }
  338|       |        /* fall through */
  339|       |
  340|    961|    case MFD_HEADER:
  ------------------
  |  Branch (340:5): [True: 0, False: 1.97k]
  ------------------
  341|    961|        {
  342|    961|            if (ctx->info == NULL) {
  ------------------
  |  Branch (342:17): [True: 961, False: 0]
  ------------------
  343|    961|                ctx->info = apr_table_make(pool, APREQ_DEFAULT_NELTS);
  ------------------
  |  |   66|    961|#define APREQ_DEFAULT_NELTS              8
  ------------------
  344|       |                /* flush out header parser internal structs for reuse */
  345|    961|                ctx->hdr_parser->ctx = NULL;
  346|    961|            }
  347|    961|            s = apreq_parser_run(ctx->hdr_parser, ctx->info, ctx->in);
  348|    961|            switch (s) {
  349|    808|            case APR_SUCCESS:
  ------------------
  |  |  225|    808|#define APR_SUCCESS 0
  ------------------
  |  Branch (349:13): [True: 808, False: 153]
  ------------------
  350|    808|                ctx->status = MFD_POST_HEADER;
  351|    808|                break;
  352|     80|            case APR_INCOMPLETE:
  ------------------
  |  |  458|     80|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     80|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     80|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     80|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (352:13): [True: 80, False: 881]
  ------------------
  353|     80|                apreq_brigade_setaside(ctx->in, pool);
  354|     80|                return APR_INCOMPLETE;
  ------------------
  |  |  458|     80|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|     80|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     80|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     80|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|     73|            default:
  ------------------
  |  Branch (355:13): [True: 73, False: 888]
  ------------------
  356|     73|                ctx->status = MFD_ERROR;
  357|     73|                return s;
  358|    961|            }
  359|    961|        }
  360|       |        /* fall through */
  361|       |
  362|    808|    case MFD_POST_HEADER:
  ------------------
  |  Branch (362:5): [True: 0, False: 1.97k]
  ------------------
  363|    808|        {
  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|    808|            const char *cd, *ct, *name, *filename;
  379|    808|            apr_size_t nlen, flen;
  380|    808|            apr_bucket *e;
  381|       |
  382|    808|            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: 798]
  ------------------
  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|     12|            case APR_SUCCESS:
  ------------------
  |  |  225|     12|#define APR_SUCCESS 0
  ------------------
  |  Branch (388:13): [True: 12, False: 796]
  ------------------
  389|       |                /* part has no body- return CRLF to front */
  390|     12|                e = apr_bucket_immortal_create(CRLF, 2,
  ------------------
  |  |   25|     12|#define CRLF    "\015\012"
  ------------------
  391|     12|                                                ctx->bb->bucket_alloc);
  392|     12|                APR_BRIGADE_INSERT_HEAD(ctx->in, e);
  ------------------
  |  |  366|     12|#define APR_BRIGADE_INSERT_HEAD(b, e) do {				\
  |  |  367|     12|	apr_bucket *ap__b = (e);                                        \
  |  |  368|     12|	APR_RING_INSERT_HEAD(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  318|     12|    APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  286|     12|#define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  287|     12|    APR_RING_PREV((ep1), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     12|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     12|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|     12|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  288|     12|    APR_RING_NEXT((epN), link) = APR_RING_FIRST((hp));        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     12|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_FIRST((hp));        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     12|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  289|     12|    APR_RING_PREV(APR_RING_FIRST((hp)), link) = (epN);        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     12|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  290|     12|    APR_RING_FIRST((hp)) = (ep1);                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|     12|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     12|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|     12|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  370|     12|    } while (0)
  |  |  ------------------
  |  |  |  Branch (370:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  393|     12|                break;
  394|       |
  395|    786|            default:
  ------------------
  |  Branch (395:13): [True: 786, False: 22]
  ------------------
  396|    786|                ; /* has body, ok */
  397|    808|            }
  398|       |
  399|    798|            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|    798|            ct = apr_table_get(ctx->info, "Content-Type");
  407|       |
  408|    798|            if (ct != NULL && strncmp(ct, "multipart/", 10) == 0) {
  ------------------
  |  Branch (408:17): [True: 204, False: 594]
  |  Branch (408:31): [True: 95, False: 109]
  ------------------
  409|     95|                struct mfd_ctx *next_ctx;
  410|       |
  411|     95|                if (ctx->level >= MAX_LEVEL) {
  ------------------
  |  |   40|     95|#define MAX_LEVEL 8
  ------------------
  |  Branch (411:21): [True: 0, False: 95]
  ------------------
  412|      0|                    ctx->status = MFD_ERROR;
  413|      0|                    goto mfd_parse_brigade;
  414|      0|                }
  415|       |
  416|     95|                next_ctx = create_multipart_context(ct, pool, ba,
  417|     95|                                                    parser->brigade_limit,
  418|     95|                                                    parser->temp_dir,
  419|     95|                                                    ctx->level + 1);
  420|     95|                if (next_ctx == NULL) {
  ------------------
  |  Branch (420:21): [True: 8, False: 87]
  ------------------
  421|      8|                    ctx->status = MFD_ERROR;
  422|      8|                    goto mfd_parse_brigade;
  423|      8|                }
  424|       |
  425|     87|                if (cd != NULL) {
  ------------------
  |  Branch (425:21): [True: 7, False: 80]
  ------------------
  426|      7|                    s = apreq_header_attribute(cd, "name", 4,
  427|      7|                                               &name, &nlen);
  428|      7|                    if (s == APR_SUCCESS && nlen) {
  ------------------
  |  |  225|     14|#define APR_SUCCESS 0
  ------------------
  |  Branch (428:25): [True: 3, False: 4]
  |  Branch (428:45): [True: 2, False: 1]
  ------------------
  429|      2|                        next_ctx->param_name = apr_pstrmemdup(pool, name,
  430|      2|                                                              nlen);
  431|      2|                    }
  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|      7|                }
  437|     84|                if (!next_ctx->param_name) {
  ------------------
  |  Branch (437:21): [True: 82, False: 2]
  ------------------
  438|     82|                    const char *cid = apr_table_get(ctx->info,
  439|     82|                                                    "Content-ID");
  440|     82|                    if (cid) {
  ------------------
  |  Branch (440:25): [True: 2, False: 80]
  ------------------
  441|      2|                        next_ctx->param_name = apr_pstrdup(pool, cid);
  442|      2|                    }
  443|     80|                    else {
  444|     80|                        next_ctx->param_name = "";
  445|     80|                    }
  446|     82|                }
  447|       |
  448|     84|                ctx->next_parser = apreq_parser_make(pool, ba, ct,
  449|     84|                                                     apreq_parse_multipart,
  450|     84|                                                     parser->brigade_limit,
  451|     84|                                                     parser->temp_dir,
  452|     84|                                                     parser->hook,
  453|     84|                                                     next_ctx);
  454|     84|                ctx->status = MFD_MIXED;
  455|     84|                goto mfd_parse_brigade;
  456|       |
  457|     87|            }
  458|       |
  459|       |            /* Look for a normal form-data part. */
  460|       |
  461|    703|            if (cd != NULL && strncmp(cd, "form-data", 9) == 0) {
  ------------------
  |  Branch (461:17): [True: 189, False: 514]
  |  Branch (461:31): [True: 71, False: 118]
  ------------------
  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: 5, False: 66]
  |  Branch (463:41): [True: 2, False: 64]
  ------------------
  464|      7|                    ctx->status = MFD_ERROR;
  465|      7|                    goto mfd_parse_brigade;
  466|      7|                }
  467|       |
  468|     64|                s = apreq_header_attribute(cd, "filename",
  469|     64|                                           8, &filename, &flen);
  470|     64|                if (s == APR_SUCCESS && flen) {
  ------------------
  |  |  225|    128|#define APR_SUCCESS 0
  ------------------
  |  Branch (470:21): [True: 5, False: 59]
  |  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|     60|                else if (s != APREQ_ERROR_NOATTR) {
  ------------------
  |  |   77|     60|#define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  2)
  |  |  ------------------
  |  |  |  |   73|     60|#define APREQ_ERROR_NODATA         (APREQ_ERROR_GENERAL  + 20)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     60|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     60|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     60|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     60|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     60|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     60|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (485:26): [True: 3, False: 57]
  ------------------
  486|      3|                    ctx->status = MFD_ERROR;
  487|      3|                    goto mfd_parse_brigade;
  488|      3|                }
  489|     57|                else {
  490|     57|                    ctx->param_name = apr_pstrmemdup(pool, name, nlen);
  491|     57|                    ctx->status = MFD_PARAM;
  492|       |                    /* fall thru */
  493|     57|                }
  494|     64|            }
  495|       |
  496|       |            /* else check for a file part in a multipart section */
  497|    632|            else if (cd != NULL && strncmp(cd, "file", 4) == 0) {
  ------------------
  |  Branch (497:22): [True: 118, False: 514]
  |  Branch (497:36): [True: 11, False: 107]
  ------------------
  498|     11|                apreq_param_t *param;
  499|       |
  500|     11|                s = apreq_header_attribute(cd, "filename",
  501|     11|                                           8, &filename, &flen);
  502|     11|                if (s != APR_SUCCESS || !flen || !ctx->param_name) {
  ------------------
  |  |  225|     22|#define APR_SUCCESS 0
  ------------------
  |  Branch (502:21): [True: 3, False: 8]
  |  Branch (502:41): [True: 2, False: 6]
  |  Branch (502:50): [True: 6, False: 0]
  ------------------
  503|     11|                    ctx->status = MFD_ERROR;
  504|     11|                    goto mfd_parse_brigade;
  505|     11|                }
  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|    621|            else {
  523|    621|                const char *cid = apr_table_get(ctx->info, "Content-ID");
  524|    621|                apreq_param_t *param;
  525|       |
  526|    621|                if (cid != NULL) {
  ------------------
  |  Branch (526:21): [True: 15, False: 606]
  ------------------
  527|     15|                    name = cid;
  528|     15|                    nlen = strlen(name);
  529|     15|                }
  530|    606|                else {
  531|    606|                    name = "";
  532|    606|                    nlen = 0;
  533|    606|                }
  534|       |
  535|    621|                filename = "";
  536|    621|                flen = 0;
  537|    621|                param = apreq_param_make(pool, name, nlen,
  538|    621|                                         filename, flen);
  539|    621|                if (param == NULL)
  ------------------
  |  Branch (539:21): [True: 0, False: 621]
  ------------------
  540|      0|                    return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  541|    621|                apreq_param_tainted_on(param);
  542|    621|                param->info = ctx->info;
  543|    621|                param->upload = apr_brigade_create(pool,
  544|    621|                                               ctx->bb->bucket_alloc);
  545|    621|                ctx->upload = param;
  546|    621|                ctx->status = MFD_UPLOAD;
  547|    621|                goto mfd_parse_brigade;
  548|    621|            }
  549|    703|        }
  550|       |        /* fall through */
  551|       |
  552|     57|    case MFD_PARAM:
  ------------------
  |  Branch (552:5): [True: 0, False: 1.97k]
  ------------------
  553|     57|        {
  554|     57|            apreq_param_t *param;
  555|     57|            apreq_value_t *v;
  556|     57|            apr_size_t len;
  557|     57|            apr_off_t off;
  558|       |
  559|     57|            s = split_on_bdry(ctx->bb, ctx->in, ctx->pattern, ctx->bdry);
  560|       |
  561|     57|            switch (s) {
  562|       |
  563|      4|            case APR_INCOMPLETE:
  ------------------
  |  |  458|      4|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      4|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      4|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      4|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (563:13): [True: 4, False: 53]
  ------------------
  564|      4|                apreq_brigade_setaside(ctx->in, pool);
  565|      4|                apreq_brigade_setaside(ctx->bb, pool);
  566|      4|                return s;
  567|       |
  568|     53|            case APR_SUCCESS:
  ------------------
  |  |  225|     53|#define APR_SUCCESS 0
  ------------------
  |  Branch (568:13): [True: 53, False: 4]
  ------------------
  569|     53|                s = apr_brigade_length(ctx->bb, 1, &off);
  570|     53|                if (s != APR_SUCCESS) {
  ------------------
  |  |  225|     53|#define APR_SUCCESS 0
  ------------------
  |  Branch (570:21): [True: 0, False: 53]
  ------------------
  571|      0|                    ctx->status = MFD_ERROR;
  572|      0|                    return s;
  573|      0|                }
  574|     53|                len = off;
  575|     53|                param = apreq_param_make(pool, ctx->param_name,
  576|     53|                                         strlen(ctx->param_name),
  577|     53|                                         NULL, len);
  578|     53|                if (param == NULL)
  ------------------
  |  Branch (578:21): [True: 0, False: 53]
  ------------------
  579|      0|                    return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  580|     53|                apreq_param_tainted_on(param);
  581|     53|                param->info = ctx->info;
  582|       |
  583|     53|                *(const apreq_value_t **)&v = &param->v;
  584|     53|                apr_brigade_flatten(ctx->bb, v->data, &len);
  585|     53|                v->data[len] = 0;
  586|       |
  587|     53|                if (parser->hook != NULL) {
  ------------------
  |  Branch (587:21): [True: 53, False: 0]
  ------------------
  588|     53|                    s = apreq_hook_run(parser->hook, param, NULL);
  589|     53|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|     53|#define APR_SUCCESS 0
  ------------------
  |  Branch (589:25): [True: 0, False: 53]
  ------------------
  590|      0|                        ctx->status = MFD_ERROR;
  591|      0|                        return s;
  592|      0|                    }
  593|     53|                }
  594|       |
  595|     53|                apreq_param_charset_set(param,
  596|     53|                                        apreq_charset_divine(v->data, len));
  597|     53|                apreq_value_table_add(v, t);
  598|     53|                ctx->status = MFD_NEXTLINE;
  599|     53|                ctx->param_name = NULL;
  600|     53|                apr_brigade_cleanup(ctx->bb);
  601|     53|                goto mfd_parse_brigade;
  602|       |
  603|      0|            default:
  ------------------
  |  Branch (603:13): [True: 0, False: 57]
  ------------------
  604|      0|                ctx->status = MFD_ERROR;
  605|      0|                return s;
  606|     57|            }
  607|       |
  608|       |
  609|     57|        }
  610|      0|        break;  /* not reached */
  611|       |
  612|    625|    case MFD_UPLOAD:
  ------------------
  |  Branch (612:5): [True: 625, False: 1.35k]
  ------------------
  613|    625|        {
  614|    625|            apreq_param_t *param = ctx->upload;
  615|       |
  616|    625|            s = split_on_bdry(ctx->bb, ctx->in, ctx->pattern, ctx->bdry);
  617|    625|            switch (s) {
  618|       |
  619|    415|            case APR_INCOMPLETE:
  ------------------
  |  |  458|    415|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|    415|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    415|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    415|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (619:13): [True: 415, False: 210]
  ------------------
  620|    415|                if (parser->hook != NULL) {
  ------------------
  |  Branch (620:21): [True: 415, False: 0]
  ------------------
  621|    415|                    s = apreq_hook_run(parser->hook, param, ctx->bb);
  622|    415|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    415|#define APR_SUCCESS 0
  ------------------
  |  Branch (622:25): [True: 0, False: 415]
  ------------------
  623|      0|                        ctx->status = MFD_ERROR;
  624|      0|                        return s;
  625|      0|                    }
  626|    415|                }
  627|    415|                apreq_brigade_setaside(ctx->bb, pool);
  628|    415|                apreq_brigade_setaside(ctx->in, pool);
  629|    415|                s = apreq_brigade_concat(pool, parser->temp_dir,
  630|    415|                                         parser->brigade_limit,
  631|    415|                                         param->upload, ctx->bb);
  632|    415|                return (s == APR_SUCCESS) ? APR_INCOMPLETE : s;
  ------------------
  |  |  225|    415|#define APR_SUCCESS 0
  ------------------
                              return (s == APR_SUCCESS) ? APR_INCOMPLETE : s;
  ------------------
  |  |  458|    415|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|    415|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    415|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    415|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (632:24): [True: 415, False: 0]
  ------------------
  633|       |
  634|    210|            case APR_SUCCESS:
  ------------------
  |  |  225|    210|#define APR_SUCCESS 0
  ------------------
  |  Branch (634:13): [True: 210, False: 415]
  ------------------
  635|    210|                if (parser->hook != NULL) {
  ------------------
  |  Branch (635:21): [True: 210, False: 0]
  ------------------
  636|    210|                    APR_BRIGADE_INSERT_TAIL(ctx->bb, ctx->eos);
  ------------------
  |  |  377|    210|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|    210|	apr_bucket *ap__b = (e);					\
  |  |  379|    210|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|    210|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    210|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    210|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    210|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    210|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    210|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    210|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    210|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    210|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    210|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    210|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    210|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    210|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    210|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|    210|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|    210|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  637|    210|                    s = apreq_hook_run(parser->hook, param, ctx->bb);
  638|    210|                    APR_BUCKET_REMOVE(ctx->eos);
  ------------------
  |  |  442|    210|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|    210|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|    210|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|    210|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    210|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|    210|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    210|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|    210|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    210|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|    210|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    210|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|    210|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  639|    210|                    if (s != APR_SUCCESS) {
  ------------------
  |  |  225|    210|#define APR_SUCCESS 0
  ------------------
  |  Branch (639:25): [True: 0, False: 210]
  ------------------
  640|      0|                        ctx->status = MFD_ERROR;
  641|      0|                        return s;
  642|      0|                    }
  643|    210|                }
  644|    210|                apreq_value_table_add(&param->v, t);
  645|    210|                apreq_brigade_setaside(ctx->bb, pool);
  646|    210|                s = apreq_brigade_concat(pool, parser->temp_dir,
  647|    210|                                         parser->brigade_limit,
  648|    210|                                         param->upload, ctx->bb);
  649|       |
  650|    210|                if (s != APR_SUCCESS)
  ------------------
  |  |  225|    210|#define APR_SUCCESS 0
  ------------------
  |  Branch (650:21): [True: 0, False: 210]
  ------------------
  651|      0|                    return s;
  652|       |
  653|    210|                ctx->status = MFD_NEXTLINE;
  654|    210|                goto mfd_parse_brigade;
  655|       |
  656|      0|            default:
  ------------------
  |  Branch (656:13): [True: 0, False: 625]
  ------------------
  657|      0|                ctx->status = MFD_ERROR;
  658|      0|                return s;
  659|    625|            }
  660|       |
  661|    625|        }
  662|      0|        break;  /* not reached */
  663|       |
  664|       |
  665|     84|    case MFD_MIXED:
  ------------------
  |  Branch (665:5): [True: 84, False: 1.89k]
  ------------------
  666|     84|        {
  667|     84|            s = apreq_parser_run(ctx->next_parser, t, ctx->in);
  668|     84|            switch (s) {
  669|     73|            case APR_SUCCESS:
  ------------------
  |  |  225|     73|#define APR_SUCCESS 0
  ------------------
  |  Branch (669:13): [True: 73, False: 11]
  ------------------
  670|     73|                ctx->status = MFD_INIT;
  671|     73|                ctx->param_name = NULL;
  672|     73|                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: 75]
  ------------------
  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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      9|#define APR_OFFSETOF(s_type,field) 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      2|#define APR_OFFSETOF(s_type,field) 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      2|#define APR_OFFSETOF(s_type,field) 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      2|#define APR_OFFSETOF(s_type,field) 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: 82]
  ------------------
  677|      2|                ctx->status = MFD_ERROR;
  678|      2|                return s;
  679|     84|            }
  680|       |
  681|     84|        }
  682|      0|        break; /* not reached */
  683|       |
  684|     32|    default:
  ------------------
  |  Branch (684:5): [True: 32, False: 1.94k]
  ------------------
  685|     32|        return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|     32|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|     32|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|     32|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|     32|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|     32|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     32|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  686|  1.97k|    }
  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.97k|}
apreq_parser_multipart.c:create_multipart_context:
  220|  1.03k|{
  221|  1.03k|    apr_status_t s;
  222|  1.03k|    apr_size_t blen;
  223|  1.03k|    struct mfd_ctx *ctx;
  224|  1.03k|    const char *attr;
  225|  1.03k|    char *buf;
  226|       |
  227|  1.03k|    attr = (content_type) ? strchr(content_type, ';') : NULL;
  ------------------
  |  Branch (227:12): [True: 1.03k, False: 0]
  ------------------
  228|  1.03k|    if (!attr)
  ------------------
  |  Branch (228:9): [True: 15, False: 1.02k]
  ------------------
  229|     15|        return NULL; /* missing semicolon */
  230|       |
  231|  1.02k|    ctx = apr_palloc(pool, sizeof *ctx);
  ------------------
  |  |  425|  1.02k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.02k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.02k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.02k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|       |
  233|  1.02k|    attr++;
  234|  1.02k|    blen = strlen(attr) + 1;
  235|  1.02k|    buf = apr_palloc(pool, 4 + blen);
  ------------------
  |  |  425|  1.02k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.02k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.02k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.02k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  1.02k|    buf += 4;
  237|  1.02k|    memcpy(buf, attr, blen);
  238|       |
  239|  1.02k|    s = apreq_header_attribute(buf, "boundary", 8,
  240|  1.02k|                               (const char **)&ctx->bdry, &blen);
  241|  1.02k|    if (s != APR_SUCCESS || !blen)
  ------------------
  |  |  225|  2.04k|#define APR_SUCCESS 0
  ------------------
  |  Branch (241:9): [True: 113, False: 907]
  |  Branch (241:29): [True: 6, False: 901]
  ------------------
  242|    119|        return NULL; /* missing or empty boundary */
  243|       |
  244|    901|    ctx->bdry[blen] = 0;
  245|       |
  246|    901|    *--ctx->bdry = '-';
  247|    901|    *--ctx->bdry = '-';
  248|    901|    *--ctx->bdry = '\n';
  249|    901|    *--ctx->bdry = '\r';
  250|       |
  251|    901|    ctx->status = MFD_INIT;
  252|    901|    ctx->pattern = apr_strmatch_precompile(pool, ctx->bdry, 1);
  253|    901|    ctx->hdr_parser = apreq_parser_make(pool, ba, "",
  254|    901|                                        apreq_parse_headers,
  255|    901|                                        brigade_limit,
  256|    901|                                        temp_dir, NULL, NULL);
  257|    901|    ctx->info = NULL;
  258|    901|    ctx->bb = apr_brigade_create(pool, ba);
  259|    901|    ctx->in = apr_brigade_create(pool, ba);
  260|    901|    ctx->eos = apr_bucket_eos_create(ba);
  261|    901|    ctx->next_parser = NULL;
  262|    901|    ctx->param_name = NULL;
  263|    901|    ctx->upload = NULL;
  264|    901|    ctx->level = level;
  265|       |
  266|    901|    return ctx;
  267|  1.02k|}
apreq_parser_multipart.c:split_on_bdry:
  116|  2.77k|{
  117|  2.77k|    apr_bucket *e = APR_BRIGADE_FIRST(in);
  ------------------
  |  |  353|  2.77k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  2.77k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  118|  2.77k|    apr_size_t blen = strlen(bdry), off = 0;
  119|       |
  120|  4.58k|    while ( e != APR_BRIGADE_SENTINEL(in) ) {
  ------------------
  |  |  339|  4.58k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  4.58k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  4.58k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (120:13): [True: 3.96k, False: 615]
  ------------------
  121|  3.96k|        apr_ssize_t idx;
  122|  3.96k|        apr_size_t len;
  123|  3.96k|        const char *buf;
  124|  3.96k|        apr_status_t s;
  125|       |
  126|  3.96k|        if (APR_BUCKET_IS_EOS(e))
  ------------------
  |  |  469|  3.96k|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 3.96k]
  |  |  ------------------
  ------------------
  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.96k|        s = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ);
  ------------------
  |  | 1159|  3.96k|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  130|  3.96k|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|  3.96k|#define APR_SUCCESS 0
  ------------------
  |  Branch (130:13): [True: 0, False: 3.96k]
  ------------------
  131|      0|            return s;
  132|       |
  133|  3.96k|        if (len == 0) {
  ------------------
  |  Branch (133:13): [True: 1, False: 3.96k]
  ------------------
  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.98k|    look_for_boundary_up_front:
  141|  3.98k|        if (strncmp(bdry + off, buf, MIN(len, blen - off)) == 0) {
  ------------------
  |  |   28|  3.98k|#define MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (28:20): [True: 304, False: 3.67k]
  |  |  ------------------
  ------------------
  |  Branch (141:13): [True: 2.32k, False: 1.66k]
  ------------------
  142|  2.32k|            if ( len >= blen - off ) {
  ------------------
  |  Branch (142:18): [True: 2.16k, False: 158]
  ------------------
  143|       |                /* complete match */
  144|  2.16k|                if (len > blen - off)
  ------------------
  |  Branch (144:21): [True: 2.11k, False: 52]
  ------------------
  145|  2.11k|                    apr_bucket_split(e, blen - off);
  ------------------
  |  | 1179|  2.11k|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  146|  2.16k|                e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|  2.16k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  2.16k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  147|       |
  148|  2.17k|                do {
  149|  2.17k|                    apr_bucket *f = APR_BRIGADE_FIRST(in);
  ------------------
  |  |  353|  2.17k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  2.17k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  150|  2.17k|                    apr_bucket_delete(f);
  ------------------
  |  | 1086|  2.17k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  2.17k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  2.17k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  2.17k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  2.17k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  2.17k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  2.17k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.17k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  2.17k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.17k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  2.17k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.17k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  2.17k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.17k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  2.17k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  2.17k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  2.17k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  2.17k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  2.17k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  2.17k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  2.17k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  2.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  151|  2.17k|                } while (APR_BRIGADE_FIRST(in) != e);
  ------------------
  |  |  353|  2.17k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  2.17k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (151:26): [True: 14, False: 2.16k]
  ------------------
  152|       |
  153|  2.16k|                return APR_SUCCESS;
  ------------------
  |  |  225|  2.16k|#define APR_SUCCESS 0
  ------------------
  154|  2.16k|            }
  155|       |            /* partial match */
  156|    158|            off += len;
  157|    158|            e = APR_BUCKET_NEXT(e);
  ------------------
  |  |  430|    158|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    158|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  158|    158|            continue;
  159|  2.32k|        }
  160|  1.66k|        else if (off > 0) {
  ------------------
  |  Branch (160:18): [True: 18, False: 1.64k]
  ------------------
  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|     18|            apr_bucket_brigade * volatile in_v = in;
  171|       |
  172|     18|            do {
  173|     18|                apr_bucket *f = APR_BRIGADE_FIRST(in_v);
  ------------------
  |  |  353|     18|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     18|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  174|     18|                APR_BUCKET_REMOVE(f);
  ------------------
  |  |  442|     18|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|     18|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|     18|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|     18|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     18|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|     18|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     18|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|     18|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     18|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|     18|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     18|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|     18|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|     18|                APR_BRIGADE_INSERT_TAIL(out, f);
  ------------------
  |  |  377|     18|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|     18|	apr_bucket *ap__b = (e);					\
  |  |  379|     18|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|     18|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     18|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|     18|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     18|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|     18|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|     18|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|     18|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     18|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     18|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|     18|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|     18|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|     18|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|     18|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|     18|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|     18|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|     18|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  176|     18|            } while (e != APR_BRIGADE_FIRST(in_v));
  ------------------
  |  |  353|     18|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|     18|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  |  Branch (176:22): [True: 0, False: 18]
  ------------------
  177|     18|            off = 0;
  178|     18|            goto look_for_boundary_up_front;
  179|     18|        }
  180|       |
  181|  1.64k|        if (pattern != NULL && len >= blen) {
  ------------------
  |  Branch (181:13): [True: 598, False: 1.04k]
  |  Branch (181:32): [True: 488, False: 110]
  ------------------
  182|    488|            const char *match = apr_strmatch(pattern, buf, len);
  ------------------
  |  |   64|    488|#define apr_strmatch(pattern, s, slen) (*((pattern)->compare))((pattern), (s), (slen))
  ------------------
  183|    488|            if (match != NULL)
  ------------------
  |  Branch (183:17): [True: 184, False: 304]
  ------------------
  184|    184|                idx = match - buf;
  185|    304|            else {
  186|    304|                idx = apreq_index(buf + len-blen, blen, bdry, blen,
  187|    304|                                  APREQ_MATCH_PARTIAL);
  188|    304|                if (idx >= 0)
  ------------------
  |  Branch (188:21): [True: 61, False: 243]
  ------------------
  189|     61|                    idx += len-blen;
  190|    304|            }
  191|    488|        }
  192|  1.15k|        else
  193|  1.15k|            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.64k|        if (idx >= 0)
  ------------------
  |  Branch (200:13): [True: 1.17k, False: 467]
  ------------------
  201|  1.17k|            apr_bucket_split(e, idx);
  ------------------
  |  | 1179|  1.17k|#define apr_bucket_split(e,point) (e)->type->split(e, point)
  ------------------
  202|       |
  203|  1.64k|        APR_BUCKET_REMOVE(e);
  ------------------
  |  |  442|  1.64k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  ------------------
  |  |  |  |  382|  1.64k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  368|  1.64k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  369|  1.64k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.64k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  370|  1.64k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.64k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  371|  1.64k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.64k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  372|  1.64k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.64k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  373|  1.64k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  1.64k|        APR_BRIGADE_INSERT_TAIL(out, e);
  ------------------
  |  |  377|  1.64k|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|  1.64k|	apr_bucket *ap__b = (e);					\
  |  |  379|  1.64k|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|  1.64k|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.64k|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|  1.64k|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.64k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|  1.64k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  1.64k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|  1.64k|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.64k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.64k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|  1.64k|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.64k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|  1.64k|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.64k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|  1.64k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  1.64k|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|  1.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  205|  1.64k|        e = APR_BRIGADE_FIRST(in);
  ------------------
  |  |  353|  1.64k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.64k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  206|  1.64k|    }
  207|       |
  208|    615|    return APR_INCOMPLETE;
  ------------------
  |  |  458|    615|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|    615|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    615|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    615|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  2.77k|}
apreq_parser_multipart.c:brigade_start_string:
   73|    808|{
   74|    808|    apr_bucket *e;
   75|    808|    apr_size_t slen = strlen(start_string);
   76|       |
   77|    831|    for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  353|    808|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    808|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    831|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    831|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    831|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (77:37): [True: 821, False: 10]
  ------------------
   78|    808|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|     23|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|     23|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
   79|    821|    {
   80|    821|        const char *buf;
   81|    821|        apr_status_t s, bytes_to_check;
   82|    821|        apr_size_t blen;
   83|       |
   84|    821|        if (slen == 0)
  ------------------
  |  Branch (84:13): [True: 12, False: 809]
  ------------------
   85|     12|            return APR_SUCCESS;
  ------------------
  |  |  225|     12|#define APR_SUCCESS 0
  ------------------
   86|       |
   87|    809|        if (APR_BUCKET_IS_EOS(e))
  ------------------
  |  |  469|    809|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 809]
  |  |  ------------------
  ------------------
   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|    809|        s = apr_bucket_read(e, &buf, &blen, APR_BLOCK_READ);
  ------------------
  |  | 1159|    809|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
   91|       |
   92|    809|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    809|#define APR_SUCCESS 0
  ------------------
  |  Branch (92:13): [True: 0, False: 809]
  ------------------
   93|      0|            return s;
   94|       |
   95|    809|        if (blen == 0)
  ------------------
  |  Branch (95:13): [True: 0, False: 809]
  ------------------
   96|      0|            continue;
   97|       |
   98|    809|        bytes_to_check = MIN(slen,blen);
  ------------------
  |  |   28|    809|#define MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (28:20): [True: 684, False: 125]
  |  |  ------------------
  ------------------
   99|       |
  100|    809|        if (strncmp(buf,start_string,bytes_to_check) != 0)
  ------------------
  |  Branch (100:13): [True: 786, False: 23]
  ------------------
  101|    786|            return APREQ_ERROR_GENERAL;
  ------------------
  |  |   53|    786|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  ------------------
  |  |  |  |  164|    786|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    786|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  117|    786|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|    786|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    786|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|       |
  103|     23|        slen -= bytes_to_check;
  104|     23|        start_string += bytes_to_check;
  105|     23|    }
  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|    808|}

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

apreq_index:
   95|  1.46k|{
   96|  1.46k|    apr_size_t len = hlen;
   97|  1.46k|    const char *end = hay + hlen;
   98|  1.46k|    const char *begin = hay;
   99|       |
  100|  5.80k|    while ( (hay = memchr(hay, ndl[0], len)) ) {
  ------------------
  |  Branch (100:13): [True: 5.34k, False: 467]
  ------------------
  101|  5.34k|        len = end - hay;
  102|       |
  103|       |        /* done if matches up to capacity of buffer */
  104|  5.34k|        if ( memcmp(hay, ndl, MIN(nlen, len)) == 0 ) {
  ------------------
  |  |   27|  5.34k|#define MIN(a,b) ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (27:20): [True: 4.16k, False: 1.17k]
  |  |  ------------------
  ------------------
  |  Branch (104:14): [True: 993, False: 4.34k]
  ------------------
  105|    993|            if (type == APREQ_MATCH_FULL && len < nlen)
  ------------------
  |  Branch (105:17): [True: 0, False: 993]
  |  Branch (105:45): [True: 0, False: 0]
  ------------------
  106|      0|                hay = NULL;     /* insufficient room for match */
  107|    993|            break;
  108|    993|        }
  109|  4.34k|        --len;
  110|  4.34k|        ++hay;
  111|  4.34k|    }
  112|       |
  113|  1.46k|    return hay ? hay - begin : -1;
  ------------------
  |  Branch (113:12): [True: 993, False: 467]
  ------------------
  114|  1.46k|}
apreq_charset_divine:
  243|  1.07k|{
  244|  1.07k|    apreq_charset_t rv = APREQ_CHARSET_ASCII;
  245|  1.07k|    register unsigned char trail = 0, saw_cntrl = 0, mask = 0;
  246|  1.07k|    register const unsigned char *s = (const unsigned char *)src;
  247|  1.07k|    const unsigned char *end = s + slen;
  248|       |
  249|  4.96k|    for (; s < end; ++s) {
  ------------------
  |  Branch (249:12): [True: 4.08k, False: 882]
  ------------------
  250|  4.08k|        if (trail) {
  ------------------
  |  Branch (250:13): [True: 677, False: 3.40k]
  ------------------
  251|    677|            if ((*s & 0xC0) == 0x80 && (mask == 0 || (mask & *s))) {
  ------------------
  |  Branch (251:17): [True: 530, False: 147]
  |  Branch (251:41): [True: 435, False: 95]
  |  Branch (251:54): [True: 71, False: 24]
  ------------------
  252|    506|                mask = 0;
  253|    506|                --trail;
  254|       |
  255|    506|                if ((*s & 0xE0) == 0x80) {
  ------------------
  |  Branch (255:21): [True: 217, False: 289]
  ------------------
  256|    217|                    saw_cntrl = 1;
  257|    217|                }
  258|    506|            }
  259|    171|            else {
  260|    171|                trail = 0;
  261|    171|                if (saw_cntrl)
  ------------------
  |  Branch (261:21): [True: 40, False: 131]
  ------------------
  262|     40|                    return APREQ_CHARSET_CP1252;
  263|    131|                rv = APREQ_CHARSET_LATIN1;
  264|    131|            }
  265|    677|        }
  266|  3.40k|        else if (*s < 0x80) {
  ------------------
  |  Branch (266:18): [True: 2.24k, False: 1.15k]
  ------------------
  267|       |            /* do nothing */
  268|  2.24k|        }
  269|  1.15k|        else if (*s < 0xA0) {
  ------------------
  |  Branch (269:18): [True: 116, False: 1.03k]
  ------------------
  270|    116|            return APREQ_CHARSET_CP1252;
  271|    116|        }
  272|  1.03k|        else if (*s < 0xC0) {
  ------------------
  |  Branch (272:18): [True: 101, False: 937]
  ------------------
  273|    101|            if (saw_cntrl)
  ------------------
  |  Branch (273:17): [True: 15, False: 86]
  ------------------
  274|     15|                return APREQ_CHARSET_CP1252;
  275|     86|            rv = APREQ_CHARSET_LATIN1;
  276|     86|        }
  277|    937|        else if (rv == APREQ_CHARSET_LATIN1) {
  ------------------
  |  Branch (277:18): [True: 115, False: 822]
  ------------------
  278|       |            /* do nothing */
  279|    115|        }
  280|       |
  281|       |        /* utf8 cases */
  282|       |
  283|    822|        else if (*s < 0xE0) {
  ------------------
  |  Branch (283:18): [True: 199, False: 623]
  ------------------
  284|    199|            if (*s & 0x1E) {
  ------------------
  |  Branch (284:17): [True: 138, False: 61]
  ------------------
  285|    138|                rv = APREQ_CHARSET_UTF8;
  286|    138|                trail = 1;
  287|    138|                mask = 0;
  288|    138|            }
  289|     61|            else if (saw_cntrl)
  ------------------
  |  Branch (289:22): [True: 17, False: 44]
  ------------------
  290|     17|                return APREQ_CHARSET_CP1252;
  291|     44|            else
  292|     44|                rv = APREQ_CHARSET_LATIN1;
  293|    199|        }
  294|    623|        else if (*s < 0xF0) {
  ------------------
  |  Branch (294:18): [True: 164, False: 459]
  ------------------
  295|    164|            mask = (*s & 0x0F) ? 0 : 0x20;
  ------------------
  |  Branch (295:20): [True: 131, False: 33]
  ------------------
  296|    164|            rv = APREQ_CHARSET_UTF8;
  297|    164|            trail = 2;
  298|    164|        }
  299|    459|        else if (*s < 0xF8) {
  ------------------
  |  Branch (299:18): [True: 99, False: 360]
  ------------------
  300|     99|            mask = (*s & 0x07) ? 0 : 0x30;
  ------------------
  |  Branch (300:20): [True: 66, False: 33]
  ------------------
  301|     99|            rv = APREQ_CHARSET_UTF8;
  302|     99|            trail = 3;
  303|     99|        }
  304|    360|        else if (*s < 0xFC) {
  ------------------
  |  Branch (304:18): [True: 98, False: 262]
  ------------------
  305|     98|            mask = (*s & 0x03) ? 0 : 0x38;
  ------------------
  |  Branch (305:20): [True: 53, False: 45]
  ------------------
  306|     98|            rv = APREQ_CHARSET_UTF8;
  307|     98|            trail = 4;
  308|     98|        }
  309|    262|        else if (*s < 0xFE) {
  ------------------
  |  Branch (309:18): [True: 92, False: 170]
  ------------------
  310|     92|            mask = (*s & 0x01) ? 0 : 0x3C;
  ------------------
  |  Branch (310:20): [True: 6, False: 86]
  ------------------
  311|     92|            rv = APREQ_CHARSET_UTF8;
  312|     92|            trail = 5;
  313|     92|        }
  314|    170|        else {
  315|    170|            rv = APREQ_CHARSET_UTF8;
  316|    170|        }
  317|  4.08k|    }
  318|       |
  319|    882|    return trail ? saw_cntrl ?
  ------------------
  |  Branch (319:12): [True: 176, False: 706]
  |  Branch (319:20): [True: 4, False: 172]
  ------------------
  320|    706|        APREQ_CHARSET_CP1252 : APREQ_CHARSET_LATIN1 : rv;
  321|  1.07k|}
apreq_decodev:
  455|  1.08k|{
  456|  1.08k|    apr_status_t status = APR_SUCCESS;
  ------------------
  |  |  225|  1.08k|#define APR_SUCCESS 0
  ------------------
  457|  1.08k|    int n = 0;
  458|       |
  459|  1.08k|    *dlen = 0;
  460|       |
  461|  2.10k|    while (n < nelts) {
  ------------------
  |  Branch (461:12): [True: 1.08k, False: 1.01k]
  ------------------
  462|  1.08k|        apr_size_t slen, len;
  463|       |
  464|  1.08k|        slen = v[n].iov_len;
  465|  1.08k|        switch (status = url_decode(d, &len, v[n].iov_base, &slen)) {
  466|       |
  467|  1.01k|        case APR_SUCCESS:
  ------------------
  |  |  225|  1.01k|#define APR_SUCCESS 0
  ------------------
  |  Branch (467:9): [True: 1.01k, False: 72]
  ------------------
  468|  1.01k|            d += len;
  469|  1.01k|            *dlen += len;
  470|  1.01k|            ++n;
  471|  1.01k|            continue;
  472|       |
  473|     12|        case APR_INCOMPLETE:
  ------------------
  |  |  458|     12|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (473:9): [True: 12, False: 1.07k]
  ------------------
  474|     12|            d += len;
  475|     12|            *dlen += len;
  476|     12|            slen = v[n].iov_len - slen;
  477|       |
  478|     12|            if (++n == nelts) {
  ------------------
  |  Branch (478:17): [True: 12, False: 0]
  ------------------
  479|     12|                return status;
  480|     12|            }
  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.02k]
  ------------------
  487|     60|            *dlen += len;
  488|     60|            return status;
  489|  1.08k|        }
  490|  1.08k|    }
  491|       |
  492|  1.01k|    return status;
  493|  1.08k|}
apreq_file_mktemp:
  802|    325|{
  803|    325|    apr_status_t rc;
  804|    325|    char *tmpl;
  805|    325|    struct cleanup_data *data;
  806|    325|    apr_int32_t flag;
  807|       |
  808|    325|    if (path == NULL) {
  ------------------
  |  Branch (808:9): [True: 0, False: 325]
  ------------------
  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|    325|    rc = apr_filepath_merge(&tmpl, path, "apreqXXXXXX",
  814|    325|                            APR_FILEPATH_NOTRELATIVE, pool);
  ------------------
  |  |  298|    325|#define APR_FILEPATH_NOTRELATIVE    0x04
  ------------------
  815|       |
  816|    325|    if (rc != APR_SUCCESS)
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (816:9): [True: 0, False: 325]
  ------------------
  817|      0|        return rc;
  818|       |
  819|    325|    data = apr_palloc(pool, sizeof *data);
  ------------------
  |  |  425|    325|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    325|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    325|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    325|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  820|       |    /* cleanups are LIFO, so this one will run just after
  821|       |       the cleanup set by mktemp */
  822|    325|    apr_pool_cleanup_register(pool, data,
  823|    325|                              apreq_file_cleanup, apreq_file_cleanup);
  824|       |
  825|       |    /* NO APR_DELONCLOSE! see comment above */
  826|    325|    flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  102|    325|#define APR_CREATE           APR_FOPEN_CREATE     /**< @deprecated @see APR_FOPEN_CREATE */
  |  |  ------------------
  |  |  |  |   56|    325|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  100|    325|#define APR_READ             APR_FOPEN_READ       /**< @deprecated @see APR_FOPEN_READ */
  |  |  ------------------
  |  |  |  |   54|    325|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  101|    325|#define APR_WRITE            APR_FOPEN_WRITE      /**< @deprecated @see APR_FOPEN_WRITE */
  |  |  ------------------
  |  |  |  |   55|    325|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  106|    325|#define APR_EXCL             APR_FOPEN_EXCL       /**< @deprecated @see APR_FOPEN_EXCL */
  |  |  ------------------
  |  |  |  |   63|    325|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  |  |  ------------------
  ------------------
                  flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
  ------------------
  |  |  105|    325|#define APR_BINARY           APR_FOPEN_BINARY     /**< @deprecated @see APR_FOPEN_BINARY */
  |  |  ------------------
  |  |  |  |   60|    325|#define APR_FOPEN_BINARY     0x00020  /**< Open the file in binary mode
  |  |  ------------------
  ------------------
  827|       |
  828|    325|    rc = apr_file_mktemp(fp, tmpl, flag, pool);
  829|       |
  830|    325|    if (rc == APR_SUCCESS) {
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (830:9): [True: 325, False: 0]
  ------------------
  831|    325|        apr_file_name_get(&data->fname, *fp);
  832|    325|        data->pool = pool;
  833|    325|    }
  834|      0|    else {
  835|      0|        apr_pool_cleanup_kill(pool, data, apreq_file_cleanup);
  836|      0|    }
  837|       |
  838|    325|    return rc;
  839|    325|}
apreq_header_attribute:
  850|  1.17k|{
  851|  1.17k|    int done = 0;
  852|       |
  853|  1.17k|    if (!nlen)
  ------------------
  |  Branch (853:9): [True: 0, False: 1.17k]
  ------------------
  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.81k|    do {
  857|  1.81k|        const char *hde, *v;
  858|  1.81k|        apr_size_t tail = 0;
  859|       |
  860|       |        /* Parse the name => [hdr:hde[ */
  861|  1.81k|        hde = hdr;
  862|  13.1k|    look_for_end_name:
  863|  13.1k|        switch (*hde) {
  864|     21|        case 0:
  ------------------
  |  Branch (864:9): [True: 21, False: 13.1k]
  ------------------
  865|     23|        case '\r':
  ------------------
  |  Branch (865:9): [True: 2, False: 13.1k]
  ------------------
  866|     27|        case '\n':
  ------------------
  |  Branch (866:9): [True: 4, False: 13.1k]
  ------------------
  867|     27|            done = 1;
  868|  1.34k|        case '=':
  ------------------
  |  Branch (868:9): [True: 1.31k, False: 11.8k]
  ------------------
  869|  1.54k|        case ';':
  ------------------
  |  Branch (869:9): [True: 202, False: 12.9k]
  ------------------
  870|  1.78k|        case ',':
  ------------------
  |  Branch (870:9): [True: 236, False: 12.8k]
  ------------------
  871|  1.78k|            v = hde;
  872|  1.78k|            hde -= tail;
  873|  1.78k|            break;
  874|    214|        case ' ':
  ------------------
  |  Branch (874:9): [True: 214, False: 12.9k]
  ------------------
  875|    300|        case '\t':
  ------------------
  |  Branch (875:9): [True: 86, False: 13.0k]
  ------------------
  876|    300|            if (hde == hdr)
  ------------------
  |  Branch (876:17): [True: 110, False: 190]
  ------------------
  877|    110|                ++hdr;
  878|    190|            else
  879|    190|                ++tail;
  880|    300|            ++hde;
  881|    300|            goto look_for_end_name;
  882|  11.0k|        default:
  ------------------
  |  Branch (882:9): [True: 11.0k, False: 2.08k]
  ------------------
  883|       |            /* The name is a token */
  884|  11.0k|            if (!IS_TOKEN_CHAR(*hde))
  ------------------
  |  |  843|  11.0k|#define IS_TOKEN_CHAR(c) (apr_isalnum(c) \
  |  |  ------------------
  |  |  |  |  203|  22.1k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (203:24): [True: 10.4k, False: 570]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  844|  11.0k|                          || ((c) && strchr("!#$%&'*+-.^_`|~", (c))))
  |  |  ------------------
  |  |  |  Branch (844:31): [True: 570, False: 0]
  |  |  |  Branch (844:38): [True: 540, False: 30]
  |  |  ------------------
  ------------------
  885|     30|                return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     30|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     30|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     30|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     30|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     30|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     30|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     30|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     30|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  886|       |            /* Nothing after the tail */
  887|  11.0k|            if (tail)
  ------------------
  |  Branch (887:17): [True: 5, False: 11.0k]
  ------------------
  888|      5|                return APREQ_ERROR_BADATTR;
  ------------------
  |  |   66|      5|#define APREQ_ERROR_BADATTR        (APREQ_ERROR_BADDATA  +  3)
  |  |  ------------------
  |  |  |  |   60|      5|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|  11.0k|            ++hde;
  890|  11.0k|            goto look_for_end_name;
  891|  13.1k|        }
  892|       |
  893|       |        /* Parse the value => (*val, *vlen) */
  894|  1.78k|        if (*v == '=') {
  ------------------
  |  Branch (894:13): [True: 1.31k, False: 465]
  ------------------
  895|  1.31k|            if (hde == hdr) {
  ------------------
  |  Branch (895:17): [True: 2, False: 1.31k]
  ------------------
  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.31k|            ++v;
  901|  1.64k|            while (IS_SPACE_CHAR(*v))
  ------------------
  |  |  842|  1.64k|#define IS_SPACE_CHAR(c) ((c) == '\t' || (c) == ' ')
  |  |  ------------------
  |  |  |  Branch (842:27): [True: 93, False: 1.55k]
  |  |  |  Branch (842:42): [True: 240, False: 1.31k]
  |  |  ------------------
  ------------------
  902|    333|                ++v;
  903|       |
  904|       |            /* Quoted string ? */
  905|  1.31k|            if (*v == '"') {
  ------------------
  |  Branch (905:17): [True: 21, False: 1.29k]
  ------------------
  906|     21|                *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|    391|            look_for_end_quote:
  914|    391|                switch (*v) {
  915|     12|                case 0:
  ------------------
  |  Branch (915:17): [True: 12, False: 379]
  ------------------
  916|     14|                case '\r':
  ------------------
  |  Branch (916:17): [True: 2, False: 389]
  ------------------
  917|     16|                case '\n':
  ------------------
  |  Branch (917:17): [True: 2, False: 389]
  ------------------
  918|     16|                    return APREQ_ERROR_BADSEQ;
  ------------------
  |  |   64|     16|#define APREQ_ERROR_BADSEQ         (APREQ_ERROR_BADDATA  +  2)
  |  |  ------------------
  |  |  |  |   60|     16|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     16|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     16|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     16|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     16|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     16|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     16|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  919|      2|                case '"':
  ------------------
  |  Branch (919:17): [True: 2, False: 389]
  ------------------
  920|      2|                    *vlen = v - *val;
  921|      2|                    break;
  922|    102|                case '\\':
  ------------------
  |  Branch (922:17): [True: 102, False: 289]
  ------------------
  923|    102|                    if (v[1] != 0)
  ------------------
  |  Branch (923:25): [True: 99, False: 3]
  ------------------
  924|     99|                        ++v;
  925|    102|                    ++v;
  926|    102|                    goto look_for_end_quote;
  927|    271|                default:
  ------------------
  |  Branch (927:17): [True: 271, False: 120]
  ------------------
  928|    271|                    if (apr_iscntrl(*v))
  ------------------
  |  |  207|    271|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (207:24): [True: 3, False: 268]
  |  |  ------------------
  ------------------
  929|      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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|    268|                    ++v;
  931|    268|                    goto look_for_end_quote;
  932|    391|                }
  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))
  ------------------
  |  |  207|      2|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (207: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.29k|            else {
  953|  1.29k|                *val = v;
  954|  1.29k|                tail = 0;
  955|       |
  956|  8.46k|            look_for_end_value:
  957|  8.46k|                switch (*v) {
  958|    699|                case 0:
  ------------------
  |  Branch (958:17): [True: 699, False: 7.76k]
  ------------------
  959|    862|                case '\r':
  ------------------
  |  Branch (959:17): [True: 163, False: 8.29k]
  ------------------
  960|    986|                case '\n':
  ------------------
  |  Branch (960:17): [True: 124, False: 8.33k]
  ------------------
  961|    986|                    done = 1;
  962|  1.16k|                case ';':
  ------------------
  |  Branch (962:17): [True: 178, False: 8.28k]
  ------------------
  963|  1.28k|                case ',':
  ------------------
  |  Branch (963:17): [True: 119, False: 8.34k]
  ------------------
  964|  1.28k|                    *vlen = v - *val - tail;
  965|  1.28k|                    break;
  966|    274|                case ' ':
  ------------------
  |  Branch (966:17): [True: 274, False: 8.18k]
  ------------------
  967|    554|                case '\t':
  ------------------
  |  Branch (967:17): [True: 280, False: 8.18k]
  ------------------
  968|    554|                    if (*val == v)
  ------------------
  |  Branch (968:25): [True: 0, False: 554]
  ------------------
  969|      0|                        ++*val;
  970|    554|                    else
  971|    554|                        ++tail;
  972|    554|                    ++v;
  973|    554|                    goto look_for_end_value;
  974|  6.62k|                default:
  ------------------
  |  Branch (974:17): [True: 6.62k, False: 1.83k]
  ------------------
  975|  6.62k|                    if (apr_iscntrl(*v))
  ------------------
  |  |  207|  6.62k|#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (207:24): [True: 11, False: 6.61k]
  |  |  ------------------
  ------------------
  976|     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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  977|  6.61k|                    ++v;
  978|  6.61k|                    tail = 0;
  979|  6.61k|                    goto look_for_end_value;
  980|  8.46k|                }
  981|  8.46k|            }
  982|  1.31k|        }
  983|    465|        else {
  984|    465|            *val = NULL;
  985|    465|            *vlen = 0;
  986|    465|        }
  987|       |
  988|  1.74k|        if (hdr + nlen == hde && strncasecmp(hdr, name, nlen) == 0) {
  ------------------
  |  Branch (988:13): [True: 1.07k, False: 671]
  |  Branch (988:34): [True: 989, False: 88]
  ------------------
  989|    989|            return APR_SUCCESS;
  ------------------
  |  |  225|    989|#define APR_SUCCESS 0
  ------------------
  990|    989|        }
  991|       |
  992|    759|        hdr = v + 1;
  993|    759|    } while (!done);
  ------------------
  |  Branch (993:14): [True: 644, 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.17k|}
apreq_brigade_concat:
 1063|    625|{
 1064|    625|    apr_status_t s;
 1065|    625|    apr_bucket_file *f;
 1066|    625|    apr_off_t wlen;
 1067|    625|    apr_file_t *file;
 1068|    625|    apr_off_t in_len, out_len;
 1069|    625|    apr_bucket *last_in, *last_out;
 1070|       |
 1071|    625|    last_out = APR_BRIGADE_LAST(out);
  ------------------
  |  |  359|    625|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    625|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
 1072|       |
 1073|    625|    if (APR_BUCKET_IS_EOS(last_out))
  ------------------
  |  |  469|    625|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 625]
  |  |  ------------------
  ------------------
 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|    625|    s = apr_brigade_length(out, 0, &out_len);
 1077|    625|    if (s != APR_SUCCESS)
  ------------------
  |  |  225|    625|#define APR_SUCCESS 0
  ------------------
  |  Branch (1077:9): [True: 0, False: 625]
  ------------------
 1078|      0|        return s;
 1079|       |
 1080|       |    /* This cast, when out_len = -1, is intentional */
 1081|    625|    if ((apr_uint64_t)out_len < heap_limit) {
  ------------------
  |  Branch (1081:9): [True: 625, False: 0]
  ------------------
 1082|       |
 1083|    625|        s = apr_brigade_length(in, 0, &in_len);
 1084|    625|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    625|#define APR_SUCCESS 0
  ------------------
  |  Branch (1084:13): [True: 0, False: 625]
  ------------------
 1085|      0|            return s;
 1086|       |
 1087|       |        /* This cast, when in_len = -1, is intentional */
 1088|    625|        if ((apr_uint64_t)in_len < heap_limit - (apr_uint64_t)out_len) {
  ------------------
  |  Branch (1088:13): [True: 300, False: 325]
  ------------------
 1089|    300|            APR_BRIGADE_CONCAT(out, in);
  ------------------
  |  |  388|    300|#define APR_BRIGADE_CONCAT(a, b) do {					\
  |  |  389|    300|        APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  338|    300|#define APR_RING_CONCAT(h1, h2, elem, link) do {            \
  |  |  |  |  339|    300|    if (!APR_RING_EMPTY((h2), elem, link)) {                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    300|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    300|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    300|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    300|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (339:9): [True: 206, False: 94]
  |  |  |  |  ------------------
  |  |  |  |  340|    206|        APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)),    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    206|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    206|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    206|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    206|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    206|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    206|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    206|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    206|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    206|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    206|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    206|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    206|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    206|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  341|    206|                 APR_RING_LAST((h2)), elem, link);          \
  |  |  |  |  342|    206|        APR_RING_INIT((h2), elem, link);                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|    206|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  |  |  |  |  193|    206|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  166|    206|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    206|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    206|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|    206|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    206|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    206|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    206|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|    206|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  343|    206|    }                                                       \
  |  |  |  |  344|    300|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  390|    300|        APR_BRIGADE_CHECK_CONSISTENCY((a));				\
  |  |  391|    300|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1090|    300|            return APR_SUCCESS;
  ------------------
  |  |  225|    300|#define APR_SUCCESS 0
  ------------------
 1091|    300|        }
 1092|    625|    }
 1093|       |
 1094|    325|    if (!BUCKET_IS_SPOOL(last_out)) {
  ------------------
  |  | 1000|    325|#define BUCKET_IS_SPOOL(e) ((e)->type == &spool_bucket_type)
  ------------------
  |  Branch (1094:9): [True: 325, False: 0]
  ------------------
 1095|       |
 1096|    325|        s = apreq_file_mktemp(&file, pool, temp_dir);
 1097|    325|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (1097:13): [True: 0, False: 325]
  ------------------
 1098|      0|            return s;
 1099|       |
 1100|    325|        s = apreq_brigade_fwrite(file, &wlen, out);
 1101|       |
 1102|    325|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (1102:13): [True: 0, False: 325]
  ------------------
 1103|      0|            return s;
 1104|       |
 1105|    325|        apr_brigade_cleanup(out);
 1106|    325|        last_out = apr_bucket_file_create(file, 0, wlen,
 1107|    325|                                          out->p, out->bucket_alloc);
 1108|    325|        last_out->type = &spool_bucket_type;
 1109|    325|        APR_BRIGADE_INSERT_TAIL(out, last_out);
  ------------------
  |  |  377|    325|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|    325|	apr_bucket *ap__b = (e);					\
  |  |  379|    325|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|    325|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    325|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|    325|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    325|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|    325|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|    325|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|    325|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    325|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    325|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|    325|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|    325|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|    325|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|    325|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|    325|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|    325|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|    325|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1110|    325|        f = last_out->data;
 1111|    325|    }
 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|    325|    if (in == out)
  ------------------
  |  Branch (1123:9): [True: 0, False: 325]
  ------------------
 1124|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1125|       |
 1126|    325|    last_in = APR_BRIGADE_LAST(in);
  ------------------
  |  |  359|    325|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|    325|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
 1127|       |
 1128|    325|    if (APR_BUCKET_IS_EOS(last_in))
  ------------------
  |  |  469|    325|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 325]
  |  |  ------------------
  ------------------
 1129|    325|        APR_BUCKET_REMOVE(last_in);
  ------------------
  |  |  442|    325|#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|    325|    s = apreq_brigade_fwrite(f->fd, &wlen, in);
 1132|       |
 1133|    325|    if (s == APR_SUCCESS) {
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (1133:9): [True: 325, 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|    325|        while ((apr_uint64_t)wlen > FILE_BUCKET_LIMIT - last_out->length) {
  ------------------
  |  | 1001|    325|#define FILE_BUCKET_LIMIT      ((apr_size_t)-1 - 1)
  ------------------
  |  Branch (1140:16): [True: 0, False: 325]
  ------------------
 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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|    325|        last_out->length += wlen;
 1160|       |
 1161|    325|        if (APR_BUCKET_IS_EOS(last_in))
  ------------------
  |  |  469|    325|#define APR_BUCKET_IS_EOS(e)         ((e)->type == &apr_bucket_type_eos)
  |  |  ------------------
  |  |  |  Branch (469:38): [True: 0, False: 325]
  |  |  ------------------
  ------------------
 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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|    325|    }
 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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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|    325|    apr_brigade_cleanup(in);
 1169|    325|    return s;
 1170|    325|}
apreq_brigade_fwrite:
 1175|    650|{
 1176|    650|    struct iovec v[APREQ_DEFAULT_NELTS];
 1177|    650|    apr_status_t s;
 1178|    650|    apr_bucket *e, *first;
 1179|    650|    int n = 0;
 1180|    650|    apr_bucket_brigade *tmp = bb;
 1181|    650|    *wlen = 0;
 1182|       |
 1183|    650|    if (BUCKET_IS_SPOOL(APR_BRIGADE_LAST(bb))) {
  ------------------
  |  | 1000|    650|#define BUCKET_IS_SPOOL(e) ((e)->type == &spool_bucket_type)
  |  |  ------------------
  |  |  |  Branch (1000:28): [True: 0, False: 650]
  |  |  ------------------
  ------------------
 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|    990|    for (e = APR_BRIGADE_FIRST(tmp); e != APR_BRIGADE_SENTINEL(tmp);
  ------------------
  |  |  353|    650|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    650|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
                  for (e = APR_BRIGADE_FIRST(tmp); e != APR_BRIGADE_SENTINEL(tmp);
  ------------------
  |  |  339|    990|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    990|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    990|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1191:38): [True: 340, False: 650]
  ------------------
 1192|    650|         e = APR_BUCKET_NEXT(e))
  ------------------
  |  |  430|    340|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    340|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
 1193|    340|    {
 1194|    340|        apr_size_t len;
 1195|    340|        if (n == APREQ_DEFAULT_NELTS) {
  ------------------
  |  |   66|    340|#define APREQ_DEFAULT_NELTS              8
  ------------------
  |  Branch (1195:13): [True: 0, False: 340]
  ------------------
 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|    340|        s = apr_bucket_read(e, (const char **)&(v[n].iov_base),
  ------------------
  |  | 1159|    340|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
 1208|    340|                            &len, APR_BLOCK_READ);
 1209|    340|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    340|#define APR_SUCCESS 0
  ------------------
  |  Branch (1209:13): [True: 0, False: 340]
  ------------------
 1210|      0|            return s;
 1211|       |
 1212|    340|        v[n++].iov_len = len;
 1213|    340|    }
 1214|       |
 1215|    975|    while (n > 0) {
  ------------------
  |  Branch (1215:12): [True: 325, False: 650]
  ------------------
 1216|    325|        apr_size_t len;
 1217|    325|        s = apreq_fwritev(f, v, &n, &len);
 1218|    325|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (1218:13): [True: 0, False: 325]
  ------------------
 1219|      0|            return s;
 1220|    325|        *wlen += len;
 1221|       |
 1222|    325|        if (tmp != bb) {
  ------------------
  |  Branch (1222:13): [True: 0, False: 325]
  ------------------
 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|    325|    }
 1227|    650|    return APR_SUCCESS;
  ------------------
  |  |  225|    650|#define APR_SUCCESS 0
  ------------------
 1228|    650|}
apreq_util.c:url_decode:
  354|  1.08k|{
  355|  1.08k|    register const char *s = src;
  356|  1.08k|    unsigned char *start = (unsigned char *)dest;
  357|  1.08k|    register unsigned char *d = (unsigned char *)dest;
  358|  1.08k|    const char *end = src + *slen;
  359|       |
  360|  4.52k|    for (; s < end; ++d, ++s) {
  ------------------
  |  Branch (360:12): [True: 3.51k, False: 1.01k]
  ------------------
  361|  3.51k|        switch (*s) {
  362|       |
  363|    173|        case '+':
  ------------------
  |  Branch (363:9): [True: 173, False: 3.33k]
  ------------------
  364|    173|            *d = ' ';
  365|    173|            break;
  366|       |
  367|    980|        case '%':
  ------------------
  |  Branch (367:9): [True: 980, False: 2.53k]
  ------------------
  368|    980|            if (s + 2 < end && apr_isxdigit(s[1]) && apr_isxdigit(s[2])) {
  ------------------
  |  |  229|  1.94k|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 683, False: 285]
  |  |  ------------------
  ------------------
                          if (s + 2 < end && apr_isxdigit(s[1]) && apr_isxdigit(s[2])) {
  ------------------
  |  |  229|    683|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 675, False: 8]
  |  |  ------------------
  ------------------
  |  Branch (368:17): [True: 968, False: 12]
  ------------------
  369|    675|                *d = hex2_to_char(s + 1);
  370|    675|                s += 2;
  371|    675|            }
  372|    305|            else if (s + 5 < end && (s[1] == 'u' || s[1] == 'U') &&
  ------------------
  |  Branch (372:22): [True: 268, False: 37]
  |  Branch (372:38): [True: 163, False: 105]
  |  Branch (372:53): [True: 85, False: 20]
  ------------------
  373|    305|                     apr_isxdigit(s[2]) && apr_isxdigit(s[3]) &&
  ------------------
  |  |  229|    553|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 246, False: 2]
  |  |  ------------------
  ------------------
                                   apr_isxdigit(s[2]) && apr_isxdigit(s[3]) &&
  ------------------
  |  |  229|    551|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 245, False: 1]
  |  |  ------------------
  ------------------
  374|    305|                     apr_isxdigit(s[4]) && apr_isxdigit(s[5]))
  ------------------
  |  |  229|    550|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 244, False: 1]
  |  |  ------------------
  ------------------
                                   apr_isxdigit(s[4]) && apr_isxdigit(s[5]))
  ------------------
  |  |  229|    244|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (229:25): [True: 243, False: 1]
  |  |  ------------------
  ------------------
  375|    243|            {
  376|    243|                apr_uint16_t c = hex4_to_bmp(s+2);
  377|       |
  378|    243|                if (c < 0x80) {
  ------------------
  |  Branch (378:21): [True: 27, False: 216]
  ------------------
  379|     27|                    *d = c;
  380|     27|                }
  381|    216|                else if (c < 0x800) {
  ------------------
  |  Branch (381:26): [True: 56, False: 160]
  ------------------
  382|     56|                    *d++ = 0xC0 | (c >> 6);
  383|     56|                    *d   = 0x80 | (c & 0x3F);
  384|     56|                }
  385|    160|                else {
  386|    160|                    *d++ = 0xE0 | (c >> 12);
  387|    160|                    *d++ = 0x80 | ((c >> 6) & 0x3F);
  388|    160|                    *d   = 0x80 | (c & 0x3F);
  389|    160|                }
  390|    243|                s += 5;
  391|    243|            }
  392|     62|            else {
  393|     62|                *dlen = d - start;
  394|     62|                *slen = s - src;
  395|     62|                if (s + 5 < end
  ------------------
  |  Branch (395:21): [True: 25, False: 37]
  ------------------
  396|     62|                    || (s + 2 < end && !apr_isxdigit(s[2]))
  ------------------
  |  |  229|     25|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (396:25): [True: 25, False: 12]
  |  Branch (396:40): [True: 5, False: 20]
  ------------------
  397|     62|                    || (s + 1 < end && !apr_isxdigit(s[1])
  ------------------
  |  |  229|     56|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (397:25): [True: 24, False: 8]
  |  Branch (397:40): [True: 23, False: 1]
  ------------------
  398|     32|                        && s[1] != 'u' && s[1] != 'U'))
  ------------------
  |  Branch (398:28): [True: 22, False: 1]
  |  Branch (398:43): [True: 20, False: 2]
  ------------------
  399|     50|                {
  400|     50|                    *d = 0;
  401|     50|                    return APREQ_ERROR_BADSEQ;
  ------------------
  |  |   64|     50|#define APREQ_ERROR_BADSEQ         (APREQ_ERROR_BADDATA  +  2)
  |  |  ------------------
  |  |  |  |   60|     50|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     50|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     50|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     50|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  117|     50|#define APR_OS_START_ERROR     20000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  123|     50|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     50|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|     50|                }
  403|       |
  404|     12|                memmove(d, s, end - s);
  405|     12|                d[end - s] = 0;
  406|     12|                return APR_INCOMPLETE;
  ------------------
  |  |  458|     12|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  407|     62|            }
  408|    918|            break;
  409|       |
  410|  2.35k|        default:
  ------------------
  |  Branch (410:9): [True: 2.35k, False: 1.15k]
  ------------------
  411|  2.35k|            if (*s > 0) {
  ------------------
  |  Branch (411:17): [True: 2.34k, False: 10]
  ------------------
  412|  2.34k|                *d = *s;
  413|  2.34k|            }
  414|     10|            else {
  415|     10|                *d = 0;
  416|     10|                *dlen = d - start;
  417|     10|                *slen = s - src;
  418|     10|                return APREQ_ERROR_BADCHAR;
  ------------------
  |  |   62|     10|#define APREQ_ERROR_BADCHAR        (APREQ_ERROR_BADDATA  +  1)
  |  |  ------------------
  |  |  |  |   60|     10|#define APREQ_ERROR_BADDATA        (APREQ_ERROR_GENERAL  + 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     10|#define APREQ_ERROR_GENERAL        APR_OS_START_USERERR
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  164|     10|#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  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
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  123|     10|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  419|     10|            }
  420|  3.51k|        }
  421|  3.51k|    }
  422|       |
  423|  1.01k|    *d = 0;
  424|  1.01k|    *dlen = d - start;
  425|  1.01k|    *slen = s - src;
  426|  1.01k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.01k|#define APR_SUCCESS 0
  ------------------
  427|  1.08k|}
apreq_util.c:hex2_to_char:
  119|    675|{
  120|    675|    register unsigned char digit;
  121|       |
  122|    675|#if !APR_CHARSET_EBCDIC
  123|    675|    digit  = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
  ------------------
  |  Branch (123:15): [True: 488, False: 187]
  ------------------
  124|    675|    digit *= 16;
  125|    675|    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0'));
  ------------------
  |  Branch (125:15): [True: 262, False: 413]
  ------------------
  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|    675|    return (digit);
  136|    675|}
apreq_util.c:hex4_to_bmp:
  325|    243|{
  326|    243|    register apr_uint16_t digit = 0;
  327|       |
  328|    243|#if !APR_CHARSET_EBCDIC
  329|    243|    digit  = (what[0] >= 'A' ? ((what[0] & 0xDF)-'A') + 10 : (what[0]-'0'));
  ------------------
  |  Branch (329:15): [True: 72, False: 171]
  ------------------
  330|    243|    digit *= 16;
  331|    243|    digit += (what[1] >= 'A' ? ((what[1] & 0xDF)-'A') + 10 : (what[1]-'0'));
  ------------------
  |  Branch (331:15): [True: 75, False: 168]
  ------------------
  332|    243|    digit *= 16;
  333|    243|    digit += (what[2] >= 'A' ? ((what[2] & 0xDF)-'A') + 10 : (what[2]-'0'));
  ------------------
  |  Branch (333:15): [True: 123, False: 120]
  ------------------
  334|    243|    digit *= 16;
  335|    243|    digit += (what[3] >= 'A' ? ((what[3] & 0xDF)-'A') + 10 : (what[3]-'0'));
  ------------------
  |  Branch (335:15): [True: 128, False: 115]
  ------------------
  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|    243|    return (digit);
  349|    243|}
apreq_util.c:apreq_file_cleanup:
  783|    325|{
  784|    325|    struct cleanup_data *data = d;
  785|    325|    return apr_file_remove(data->fname, data->pool);
  786|    325|}
apreq_util.c:spool_bucket_destroy:
 1005|    325|{
 1006|    325|    apr_bucket_type_file.destroy(data);
 1007|    325|}
apreq_util.c:apreq_fwritev:
  704|    325|{
  705|    325|    apr_size_t len;
  706|    325|    int n;
  707|    325|    apr_status_t s;
  708|       |
  709|    325|    *bytes_written = 0;
  710|       |
  711|    325|    while (1) {
  ------------------
  |  Branch (711:12): [Folded - Ignored]
  ------------------
  712|       |        /* try to write */
  713|    325|        s = apr_file_writev(f, v, *nelts, &len);
  714|       |
  715|    325|        *bytes_written += len;
  716|       |
  717|    325|        if (s != APR_SUCCESS)
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (717:13): [True: 0, False: 325]
  ------------------
  718|      0|            return s;
  719|       |
  720|       |        /* see how far we've come */
  721|    325|        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|    665|        while (n < *nelts && len >= v[n].iov_len)
  ------------------
  |  Branch (744:16): [True: 340, False: 325]
  |  Branch (744:30): [True: 340, False: 0]
  ------------------
  745|    340|#endif
  746|    340|            len -= v[n++].iov_len;
  747|       |
  748|    325|        if (n == *nelts) {
  ------------------
  |  Branch (748:13): [True: 325, False: 0]
  ------------------
  749|       |            /* nothing left to write, report success */
  750|    325|            *nelts = 0;
  751|    325|            return APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  752|    325|        }
  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|    325|}

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

apr_brigade_cleanup:
   38|  5.71k|{
   39|  5.71k|    apr_bucket_brigade *b = data;
   40|       |
   41|  5.71k|#ifndef APR_BUCKET_DEBUG
   42|  8.53k|    while (!APR_BRIGADE_EMPTY(b)) {
  ------------------
  |  |  346|  8.53k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  8.53k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  8.53k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  8.53k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  8.53k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (42:12): [True: 2.81k, False: 5.71k]
  ------------------
   43|  2.81k|        apr_bucket_delete(APR_BRIGADE_FIRST(b));
  ------------------
  |  | 1086|  2.81k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  2.81k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  2.81k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  2.81k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  2.81k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  2.81k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  2.81k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.81k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  2.81k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.81k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  2.81k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.81k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  2.81k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.81k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  2.81k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  2.81k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  2.81k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  2.81k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  2.81k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  2.81k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  2.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  2.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   44|  2.81k|    }
   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.71k|    return APR_SUCCESS;
  ------------------
  |  |  225|  5.71k|#define APR_SUCCESS 0
  ------------------
   63|  5.71k|}
apr_brigade_create:
   87|  4.66k|{
   88|  4.66k|    apr_bucket_brigade *b;
   89|       |
   90|  4.66k|    b = apr_palloc(p, sizeof(*b));
  ------------------
  |  |  425|  4.66k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.66k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  4.66k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  4.66k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|  4.66k|    b->p = p;
   92|  4.66k|    b->bucket_alloc = list;
   93|       |
   94|  4.66k|    APR_RING_INIT(&b->list, apr_bucket, link);
  ------------------
  |  |  192|  4.66k|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  193|  4.66k|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  166|  4.66k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  160|  4.66k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  4.66k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  194|  4.66k|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  171|  4.66k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  160|  4.66k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  4.66k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  195|  4.66k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   95|       |
   96|  4.66k|    apr_pool_cleanup_register(b->p, b, brigade_cleanup, apr_pool_cleanup_null);
   97|  4.66k|    return b;
   98|  4.66k|}
apr_brigade_length:
  221|  1.72k|{
  222|  1.72k|    apr_off_t total = 0;
  223|  1.72k|    apr_bucket *bkt;
  224|  1.72k|    apr_status_t status = APR_SUCCESS;
  ------------------
  |  |  225|  1.72k|#define APR_SUCCESS 0
  ------------------
  225|       |
  226|  1.72k|    for (bkt = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|  1.72k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.72k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  227|  2.76k|         bkt != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|  2.76k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  2.76k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  2.76k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (227:10): [True: 1.03k, False: 1.72k]
  ------------------
  228|  1.72k|         bkt = APR_BUCKET_NEXT(bkt))
  ------------------
  |  |  430|  1.03k|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|  1.03k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  229|  1.03k|    {
  230|  1.03k|        if (bkt->length == (apr_size_t)(-1)) {
  ------------------
  |  Branch (230:13): [True: 0, False: 1.03k]
  ------------------
  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.03k|        total += bkt->length;
  246|  1.03k|    }
  247|       |
  248|  1.72k|    *length = total;
  249|  1.72k|    return status;
  250|  1.72k|}
apr_brigade_flatten:
  254|    479|{
  255|    479|    apr_size_t actual = 0;
  256|    479|    apr_bucket *b;
  257|       |
  258|    479|    for (b = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|    479|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    479|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  259|    485|         b != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    485|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    485|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    485|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (259:10): [True: 481, False: 4]
  ------------------
  260|    479|         b = APR_BUCKET_NEXT(b))
  ------------------
  |  |  430|      6|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|      6|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  261|    481|    {
  262|    481|        const char *str;
  263|    481|        apr_size_t str_len;
  264|    481|        apr_status_t status;
  265|       |
  266|    481|        status = apr_bucket_read(b, &str, &str_len, APR_BLOCK_READ);
  ------------------
  |  | 1159|    481|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  267|    481|        if (status != APR_SUCCESS) {
  ------------------
  |  |  225|    481|#define APR_SUCCESS 0
  ------------------
  |  Branch (267:13): [True: 0, False: 481]
  ------------------
  268|      0|            return status;
  269|      0|        }
  270|       |
  271|       |        /* If we would overflow. */
  272|    481|        if (str_len + actual > *len) {
  ------------------
  |  Branch (272:13): [True: 0, False: 481]
  ------------------
  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|    481|        memcpy(c, str, str_len);
  282|       |
  283|    481|        c += str_len;
  284|    481|        actual += str_len;
  285|       |
  286|       |        /* This could probably be actual == *len, but be safe from stray
  287|       |         * photons. */
  288|    481|        if (actual >= *len) {
  ------------------
  |  Branch (288:13): [True: 475, False: 6]
  ------------------
  289|    475|            break;
  290|    475|        }
  291|    481|    }
  292|       |
  293|    479|    *len = actual;
  294|    479|    return APR_SUCCESS;
  ------------------
  |  |  225|    479|#define APR_SUCCESS 0
  ------------------
  295|    479|}
apr_brigade_pflatten:
  301|    426|{
  302|    426|    apr_off_t actual;
  303|    426|    apr_size_t total;
  304|    426|    apr_status_t rv;
  305|       |
  306|    426|    apr_brigade_length(bb, 1, &actual);
  307|       |
  308|       |    /* XXX: This is dangerous beyond belief.  At least in the
  309|       |     * apr_brigade_flatten case, the user explicitly stated their
  310|       |     * buffer length - so we don't up and palloc 4GB for a single
  311|       |     * file bucket.  This API must grow a useful max boundry,
  312|       |     * either compiled-in or preset via the *len value.
  313|       |     *
  314|       |     * Shouldn't both fn's grow an additional return value for
  315|       |     * the case that the brigade couldn't be flattened into the
  316|       |     * provided or allocated buffer (such as APR_EMOREDATA?)
  317|       |     * Not a failure, simply an advisory result.
  318|       |     */
  319|    426|    total = (apr_size_t)actual;
  320|       |
  321|    426|    *c = apr_palloc(pool, total);
  ------------------
  |  |  425|    426|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    426|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    426|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    426|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|       |
  323|    426|    rv = apr_brigade_flatten(bb, *c, &total);
  324|       |
  325|    426|    if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|    426|#define APR_SUCCESS 0
  ------------------
  |  Branch (325:9): [True: 0, False: 426]
  ------------------
  326|      0|        return rv;
  327|      0|    }
  328|       |
  329|    426|    *len = total;
  330|    426|    return APR_SUCCESS;
  ------------------
  |  |  225|    426|#define APR_SUCCESS 0
  ------------------
  331|    426|}
apr_brigade_write:
  766|  1.10k|{
  767|  1.10k|    apr_bucket *e = APR_BRIGADE_LAST(b);
  ------------------
  |  |  359|  1.10k|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|  1.10k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
  768|  1.10k|    apr_size_t remaining = APR_BUCKET_BUFF_SIZE;
  ------------------
  |  |   54|  1.10k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  769|  1.10k|    char *buf = NULL;
  770|       |
  771|       |    /*
  772|       |     * If the last bucket is a heap bucket and its buffer is not shared with
  773|       |     * another bucket, we may write into that bucket.
  774|       |     */
  775|  1.10k|    if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
  ------------------
  |  |  346|  1.10k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  2.21k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  1.10k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.10k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  1.10k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
  ------------------
  |  |  493|  1.10k|#define APR_BUCKET_IS_HEAP(e)        ((e)->type == &apr_bucket_type_heap)
  |  |  ------------------
  |  |  |  Branch (493:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (775:9): [True: 0, False: 1.10k]
  ------------------
  776|  1.10k|        && ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) {
  ------------------
  |  Branch (776:12): [True: 0, False: 0]
  ------------------
  777|      0|        apr_bucket_heap *h = e->data;
  778|       |
  779|       |        /* HEAP bucket start offsets are always in-memory, safe to cast */
  780|      0|        remaining = h->alloc_len - (e->length + (apr_size_t)e->start);
  781|      0|        buf = h->base + e->start + e->length;
  782|      0|    }
  783|       |
  784|  1.10k|    if (nbyte > remaining) {
  ------------------
  |  Branch (784:9): [True: 0, False: 1.10k]
  ------------------
  785|       |        /* either a buffer bucket exists but is full,
  786|       |         * or no buffer bucket exists and the data is too big
  787|       |         * to buffer.  In either case, we should flush.  */
  788|      0|        if (flush) {
  ------------------
  |  Branch (788:13): [True: 0, False: 0]
  ------------------
  789|      0|            e = apr_bucket_transient_create(str, nbyte, b->bucket_alloc);
  790|      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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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]
  |  |  ------------------
  ------------------
  791|      0|            return flush(b, ctx);
  792|      0|        }
  793|      0|        else {
  794|      0|            e = apr_bucket_heap_create(str, nbyte, NULL, b->bucket_alloc);
  795|      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))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|#define APR_OFFSETOF(s_type,field) 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]
  |  |  ------------------
  ------------------
  796|      0|            return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  797|      0|        }
  798|      0|    }
  799|  1.10k|    else if (!buf) {
  ------------------
  |  Branch (799:14): [True: 1.10k, False: 0]
  ------------------
  800|       |        /* we don't have a buffer, but the data is small enough
  801|       |         * that we don't mind making a new buffer */
  802|  1.10k|        buf = apr_bucket_alloc(APR_BUCKET_BUFF_SIZE, b->bucket_alloc);
  ------------------
  |  |   54|  1.10k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  803|  1.10k|        e = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE,
  ------------------
  |  |   54|  1.10k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  804|  1.10k|                                   apr_bucket_free, b->bucket_alloc);
  805|  1.10k|        APR_BRIGADE_INSERT_TAIL(b, e);
  ------------------
  |  |  377|  1.10k|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|  1.10k|	apr_bucket *ap__b = (e);					\
  |  |  379|  1.10k|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|  1.10k|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.10k|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|  1.10k|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.10k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|  1.10k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  1.10k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|  1.10k|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.10k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.10k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|  1.10k|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.10k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|  1.10k|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.10k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|  1.10k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  1.10k|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|  1.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  806|  1.10k|        e->length = 0;   /* We are writing into the brigade, and
  807|       |                          * allocating more memory than we need.  This
  808|       |                          * ensures that the bucket thinks it is empty just
  809|       |                          * after we create it.  We'll fix the length
  810|       |                          * once we put data in it below.
  811|       |                          */
  812|  1.10k|    }
  813|       |
  814|       |    /* there is a sufficiently big buffer bucket available now */
  815|  1.10k|    memcpy(buf, str, nbyte);
  816|  1.10k|    e->length += nbyte;
  817|       |
  818|  1.10k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
  819|  1.10k|}
apr_brigade.c:brigade_cleanup:
   33|  4.66k|{
   34|  4.66k|    return apr_brigade_cleanup(data);
   35|  4.66k|}

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

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

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

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

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

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

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

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

apr_filepath_merge:
   86|    325|{
   87|    325|    char *path;
   88|    325|    apr_size_t rootlen; /* is the length of the src rootpath */
   89|    325|    apr_size_t maxlen;  /* maximum total path length */
   90|    325|    apr_size_t keptlen; /* is the length of the retained rootpath */
   91|    325|    apr_size_t pathlen; /* is the length of the result path */
   92|    325|    apr_size_t seglen;  /* is the end of the current segment */
   93|    325|    apr_status_t rv;
   94|       |
   95|       |    /* Treat null as an empty path.
   96|       |     */
   97|    325|    if (!addpath)
  ------------------
  |  Branch (97:9): [True: 0, False: 325]
  ------------------
   98|      0|        addpath = "";
   99|       |
  100|    325|    if (addpath[0] == '/') {
  ------------------
  |  Branch (100:9): [True: 0, False: 325]
  ------------------
  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|    325|    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|    325|        if (flags & APR_FILEPATH_NOTABSOLUTE) {
  ------------------
  |  |  301|    325|#define APR_FILEPATH_NOTABSOLUTE    0x08
  ------------------
  |  Branch (123:13): [True: 0, False: 325]
  ------------------
  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|    325|    }
  130|       |
  131|    325|    if (!rootpath) {
  ------------------
  |  Branch (131:9): [True: 0, False: 325]
  ------------------
  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|    325|    rootlen = strlen(rootpath);
  150|    325|    maxlen = rootlen + strlen(addpath) + 4; /* 4 for slashes at start, after
  151|       |                                             * root, and at end, plus trailing
  152|       |                                             * null */
  153|    325|    if (maxlen > APR_PATH_MAX) {
  ------------------
  |  |  670|    325|#define APR_PATH_MAX       PATH_MAX
  ------------------
  |  Branch (153:9): [True: 0, False: 325]
  ------------------
  154|      0|        return APR_ENAMETOOLONG;
  ------------------
  |  |  659|      0|#define APR_ENAMETOOLONG ENAMETOOLONG
  ------------------
  155|      0|    }
  156|    325|    path = (char *)apr_palloc(p, maxlen);
  ------------------
  |  |  425|    325|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    325|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    325|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    325|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|       |
  158|    325|    if (addpath[0] == '/') {
  ------------------
  |  Branch (158:9): [True: 0, False: 325]
  ------------------
  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|    325|    else {
  170|       |        /* If both paths are relative, fail early
  171|       |         */
  172|    325|        if (rootpath[0] != '/' && (flags & APR_FILEPATH_NOTRELATIVE))
  ------------------
  |  |  298|      0|#define APR_FILEPATH_NOTRELATIVE    0x04
  ------------------
  |  Branch (172:13): [True: 0, False: 325]
  |  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|    325|        keptlen = rootlen;
  178|    325|        memcpy(path, rootpath, rootlen);
  179|       |
  180|       |        /* Always '/' terminate the given root path
  181|       |         */
  182|    325|        if (keptlen && path[keptlen - 1] != '/') {
  ------------------
  |  Branch (182:13): [True: 325, False: 0]
  |  Branch (182:24): [True: 0, False: 325]
  ------------------
  183|      0|            path[keptlen++] = '/';
  184|      0|        }
  185|    325|        pathlen = keptlen;
  186|    325|    }
  187|       |
  188|    650|    while (*addpath) {
  ------------------
  |  Branch (188:12): [True: 325, False: 325]
  ------------------
  189|       |        /* Parse each segment, find the closing '/'
  190|       |         */
  191|    325|        const char *next = addpath;
  192|  3.90k|        while (*next && (*next != '/')) {
  ------------------
  |  Branch (192:16): [True: 3.57k, False: 325]
  |  Branch (192:25): [True: 3.57k, False: 0]
  ------------------
  193|  3.57k|            ++next;
  194|  3.57k|        }
  195|    325|        seglen = next - addpath;
  196|       |
  197|    325|        if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) {
  ------------------
  |  Branch (197:13): [True: 0, False: 325]
  |  Branch (197:29): [True: 0, False: 325]
  |  Branch (197:44): [True: 0, False: 0]
  ------------------
  198|       |            /* noop segment (/ or ./) so skip it
  199|       |             */
  200|      0|        }
  201|    325|        else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') {
  ------------------
  |  Branch (201:18): [True: 0, False: 325]
  |  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|    325|        else {
  253|       |            /* An actual segment, append it to the destination path
  254|       |             */
  255|    325|            if (*next) {
  ------------------
  |  Branch (255:17): [True: 0, False: 325]
  ------------------
  256|      0|                seglen++;
  257|      0|            }
  258|    325|            memcpy(path + pathlen, addpath, seglen);
  259|    325|            pathlen += seglen;
  260|    325|        }
  261|       |
  262|       |        /* Skip over trailing slash to the next segment
  263|       |         */
  264|    325|        if (*next) {
  ------------------
  |  Branch (264:13): [True: 0, False: 325]
  ------------------
  265|      0|            ++next;
  266|      0|        }
  267|       |
  268|    325|        addpath = next;
  269|    325|    }
  270|    325|    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|    325|    if ((flags & APR_FILEPATH_NOTABOVEROOT) && keptlen < rootlen) {
  ------------------
  |  |  287|    325|#define APR_FILEPATH_NOTABOVEROOT   0x01
  ------------------
  |  Branch (278:9): [True: 0, False: 325]
  |  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|    325|    *newpath = path;
  289|    325|    return APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  290|    325|}

apr_file_mktemp:
  187|    325|{
  188|    325|#ifdef HAVE_MKSTEMP
  189|    325|    int fd;
  190|    325|#endif
  191|    325|    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: 325]
  ------------------
  192|    325|                       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|    325|    fd = wrap_mkostemp(template,
  ------------------
  |  |  179|    650|#define wrap_mkostemp(t, f) mkostemp(t, (f))
  |  |  ------------------
  |  |  |  Branch (179:42): [True: 0, False: 325]
  |  |  ------------------
  ------------------
  198|    325|                       (flags & APR_FOPEN_NOCLEANUP) ? 0 : O_CLOEXEC);
  199|    325|    if (fd == -1) {
  ------------------
  |  Branch (199:9): [True: 0, False: 325]
  ------------------
  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|    325|    apr_os_file_put(fp, &fd, flags, p);
  210|    325|    (*fp)->fname = apr_pstrdup(p, template);
  211|       |
  212|    325|    if (!(flags & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|    325|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (212:9): [True: 325, 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|    325|        apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
  225|    325|                                  apr_unix_file_cleanup,
  226|    325|                                  apr_unix_child_file_cleanup);
  227|       |
  228|       |        /* Clear APR_FOPEN_NOCLEANUP set by apr_os_file_put() */
  229|    325|        (*fp)->flags &= ~APR_FOPEN_NOCLEANUP;
  ------------------
  |  |   74|    325|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  230|    325|     }
  231|    325|#endif
  232|    325|    return APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  233|    325|}

apr_unix_file_cleanup:
   73|    325|{
   74|    325|    apr_file_t *file = thefile;
   75|    325|    apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
                  apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
   76|       |
   77|    325|    if (file->buffered) {
  ------------------
  |  Branch (77:9): [True: 0, False: 325]
  ------------------
   78|      0|        flush_rv = apr_file_flush(file);
   79|      0|    }
   80|       |
   81|    325|    rv = file_cleanup(file, 0);
   82|       |
   83|    325|    return rv != APR_SUCCESS ? rv : flush_rv;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (83:12): [True: 0, False: 325]
  ------------------
   84|    325|}
apr_file_remove:
  285|    325|{
  286|    325|    if (unlink(path) == 0) {
  ------------------
  |  Branch (286:9): [True: 325, False: 0]
  ------------------
  287|    325|        return APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  288|    325|    }
  289|      0|    else {
  290|      0|        return errno;
  291|      0|    }
  292|    325|}
apr_os_file_put:
  314|    325|{
  315|    325|    int *dafile = thefile;
  316|       |
  317|    325|    (*file) = apr_pcalloc(pool, sizeof(apr_file_t));
  ------------------
  |  |  454|    325|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    325|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    325|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    325|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|    325|    (*file)->pool = pool;
  319|    325|    (*file)->eof_hit = 0;
  320|    325|    (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */
  321|    325|    (*file)->timeout = -1;
  322|    325|    (*file)->ungetchar = -1; /* no char avail */
  323|    325|    (*file)->filedes = *dafile;
  324|    325|    (*file)->flags = flags | APR_FOPEN_NOCLEANUP;
  ------------------
  |  |   74|    325|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  325|    325|    (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0;
  ------------------
  |  |   65|    325|#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|    325|    if ((*file)->buffered) {
  ------------------
  |  Branch (334:9): [True: 0, False: 325]
  ------------------
  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__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      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|    325|    return APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  349|    325|}
open.c:file_cleanup:
   31|    325|{
   32|    325|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
   33|    325|    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|    325|    file->filedes = -1;
   39|       |
   40|    325|    if (close(fd) == 0) {
  ------------------
  |  Branch (40:9): [True: 325, False: 0]
  ------------------
   41|       |        /* Only the parent process should delete the file! */
   42|    325|        if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) {
  ------------------
  |  |   66|    325|#define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
  ------------------
  |  Branch (42:13): [True: 325, False: 0]
  |  Branch (42:26): [True: 0, False: 325]
  ------------------
   43|      0|            unlink(file->fname);
   44|      0|        }
   45|    325|#if APR_HAS_THREADS
   46|    325|        if (file->thlock) {
  ------------------
  |  Branch (46:13): [True: 0, False: 325]
  ------------------
   47|      0|            rv = apr_thread_mutex_destroy(file->thlock);
   48|      0|        }
   49|    325|#endif
   50|    325|    }
   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|    325|    return rv;
   70|    325|}

apr_file_writev:
  313|    325|{
  314|    325|#ifdef HAVE_WRITEV
  315|    325|    apr_status_t rv;
  316|    325|    apr_ssize_t bytes;
  317|       |
  318|    325|    if (thefile->buffered) {
  ------------------
  |  Branch (318:9): [True: 0, False: 325]
  ------------------
  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|    325|    rv = file_rotating_check(thefile);
  344|    325|    if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  |  Branch (344:9): [True: 0, False: 325]
  ------------------
  345|      0|        return rv;
  346|      0|    }
  347|       |
  348|    325|    if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
  ------------------
  |  Branch (348:9): [True: 0, False: 325]
  ------------------
  349|      0|        *nbytes = 0;
  350|      0|        rv = errno;
  351|      0|    }
  352|    325|    else {
  353|    325|        *nbytes = bytes;
  354|    325|        rv = APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  355|    325|    }
  356|    325|    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|    325|}
readwrite.c:file_rotating_check:
  201|    325|{
  202|    325|    if (thefile->rotating && thefile->rotating->manual == 0) {
  ------------------
  |  Branch (202:9): [True: 0, False: 325]
  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  390|      0| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|      0|        return do_rotating_check(thefile, now);
  205|      0|    }
  206|    325|    return APR_SUCCESS;
  ------------------
  |  |  225|    325|#define APR_SUCCESS 0
  ------------------
  207|    325|}

apr_thread_mutex_create:
   40|  1.10k|{
   41|  1.10k|    apr_thread_mutex_t *new_mutex;
   42|  1.10k|    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.10k|    new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
  ------------------
  |  |  454|  1.10k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.10k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.10k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.10k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|  1.10k|    new_mutex->pool = pool;
   52|       |
   53|  1.10k|#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE
   54|  1.10k|    if (flags & APR_THREAD_MUTEX_NESTED) {
  ------------------
  |  |   44|  1.10k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
  |  Branch (54:9): [True: 1.10k, False: 0]
  ------------------
   55|  1.10k|        pthread_mutexattr_t mattr;
   56|       |
   57|  1.10k|        rv = pthread_mutexattr_init(&mattr);
   58|  1.10k|        if (rv) return rv;
  ------------------
  |  Branch (58:13): [True: 0, False: 1.10k]
  ------------------
   59|       |
   60|  1.10k|        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
   61|  1.10k|        if (rv) {
  ------------------
  |  Branch (61:13): [True: 0, False: 1.10k]
  ------------------
   62|      0|            pthread_mutexattr_destroy(&mattr);
   63|      0|            return rv;
   64|      0|        }
   65|       |
   66|  1.10k|        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   67|       |
   68|  1.10k|        pthread_mutexattr_destroy(&mattr);
   69|  1.10k|    } 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.10k|    if (rv) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1.10k]
  ------------------
   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.10k|    apr_pool_cleanup_register(new_mutex->pool,
  113|  1.10k|                              new_mutex, thread_mutex_cleanup,
  114|  1.10k|                              apr_pool_cleanup_null);
  115|       |
  116|  1.10k|    *mutex = new_mutex;
  117|  1.10k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
  118|  1.10k|}
apr_thread_mutex_lock:
  121|  5.38k|{
  122|  5.38k|    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|  5.38k|    rv = pthread_mutex_lock(&mutex->mutex);
  159|       |#ifdef HAVE_ZOS_PTHREADS
  160|       |    if (rv) {
  161|       |        rv = errno;
  162|       |    }
  163|       |#endif
  164|       |
  165|  5.38k|    return rv;
  166|  5.38k|}
apr_thread_mutex_unlock:
  302|  5.38k|{
  303|  5.38k|    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|  5.38k|    status = pthread_mutex_unlock(&mutex->mutex);
  331|       |#ifdef HAVE_ZOS_PTHREADS
  332|       |    if (status) {
  333|       |        status = errno;
  334|       |    }
  335|       |#endif
  336|       |
  337|  5.38k|    return status;
  338|  5.38k|}
thread_mutex.c:thread_mutex_cleanup:
   24|  1.10k|{
   25|  1.10k|    apr_thread_mutex_t *mutex = data;
   26|  1.10k|    apr_status_t rv;
   27|       |
   28|  1.10k|    rv = pthread_mutex_destroy(&mutex->mutex);
   29|       |#ifdef HAVE_ZOS_PTHREADS
   30|       |    if (rv) {
   31|       |        rv = errno;
   32|       |    }
   33|       |#endif
   34|  1.10k|    return rv;
   35|  1.10k|}

apr_allocator_create:
  173|  1.10k|{
  174|  1.10k|    apr_allocator_t *new_allocator;
  175|       |
  176|  1.10k|    *allocator = NULL;
  177|       |
  178|  1.10k|    if ((new_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL)
  ------------------
  |  |  147|  1.10k|#define SIZEOF_ALLOCATOR_T  APR_ALIGN_DEFAULT(sizeof(apr_allocator_t))
  |  |  ------------------
  |  |  |  |  143|  1.10k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  1.10k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (178:9): [True: 0, False: 1.10k]
  ------------------
  179|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
  180|       |
  181|  1.10k|    memset(new_allocator, 0, SIZEOF_ALLOCATOR_T);
  ------------------
  |  |  147|  1.10k|#define SIZEOF_ALLOCATOR_T  APR_ALIGN_DEFAULT(sizeof(apr_allocator_t))
  |  |  ------------------
  |  |  |  |  143|  1.10k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  1.10k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.10k|    new_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
  ------------------
  |  |   67|  1.10k|#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
  ------------------
  183|       |
  184|  1.10k|    *allocator = new_allocator;
  185|       |
  186|  1.10k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
  187|  1.10k|}
apr_allocator_destroy:
  190|  1.10k|{
  191|  1.10k|    apr_size_t index;
  192|  1.10k|    apr_memnode_t *node, **ref;
  193|       |
  194|  24.3k|    for (index = 0; index <= MAX_INDEX; index++) {
  ------------------
  |  |   70|  24.3k|#define MAX_INDEX   20
  ------------------
  |  Branch (194:21): [True: 23.2k, False: 1.10k]
  ------------------
  195|  23.2k|        ref = &allocator->free[index];
  196|  25.4k|        while ((node = *ref) != NULL) {
  ------------------
  |  Branch (196:16): [True: 2.21k, False: 23.2k]
  ------------------
  197|  2.21k|            *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.21k|            free(node);
  203|  2.21k|#endif
  204|  2.21k|        }
  205|  23.2k|    }
  206|       |
  207|  1.10k|    free(allocator);
  208|  1.10k|}
apr_allocator_alloc:
  496|  2.21k|{
  497|  2.21k|    return allocator_alloc(allocator, size);
  498|  2.21k|}
apr_allocator_free:
  502|  2.21k|{
  503|  2.21k|    allocator_free(allocator, node);
  504|  2.21k|}
apr_pool_initialize:
 1674|  1.10k|{
 1675|  1.10k|    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.10k|    if (apr_pools_initialized++)
  ------------------
  |  Branch (1681:9): [True: 0, False: 1.10k]
  ------------------
 1682|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1683|       |
 1684|  1.10k|#if defined(_SC_PAGESIZE)
 1685|  1.10k|    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.10k|    boundary_index = 12;
 1694|  1.10k|    while ( (1 << boundary_index) < boundary_size)
  ------------------
  |  Branch (1694:13): [True: 0, False: 1.10k]
  ------------------
 1695|      0|        boundary_index++;
 1696|  1.10k|    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.10k|    if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL,
  ------------------
  |  |  247|  1.10k|    apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
  |  |  248|  1.10k|                             APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.10k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.10k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.10k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1703:9): [True: 0, False: 1.10k]
  ------------------
 1704|  1.10k|                                 NULL)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
 1705|      0|        return rv;
 1706|      0|    }
 1707|       |
 1708|  1.10k|    apr_pool_tag(global_pool, "APR global pool");
 1709|       |
 1710|  1.10k|    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.10k|    if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1715:9): [True: 0, False: 1.10k]
  ------------------
 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.10k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
 1759|  1.10k|}
apr_pool_terminate:
 1762|  1.10k|{
 1763|  1.10k|    if (!apr_pools_initialized)
  ------------------
  |  Branch (1763:9): [True: 0, False: 1.10k]
  ------------------
 1764|      0|        return;
 1765|       |
 1766|  1.10k|    if (--apr_pools_initialized)
  ------------------
  |  Branch (1766:9): [True: 0, False: 1.10k]
  ------------------
 1767|      0|        return;
 1768|       |
 1769|  1.10k|    apr_pool_destroy(global_pool); /* This will also destroy the mutex */
  ------------------
  |  |  388|  1.10k|    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.10k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.10k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.10k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1770|  1.10k|    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.10k|}
apr_palloc_debug:
 1823|  26.3k|{
 1824|  26.3k|    void *mem;
 1825|       |
 1826|  26.3k|    apr_pool_check_integrity(pool);
 1827|       |
 1828|  26.3k|    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|  26.3k|    return mem;
 1835|  26.3k|}
apr_pcalloc_debug:
 1839|  2.56k|{
 1840|  2.56k|    void *mem;
 1841|       |
 1842|  2.56k|    apr_pool_check_integrity(pool);
 1843|       |
 1844|  2.56k|    mem = pool_alloc(pool, size);
 1845|  2.56k|    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.56k|    return mem;
 1852|  2.56k|}
apr_pool_destroy_debug:
 1985|  1.10k|{
 1986|  1.10k|#if APR_HAS_THREADS
 1987|  1.10k|    apr_thread_mutex_t *mutex;
 1988|  1.10k|#endif
 1989|       |
 1990|  1.10k|    apr_pool_check_lifetime(pool);
 1991|       |
 1992|  1.10k|    if (pool->joined) {
  ------------------
  |  Branch (1992:9): [True: 0, False: 1.10k]
  ------------------
 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.10k|#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.10k|    mutex = parent_lock(pool);
 2008|  1.10k|#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.10k|    pool_destroy_debug(pool, file_line);
 2015|       |
 2016|  1.10k|#if APR_HAS_THREADS
 2017|       |    /* Unlock the mutex we obtained above */
 2018|  1.10k|    parent_unlock(mutex);
 2019|  1.10k|#endif /* APR_HAS_THREADS */
 2020|  1.10k|}
apr_pool_create_ex_debug:
 2027|  2.21k|{
 2028|  2.21k|    apr_pool_t *pool;
 2029|       |
 2030|  2.21k|    *newpool = NULL;
 2031|       |
 2032|  2.21k|    if (!parent) {
  ------------------
  |  Branch (2032:9): [True: 2.21k, False: 0]
  ------------------
 2033|  2.21k|        parent = global_pool;
 2034|  2.21k|    }
 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.21k|    if (!abort_fn && parent)
  ------------------
  |  Branch (2042:9): [True: 2.21k, False: 0]
  |  Branch (2042:22): [True: 1.10k, False: 1.10k]
  ------------------
 2043|  1.10k|        abort_fn = parent->abort_fn;
 2044|       |
 2045|  2.21k|    if ((pool = malloc(SIZEOF_POOL_T)) == NULL) {
  ------------------
  |  |  618|  2.21k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  143|  2.21k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.21k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2045:9): [True: 0, False: 2.21k]
  ------------------
 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.21k|    memset(pool, 0, SIZEOF_POOL_T);
  ------------------
  |  |  618|  2.21k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  143|  2.21k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.21k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2053|       |
 2054|  2.21k|    pool->allocator = allocator;
 2055|  2.21k|    pool->abort_fn = abort_fn;
 2056|  2.21k|    pool->tag = file_line;
 2057|  2.21k|    pool->file_line = file_line;
 2058|       |
 2059|  2.21k|#if APR_HAS_THREADS
 2060|  2.21k|    if (parent == NULL || parent->allocator != allocator) {
  ------------------
  |  Branch (2060:9): [True: 1.10k, False: 1.10k]
  |  Branch (2060:27): [True: 0, False: 1.10k]
  ------------------
 2061|  1.10k|        apr_status_t rv;
 2062|       |
 2063|       |        /* No matter what the creation flags say, always create
 2064|       |         * a lock.  Without it integrity_check and apr_pool_num_bytes
 2065|       |         * blow up (because they traverse pools child lists that
 2066|       |         * possibly belong to another thread, in combination with
 2067|       |         * the pool having no lock).  However, this might actually
 2068|       |         * hide problems like creating a child pool of a pool
 2069|       |         * belonging to another thread.
 2070|       |         */
 2071|  1.10k|        if ((rv = apr_thread_mutex_create(&pool->mutex,
  ------------------
  |  Branch (2071:13): [True: 0, False: 1.10k]
  ------------------
 2072|  1.10k|                APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |   44|  1.10k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
                              APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.10k|#define APR_SUCCESS 0
  ------------------
 2073|      0|            free(pool);
 2074|      0|            return rv;
 2075|      0|        }
 2076|  1.10k|    }
 2077|  1.10k|    else {
 2078|  1.10k|        pool->mutex = parent->mutex;
 2079|  1.10k|    }
 2080|  2.21k|#endif /* APR_HAS_THREADS */
 2081|       |
 2082|  2.21k|    if ((pool->parent = parent) != NULL) {
  ------------------
  |  Branch (2082:9): [True: 1.10k, False: 1.10k]
  ------------------
 2083|  1.10k|        pool_lock(parent);
 2084|       |
 2085|  1.10k|        if ((pool->sibling = parent->child) != NULL)
  ------------------
  |  Branch (2085:13): [True: 0, False: 1.10k]
  ------------------
 2086|      0|            pool->sibling->ref = &pool->sibling;
 2087|       |
 2088|  1.10k|        parent->child = pool;
 2089|  1.10k|        pool->ref = &parent->child;
 2090|       |
 2091|  1.10k|        pool_unlock(parent);
 2092|  1.10k|    }
 2093|  1.10k|    else {
 2094|  1.10k|        pool->sibling = NULL;
 2095|  1.10k|        pool->ref = NULL;
 2096|  1.10k|    }
 2097|       |
 2098|  2.21k|#if APR_HAS_THREADS
 2099|  2.21k|    pool->owner = apr_os_thread_current();
 2100|  2.21k|#endif /* APR_HAS_THREADS */
 2101|       |#ifdef NETWARE
 2102|       |    pool->owner_proc = (apr_os_proc_t)getnlmhandle();
 2103|       |#endif /* defined(NETWARE) */
 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.21k|    *newpool = pool;
 2110|       |
 2111|  2.21k|    return APR_SUCCESS;
  ------------------
  |  |  225|  2.21k|#define APR_SUCCESS 0
  ------------------
 2112|  2.21k|}
apr_pool_find:
 2297|  4.27k|{
 2298|  4.27k|    void *pool = (void *)mem;
 2299|       |
 2300|  4.27k|    if (apr_pool_walk_tree(global_pool, pool_find, &pool))
  ------------------
  |  Branch (2300:9): [True: 4.27k, False: 0]
  ------------------
 2301|  4.27k|        return pool;
 2302|       |
 2303|      0|    return NULL;
 2304|  4.27k|}
apr_pool_allocator_get:
 2409|  2.21k|{
 2410|  2.21k|    return pool->allocator;
 2411|  2.21k|}
apr_pool_is_ancestor:
 2417|  4.27k|{
 2418|  4.27k|    if (a == NULL)
  ------------------
  |  Branch (2418:9): [True: 0, False: 4.27k]
  ------------------
 2419|      0|        return 1;
 2420|       |
 2421|  4.27k|#if APR_POOL_DEBUG
 2422|       |    /* Find the pool with the longest lifetime guaranteed by the
 2423|       |     * caller: */
 2424|  4.27k|    while (a->joined) {
  ------------------
  |  Branch (2424:12): [True: 0, False: 4.27k]
  ------------------
 2425|      0|        a = a->joined;
 2426|      0|    }
 2427|  4.27k|#endif
 2428|       |
 2429|  4.27k|    while (b) {
  ------------------
  |  Branch (2429:12): [True: 4.27k, False: 0]
  ------------------
 2430|  4.27k|        if (a == b)
  ------------------
  |  Branch (2430:13): [True: 4.27k, False: 0]
  ------------------
 2431|  4.27k|            return 1;
 2432|       |
 2433|      0|        b = b->parent;
 2434|      0|    }
 2435|       |
 2436|      0|    return 0;
 2437|  4.27k|}
apr_pool_tag:
 2440|  1.10k|{
 2441|  1.10k|    pool->tag = tag;
 2442|  1.10k|}
apr_pool_cleanup_register:
 2530|  7.53k|{
 2531|  7.53k|    cleanup_t *c = NULL;
 2532|       |
 2533|  7.53k|#if APR_POOL_DEBUG
 2534|  7.53k|    apr_pool_check_integrity(p);
 2535|  7.53k|#endif /* APR_POOL_DEBUG */
 2536|       |
 2537|  7.53k|    if (p != NULL) {
  ------------------
  |  Branch (2537:9): [True: 7.53k, False: 0]
  ------------------
 2538|  7.53k|        if (p->free_cleanups) {
  ------------------
  |  Branch (2538:13): [True: 0, False: 7.53k]
  ------------------
 2539|       |            /* reuse a cleanup structure */
 2540|      0|            c = p->free_cleanups;
 2541|      0|            p->free_cleanups = c->next;
 2542|  7.53k|        } else {
 2543|  7.53k|            c = apr_palloc(p, sizeof(cleanup_t));
  ------------------
  |  |  425|  7.53k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  7.53k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  7.53k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  7.53k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2544|  7.53k|        }
 2545|  7.53k|        c->data = data;
 2546|  7.53k|        c->plain_cleanup_fn = plain_cleanup_fn;
 2547|  7.53k|        c->child_cleanup_fn = child_cleanup_fn;
 2548|  7.53k|        c->next = p->cleanups;
 2549|  7.53k|        p->cleanups = c;
 2550|  7.53k|    }
 2551|       |
 2552|  7.53k|#if APR_POOL_DEBUG
 2553|  7.53k|    if (!c || !c->plain_cleanup_fn || !c->child_cleanup_fn) {
  ------------------
  |  Branch (2553:9): [True: 0, False: 7.53k]
  |  Branch (2553:15): [True: 0, False: 7.53k]
  |  Branch (2553:39): [True: 0, False: 7.53k]
  ------------------
 2554|      0|        abort();
 2555|      0|    }
 2556|  7.53k|#endif /* APR_POOL_DEBUG */
 2557|  7.53k|}
apr_pool_create_ex:
 2979|  1.10k|{
 2980|  1.10k|    return apr_pool_create_ex_debug(newpool, parent,
 2981|  1.10k|                                    abort_fn, allocator,
 2982|  1.10k|                                    "undefined");
 2983|  1.10k|}
apr_pools.c:allocator_lock:
  156|  2.21k|{
  157|  2.21k|#if APR_HAS_THREADS
  158|  2.21k|    if (allocator->mutex)
  ------------------
  |  Branch (158:9): [True: 0, False: 2.21k]
  ------------------
  159|      0|        apr_thread_mutex_lock(allocator->mutex);
  160|  2.21k|#endif /* APR_HAS_THREADS */
  161|  2.21k|}
apr_pools.c:allocator_unlock:
  165|  2.21k|{
  166|  2.21k|#if APR_HAS_THREADS
  167|  2.21k|    if (allocator->mutex)
  ------------------
  |  Branch (167:9): [True: 0, False: 2.21k]
  ------------------
  168|      0|        apr_thread_mutex_unlock(allocator->mutex);
  169|  2.21k|#endif /* APR_HAS_THREADS */
  170|  2.21k|}
apr_pools.c:allocator_align:
  255|  2.21k|{
  256|  2.21k|    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.21k|    size = APR_ALIGN(size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE);
  ------------------
  |  |  140|  2.21k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  ------------------
  262|  2.21k|    if (size < in_size) {
  ------------------
  |  Branch (262:9): [True: 0, False: 2.21k]
  ------------------
  263|      0|        return 0;
  264|      0|    }
  265|  2.21k|    if (size < MIN_ALLOC) {
  ------------------
  |  |   73|  2.21k|#define MIN_ALLOC   (BOUNDARY_SIZE << min_order)
  |  |  ------------------
  |  |  |  |   82|  2.21k|#define BOUNDARY_SIZE   boundary_size
  |  |  ------------------
  ------------------
  |  Branch (265:9): [True: 0, False: 2.21k]
  ------------------
  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.21k|    return size;
  270|  2.21k|}
apr_pools.c:allocator_alloc:
  281|  2.21k|{
  282|  2.21k|    apr_memnode_t *node, **ref;
  283|  2.21k|    apr_size_t max_index, upper_index;
  284|  2.21k|    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.21k|    size = allocator_align(in_size);
  290|  2.21k|    if (!size) {
  ------------------
  |  Branch (290:9): [True: 0, False: 2.21k]
  ------------------
  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.21k|    index = (size >> BOUNDARY_INDEX) - 1;
  ------------------
  |  |   81|  2.21k|#define BOUNDARY_INDEX  boundary_index
  ------------------
  298|       |
  299|  2.21k|    if (index > APR_UINT32_MAX) {
  ------------------
  |  |  442|  2.21k|#define APR_UINT32_MAX  UINT32_MAX
  ------------------
  |  Branch (299:9): [True: 0, False: 2.21k]
  ------------------
  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.21k|    if (index <= allocator->max_index) {
  ------------------
  |  Branch (306:9): [True: 0, False: 2.21k]
  ------------------
  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.21k|    else if (allocator->free[MAX_INDEX]) {
  ------------------
  |  |   70|  2.21k|#define MAX_INDEX   20
  ------------------
  |  Branch (364:14): [True: 0, False: 2.21k]
  ------------------
  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.21k|    if ((node = malloc(size)) == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 2.21k]
  ------------------
  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.21k|    node->index = (apr_uint32_t)index;
  411|  2.21k|    node->endp = (char *)node + size;
  412|       |
  413|  2.21k|have_node:
  414|  2.21k|    node->next = NULL;
  415|  2.21k|    node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
  ------------------
  |  |   64|  2.21k|#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
  |  |  ------------------
  |  |  |  |  143|  2.21k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.21k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  416|       |
  417|  2.21k|    APR_VALGRIND_UNDEFINED(node->first_avail, size - APR_MEMNODE_T_SIZE);
  418|       |
  419|  2.21k|    return node;
  420|  2.21k|}
apr_pools.c:allocator_free:
  424|  2.21k|{
  425|  2.21k|    apr_memnode_t *next, *freelist = NULL;
  426|  2.21k|    apr_size_t index, max_index;
  427|  2.21k|    apr_size_t max_free_index, current_free_index;
  428|       |
  429|  2.21k|    allocator_lock(allocator);
  430|       |
  431|  2.21k|    max_index = allocator->max_index;
  432|  2.21k|    max_free_index = allocator->max_free_index;
  433|  2.21k|    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.21k|    do {
  439|  2.21k|        next = node->next;
  440|  2.21k|        index = node->index;
  441|       |
  442|  2.21k|        APR_VALGRIND_NOACCESS((char *)node + APR_MEMNODE_T_SIZE,
  443|  2.21k|                              (node->index+1) << BOUNDARY_INDEX);
  444|       |
  445|  2.21k|        if (max_free_index != APR_ALLOCATOR_MAX_FREE_UNLIMITED
  ------------------
  |  |   67|  4.43k|#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
  ------------------
  |  Branch (445:13): [True: 0, False: 2.21k]
  ------------------
  446|  2.21k|            && 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.21k|        else if (index < MAX_INDEX) {
  ------------------
  |  |   70|  2.21k|#define MAX_INDEX   20
  ------------------
  |  Branch (450:18): [True: 2.21k, False: 0]
  ------------------
  451|       |            /* Add the node to the appropriate 'size' bucket.  Adjust
  452|       |             * the max_index when appropriate.
  453|       |             */
  454|  2.21k|            if ((node->next = allocator->free[index]) == NULL
  ------------------
  |  Branch (454:17): [True: 1.10k, False: 1.10k]
  ------------------
  455|  2.21k|                && index > max_index) {
  ------------------
  |  Branch (455:20): [True: 1.10k, False: 0]
  ------------------
  456|  1.10k|                max_index = index;
  457|  1.10k|            }
  458|  2.21k|            allocator->free[index] = node;
  459|  2.21k|            if (current_free_index >= index + 1)
  ------------------
  |  Branch (459:17): [True: 0, False: 2.21k]
  ------------------
  460|      0|                current_free_index -= index + 1;
  461|  2.21k|            else
  462|  2.21k|                current_free_index = 0;
  463|  2.21k|        }
  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.21k|    } while ((node = next) != NULL);
  ------------------
  |  Branch (475:14): [True: 0, False: 2.21k]
  ------------------
  476|       |
  477|  2.21k|    allocator->max_index = max_index;
  478|  2.21k|    allocator->current_free_index = current_free_index;
  479|       |
  480|  2.21k|    allocator_unlock(allocator);
  481|       |
  482|  2.21k|    while (freelist != NULL) {
  ------------------
  |  Branch (482:12): [True: 0, False: 2.21k]
  ------------------
  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.21k|}
apr_pools.c:apr_pool_check_integrity:
 1657|  36.4k|{
 1658|  36.4k|    apr_pool_check_lifetime(pool);
 1659|  36.4k|    apr_pool_check_owner(pool);
 1660|  36.4k|}
apr_pools.c:apr_pool_check_owner:
 1642|  38.6k|{
 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|  38.6k|}
apr_pools.c:pool_alloc:
 1783|  28.9k|{
 1784|  28.9k|    debug_node_t *node;
 1785|  28.9k|    void *mem;
 1786|       |
 1787|  28.9k|    if ((mem = malloc(size)) == NULL) {
  ------------------
  |  Branch (1787:9): [True: 0, False: 28.9k]
  ------------------
 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.9k|    node = pool->nodes;
 1795|  28.9k|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (1795:9): [True: 2.21k, False: 26.7k]
  |  Branch (1795:25): [True: 11, False: 26.7k]
  ------------------
 1796|  2.22k|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|  2.22k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|  2.22k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.22k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1796:13): [True: 0, False: 2.22k]
  ------------------
 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.22k|        memset(node, 0, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.22k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|  2.22k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.22k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1805|       |
 1806|  2.22k|        node->next = pool->nodes;
 1807|  2.22k|        pool->nodes = node;
 1808|  2.22k|        node->index = 0;
 1809|  2.22k|    }
 1810|       |
 1811|  28.9k|    node->beginp[node->index] = mem;
 1812|  28.9k|    node->endp[node->index] = (char *)mem + size;
 1813|  28.9k|    node->index++;
 1814|       |
 1815|  28.9k|    pool->stat_alloc++;
 1816|  28.9k|    pool->stat_total_alloc++;
 1817|       |
 1818|  28.9k|    return mem;
 1819|  28.9k|}
apr_pools.c:apr_pool_check_lifetime:
 1616|  37.5k|{
 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|  37.5k|    if (pool == global_pool || global_pool == NULL)
  ------------------
  |  Branch (1622:9): [True: 1.10k, False: 36.4k]
  |  Branch (1622:32): [True: 3.32k, False: 33.1k]
  ------------------
 1623|  4.43k|        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|  37.5k|}
apr_pools.c:parent_lock:
 1491|  1.10k|{
 1492|  1.10k|    if (pool->parent) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 1.10k]
  ------------------
 1493|      0|        apr_thread_mutex_lock(pool->parent->mutex);
 1494|      0|        return pool->parent->mutex;
 1495|      0|    }
 1496|  1.10k|    return NULL;
 1497|  1.10k|}
apr_pools.c:pool_clear_debug:
 1862|  2.21k|{
 1863|  2.21k|    debug_node_t *node;
 1864|  2.21k|    apr_size_t index;
 1865|       |
 1866|       |    /* Run pre destroy cleanups */
 1867|  2.21k|    run_cleanups(&pool->pre_cleanups);
 1868|  2.21k|    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.21k|    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.32k|    while (pool->child)
  ------------------
  |  Branch (1879:12): [True: 1.10k, False: 2.21k]
  ------------------
 1880|  1.10k|        pool_destroy_debug(pool->child, file_line);
 1881|       |
 1882|       |    /* Run cleanups */
 1883|  2.21k|    run_cleanups(&pool->cleanups);
 1884|  2.21k|    pool->free_cleanups = NULL;
 1885|  2.21k|    pool->cleanups = NULL;
 1886|       |
 1887|       |    /* If new child pools showed up, this is a reason to raise a flag */
 1888|  2.21k|    if (pool->child)
  ------------------
  |  Branch (1888:9): [True: 0, False: 2.21k]
  ------------------
 1889|      0|        abort();
 1890|       |
 1891|       |    /* Free subprocesses */
 1892|  2.21k|    free_proc_chain(pool->subprocesses);
 1893|  2.21k|    pool->subprocesses = NULL;
 1894|       |
 1895|       |    /* Clear the user data. */
 1896|  2.21k|    pool->user_data = NULL;
 1897|       |
 1898|       |    /* Free the blocks, scribbling over them first to help highlight
 1899|       |     * use-after-free issues. */
 1900|  4.44k|    while ((node = pool->nodes) != NULL) {
  ------------------
  |  Branch (1900:12): [True: 2.22k, False: 2.21k]
  ------------------
 1901|  2.22k|        pool->nodes = node->next;
 1902|       |
 1903|  31.1k|        for (index = 0; index < node->index; index++) {
  ------------------
  |  Branch (1903:25): [True: 28.9k, False: 2.22k]
  ------------------
 1904|  28.9k|            memset(node->beginp[index], POOL_POISON_BYTE,
  ------------------
  |  | 1859|  28.9k|#define POOL_POISON_BYTE 'A'
  ------------------
 1905|  28.9k|                   (char *)node->endp[index] - (char *)node->beginp[index]);
 1906|  28.9k|            free(node->beginp[index]);
 1907|  28.9k|        }
 1908|       |
 1909|  2.22k|        memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  | 1859|  2.22k|#define POOL_POISON_BYTE 'A'
  ------------------
                      memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.22k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  143|  2.22k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|  2.22k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1910|  2.22k|        free(node);
 1911|  2.22k|    }
 1912|       |
 1913|  2.21k|    pool->stat_alloc = 0;
 1914|  2.21k|    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.21k|}
apr_pools.c:run_cleanups:
 2684|  4.43k|{
 2685|  4.43k|    cleanup_t *c = *cref;
 2686|       |
 2687|  11.9k|    while (c) {
  ------------------
  |  Branch (2687:12): [True: 7.53k, False: 4.43k]
  ------------------
 2688|  7.53k|        *cref = c->next;
 2689|  7.53k|        (*c->plain_cleanup_fn)((void *)c->data);
 2690|  7.53k|        c = *cref;
 2691|  7.53k|    }
 2692|  4.43k|}
apr_pools.c:free_proc_chain:
 2764|  2.21k|{
 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.21k|    struct process_chain *pc;
 2770|  2.21k|    int need_timeout = 0;
 2771|  2.21k|    apr_time_t timeout_interval;
 2772|       |
 2773|  2.21k|    if (!procs)
  ------------------
  |  Branch (2773:9): [True: 2.21k, False: 0]
  ------------------
 2774|  2.21k|        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.10k|{
 1502|  1.10k|    if (mutex) {
  ------------------
  |  Branch (1502:9): [True: 0, False: 1.10k]
  ------------------
 1503|      0|        apr_thread_mutex_unlock(mutex);
 1504|      0|    }
 1505|  1.10k|}
apr_pools.c:pool_destroy_debug:
 1964|  2.21k|{
 1965|  2.21k|    pool_clear_debug(pool, file_line);
 1966|       |
 1967|       |    /* Remove the pool from the parent's child list */
 1968|  2.21k|    if (pool->parent != NULL
  ------------------
  |  Branch (1968:9): [True: 1.10k, False: 1.10k]
  ------------------
 1969|  2.21k|        && (*pool->ref = pool->sibling) != NULL) {
  ------------------
  |  Branch (1969:12): [True: 0, False: 1.10k]
  ------------------
 1970|      0|        pool->sibling->ref = pool->ref;
 1971|      0|    }
 1972|       |
 1973|       |    /* Destroy the allocator if the pool owns it */
 1974|  2.21k|    if (pool->allocator != NULL
  ------------------
  |  Branch (1974:9): [True: 0, False: 2.21k]
  ------------------
 1975|  2.21k|        && 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.21k|    free(pool);
 1981|  2.21k|}
apr_pools.c:pool_lock:
 1474|  5.38k|{
 1475|  5.38k|#if APR_HAS_THREADS
 1476|  5.38k|    apr_thread_mutex_lock(pool->mutex);
 1477|  5.38k|#endif /* APR_HAS_THREADS */
 1478|  5.38k|}
apr_pools.c:pool_unlock:
 1482|  5.38k|{
 1483|  5.38k|#if APR_HAS_THREADS
 1484|  5.38k|    apr_thread_mutex_unlock(pool->mutex);
 1485|  5.38k|#endif /* APR_HAS_THREADS */
 1486|  5.38k|}
apr_pools.c:apr_pool_walk_tree:
 1516|  8.55k|{
 1517|  8.55k|    int rv;
 1518|  8.55k|    apr_pool_t *child;
 1519|       |
 1520|  8.55k|    rv = fn(pool, data);
 1521|  8.55k|    if (rv)
  ------------------
  |  Branch (1521:9): [True: 4.27k, False: 4.27k]
  ------------------
 1522|  4.27k|        return rv;
 1523|       |
 1524|  4.27k|    pool_lock(pool);
 1525|       |
 1526|  4.27k|    child = pool->child;
 1527|  4.27k|    while (child) {
  ------------------
  |  Branch (1527:12): [True: 4.27k, False: 0]
  ------------------
 1528|  4.27k|        rv = apr_pool_walk_tree(child, fn, data);
 1529|  4.27k|        if (rv)
  ------------------
  |  Branch (1529:13): [True: 4.27k, False: 0]
  ------------------
 1530|  4.27k|            break;
 1531|       |
 1532|      0|        child = child->sibling;
 1533|      0|    }
 1534|       |
 1535|  4.27k|    pool_unlock(pool);
 1536|       |
 1537|  4.27k|    return rv;
 1538|  8.55k|}
apr_pools.c:pool_find:
 2274|  8.55k|{
 2275|  8.55k|    void **pmem = (void **)data;
 2276|  8.55k|    debug_node_t *node;
 2277|  8.55k|    apr_size_t index;
 2278|       |
 2279|  8.55k|    node = pool->nodes;
 2280|       |
 2281|  12.8k|    while (node) {
  ------------------
  |  Branch (2281:12): [True: 8.55k, False: 4.27k]
  ------------------
 2282|   113k|        for (index = 0; index < node->index; index++) {
  ------------------
  |  Branch (2282:25): [True: 108k, False: 4.27k]
  ------------------
 2283|   108k|             if (node->beginp[index] <= *pmem
  ------------------
  |  Branch (2283:18): [True: 62.6k, False: 46.1k]
  ------------------
 2284|   108k|                 && node->endp[index] > *pmem) {
  ------------------
  |  Branch (2284:21): [True: 4.27k, False: 58.3k]
  ------------------
 2285|  4.27k|                 *pmem = pool;
 2286|  4.27k|                 return 1;
 2287|  4.27k|             }
 2288|   108k|        }
 2289|       |
 2290|  4.27k|        node = node->next;
 2291|  4.27k|    }
 2292|       |
 2293|  4.27k|    return 0;
 2294|  8.55k|}

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

apr_strmatch_precompile:
   85|    901|{
   86|    901|    apr_strmatch_pattern *pattern;
   87|    901|    apr_size_t i;
   88|    901|    apr_size_t *shift;
   89|       |
   90|    901|    pattern = apr_palloc(p, sizeof(*pattern));
  ------------------
  |  |  425|    901|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    901|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    901|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    901|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|    901|    pattern->pattern = s;
   92|    901|    pattern->length = strlen(s);
   93|    901|    if (pattern->length == 0) {
  ------------------
  |  Branch (93:9): [True: 0, False: 901]
  ------------------
   94|      0|        pattern->compare = match_no_op;
   95|      0|        pattern->context = NULL;
   96|      0|        return pattern;
   97|      0|    }
   98|       |
   99|    901|    shift = (apr_size_t *)apr_palloc(p, sizeof(apr_size_t) * NUM_CHARS);
  ------------------
  |  |  425|    901|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    901|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    901|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    901|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|   231k|    for (i = 0; i < NUM_CHARS; i++) {
  ------------------
  |  |   23|   231k|#define NUM_CHARS  256
  ------------------
  |  Branch (100:17): [True: 230k, False: 901]
  ------------------
  101|   230k|        shift[i] = pattern->length;
  102|   230k|    }
  103|    901|    if (case_sensitive) {
  ------------------
  |  Branch (103:9): [True: 901, False: 0]
  ------------------
  104|    901|        pattern->compare = match_boyer_moore_horspool;
  105|  9.04k|        for (i = 0; i < pattern->length - 1; i++) {
  ------------------
  |  Branch (105:21): [True: 8.14k, False: 901]
  ------------------
  106|  8.14k|            shift[(unsigned char)s[i]] = pattern->length - i - 1;
  107|  8.14k|        }
  108|    901|    }
  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;
  ------------------
  |  |  231|      0|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  113|      0|        }
  114|      0|    }
  115|    901|    pattern->context = shift;
  116|       |
  117|    901|    return pattern;
  118|    901|}
apr_strmatch.c:match_boyer_moore_horspool:
   37|    488|{
   38|    488|    const char *s_end = s + slen;
   39|    488|    apr_size_t *shift = (apr_size_t *)(this_pattern->context);
   40|    488|    const char *s_next = s + this_pattern->length - 1;
   41|    488|    const char *p_start = this_pattern->pattern;
   42|    488|    const char *p_end = p_start + this_pattern->length - 1;
   43|  2.67k|    while (s_next < s_end) {
  ------------------
  |  Branch (43:12): [True: 2.37k, False: 304]
  ------------------
   44|  2.37k|        const char *s_tmp = s_next;
   45|  2.37k|        const char *p_tmp = p_end;
   46|  5.65k|        while (*s_tmp == *p_tmp) {
  ------------------
  |  Branch (46:16): [True: 3.46k, False: 2.18k]
  ------------------
   47|  3.46k|            p_tmp--;
   48|  3.46k|            if (p_tmp < p_start) {
  ------------------
  |  Branch (48:17): [True: 184, False: 3.28k]
  ------------------
   49|    184|                return s_tmp;
   50|    184|            }
   51|  3.28k|            s_tmp--;
   52|  3.28k|        }
   53|  2.18k|        s_next += shift[(int)*((const unsigned char *)s_next)];
   54|  2.18k|    }
   55|    304|    return NULL;
   56|    488|}

apr_array_push:
  108|  2.51k|{
  109|  2.51k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (109:9): [True: 0, False: 2.51k]
  ------------------
  110|      0|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (110:24): [True: 0, False: 0]
  ------------------
  111|      0|        char *new_data;
  112|       |
  113|      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__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|      0|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  116|      0|        memset(new_data + arr->nalloc * arr->elt_size, 0,
  117|      0|               arr->elt_size * (new_size - arr->nalloc));
  118|      0|        arr->elts = new_data;
  119|      0|        arr->nalloc = new_size;
  120|      0|    }
  121|       |
  122|  2.51k|    ++arr->nelts;
  123|  2.51k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  124|  2.51k|}
apr_table_make:
  401|  2.06k|{
  402|  2.06k|    apr_table_t *t = apr_palloc(p, sizeof(apr_table_t));
  ------------------
  |  |  425|  2.06k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  2.06k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.06k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.06k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|       |
  404|  2.06k|    make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t), 0);
  405|       |#ifdef MAKE_TABLE_PROFILE
  406|       |    t->creator = __builtin_return_address(0);
  407|       |#endif
  408|  2.06k|    t->index_initialized = 0;
  409|  2.06k|    return t;
  410|  2.06k|}
apr_table_get:
  472|  2.29k|{
  473|  2.29k|    apr_table_entry_t *next_elt;
  474|  2.29k|    apr_table_entry_t *end_elt;
  475|  2.29k|    apr_uint32_t checksum;
  476|  2.29k|    int hash;
  477|       |
  478|  2.29k|    if (key == NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 2.29k]
  ------------------
  479|      0|	return NULL;
  480|      0|    }
  481|       |
  482|  2.29k|    hash = TABLE_HASH(key);
  ------------------
  |  |  298|  2.29k|#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
  |  |  ------------------
  |  |  |  |  297|  2.29k|#define TABLE_INDEX_MASK 0x1f
  |  |  ------------------
  ------------------
  483|  2.29k|    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
  ------------------
  |  |  299|  2.29k|#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
  ------------------
  |  Branch (483:9): [True: 747, False: 1.55k]
  ------------------
  484|    747|        return NULL;
  485|    747|    }
  486|  1.55k|    COMPUTE_KEY_CHECKSUM(key, checksum);
  ------------------
  |  |  308|  1.55k|#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
  |  |  309|  1.55k|{                                              \
  |  |  310|  1.55k|    const char *k = (key);                     \
  |  |  311|  1.55k|    apr_uint32_t c = (apr_uint32_t)*k;         \
  |  |  312|  1.55k|    (checksum) = c;                            \
  |  |  313|  1.55k|    (checksum) <<= 8;                          \
  |  |  314|  1.55k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 1.55k, False: 0]
  |  |  ------------------
  |  |  315|  1.55k|        c = (apr_uint32_t)*++k;                \
  |  |  316|  1.55k|        checksum |= c;                         \
  |  |  317|  1.55k|    }                                          \
  |  |  318|  1.55k|    (checksum) <<= 8;                          \
  |  |  319|  1.55k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 1.55k, False: 0]
  |  |  ------------------
  |  |  320|  1.55k|        c = (apr_uint32_t)*++k;                \
  |  |  321|  1.55k|        checksum |= c;                         \
  |  |  322|  1.55k|    }                                          \
  |  |  323|  1.55k|    (checksum) <<= 8;                          \
  |  |  324|  1.55k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (324:9): [True: 1.55k, False: 0]
  |  |  ------------------
  |  |  325|  1.55k|        c = (apr_uint32_t)*++k;                \
  |  |  326|  1.55k|        checksum |= c;                         \
  |  |  327|  1.55k|    }                                          \
  |  |  328|  1.55k|    checksum &= CASE_MASK;                     \
  |  |  ------------------
  |  |  |  |  293|  1.55k|#define CASE_MASK 0xdfdfdfdf
  |  |  ------------------
  |  |  329|  1.55k|}
  ------------------
  487|  1.55k|    next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];;
  488|  1.55k|    end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash];
  489|       |
  490|  3.23k|    for (; next_elt <= end_elt; next_elt++) {
  ------------------
  |  Branch (490:12): [True: 2.10k, False: 1.13k]
  ------------------
  491|  2.10k|	if ((checksum == next_elt->key_checksum) &&
  ------------------
  |  Branch (491:6): [True: 1.53k, False: 566]
  ------------------
  492|  2.10k|            !strcasecmp(next_elt->key, key)) {
  ------------------
  |  Branch (492:13): [True: 417, False: 1.11k]
  ------------------
  493|    417|	    return next_elt->val;
  494|    417|	}
  495|  2.10k|    }
  496|       |
  497|  1.13k|    return NULL;
  498|  1.55k|}
apr_table_addn:
  812|  2.13k|{
  813|  2.13k|    apr_table_entry_t *elts;
  814|  2.13k|    apr_uint32_t checksum;
  815|  2.13k|    int hash;
  816|       |
  817|  2.13k|#if APR_POOL_DEBUG
  818|  2.13k|    {
  819|  2.13k|	if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) {
  ------------------
  |  Branch (819:6): [True: 0, False: 2.13k]
  ------------------
  820|      0|	    fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n");
  821|      0|	    abort();
  822|      0|	}
  823|  2.13k|	if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) {
  ------------------
  |  Branch (823:6): [True: 0, False: 2.13k]
  ------------------
  824|      0|	    fprintf(stderr, "apr_table_addn: val not in ancestor pool of t\n");
  825|      0|	    abort();
  826|      0|	}
  827|  2.13k|    }
  828|  2.13k|#endif
  829|       |
  830|  2.13k|    hash = TABLE_HASH(key);
  ------------------
  |  |  298|  2.13k|#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
  |  |  ------------------
  |  |  |  |  297|  2.13k|#define TABLE_INDEX_MASK 0x1f
  |  |  ------------------
  ------------------
  831|  2.13k|    t->index_last[hash] = t->a.nelts;
  832|  2.13k|    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
  ------------------
  |  |  299|  2.13k|#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
  ------------------
  |  Branch (832:9): [True: 1.47k, False: 662]
  ------------------
  833|  1.47k|        t->index_first[hash] = t->a.nelts;
  834|  1.47k|        TABLE_SET_INDEX_INITIALIZED(t, hash);
  ------------------
  |  |  300|  1.47k|#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1u << (i)))
  ------------------
  835|  1.47k|    }
  836|  2.13k|    COMPUTE_KEY_CHECKSUM(key, checksum);
  ------------------
  |  |  308|  2.13k|#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
  |  |  309|  2.13k|{                                              \
  |  |  310|  2.13k|    const char *k = (key);                     \
  |  |  311|  2.13k|    apr_uint32_t c = (apr_uint32_t)*k;         \
  |  |  312|  2.13k|    (checksum) = c;                            \
  |  |  313|  2.13k|    (checksum) <<= 8;                          \
  |  |  314|  2.13k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 1.92k, False: 214]
  |  |  ------------------
  |  |  315|  1.92k|        c = (apr_uint32_t)*++k;                \
  |  |  316|  1.92k|        checksum |= c;                         \
  |  |  317|  1.92k|    }                                          \
  |  |  318|  2.13k|    (checksum) <<= 8;                          \
  |  |  319|  2.13k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 1.07k, False: 1.06k]
  |  |  ------------------
  |  |  320|  1.07k|        c = (apr_uint32_t)*++k;                \
  |  |  321|  1.07k|        checksum |= c;                         \
  |  |  322|  1.07k|    }                                          \
  |  |  323|  2.13k|    (checksum) <<= 8;                          \
  |  |  324|  2.13k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (324:9): [True: 879, False: 1.25k]
  |  |  ------------------
  |  |  325|    879|        c = (apr_uint32_t)*++k;                \
  |  |  326|    879|        checksum |= c;                         \
  |  |  327|    879|    }                                          \
  |  |  328|  2.13k|    checksum &= CASE_MASK;                     \
  |  |  ------------------
  |  |  |  |  293|  2.13k|#define CASE_MASK 0xdfdfdfdf
  |  |  ------------------
  |  |  329|  2.13k|}
  ------------------
  837|  2.13k|    elts = (apr_table_entry_t *) table_push(t);
  ------------------
  |  |  387|  2.13k|#define table_push(t)	((apr_table_entry_t *) apr_array_push_noclear(&(t)->a))
  ------------------
  838|  2.13k|    elts->key = (char *)key;
  839|  2.13k|    elts->val = (char *)val;
  840|  2.13k|    elts->key_checksum = checksum;
  841|  2.13k|}
apr_tables.c:make_array_core:
   56|  2.06k|{
   57|       |    /*
   58|       |     * Assure sanity if someone asks for
   59|       |     * array of zero elts.
   60|       |     */
   61|  2.06k|    if (nelts < 1) {
  ------------------
  |  Branch (61:9): [True: 0, False: 2.06k]
  ------------------
   62|      0|        nelts = 1;
   63|      0|    }
   64|       |
   65|  2.06k|    if (clear) {
  ------------------
  |  Branch (65:9): [True: 0, False: 2.06k]
  ------------------
   66|      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__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   67|      0|    }
   68|  2.06k|    else {
   69|  2.06k|        res->elts = apr_palloc(p, nelts * elt_size);
  ------------------
  |  |  425|  2.06k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  2.06k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.06k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.06k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|  2.06k|    }
   71|       |
   72|  2.06k|    res->pool = p;
   73|  2.06k|    res->elt_size = elt_size;
   74|  2.06k|    res->nelts = 0;		/* No active elements yet... */
   75|  2.06k|    res->nalloc = nelts;	/* ...but this many allocated */
   76|  2.06k|}
apr_tables.c:apr_array_push_noclear:
  127|  2.13k|{
  128|  2.13k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (128:9): [True: 31, False: 2.10k]
  ------------------
  129|     31|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (129:24): [True: 0, False: 31]
  ------------------
  130|     31|        char *new_data;
  131|       |
  132|     31|        new_data = apr_palloc(arr->pool, arr->elt_size * new_size);
  ------------------
  |  |  425|     31|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     31|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|     31|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|     31|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|       |
  134|     31|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  135|     31|        arr->elts = new_data;
  136|     31|        arr->nalloc = new_size;
  137|     31|    }
  138|       |
  139|  2.13k|    ++arr->nelts;
  140|  2.13k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  141|  2.13k|}

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

