aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-03 17:03:53 -0700
committerEric Wong <normalperson@yhbt.net>2008-10-03 17:17:35 -0700
commit8d9a77bfcb2e37728f1a683a74d266d145aff14c (patch)
treebfb97602de8af33b7ef2a290ed59b250a08a7e7d /src/directory.h
parent41a44f79ee1e559257fb6b2c88e1eb140fe657bf (diff)
downloadmpd-8d9a77bfcb2e37728f1a683a74d266d145aff14c.tar.gz
mpd-8d9a77bfcb2e37728f1a683a74d266d145aff14c.tar.xz
mpd-8d9a77bfcb2e37728f1a683a74d266d145aff14c.zip
directory: simplify list update handling logic
Now the "update" command can be issued multiple times regardless of whether the client is in list mode or not. We serialize the update tasks to prevent updates from trampling over each other and will spawn another update task once the current one is finished updating and reaped. Right now we cap the queue size to 32 which is probably enough (I bet most people usually run update with no argument anyways); but we can make it grow/shrink dynamically if needed. There'll still be a hard-coded limit to prevent DoS attacks, though.
Diffstat (limited to 'src/directory.h')
-rw-r--r--src/directory.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/directory.h b/src/directory.h
index eb1b35aa7..20b784166 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -43,11 +43,10 @@ int isUpdatingDB(void);
/*
* returns the non-negative update job ID on success,
- * -1 if busy, -2 if invalid argument
- * @argv itself is safe to free once updateInit returns, but the
- * string values contained by @argv MUST NOT be freed manually
+ * returns -1 if busy
+ * @path will be freed by this function and should not be reused
*/
-int updateInit(int argc, char *argv[]);
+int directory_update_init(char *path);
void directory_init(void);