src/server/safs/service.c

changeset 102
136a76e293b5
parent 94
6b15a094d996
child 104
a8acbb12f27c
--- a/src/server/safs/service.c	Sat Oct 17 21:17:34 2015 +0200
+++ b/src/server/safs/service.c	Sat Oct 17 22:24:38 2015 +0200
@@ -81,14 +81,14 @@
         protocol_status(sn, rq, 302, NULL);
         http_start_response(sn, rq);
         vfs_close(fd);
-        return fd;
+        return NULL;
     }
-
-    // add content-length header
-    char contentLength[32];
-    int len = snprintf(contentLength, 32, "%jd", s->st_size);
-
-    pblock_kvinsert(pb_key_content_length, contentLength, len, rq->srvhdrs);
+    
+    // sets last-modified, content-length and checks conditions
+    if(http_set_finfo(sn, rq, s) != REQ_PROCEED) {
+        vfs_close(fd);
+        return NULL;
+    }
 
     // start response
     protocol_status(sn, rq, 200, NULL);

mercurial