summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-upload.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-10 01:39:49 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-15 22:34:41 -0400
commit5bc891206dd8eb4e4df58f502b0184b8426caf22 (patch)
tree816670c7a3f4f86fa95015d6e50bb3e5e177bd06 /src/journal-remote/journal-upload.c
parent9ff48d0982fcb97923955685fe9fa4e0e67cb238 (diff)
journal-remote: let user specify just the main part of the url
We can append /upload ourselves.
Diffstat (limited to 'src/journal-remote/journal-upload.c')
-rw-r--r--src/journal-remote/journal-upload.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index 95be9a0e21..c5a3e1907b 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -396,7 +396,13 @@ static int setup_uploader(Uploader *u, const char *url, const char *state_file)
memzero(u, sizeof(Uploader));
u->input = -1;
- u->url = url;
+ if (!startswith(url, "http://") && !startswith(url, "https://"))
+ url = strappenda("https://", url);
+
+ u->url = strappend(url, "/upload");
+ if (!u->url)
+ return log_oom();
+
u->state_file = state_file;
r = sd_event_default(&u->events);
@@ -424,6 +430,8 @@ static void destroy_uploader(Uploader *u) {
free(u->last_cursor);
free(u->current_cursor);
+ free(u->url);
+
u->input_event = sd_event_source_unref(u->input_event);
close_fd_input(u);