fix outidx iteration and adjust internal rescan

This commit is contained in:
Troy D. Hanson
2014-10-22 19:58:11 -04:00
parent a274a49f56
commit 39f0aa35b6
3 changed files with 4 additions and 4 deletions

View File

@@ -11,7 +11,7 @@
#define KVSPOOL_MAGIC "KV+SPOOL"
/* (reader): scan for new readable spools when > x seconds elapse */
#define KVSPOOL_RESCAN_INTERVAL 10 /* seconds */
#define KVSPOOL_RESCAN_INTERVAL 1 /* seconds */
/* (writer) attrition as needed to keep the total spool size approx under x */
/* 1 GB is a default but this can be configured using the 'limits' file. */

View File

@@ -13,7 +13,7 @@
#include "utstring.h"
#include "tpl.h"
#define INTERNAL_RESCAN_INTERVAL_SEC (10)
#define INTERNAL_RESCAN_INTERVAL_SEC (1)
typedef struct {
char *srpath; /* e.g. /tmp/myspool/spool.123456789.999-000.sr */

View File

@@ -70,7 +70,7 @@ void mark_writable() {
UT_string **s=NULL;
while ( (fd=(int*)utarray_next(cfg.clients,fd))) {
s=(UT_string**)utarray_next(cfg.outbufs,s); assert(s);
i=(int*)utarray_next(cfg.outidxs,s); assert(i);
i=(int*)utarray_next(cfg.outidxs,i); assert(i);
if (utstring_len(*s) > *i) mod_epoll(EPOLLIN|EPOLLOUT, *fd);
}
}
@@ -168,7 +168,7 @@ void shift_buffers() {
while ( (fd=(int*)utarray_next(cfg.clients,fd))) {
s=(UT_string**)utarray_next(cfg.outbufs,s); assert(s);
i=(int*)utarray_next(cfg.outidxs,s); assert(i);
i=(int*)utarray_next(cfg.outidxs,i); assert(i);
len = utstring_len(*s);
if (*i == 0) continue; // nothing to shift