replace UcxList with WebdavPList in the multistatus object webdav

Fri, 17 Jan 2020 19:12:05 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 17 Jan 2020 19:12:05 +0100
branch
webdav
changeset 229
73cb1c98ef7d
parent 228
c0afce708b1d
child 230
ca50e1ebdc4d

replace UcxList with WebdavPList in the multistatus object

src/server/test/webdav.c file | annotate | diff | comparison | revisions
src/server/webdav/multistatus.c file | annotate | diff | comparison | revisions
src/server/webdav/multistatus.h file | annotate | diff | comparison | revisions
--- a/src/server/test/webdav.c	Fri Jan 17 19:08:19 2020 +0100
+++ b/src/server/test/webdav.c	Fri Jan 17 19:12:05 2020 +0100
@@ -849,9 +849,9 @@
     UCX_TEST_ASSERT(r->errors->next->next, "no third error code");
     UCX_TEST_ASSERT(!r->errors->next->next->next, "too many error codes");
     
-    UCX_TEST_ASSERT(ucx_list_size(r->errors->begin) == 2, "404 list size != 2");
-    UCX_TEST_ASSERT(ucx_list_size(r->errors->next->begin) == 4, "403 list size != 4");
-    UCX_TEST_ASSERT(ucx_list_size(r->errors->next->next->begin) == 1, "500 list size != 1");
+    UCX_TEST_ASSERT(webdav_plist_size(r->errors->begin) == 2, "404 list size != 2");
+    UCX_TEST_ASSERT(webdav_plist_size(r->errors->next->begin) == 4, "403 list size != 4");
+    UCX_TEST_ASSERT(webdav_plist_size(r->errors->next->next->begin) == 1, "500 list size != 1");
     
     // new resource for prop duplication tests
     r = (MSResponse*)ms->response.addresource((WebdavResponse*)ms, "/test");
@@ -867,7 +867,7 @@
     r->resource.addproperty((WebdavResource*)r, &dp2, 404);
     UCX_TEST_ASSERT(!r->plist_begin->next, "dp1: adding dp2 with different status should not work (1)");
     if(r->errors) {
-        UCX_TEST_ASSERT(ucx_list_size(r->errors->begin) == 0, "dp1: error list not empty");
+        UCX_TEST_ASSERT(webdav_plist_size(r->errors->begin) == 0, "dp1: error list not empty");
     }
     
     r->resource.addproperty((WebdavResource*)r, &dp3, 200);
--- a/src/server/webdav/multistatus.c	Fri Jan 17 19:08:19 2020 +0100
+++ b/src/server/webdav/multistatus.c	Fri Jan 17 19:12:05 2020 +0100
@@ -214,14 +214,9 @@
     }
     
     // we have the list -> add the new element
-    UcxList *newlistelm = ucx_list_append_a(a, errlist->end, property);
-    if(!newlistelm) {
+    if(webdav_plist_add(pool, &errlist->begin, &errlist->end, property)) {
         return 1;
     }
-    errlist->end = newlistelm;
-    if(!errlist->begin) {
-        errlist->begin = newlistelm;
-    }
     return 0;
 }
 
--- a/src/server/webdav/multistatus.h	Fri Jan 17 19:08:19 2020 +0100
+++ b/src/server/webdav/multistatus.h	Fri Jan 17 19:12:05 2020 +0100
@@ -83,8 +83,8 @@
 
 struct PropertyErrorList {
     PropertyErrorList *next;
-    UcxList *begin;
-    UcxList *end;
+    WebdavPList *begin;
+    WebdavPList *end;
     int status;
 };
 

mercurial