close last resource in multistatus_send webdav

Mon, 25 Apr 2022 13:54:27 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 25 Apr 2022 13:54:27 +0200
branch
webdav
changeset 308
c3cad8f51a24
parent 307
8787cb5ebab3
child 309
fc021bd576d4

close last resource in multistatus_send

src/server/webdav/multistatus.c file | annotate | diff | comparison | revisions
--- a/src/server/webdav/multistatus.c	Mon Apr 25 13:48:05 2022 +0200
+++ b/src/server/webdav/multistatus.c	Mon Apr 25 13:54:27 2022 +0200
@@ -255,7 +255,12 @@
     return out->error;
 }
 
-int multistatus_send(Multistatus *ms, SYS_NETFD net) {  
+int multistatus_send(Multistatus *ms, SYS_NETFD net) { 
+    // make sure every resource is closed
+    if(ms->current && !ms->current->resource.isclosed) {
+        msresponse_close((WebdavResource*)ms->current);
+    }
+    
     // start http response
     protocol_status(ms->sn, ms->rq, 207, NULL);
     protocol_start_response(ms->sn, ms->rq);

mercurial