summaryrefslogtreecommitdiffabout
path: root/src/binlog.c
authorSergey Poznyakoff <gray@gnu.org.ua>2013-10-12 14:29:05 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-10-12 14:29:05 (GMT)
commit66f3521c257d2777cbf9697716a9f2288254376c (patch) (side-by-side diff)
treebe3b4993d1b4bb515f67227bd0647dac4dbc08ff /src/binlog.c
parent60a356d55ed0aca4283ddc3134298936e45ad18b (diff)
downloadvmod-binlog-66f3521c257d2777cbf9697716a9f2288254376c.tar.gz
vmod-binlog-66f3521c257d2777cbf9697716a9f2288254376c.tar.bz2
Fix processing repeat counts in packinnext.
* src/binlog.c (vmod_start): call packinit. * src/pack.c (packinst) <cur>: New member. (packinnext): Correctly process repeat counts. (packout): Likewise. (packinit): New function. * src/pack.h (packinit): New proto.
Diffstat (limited to 'src/binlog.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/binlog.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/binlog.c b/src/binlog.c
index b2d9f87..325f337 100644
--- a/src/binlog.c
+++ b/src/binlog.c
@@ -45,29 +45,29 @@ enum binlog_state {
};
struct binlog_config {
- size_t size; /* maximum file size */
- unsigned interval; /* file rotation interval */
- char *pattern; /* file name pattern */
- int umask; /* umask for new files and directories */
- char *dir; /* root storage directory */
- int dd; /* directory descriptor */
- char *fname; /* current file name */
- int fd; /* current file descriptor */
+ size_t size; /* maximum file size */
+ unsigned interval; /* file rotation interval */
+ char *pattern; /* file name pattern */
+ int umask; /* umask for new files and directories */
+ char *dir; /* root storage directory */
+ int dd; /* directory descriptor */
+ char *fname; /* current file name */
+ int fd; /* current file descriptor */
struct binlog_file_header *base; /* mmap base */
- char *recbase; /* record base */
- size_t recnum; /* number of records in recbase */
- size_t recsize; /* record size */
- time_t stoptime; /* when to rotate the current file */
+ char *recbase; /* record base */
+ size_t recnum; /* number of records in recbase */
+ size_t recsize; /* record size */
+ time_t stoptime; /* when to rotate the current file */
pthread_mutex_t mutex;
- int debug;
- int flags;
-
- char *dataspec;
- struct packinst *inst_head;
- struct packinst *inst_cur;
- struct packenv *env;
- enum binlog_state state;
- time_t timestamp;
+ int debug; /* debug level */
+ int flags; /* flags (see BLF_* defines above) */
+
+ char *dataspec; /* data format specification */
+ struct packinst *inst_head; /* compiled dataspec */
+ struct packinst *inst_cur; /* current instruction */
+ struct packenv *env; /* pack environment */
+ enum binlog_state state; /* binlog machine state */
+ time_t timestamp; /* timestamp for the entry being built */
};
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -496,7 +496,7 @@ vmod_start(struct sess *sp, struct vmod_priv *priv)
packenv_init(conf->env);
conf->state = state_start;
- conf->inst_cur = conf->inst_head;
+ conf->inst_cur = packinit(conf->inst_head);
conf->timestamp = ts;
}

Return to:

Send suggestions and report system problems to the System administrator.