From 5d112196d3801bbffbeb3034ee7bcfcc4556832e Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Sun, 3 Sep 2017 18:33:39 +0200 Subject: [PATCH] [fix] changed some output strings to increase readability --- src/get.c | 4 ++-- src/server.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/get.c b/src/get.c index 92bd70a..4555e63 100644 --- a/src/get.c +++ b/src/get.c @@ -72,7 +72,7 @@ get (char *url, const gchar *output_file_path) } else if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { //if there is no file name and path the page will not get saved if (output_file_path == NULL) { - g_print ("Got a file offered form a other peer. Will not save anything.\n"); + //g_print ("%s: Got a file offered form a other peer. Will not save anything.\n", name); } else { output_file = fopen (output_file_path, "w"); @@ -103,7 +103,7 @@ int do_client_notify (char * url) int do_downloading (char * url, char * file_name) { - g_print("Downloading url %s\n", url); + g_print("Downloading %s to %s (Does not yet save)\n", url, g_uri_escape_string(file_name, NULL, TRUE)); //get (g_strdup(url),"./test_download"); //get ("http://juliansparber.com/index.html", "./test_download"); return 0; diff --git a/src/server.c b/src/server.c index 8b18a3c..69c1a89 100644 --- a/src/server.c +++ b/src/server.c @@ -230,9 +230,9 @@ do_get_response_json (SoupServer *server, SoupMessage *msg, const char *path) soup_message_set_status (msg, SOUP_STATUS_OK); } static void handle_incoming_file(const char * hash, const char * name, const char * size, const char * origin) { + g_print("Got a new file form %s with size:%s with title: %s\n", origin, size, name); //If the user accepts the file do_downloading(g_strdup_printf("http://%s:%d/transfer/%s", origin, port, hash), name); - g_print("Got a new file form %s with size:%s with title: %s\n", origin, size, name); } static void