X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Flog.c;h=4c522b8788f8c4cc3e02dc9628508f9b6dd768dd;hb=db4915b4f7fc8f74958c4d1891dc69b76cbbe383;hp=ee96976ff1865606e963cba9563bd02f548bdca9;hpb=3bf92d26e3256d76766e77106502a68c9e30c14b;p=bluesky.git diff --git a/bluesky/log.c b/bluesky/log.c index ee96976..4c522b8 100644 --- a/bluesky/log.c +++ b/bluesky/log.c @@ -139,12 +139,14 @@ static gpointer log_thread(gpointer d) footer.crc = crc32c_finalize(crc); writebuf(log->fd, (const char *)&footer, sizeof(footer)); + logsize += sizeof(header) + sizeof(footer); + logsize += strlen(item->key) + item->data->len; + committed = g_slist_prepend(committed, item); /* Force an fsync either if we will be closing this log segment and * opening a new file, or if there are no other log items currently * waiting to be written. */ - logsize += strlen(item->key) + item->data->len + sizeof(header) + sizeof(footer); if (logsize >= LOG_SEGMENT_SIZE || g_async_queue_length(log->queue) <= 0)