]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/server/upload.c
move struct uploaded_file to webcit.h
[citadel.git] / webcit-ng / server / upload.c
index 17d96a9a31f1314ded2605e019a9f1ee2bfe5448..110241c3c5c23268699b3fc5e8d6dfe5af6bfd6b 100644 (file)
@@ -7,14 +7,6 @@
 
 #include "webcit.h"
 
-struct uploaded_file {
-       char id[64];
-       char filename[256];
-       char content_type[256];
-       long length;
-       FILE *fp;
-};
-
 Array *upload_list = NULL;                                     // all files uploaded to this webcit instance
 pthread_mutex_t upload_list_mutex = PTHREAD_MUTEX_INITIALIZER; // Lock it before modifying
 
@@ -106,8 +98,8 @@ void ctdl_p_base(struct http_transaction *h, struct ctdlsession *c) {
 }
 
 
-// DAV delete an uploaded item
-void dav_delete_upload(struct http_transaction *h, struct ctdlsession *c, struct uploaded_file this_one) {
+// delete an uploaded item
+void delete_upload(struct uploaded_file this_one) {
        int i;
        struct uploaded_file *u;
 
@@ -121,7 +113,12 @@ void dav_delete_upload(struct http_transaction *h, struct ctdlsession *c, struct
                }
        }
        pthread_mutex_unlock(&upload_list_mutex);
+}
 
+
+// DAV delete an uploaded item
+void dav_delete_upload(struct http_transaction *h, struct ctdlsession *c, struct uploaded_file this_one) {
+       delete_upload(this_one);
        do_204(h);
 }
 
@@ -187,4 +184,4 @@ void ctdl_p(struct http_transaction *h, struct ctdlsession *c) {
 
        // If we get to this point, the client requested an action we don't know how to perform.
        do_404(h);
-}
\ No newline at end of file
+}