chiark / gitweb /
journal-remote: HTTP(s) support
[elogind.git] / src / journal / journal-remote-parse.c
index ee2260c5a961e2175f1702a06a66bcee1106ab7d..c961844c443e7f08d86a0052602e78b73b907821 100644 (file)
@@ -100,6 +100,20 @@ static int get_line(RemoteSource *source, char **line, size_t *size) {
         return 1;
 }
 
+int push_data(RemoteSource *source, const char *data, size_t size) {
+        assert(source);
+        assert(source->state != STATE_EOF);
+
+        if (!GREEDY_REALLOC(source->buf, source->size,
+                            source->filled + size))
+                return log_oom();
+
+        memcpy(source->buf + source->filled, data, size);
+        source->filled += size;
+
+        return 0;
+}
+
 static int fill_fixed_size(RemoteSource *source, void **data, size_t size) {
         int n;
         char *newbuf = NULL;