projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add subscription feed fetching, clean up a bit
[blerg.git]
/
database
/
database.c
diff --git
a/database/database.c
b/database/database.c
index
585f508
..
a45c92b
100644
(file)
--- a/
database/database.c
+++ b/
database/database.c
@@
-1,3
+1,6
@@
+/* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a
+ * BSD-style license. Please see the COPYING file for details.
+ */
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@
-10,6
+13,7
@@
#include <sys/file.h>
#include <fcntl.h>
#include "database.h"
#include <sys/file.h>
#include <fcntl.h>
#include "database.h"
+#include "subscription.h"
#include "util.h"
#include "config.h"
#include "util.h"
#include "config.h"
@@
-243,11
+247,12
@@
int blerg_store(struct blerg *blerg, const char *data, int len) {
blerg->index[seg_rec].length = len;
blerg->index[seg_rec].timestamp = time(NULL);
blerg->index[seg_rec].length = len;
blerg->index[seg_rec].timestamp = time(NULL);
- tag_scan(blerg->name, data, len, record);
-
flock(blerg->data_fd, LOCK_UN);
flock(blerg->index_fd, LOCK_UN);
flock(blerg->data_fd, LOCK_UN);
flock(blerg->index_fd, LOCK_UN);
+ tag_scan(blerg->name, data, len, record);
+ subscription_notify(blerg->name, record);
+
return record;
}
return record;
}