pg propfind stores resource_id in rq->vars webdav

Thu, 18 Aug 2022 18:18:06 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 18 Aug 2022 18:18:06 +0200
branch
webdav
changeset 380
0f85d9bde309
parent 379
4e2cb3adc0f2
child 381
7d55d60e1fe2

pg propfind stores resource_id in rq->vars

src/server/plugins/postgresql/webdav.c file | annotate | diff | comparison | revisions
--- a/src/server/plugins/postgresql/webdav.c	Thu Aug 18 16:54:57 2022 +0200
+++ b/src/server/plugins/postgresql/webdav.c	Thu Aug 18 18:18:06 2022 +0200
@@ -428,6 +428,12 @@
         return 1;
     }
     
+    // store resource_id in rq->vars, maybe some other modules
+    // like to use it
+    char resource_id_str[32];
+    snprintf(resource_id_str, 32, "%" PRId64, resource_id);
+    pblock_nvinsert("resource_id",resource_id_str, rq->rq->vars);
+    
     // create a list of requsted extended properties
     PgPropfindExtCol *ext;
     size_t numext;
@@ -486,9 +492,6 @@
     query = sql->space;
     
     // get all resources and properties
-    char resource_id_str[32];
-    snprintf(resource_id_str, 32, "%" PRId64, resource_id);
-    
     size_t href_len = strlen(href);
     char *href_param = pool_malloc(rq->sn->pool, href_len + 1);
     memcpy(href_param, href, href_len);

mercurial