src/server/plugins/postgresql/vfs.c

branch
webdav
changeset 379
4e2cb3adc0f2
parent 374
77506ec632a4
child 382
9e2289c77b04
equal deleted inserted replaced
378:0344108db255 379:4e2cb3adc0f2
30 #include "config.h" 30 #include "config.h"
31 31
32 #include <inttypes.h> 32 #include <inttypes.h>
33 33
34 #include "../../util/util.h" 34 #include "../../util/util.h"
35 #include "../../util/pblock.h"
35 36
36 static VFS pg_vfs_class = { 37 static VFS pg_vfs_class = {
37 pg_vfs_open, 38 pg_vfs_open,
38 pg_vfs_stat, 39 pg_vfs_stat,
39 pg_vfs_fstat, 40 pg_vfs_fstat,
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));

mercurial