aboutsummaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-01-01 19:48:33 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-01-01 20:53:41 +0200
commit66775034166ac35bda383ef41213c95021b37b64 (patch)
tree5a64f2e45955acc5758977c6de0740ba34707d65 /src/process.c
parentfad678ec27c7f37da83ddf3ba3a96196a962c238 (diff)
downloadwydawca-66775034166ac35bda383ef41213c95021b37b64.tar.gz
wydawca-66775034166ac35bda383ef41213c95021b37b64.tar.bz2
Avoid processing same triplet twice.release-2.2
* src/wydawca.h (file_triplet) <jq_prev,jq_next,job>: New members. (spool_commit_triplets,schedule_job): Update signature. (count_processable_triplets): Remove. (link_processable_triplets): New proto. (remove_triplet): New proto. (triplet_jq_unlink): New proto. * src/job.c (job) <triplet_list>: New member. (triplet_jq_unlink,jq_clear): New functions. (procspool): Create and stop spool timers. (wydawca_scanner): Call spool_create_timers. (schedule_job): Additional argument specifies triplets to process. Initialize job->triplet_list; (job_queue_runner): Call jq_clear. * src/net.c (handle_connection): Update call to schedule_job. * src/process.c (spool_cwd_add_new_file): Update call to spool_commit_triplets. * src/triplet.c (remove_triplet): Now extern. Takes two args. All uses updated. (spool_commit_triplets): Additional argument specifies triplets to process. (count_processable_triplets): Remove. (link_processable_triplets): New function. * src/watcher.c: Use link_processable_triplets to obtain a doubly-linked list of triplets to process. Pass it to schedule_job.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c
index 1226ed2..0b4fd1b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -149,7 +149,7 @@ match_uid_p(uid_t uid, int uc, uid_t * uv)
int
spool_cwd_add_new_file(const struct spool *spool, const char *name,
- int uc, uid_t * uv)
+ int uc, uid_t *uv)
{
struct stat st;
struct file_info finfo;
@@ -203,7 +203,7 @@ spool_add_new_file(const struct spool *spool, const char *name,
/* Scan upload directory from the DPAIR and register all files found
there, forming triplets when possible */
void
-scan_spool_unlocked(struct spool *spool, int uc, uid_t * uv)
+scan_spool_unlocked(struct spool *spool, int uc, uid_t *uv)
{
DIR *dir;
struct dirent *ent;
@@ -238,7 +238,7 @@ scan_spool_unlocked(struct spool *spool, int uc, uid_t * uv)
closedir(dir);
if (count_collected_triplets() > 0)
- spool_commit_triplets(spool);
+ spool_commit_triplets(spool, NULL);
timer_stop(spool->tag);
timer_stop("spool");

Return to:

Send suggestions and report system problems to the System administrator.