X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fserver%2Fupload.c;h=101d7894882493363773602817a3ce1dcc5e8a91;hb=18f1d6b9e7e27816d0ba7d455bcfd26c4c457c22;hp=110241c3c5c23268699b3fc5e8d6dfe5af6bfd6b;hpb=fe16fd5964ff022781bc01f5c60a74e6e855e237;p=citadel.git diff --git a/webcit-ng/server/upload.c b/webcit-ng/server/upload.c index 110241c3c..101d78948 100644 --- a/webcit-ng/server/upload.c +++ b/webcit-ng/server/upload.c @@ -28,7 +28,13 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, syslog(LOG_DEBUG, " id: %s", cbid); struct uploaded_file u; - generate_uuid(u.id); + + // create a random ID for the attachment + for (int i=0; iid, id)) { + ret = *u; + 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); + + return(ret); // ret will be all-zeroes if we didn't find it +} + + // Handle operations on a specific upload void specific_upload(struct http_transaction *h, struct ctdlsession *c, char *name) { int i;