diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-26 16:56:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-26 16:56:00 +0000 |
commit | 4757258de33285fed2aa318c374dcdbf586c29f0 (patch) | |
tree | 283fa337cdaa54fbb3bbf08c937fdb6467c2b5d1 /src/dht/gnunet-dht-put.c | |
parent | 506d42b2ba6eb104e64fd0c8889ea7233a9b96b3 (diff) | |
download | gnunet-4757258de33285fed2aa318c374dcdbf586c29f0.tar.gz gnunet-4757258de33285fed2aa318c374dcdbf586c29f0.zip |
-fixing #2277
Diffstat (limited to 'src/dht/gnunet-dht-put.c')
-rw-r--r-- | src/dht/gnunet-dht-put.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index ef5ae5ea7..59acc792b 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c | |||
@@ -80,7 +80,7 @@ static char *data; | |||
80 | static void | 80 | static void |
81 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 81 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
82 | { | 82 | { |
83 | if (dht_handle != NULL) | 83 | if (NULL != dht_handle) |
84 | { | 84 | { |
85 | GNUNET_DHT_disconnect (dht_handle); | 85 | GNUNET_DHT_disconnect (dht_handle); |
86 | dht_handle = NULL; | 86 | dht_handle = NULL; |
@@ -91,13 +91,33 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
91 | * Signature of the main function of a task. | 91 | * Signature of the main function of a task. |
92 | * | 92 | * |
93 | * @param cls closure | 93 | * @param cls closure |
94 | * @param tc context information (why was this task triggered now) | 94 | * @param success GNUNET_OK if the PUT was transmitted, |
95 | * GNUNET_NO on timeout, | ||
96 | * GNUNET_SYSERR on disconnect from service | ||
97 | * after the PUT message was transmitted | ||
98 | * (so we don't know if it was received or not) | ||
95 | */ | 99 | */ |
96 | void | 100 | static void |
97 | message_sent_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 101 | message_sent_cont (void *cls, int success) |
98 | { | 102 | { |
99 | if (verbose) | 103 | if (verbose) |
100 | FPRINTF (stderr, "%s", _("PUT request sent!\n")); | 104 | { |
105 | switch (success) | ||
106 | { | ||
107 | case GNUNET_OK: | ||
108 | FPRINTF (stderr, "%s", _("PUT request sent!\n")); | ||
109 | break; | ||
110 | case GNUNET_NO: | ||
111 | FPRINTF (stderr, "%s", _("Timeout sending PUT request!\n")); | ||
112 | break; | ||
113 | case GNUNET_SYSERR: | ||
114 | FPRINTF (stderr, "%s", _("PUT request not confirmed!\n")); | ||
115 | break; | ||
116 | default: | ||
117 | GNUNET_break (0); | ||
118 | break; | ||
119 | } | ||
120 | } | ||
101 | GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); | 121 | GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); |
102 | } | 122 | } |
103 | 123 | ||