diff options
Diffstat (limited to 'src/cache_iterators.c')
-rw-r--r-- | src/cache_iterators.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cache_iterators.c b/src/cache_iterators.c index c7183fd..2707366 100644 --- a/src/cache_iterators.c +++ b/src/cache_iterators.c @@ -184,6 +184,11 @@ void cache_commit(struct cache *c, struct nfct_handle *h, int clientfd) }; struct timeval commit_stop, res; + /* we already have one commit in progress, close this request. */ + if (clientfd && STATE_SYNC(commit).clientfd != -1) { + close(clientfd); + return; + } switch(STATE_SYNC(commit).state) { case COMMIT_STATE_INACTIVE: gettimeofday(&STATE_SYNC(commit).stats.start, NULL); @@ -241,6 +246,7 @@ void cache_commit(struct cache *c, struct nfct_handle *h, int clientfd) /* Close the client socket now that we're done. */ close(STATE_SYNC(commit).clientfd); + STATE_SYNC(commit).clientfd = -1; } } |