613 } else { |
614 } else { |
614 return NULL; |
615 return NULL; |
615 } |
616 } |
616 } |
617 } |
617 |
618 |
|
619 // store the resource_id in rq->vars |
|
620 if(ctx->rq) { |
|
621 char *rq_path = pblock_findkeyval(pb_key_path, ctx->rq->vars); |
|
622 if(rq_path && !strcmp(rq_path, path)) { |
|
623 char *res_id_str = pblock_findval("resource_id", ctx->rq->vars); |
|
624 if(!res_id_str) { |
|
625 char resource_id_str[32]; |
|
626 snprintf(resource_id_str, 32, "%" PRId64, resource_id); |
|
627 pblock_nvinsert("resource_id",resource_id_str, ctx->rq->vars); |
|
628 } |
|
629 } |
|
630 } |
|
631 |
618 VFSFile *file = pool_malloc(ctx->pool, sizeof(VFSFile)); |
632 VFSFile *file = pool_malloc(ctx->pool, sizeof(VFSFile)); |
619 if(!file) { |
633 if(!file) { |
620 return NULL; |
634 return NULL; |
621 } |
635 } |
622 PgFile *pgfile = pool_malloc(ctx->pool, sizeof(PgFile)); |
636 PgFile *pgfile = pool_malloc(ctx->pool, sizeof(PgFile)); |