diff options
Diffstat (limited to 'src/namestore/test_namestore_api_create_update.c')
-rw-r--r-- | src/namestore/test_namestore_api_create_update.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/namestore/test_namestore_api_create_update.c b/src/namestore/test_namestore_api_create_update.c index 2d18af89e..45a6b3870 100644 --- a/src/namestore/test_namestore_api_create_update.c +++ b/src/namestore/test_namestore_api_create_update.c | |||
@@ -76,6 +76,7 @@ static int res; | |||
76 | static void | 76 | static void |
77 | endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 77 | endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
78 | { | 78 | { |
79 | GNUNET_break (0); | ||
79 | if (nsh != NULL) | 80 | if (nsh != NULL) |
80 | GNUNET_NAMESTORE_disconnect (nsh); | 81 | GNUNET_NAMESTORE_disconnect (nsh); |
81 | nsh = NULL; | 82 | nsh = NULL; |
@@ -136,8 +137,12 @@ static void | |||
136 | create_identical_cont (void *cls, int32_t success, const char *emsg) | 137 | create_identical_cont (void *cls, int32_t success, const char *emsg) |
137 | { | 138 | { |
138 | char *name = cls; | 139 | char *name = cls; |
139 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating identical record for `%s': %s `%s'\n", name, ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" : "FAIL", emsg); | 140 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
140 | if (success == GNUNET_NO) | 141 | "Updating identical record for `%s': %s `%s'\n", |
142 | name, | ||
143 | ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" : "FAIL", | ||
144 | emsg); | ||
145 | if (success == GNUNET_OK) | ||
141 | { | 146 | { |
142 | res = 0; | 147 | res = 0; |
143 | s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value; | 148 | s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value; |
@@ -148,10 +153,13 @@ create_identical_cont (void *cls, int32_t success, const char *emsg) | |||
148 | else | 153 | else |
149 | { | 154 | { |
150 | res = 1; | 155 | res = 1; |
151 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating identical record for `%s': %s `%s'\n", name, ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" : "FAIL", emsg); | 156 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
152 | GNUNET_SCHEDULER_add_now(&end, NULL); | 157 | "Updating identical record for `%s': %s `%s'\n", |
158 | name, | ||
159 | ((success == GNUNET_YES) || (success == GNUNET_NO)) ? "SUCCESS" : "FAIL", | ||
160 | emsg); | ||
161 | GNUNET_SCHEDULER_add_now (&end, NULL); | ||
153 | } | 162 | } |
154 | |||
155 | } | 163 | } |
156 | 164 | ||
157 | 165 | ||
@@ -159,7 +167,10 @@ static void | |||
159 | create_first_cont (void *cls, int32_t success, const char *emsg) | 167 | create_first_cont (void *cls, int32_t success, const char *emsg) |
160 | { | 168 | { |
161 | char *name = cls; | 169 | char *name = cls; |
162 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Create record for `%s': %s `%s'\n", name, (success == GNUNET_OK) ? "SUCCESS" : "FAIL", emsg); | 170 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
171 | "Create record for `%s': %s `%s'\n", | ||
172 | name, (success == GNUNET_OK) ? "SUCCESS" : "FAIL", | ||
173 | emsg); | ||
163 | if (success == GNUNET_OK) | 174 | if (success == GNUNET_OK) |
164 | { | 175 | { |
165 | res = 0; | 176 | res = 0; |
@@ -171,7 +182,8 @@ create_first_cont (void *cls, int32_t success, const char *emsg) | |||
171 | else | 182 | else |
172 | { | 183 | { |
173 | res = 1; | 184 | res = 1; |
174 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to put records for name `%s'\n", name); | 185 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
186 | "Failed to put records for name `%s'\n", name); | ||
175 | GNUNET_SCHEDULER_add_now(&end, NULL); | 187 | GNUNET_SCHEDULER_add_now(&end, NULL); |
176 | } | 188 | } |
177 | 189 | ||
@@ -206,7 +218,7 @@ run (void *cls, | |||
206 | char *hostkey_file; | 218 | char *hostkey_file; |
207 | struct GNUNET_TIME_Absolute et; | 219 | struct GNUNET_TIME_Absolute et; |
208 | 220 | ||
209 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 221 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, endbadly, NULL); |
210 | 222 | ||
211 | /* load privat key */ | 223 | /* load privat key */ |
212 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 224 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |