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

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

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

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

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

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

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

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

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

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

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

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

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

apr_brigade_cleanup:
   38|  5.49k|{
   39|  5.49k|    apr_bucket_brigade *b = data;
   40|       |
   41|  5.49k|#ifndef APR_BUCKET_DEBUG
   42|  8.17k|    while (!APR_BRIGADE_EMPTY(b)) {
  ------------------
  |  |  346|  8.17k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  8.17k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  8.17k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  8.17k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  8.17k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (42:12): [True: 2.68k, False: 5.49k]
  ------------------
   43|  2.68k|        apr_bucket_delete(APR_BRIGADE_FIRST(b));
  ------------------
  |  | 1086|  2.68k|#define apr_bucket_delete(e) do {					\
  |  | 1087|  2.68k|        apr_bucket *apr__b = (e);					\
  |  | 1088|  2.68k|        APR_BUCKET_REMOVE(apr__b);					\
  |  |  ------------------
  |  |  |  |  442|  2.68k|#define APR_BUCKET_REMOVE(e)	APR_RING_REMOVE((e), link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  2.68k|    APR_RING_UNSPLICE((ep), (ep), link)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  368|  2.68k|#define APR_RING_UNSPLICE(ep1, epN, link) do {                \
  |  |  |  |  |  |  |  |  369|  2.68k|    APR_RING_NEXT(APR_RING_PREV((ep1), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.68k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  370|  2.68k|             APR_RING_NEXT((epN), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  177|  2.68k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|  2.68k|    APR_RING_PREV(APR_RING_NEXT((epN), link), link) =        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.68k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  372|  2.68k|             APR_RING_PREV((ep1), link);            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  2.68k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  373|  2.68k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (373:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1089|  2.68k|        apr_bucket_destroy(apr__b);					\
  |  |  ------------------
  |  |  |  | 1069|  2.68k|#define apr_bucket_destroy(e) do {					\
  |  |  |  | 1070|  2.68k|        apr_bucket *apr__d = (e);					\
  |  |  |  | 1071|  2.68k|        apr__d->type->destroy(apr__d->data);			       	\
  |  |  |  | 1072|  2.68k|        apr__d->free(apr__d);						\
  |  |  |  | 1073|  2.68k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1090|  2.68k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1090:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   44|  2.68k|    }
   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.49k|    return APR_SUCCESS;
  ------------------
  |  |  225|  5.49k|#define APR_SUCCESS 0
  ------------------
   63|  5.49k|}
apr_brigade_create:
   87|  4.48k|{
   88|  4.48k|    apr_bucket_brigade *b;
   89|       |
   90|  4.48k|    b = apr_palloc(p, sizeof(*b));
  ------------------
  |  |  425|  4.48k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.48k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  4.48k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  4.48k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|  4.48k|    b->p = p;
   92|  4.48k|    b->bucket_alloc = list;
   93|       |
   94|  4.48k|    APR_RING_INIT(&b->list, apr_bucket, link);
  ------------------
  |  |  192|  4.48k|#define APR_RING_INIT(hp, elem, link) do {                \
  |  |  193|  4.48k|    APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  166|  4.48k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  |  |                   APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  160|  4.48k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  4.48k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  194|  4.48k|    APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  171|  4.48k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  |  |                   APR_RING_LAST((hp))  = APR_RING_SENTINEL((hp), elem, link);    \
  |  |  ------------------
  |  |  |  |  160|  4.48k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  4.48k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  195|  4.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (195:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
   95|       |
   96|  4.48k|    apr_pool_cleanup_register(b->p, b, brigade_cleanup, apr_pool_cleanup_null);
   97|  4.48k|    return b;
   98|  4.48k|}
apr_brigade_length:
  221|  1.63k|{
  222|  1.63k|    apr_off_t total = 0;
  223|  1.63k|    apr_bucket *bkt;
  224|  1.63k|    apr_status_t status = APR_SUCCESS;
  ------------------
  |  |  225|  1.63k|#define APR_SUCCESS 0
  ------------------
  225|       |
  226|  1.63k|    for (bkt = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|  1.63k|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|  1.63k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  227|  2.61k|         bkt != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|  2.61k|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|  2.61k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  2.61k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (227:10): [True: 977, False: 1.63k]
  ------------------
  228|  1.63k|         bkt = APR_BUCKET_NEXT(bkt))
  ------------------
  |  |  430|    977|#define APR_BUCKET_NEXT(e)	APR_RING_NEXT((e), link)
  |  |  ------------------
  |  |  |  |  177|    977|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  ------------------
  ------------------
  229|    977|    {
  230|    977|        if (bkt->length == (apr_size_t)(-1)) {
  ------------------
  |  Branch (230:13): [True: 0, False: 977]
  ------------------
  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|    977|        total += bkt->length;
  246|    977|    }
  247|       |
  248|  1.63k|    *length = total;
  249|  1.63k|    return status;
  250|  1.63k|}
apr_brigade_flatten:
  254|    445|{
  255|    445|    apr_size_t actual = 0;
  256|    445|    apr_bucket *b;
  257|       |
  258|    445|    for (b = APR_BRIGADE_FIRST(bb);
  ------------------
  |  |  353|    445|#define APR_BRIGADE_FIRST(b)	APR_RING_FIRST(&(b)->list)
  |  |  ------------------
  |  |  |  |  166|    445|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  ------------------
  ------------------
  259|    451|         b != APR_BRIGADE_SENTINEL(bb);
  ------------------
  |  |  339|    451|#define APR_BRIGADE_SENTINEL(b)	APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  160|    451|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    451|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (259:10): [True: 449, False: 2]
  ------------------
  260|    445|         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|    449|    {
  262|    449|        const char *str;
  263|    449|        apr_size_t str_len;
  264|    449|        apr_status_t status;
  265|       |
  266|    449|        status = apr_bucket_read(b, &str, &str_len, APR_BLOCK_READ);
  ------------------
  |  | 1159|    449|#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
  ------------------
  267|    449|        if (status != APR_SUCCESS) {
  ------------------
  |  |  225|    449|#define APR_SUCCESS 0
  ------------------
  |  Branch (267:13): [True: 0, False: 449]
  ------------------
  268|      0|            return status;
  269|      0|        }
  270|       |
  271|       |        /* If we would overflow. */
  272|    449|        if (str_len + actual > *len) {
  ------------------
  |  Branch (272:13): [True: 0, False: 449]
  ------------------
  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|    449|        memcpy(c, str, str_len);
  282|       |
  283|    449|        c += str_len;
  284|    449|        actual += str_len;
  285|       |
  286|       |        /* This could probably be actual == *len, but be safe from stray
  287|       |         * photons. */
  288|    449|        if (actual >= *len) {
  ------------------
  |  Branch (288:13): [True: 443, False: 6]
  ------------------
  289|    443|            break;
  290|    443|        }
  291|    449|    }
  292|       |
  293|    445|    *len = actual;
  294|    445|    return APR_SUCCESS;
  ------------------
  |  |  225|    445|#define APR_SUCCESS 0
  ------------------
  295|    445|}
apr_brigade_pflatten:
  301|    399|{
  302|    399|    apr_off_t actual;
  303|    399|    apr_size_t total;
  304|    399|    apr_status_t rv;
  305|       |
  306|    399|    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|    399|    total = (apr_size_t)actual;
  320|       |
  321|    399|    *c = apr_palloc(pool, total);
  ------------------
  |  |  425|    399|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    399|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|    399|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|    399|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|       |
  323|    399|    rv = apr_brigade_flatten(bb, *c, &total);
  324|       |
  325|    399|    if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|    399|#define APR_SUCCESS 0
  ------------------
  |  Branch (325:9): [True: 0, False: 399]
  ------------------
  326|      0|        return rv;
  327|      0|    }
  328|       |
  329|    399|    *len = total;
  330|    399|    return APR_SUCCESS;
  ------------------
  |  |  225|    399|#define APR_SUCCESS 0
  ------------------
  331|    399|}
apr_brigade_write:
  766|  1.06k|{
  767|  1.06k|    apr_bucket *e = APR_BRIGADE_LAST(b);
  ------------------
  |  |  359|  1.06k|#define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
  |  |  ------------------
  |  |  |  |  171|  1.06k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  ------------------
  ------------------
  768|  1.06k|    apr_size_t remaining = APR_BUCKET_BUFF_SIZE;
  ------------------
  |  |   54|  1.06k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  769|  1.06k|    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.06k|    if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
  ------------------
  |  |  346|  1.06k|#define APR_BRIGADE_EMPTY(b)	APR_RING_EMPTY(&(b)->list, apr_bucket, link)
  |  |  ------------------
  |  |  |  |  205|  2.12k|    (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  166|  1.06k|#define APR_RING_FIRST(hp)    (hp)->next
  |  |  |  |  ------------------
  |  |  |  |                   (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link))
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.06k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  1.06k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
  ------------------
  |  |  493|  1.06k|#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.06k]
  ------------------
  776|  1.06k|        && ((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.06k|    if (nbyte > remaining) {
  ------------------
  |  Branch (784:9): [True: 0, False: 1.06k]
  ------------------
  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.06k|    else if (!buf) {
  ------------------
  |  Branch (799:14): [True: 1.06k, 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.06k|        buf = apr_bucket_alloc(APR_BUCKET_BUFF_SIZE, b->bucket_alloc);
  ------------------
  |  |   54|  1.06k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  803|  1.06k|        e = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE,
  ------------------
  |  |   54|  1.06k|#define APR_BUCKET_BUFF_SIZE 8000
  ------------------
  804|  1.06k|                                   apr_bucket_free, b->bucket_alloc);
  805|  1.06k|        APR_BRIGADE_INSERT_TAIL(b, e);
  ------------------
  |  |  377|  1.06k|#define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
  |  |  378|  1.06k|	apr_bucket *ap__b = (e);					\
  |  |  379|  1.06k|	APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link);	\
  |  |  ------------------
  |  |  |  |  329|  1.06k|    APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.06k|#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do {        \
  |  |  |  |  |  |  303|  1.06k|    APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.06k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  160|  1.06k|    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  1.06k|#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  304|  1.06k|    APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  1.06k|#define APR_RING_PREV(ep, link)    (ep)->link.prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   APR_RING_PREV((ep1), link) = APR_RING_LAST((hp));               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.06k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  305|  1.06k|    APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1);               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|  1.06k|#define APR_RING_NEXT(ep, link)    (ep)->link.next
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  306|  1.06k|    APR_RING_LAST((hp)) = (epN);                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|  1.06k|#define APR_RING_LAST(hp)    (hp)->prev
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  307|  1.06k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (307:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  1.06k|        APR_BRIGADE_CHECK_CONSISTENCY((b));				\
  |  |  381|  1.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (381:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  806|  1.06k|        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.06k|    }
  813|       |
  814|       |    /* there is a sufficiently big buffer bucket available now */
  815|  1.06k|    memcpy(buf, str, nbyte);
  816|  1.06k|    e->length += nbyte;
  817|       |
  818|  1.06k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.06k|#define APR_SUCCESS 0
  ------------------
  819|  1.06k|}
apr_brigade.c:brigade_cleanup:
   33|  4.48k|{
   34|  4.48k|    return apr_brigade_cleanup(data);
   35|  4.48k|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

apr_array_push:
  108|  2.49k|{
  109|  2.49k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (109:9): [True: 0, False: 2.49k]
  ------------------
  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.49k|    ++arr->nelts;
  123|  2.49k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  124|  2.49k|}
apr_table_make:
  401|  1.97k|{
  402|  1.97k|    apr_table_t *t = apr_palloc(p, sizeof(apr_table_t));
  ------------------
  |  |  425|  1.97k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.97k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.97k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.97k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|       |
  404|  1.97k|    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|  1.97k|    t->index_initialized = 0;
  409|  1.97k|    return t;
  410|  1.97k|}
apr_table_get:
  472|  2.20k|{
  473|  2.20k|    apr_table_entry_t *next_elt;
  474|  2.20k|    apr_table_entry_t *end_elt;
  475|  2.20k|    apr_uint32_t checksum;
  476|  2.20k|    int hash;
  477|       |
  478|  2.20k|    if (key == NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 2.20k]
  ------------------
  479|      0|	return NULL;
  480|      0|    }
  481|       |
  482|  2.20k|    hash = TABLE_HASH(key);
  ------------------
  |  |  298|  2.20k|#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
  |  |  ------------------
  |  |  |  |  297|  2.20k|#define TABLE_INDEX_MASK 0x1f
  |  |  ------------------
  ------------------
  483|  2.20k|    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
  ------------------
  |  |  299|  2.20k|#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
  ------------------
  |  Branch (483:9): [True: 603, False: 1.59k]
  ------------------
  484|    603|        return NULL;
  485|    603|    }
  486|  1.59k|    COMPUTE_KEY_CHECKSUM(key, checksum);
  ------------------
  |  |  308|  1.59k|#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
  |  |  309|  1.59k|{                                              \
  |  |  310|  1.59k|    const char *k = (key);                     \
  |  |  311|  1.59k|    apr_uint32_t c = (apr_uint32_t)*k;         \
  |  |  312|  1.59k|    (checksum) = c;                            \
  |  |  313|  1.59k|    (checksum) <<= 8;                          \
  |  |  314|  1.59k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 1.59k, False: 0]
  |  |  ------------------
  |  |  315|  1.59k|        c = (apr_uint32_t)*++k;                \
  |  |  316|  1.59k|        checksum |= c;                         \
  |  |  317|  1.59k|    }                                          \
  |  |  318|  1.59k|    (checksum) <<= 8;                          \
  |  |  319|  1.59k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 1.59k, False: 0]
  |  |  ------------------
  |  |  320|  1.59k|        c = (apr_uint32_t)*++k;                \
  |  |  321|  1.59k|        checksum |= c;                         \
  |  |  322|  1.59k|    }                                          \
  |  |  323|  1.59k|    (checksum) <<= 8;                          \
  |  |  324|  1.59k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (324:9): [True: 1.59k, False: 0]
  |  |  ------------------
  |  |  325|  1.59k|        c = (apr_uint32_t)*++k;                \
  |  |  326|  1.59k|        checksum |= c;                         \
  |  |  327|  1.59k|    }                                          \
  |  |  328|  1.59k|    checksum &= CASE_MASK;                     \
  |  |  ------------------
  |  |  |  |  293|  1.59k|#define CASE_MASK 0xdfdfdfdf
  |  |  ------------------
  |  |  329|  1.59k|}
  ------------------
  487|  1.59k|    next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];;
  488|  1.59k|    end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash];
  489|       |
  490|  3.39k|    for (; next_elt <= end_elt; next_elt++) {
  ------------------
  |  Branch (490:12): [True: 2.20k, False: 1.18k]
  ------------------
  491|  2.20k|	if ((checksum == next_elt->key_checksum) &&
  ------------------
  |  Branch (491:6): [True: 1.50k, False: 698]
  ------------------
  492|  2.20k|            !strcasecmp(next_elt->key, key)) {
  ------------------
  |  Branch (492:13): [True: 408, False: 1.10k]
  ------------------
  493|    408|	    return next_elt->val;
  494|    408|	}
  495|  2.20k|    }
  496|       |
  497|  1.18k|    return NULL;
  498|  1.59k|}
apr_table_addn:
  812|  2.08k|{
  813|  2.08k|    apr_table_entry_t *elts;
  814|  2.08k|    apr_uint32_t checksum;
  815|  2.08k|    int hash;
  816|       |
  817|  2.08k|#if APR_POOL_DEBUG
  818|  2.08k|    {
  819|  2.08k|	if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) {
  ------------------
  |  Branch (819:6): [True: 0, False: 2.08k]
  ------------------
  820|      0|	    fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n");
  821|      0|	    abort();
  822|      0|	}
  823|  2.08k|	if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) {
  ------------------
  |  Branch (823:6): [True: 0, False: 2.08k]
  ------------------
  824|      0|	    fprintf(stderr, "apr_table_addn: val not in ancestor pool of t\n");
  825|      0|	    abort();
  826|      0|	}
  827|  2.08k|    }
  828|  2.08k|#endif
  829|       |
  830|  2.08k|    hash = TABLE_HASH(key);
  ------------------
  |  |  298|  2.08k|#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(unsigned char *)(key))
  |  |  ------------------
  |  |  |  |  297|  2.08k|#define TABLE_INDEX_MASK 0x1f
  |  |  ------------------
  ------------------
  831|  2.08k|    t->index_last[hash] = t->a.nelts;
  832|  2.08k|    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
  ------------------
  |  |  299|  2.08k|#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1u << (i)))
  ------------------
  |  Branch (832:9): [True: 1.43k, False: 652]
  ------------------
  833|  1.43k|        t->index_first[hash] = t->a.nelts;
  834|  1.43k|        TABLE_SET_INDEX_INITIALIZED(t, hash);
  ------------------
  |  |  300|  1.43k|#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1u << (i)))
  ------------------
  835|  1.43k|    }
  836|  2.08k|    COMPUTE_KEY_CHECKSUM(key, checksum);
  ------------------
  |  |  308|  2.08k|#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
  |  |  309|  2.08k|{                                              \
  |  |  310|  2.08k|    const char *k = (key);                     \
  |  |  311|  2.08k|    apr_uint32_t c = (apr_uint32_t)*k;         \
  |  |  312|  2.08k|    (checksum) = c;                            \
  |  |  313|  2.08k|    (checksum) <<= 8;                          \
  |  |  314|  2.08k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 1.89k, False: 192]
  |  |  ------------------
  |  |  315|  1.89k|        c = (apr_uint32_t)*++k;                \
  |  |  316|  1.89k|        checksum |= c;                         \
  |  |  317|  1.89k|    }                                          \
  |  |  318|  2.08k|    (checksum) <<= 8;                          \
  |  |  319|  2.08k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 1.11k, False: 971]
  |  |  ------------------
  |  |  320|  1.11k|        c = (apr_uint32_t)*++k;                \
  |  |  321|  1.11k|        checksum |= c;                         \
  |  |  322|  1.11k|    }                                          \
  |  |  323|  2.08k|    (checksum) <<= 8;                          \
  |  |  324|  2.08k|    if (c) {                                   \
  |  |  ------------------
  |  |  |  Branch (324:9): [True: 919, False: 1.16k]
  |  |  ------------------
  |  |  325|    919|        c = (apr_uint32_t)*++k;                \
  |  |  326|    919|        checksum |= c;                         \
  |  |  327|    919|    }                                          \
  |  |  328|  2.08k|    checksum &= CASE_MASK;                     \
  |  |  ------------------
  |  |  |  |  293|  2.08k|#define CASE_MASK 0xdfdfdfdf
  |  |  ------------------
  |  |  329|  2.08k|}
  ------------------
  837|  2.08k|    elts = (apr_table_entry_t *) table_push(t);
  ------------------
  |  |  387|  2.08k|#define table_push(t)	((apr_table_entry_t *) apr_array_push_noclear(&(t)->a))
  ------------------
  838|  2.08k|    elts->key = (char *)key;
  839|  2.08k|    elts->val = (char *)val;
  840|  2.08k|    elts->key_checksum = checksum;
  841|  2.08k|}
