src/server/plugins/postgresql/webdav.c

changeset 579
e10457d74fe1
parent 564
f19fd264c69c
equal deleted inserted replaced
578:eb48f716b31c 579:e10457d74fe1
442 if(pgdav->repository->ntables == 0) { 442 if(pgdav->repository->ntables == 0) {
443 // no property extensions configured 443 // no property extensions configured
444 ext = NULL; 444 ext = NULL;
445 numext = 0; 445 numext = 0;
446 } else { 446 } else {
447 numext = pgdav->repository->prop_ext->size; 447 numext = cxMapSize(pgdav->repository->prop_ext);
448 ext = pool_calloc(rq->sn->pool, numext, sizeof(PgPropfindExtCol)); 448 ext = pool_calloc(rq->sn->pool, numext, sizeof(PgPropfindExtCol));
449 449
450 if(rq->allprop) { 450 if(rq->allprop) {
451 // the map pgdav->repository->prop_ext contains all property extensions 451 // the map pgdav->repository->prop_ext contains all property extensions
452 // we can just convert the map to an array 452 // we can just convert the map to an array
453 CxIterator i = cxMapIteratorValues(pgdav->repository->prop_ext); 453 CxMapIterator i = cxMapIteratorValues(pgdav->repository->prop_ext);
454 int j = 0; 454 int j = 0;
455 cx_foreach(PgPropertyStoreExt *, cfg_ext, i) { 455 cx_foreach(PgPropertyStoreExt *, cfg_ext, i) {
456 PgPropfindExtCol extcol; 456 PgPropfindExtCol extcol;
457 extcol.ext = cfg_ext; 457 extcol.ext = cfg_ext;
458 extcol.field_num = -1; // get the field_num after the PQexec 458 extcol.field_num = -1; // get the field_num after the PQexec
607 if(fieldnum) { 607 if(fieldnum) {
608 c->field_num = *fieldnum; 608 c->field_num = *fieldnum;
609 } 609 }
610 } 610 }
611 611
612 cxMapDestroy(fieldmap); 612 cxMapFree(fieldmap);
613 } 613 }
614 614
615 return 0; 615 return 0;
616 } 616 }
617 617

mercurial