diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-10-28 23:14:38 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-10-28 23:14:45 +0200 |
commit | a98fecfbfa095ceee45b963c07480ed9331c48e2 (patch) | |
tree | 7a4d427ccb99ed3dcab33be7e7883c16e39dcef1 /src/fs | |
parent | 4e2259f14be320c8e2fe2a672a473e09677269c4 (diff) | |
download | gnunet-a98fecfbfa095ceee45b963c07480ed9331c48e2.tar.gz gnunet-a98fecfbfa095ceee45b963c07480ed9331c48e2.zip |
-code cleanup plus one new assertion to debug madmurphy issue
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_api.c | 38 | ||||
-rw-r--r-- | src/fs/fs_list_indexed.c | 6 | ||||
-rw-r--r-- | src/fs/gnunet-fs.c | 2 |
3 files changed, 18 insertions, 28 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index c1b5ef84b..6e97a3812 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -3190,16 +3190,20 @@ deserialize_download_file (void *cls, const char *filename) | |||
3190 | if (NULL == rh) | 3190 | if (NULL == rh) |
3191 | { | 3191 | { |
3192 | if (0 != unlink (filename)) | 3192 | if (0 != unlink (filename)) |
3193 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", filename); | 3193 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, |
3194 | "unlink", | ||
3195 | filename); | ||
3194 | GNUNET_free (set); | 3196 | GNUNET_free (set); |
3195 | return GNUNET_OK; | 3197 | return GNUNET_OK; |
3196 | } | 3198 | } |
3197 | deserialize_download (h, rh, NULL, NULL, set); | 3199 | deserialize_download (h, rh, NULL, NULL, set); |
3198 | GNUNET_free (set); | 3200 | GNUNET_free (set); |
3199 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) | 3201 | if (GNUNET_OK != |
3202 | GNUNET_BIO_read_close (rh, | ||
3203 | &emsg)) | ||
3200 | { | 3204 | { |
3201 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3205 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3202 | _ ("Failure while resuming download operation `%s': %s\n"), | 3206 | "Failure while resuming download operation `%s': %s\n", |
3203 | filename, | 3207 | filename, |
3204 | emsg); | 3208 | emsg); |
3205 | GNUNET_free (emsg); | 3209 | GNUNET_free (emsg); |
@@ -3225,23 +3229,16 @@ deserialization_master (const char *master_path, | |||
3225 | dn = get_serialization_file_name (h, master_path, ""); | 3229 | dn = get_serialization_file_name (h, master_path, ""); |
3226 | if (NULL == dn) | 3230 | if (NULL == dn) |
3227 | return; | 3231 | return; |
3228 | if (GNUNET_YES == GNUNET_DISK_directory_test (dn, GNUNET_YES)) | 3232 | if (GNUNET_YES == |
3229 | GNUNET_DISK_directory_scan (dn, proc, h); | 3233 | GNUNET_DISK_directory_test (dn, |
3234 | GNUNET_YES)) | ||
3235 | GNUNET_DISK_directory_scan (dn, | ||
3236 | proc, | ||
3237 | h); | ||
3230 | GNUNET_free (dn); | 3238 | GNUNET_free (dn); |
3231 | } | 3239 | } |
3232 | 3240 | ||
3233 | 3241 | ||
3234 | /** | ||
3235 | * Setup a connection to the file-sharing service. | ||
3236 | * | ||
3237 | * @param cfg configuration to use | ||
3238 | * @param client_name unique identifier for this client | ||
3239 | * @param upcb function to call to notify about FS actions | ||
3240 | * @param upcb_cls closure for @a upcb | ||
3241 | * @param flags specific attributes for fs-operations | ||
3242 | * @param ... list of optional options, terminated with #GNUNET_FS_OPTIONS_END | ||
3243 | * @return NULL on error | ||
3244 | */ | ||
3245 | struct GNUNET_FS_Handle * | 3242 | struct GNUNET_FS_Handle * |
3246 | GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 3243 | GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
3247 | const char *client_name, | 3244 | const char *client_name, |
@@ -3308,15 +3305,6 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
3308 | } | 3305 | } |
3309 | 3306 | ||
3310 | 3307 | ||
3311 | /** | ||
3312 | * Close our connection with the file-sharing service. | ||
3313 | * The callback given to #GNUNET_FS_start() will no longer be | ||
3314 | * called after this function returns. | ||
3315 | * This function MUST NOT be called from within the | ||
3316 | * callback itself. | ||
3317 | * | ||
3318 | * @param h handle that was returned from #GNUNET_FS_start() | ||
3319 | */ | ||
3320 | void | 3308 | void |
3321 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h) | 3309 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h) |
3322 | { | 3310 | { |
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c index 7cd6161e3..eaee4ce55 100644 --- a/src/fs/fs_list_indexed.c +++ b/src/fs/fs_list_indexed.c | |||
@@ -148,10 +148,12 @@ mq_error_handler (void *cls, | |||
148 | struct GNUNET_FS_GetIndexedContext *gic = cls; | 148 | struct GNUNET_FS_GetIndexedContext *gic = cls; |
149 | 149 | ||
150 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 150 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
151 | _ ("Failed to receive response from `%s' service (error code is %d).\n"), | 151 | "Failed to receive response from `%s' service (error code is %d).\n", |
152 | "fs", | 152 | "fs", |
153 | error); | 153 | error); |
154 | (void) gic->iterator (gic->iterator_cls, NULL, NULL); | 154 | (void) gic->iterator (gic->iterator_cls, |
155 | NULL, | ||
156 | NULL); | ||
155 | GNUNET_FS_get_indexed_files_cancel (gic); | 157 | GNUNET_FS_get_indexed_files_cancel (gic); |
156 | } | 158 | } |
157 | 159 | ||
diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c index f9d63e101..0f8f02a1c 100644 --- a/src/fs/gnunet-fs.c +++ b/src/fs/gnunet-fs.c | |||
@@ -57,7 +57,7 @@ static unsigned int verbose; | |||
57 | * @param cls closure | 57 | * @param cls closure |
58 | * @param filename the name of the file | 58 | * @param filename the name of the file |
59 | * @param file_id hash of the contents of the indexed file | 59 | * @param file_id hash of the contents of the indexed file |
60 | * @return GNUNET_OK to continue iteration | 60 | * @return #GNUNET_OK to continue iteration |
61 | */ | 61 | */ |
62 | static enum GNUNET_GenericReturnValue | 62 | static enum GNUNET_GenericReturnValue |
63 | print_indexed (void *cls, | 63 | print_indexed (void *cls, |