fix resourcetype initialization webdav

Sat, 27 Aug 2022 11:57:27 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 27 Aug 2022 11:57:27 +0200
branch
webdav
changeset 381
7d55d60e1fe2
parent 380
0f85d9bde309
child 382
9e2289c77b04

fix resourcetype initialization

src/server/util/writer.c file | annotate | diff | comparison | revisions
src/server/webdav/multistatus.c file | annotate | diff | comparison | revisions
src/server/webdav/webdav.c file | annotate | diff | comparison | revisions
--- a/src/server/util/writer.c	Thu Aug 18 18:18:06 2022 +0200
+++ b/src/server/util/writer.c	Sat Aug 27 11:57:27 2022 +0200
@@ -59,6 +59,8 @@
     size_t len = w->pos;
     
     while(len > 0) {
+        //fwrite(w->buffer+pos, 1, len, stdout);
+        //fflush(stdout);
         ssize_t r = w->write(w->fd, w->buffer + pos, len);
         if(r <= 0) {
             break;
--- a/src/server/webdav/multistatus.c	Thu Aug 18 18:18:06 2022 +0200
+++ b/src/server/webdav/multistatus.c	Sat Aug 27 11:57:27 2022 +0200
@@ -341,7 +341,7 @@
     // end multistatus
     writer_puts(out, S("</D:multistatus>\n"));
     
-    //printf("\n\n%.*s\n\n", (int)writer.pos, writer.buffer);
+    //printf("\n\n");
     //fflush(stdout);
     
     writer_flush(out);
--- a/src/server/webdav/webdav.c	Thu Aug 18 18:18:06 2022 +0200
+++ b/src/server/webdav/webdav.c	Sat Aug 27 11:57:27 2022 +0200
@@ -171,12 +171,13 @@
     dav_resourcetype_empty.namespace = &dav_namespace;
     dav_resourcetype_empty.name = "resourcetype";
     
+    dav_resourcetype_collection_value.data = WEBDAV_RESOURCE_TYPE_COLLECTION;
+    dav_resourcetype_collection_value.length = sizeof(WEBDAV_RESOURCE_TYPE_COLLECTION)-1;
+    
     dav_resourcetype_collection.namespace = &dav_namespace;
     dav_resourcetype_collection.name = "resourcetype";
     dav_resourcetype_collection.value.data = dav_resourcetype_collection_value;
     dav_resourcetype_collection.vtype = WS_VALUE_XML_DATA;
-    dav_resourcetype_collection_value.data = WEBDAV_RESOURCE_TYPE_COLLECTION;
-    dav_resourcetype_collection_value.length = sizeof(WEBDAV_RESOURCE_TYPE_COLLECTION)-1;
     
     return REQ_PROCEED;
 }

mercurial