fix prepare_service_file error handling

Sat, 12 Nov 2022 17:34:58 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 12 Nov 2022 17:34:58 +0100
changeset 429
25c8e8021156
parent 428
ab58e46b50a5
child 430
83560f32e7d5

fix prepare_service_file error handling

src/server/safs/service.c file | annotate | diff | comparison | revisions
--- a/src/server/safs/service.c	Sat Nov 12 17:28:32 2022 +0100
+++ b/src/server/safs/service.c	Sat Nov 12 17:34:58 2022 +0100
@@ -59,6 +59,7 @@
     SYS_FILE fd = vfs_open(vfs, path, O_RDONLY);
     if(!fd) {
         // vfs_open sets http status code
+        *ret = REQ_ABORTED;
         return NULL;
     }
 
@@ -66,6 +67,7 @@
     if(vfs_fstat(vfs, fd, s) != 0) {
         //perror("prepare_service_file: stat");
         protocol_status(sn, rq, 500, NULL);
+        *ret = REQ_ABORTED;
         return NULL;
     }
     

mercurial