apr_tables.c:make_array_core:
   56|  1.97k|{
   57|       |    /*
   58|       |     * Assure sanity if someone asks for
   59|       |     * array of zero elts.
   60|       |     */
   61|  1.97k|    if (nelts < 1) {
  ------------------
  |  Branch (61:9): [True: 0, False: 1.97k]
  ------------------
   62|      0|        nelts = 1;
   63|      0|    }
   64|       |
   65|  1.97k|    if (clear) {
  ------------------
  |  Branch (65:9): [True: 0, False: 1.97k]
  ------------------
   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|  1.97k|    else {
   69|  1.97k|        res->elts = apr_palloc(p, nelts * elt_size);
  ------------------
  |  |  425|  1.97k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.97k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.97k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  1.97k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|  1.97k|    }
   71|       |
   72|  1.97k|    res->pool = p;
   73|  1.97k|    res->elt_size = elt_size;
   74|  1.97k|    res->nelts = 0;		/* No active elements yet... */
   75|  1.97k|    res->nalloc = nelts;	/* ...but this many allocated */
   76|  1.97k|}
apr_tables.c:apr_array_push_noclear:
  127|  2.08k|{
  128|  2.08k|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (128:9): [True: 33, False: 2.05k]
  ------------------
  129|     33|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (129:24): [True: 0, False: 33]
  ------------------
  130|     33|        char *new_data;
  131|       |
  132|     33|        new_data = apr_palloc(arr->pool, arr->elt_size * new_size);
  ------------------
  |  |  425|     33|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     33|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|     33|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|     33|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|       |
  134|     33|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  135|     33|        arr->elts = new_data;
  136|     33|        arr->nalloc = new_size;
  137|     33|    }
  138|       |
  139|  2.08k|    ++arr->nelts;
  140|  2.08k|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  141|  2.08k|}

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

