+// DAV delete an uploaded item
+void dav_delete_upload(struct http_transaction *h, struct ctdlsession *c, struct uploaded_file this_one) {
+ int i;
+ struct uploaded_file *u;
+
+ pthread_mutex_lock(&upload_list_mutex);
+ for (i=0; i<array_len(upload_list); ++i) {
+ u = (struct uploaded_file *) array_get_element_at(upload_list, i), sizeof(struct uploaded_file);
+ if (!strcmp(u->id, this_one.id)) {
+ fclose(u->fp); // this deletes the file because it has 0 links
+ array_delete_element_at(upload_list, i);
+ i = array_len(upload_list) + 1; // Go out of scope; we're done here
+ }
+ }
+ pthread_mutex_unlock(&upload_list_mutex);
+
+ do_204(h);
+}
+
+