aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-06 18:32:27 +0200
committerMax Kellermann <max@duempel.org>2008-10-06 18:32:27 +0200
commit37a8239f442e54de8e55de41f95b8e4a4c972701 (patch)
tree31da96e4791d2f89d3480191e76aa097e3ccaddb /src/directory.h
parent700f18eee55cd6a5906bd526f62e958647cea221 (diff)
downloadmpd-37a8239f442e54de8e55de41f95b8e4a4c972701.tar.gz
mpd-37a8239f442e54de8e55de41f95b8e4a4c972701.tar.xz
mpd-37a8239f442e54de8e55de41f95b8e4a4c972701.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.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/directory.h b/src/directory.h
index 42d0e2bb6..764902071 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -42,12 +42,12 @@ void reap_update_task(void);
int isUpdatingDB(void);
-/**
- * Starts the tag cache update in the specified location(s). Returns
- * the job id on success, -1 on error or 0 if an update is already
- * running.
+/*
+ * returns the non-negative update job ID on success,
+ * returns -1 if busy
+ * @path will be freed by this function and should not be reused
*/
-int updateInit(List * pathList);
+int directory_update_init(char *path);
void directory_init(void);