diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-15 18:28:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-15 18:28:18 +0000 |
commit | baf16447ccaa8a1e18a00767d35cc05a9da99256 (patch) | |
tree | c93f2e35fa18a9491770f6253fc58784c16d3edc /src/dht/gnunet-dht-put.c | |
parent | ce1537de07f093ffcc3bccf3a444f7dfd9784181 (diff) | |
download | gnunet-baf16447ccaa8a1e18a00767d35cc05a9da99256.tar.gz gnunet-baf16447ccaa8a1e18a00767d35cc05a9da99256.zip |
fixing #2544
Diffstat (limited to 'src/dht/gnunet-dht-put.c')
-rw-r--r-- | src/dht/gnunet-dht-put.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index a55986450..67884c423 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c | |||
@@ -148,24 +148,20 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
148 | 148 | ||
149 | cfg = c; | 149 | cfg = c; |
150 | 150 | ||
151 | if ((query_key == NULL) || (data == NULL)) | 151 | if ((NULL == query_key) || (NULL == data)) |
152 | { | 152 | { |
153 | FPRINTF (stderr, "%s", _("Must provide KEY and DATA for DHT put!\n")); | 153 | FPRINTF (stderr, "%s", _("Must provide KEY and DATA for DHT put!\n")); |
154 | ret = 1; | 154 | ret = 1; |
155 | return; | 155 | return; |
156 | } | 156 | } |
157 | 157 | ||
158 | dht_handle = GNUNET_DHT_connect (cfg, 1); | 158 | if (NULL == (dht_handle = GNUNET_DHT_connect (cfg, 1))) |
159 | if (dht_handle == NULL) | ||
160 | { | 159 | { |
161 | FPRINTF (stderr, _("Could not connect to %s service!\n"), "DHT"); | 160 | FPRINTF (stderr, _("Could not connect to %s service!\n"), "DHT"); |
162 | ret = 1; | 161 | ret = 1; |
163 | return; | 162 | return; |
164 | } | 163 | } |
165 | else if (verbose) | 164 | if (GNUNET_BLOCK_TYPE_ANY == query_type) /* Type of data not set */ |
166 | FPRINTF (stderr, _("Connected to %s service!\n"), "DHT"); | ||
167 | |||
168 | if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */ | ||
169 | query_type = GNUNET_BLOCK_TYPE_TEST; | 165 | query_type = GNUNET_BLOCK_TYPE_TEST; |
170 | 166 | ||
171 | GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); | 167 | GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); |
@@ -176,7 +172,6 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
176 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply | 172 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply |
177 | (GNUNET_TIME_UNIT_SECONDS, | 173 | (GNUNET_TIME_UNIT_SECONDS, |
178 | expiration_seconds)); | 174 | expiration_seconds)); |
179 | |||
180 | if (verbose) | 175 | if (verbose) |
181 | FPRINTF (stderr, _("Issuing put request for `%s' with data `%s'!\n"), | 176 | FPRINTF (stderr, _("Issuing put request for `%s' with data `%s'!\n"), |
182 | query_key, data); | 177 | query_key, data); |