diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-03 17:03:53 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-03 17:17:35 -0700 |
commit | 8d9a77bfcb2e37728f1a683a74d266d145aff14c (patch) | |
tree | bfb97602de8af33b7ef2a290ed59b250a08a7e7d /src/directory.h | |
parent | 41a44f79ee1e559257fb6b2c88e1eb140fe657bf (diff) | |
download | mpd-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 '')
-rw-r--r-- | src/directory.h | 7 |
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); |