diff options
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r-- | src/fs/fs_api.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 920786146..63b17a93e 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -584,7 +584,7 @@ GNUNET_FS_data_reader_copy_ (void *cls, | |||
584 | * | 584 | * |
585 | * @param h master context | 585 | * @param h master context |
586 | * @param ext component of the path | 586 | * @param ext component of the path |
587 | * @param ent entity identifier (or emtpy string for the directory) | 587 | * @param ent entity identifier (or empty string for the directory) |
588 | * @return NULL on error | 588 | * @return NULL on error |
589 | */ | 589 | */ |
590 | static char * | 590 | static char * |
@@ -624,7 +624,7 @@ get_serialization_file_name (struct GNUNET_FS_Handle *h, | |||
624 | * @param h master context | 624 | * @param h master context |
625 | * @param ext component of the path | 625 | * @param ext component of the path |
626 | * @param uni name of the parent operation | 626 | * @param uni name of the parent operation |
627 | * @param ent entity identifier (or emtpy string for the directory) | 627 | * @param ent entity identifier (or empty string for the directory) |
628 | * @return NULL on error | 628 | * @return NULL on error |
629 | */ | 629 | */ |
630 | static char * | 630 | static char * |
@@ -664,7 +664,7 @@ get_serialization_file_name_in_dir (struct GNUNET_FS_Handle *h, | |||
664 | * | 664 | * |
665 | * @param h master context | 665 | * @param h master context |
666 | * @param ext component of the path | 666 | * @param ext component of the path |
667 | * @param ent entity identifier (or emtpy string for the directory) | 667 | * @param ent entity identifier (or empty string for the directory) |
668 | * @return NULL on error | 668 | * @return NULL on error |
669 | */ | 669 | */ |
670 | static struct GNUNET_BIO_ReadHandle * | 670 | static struct GNUNET_BIO_ReadHandle * |
@@ -687,7 +687,7 @@ get_read_handle (struct GNUNET_FS_Handle *h, const char *ext, const char *ent) | |||
687 | * | 687 | * |
688 | * @param h master context | 688 | * @param h master context |
689 | * @param ext component of the path | 689 | * @param ext component of the path |
690 | * @param ent entity identifier (or emtpy string for the directory) | 690 | * @param ent entity identifier (or empty string for the directory) |
691 | * @return NULL on error | 691 | * @return NULL on error |
692 | */ | 692 | */ |
693 | static struct GNUNET_BIO_WriteHandle * | 693 | static struct GNUNET_BIO_WriteHandle * |
@@ -712,7 +712,7 @@ get_write_handle (struct GNUNET_FS_Handle *h, const char *ext, const char *ent) | |||
712 | * @param h master context | 712 | * @param h master context |
713 | * @param ext component of the path | 713 | * @param ext component of the path |
714 | * @param uni name of parent | 714 | * @param uni name of parent |
715 | * @param ent entity identifier (or emtpy string for the directory) | 715 | * @param ent entity identifier (or empty string for the directory) |
716 | * @return NULL on error | 716 | * @return NULL on error |
717 | */ | 717 | */ |
718 | static struct GNUNET_BIO_WriteHandle * | 718 | static struct GNUNET_BIO_WriteHandle * |
@@ -877,7 +877,7 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, | |||
877 | * | 877 | * |
878 | * @param h master context | 878 | * @param h master context |
879 | * @param filename name of the file (without directory) with | 879 | * @param filename name of the file (without directory) with |
880 | * the infromation | 880 | * the information |
881 | * @return NULL on error | 881 | * @return NULL on error |
882 | */ | 882 | */ |
883 | static struct GNUNET_FS_FileInformation * | 883 | static struct GNUNET_FS_FileInformation * |
@@ -890,7 +890,7 @@ deserialize_file_information (struct GNUNET_FS_Handle *h, const char *filename); | |||
890 | * | 890 | * |
891 | * @param h master context | 891 | * @param h master context |
892 | * @param fn name of the file (without directory) with | 892 | * @param fn name of the file (without directory) with |
893 | * the infromation | 893 | * the information |
894 | * @param rh handle for reading | 894 | * @param rh handle for reading |
895 | * @return NULL on error | 895 | * @return NULL on error |
896 | */ | 896 | */ |
@@ -1152,7 +1152,7 @@ cleanup: | |||
1152 | * | 1152 | * |
1153 | * @param h master context | 1153 | * @param h master context |
1154 | * @param filename name of the file (without directory) with | 1154 | * @param filename name of the file (without directory) with |
1155 | * the infromation | 1155 | * the information |
1156 | * @return NULL on error | 1156 | * @return NULL on error |
1157 | */ | 1157 | */ |
1158 | static struct GNUNET_FS_FileInformation * | 1158 | static struct GNUNET_FS_FileInformation * |
@@ -1230,7 +1230,7 @@ get_serialization_short_name (const char *fullname) | |||
1230 | * | 1230 | * |
1231 | * @param h master context | 1231 | * @param h master context |
1232 | * @param ext component of the path | 1232 | * @param ext component of the path |
1233 | * @return NULL on errror | 1233 | * @return NULL on error |
1234 | */ | 1234 | */ |
1235 | static char * | 1235 | static char * |
1236 | make_serialization_file_name (struct GNUNET_FS_Handle *h, const char *ext) | 1236 | make_serialization_file_name (struct GNUNET_FS_Handle *h, const char *ext) |
@@ -1266,7 +1266,7 @@ make_serialization_file_name (struct GNUNET_FS_Handle *h, const char *ext) | |||
1266 | * @param h master context | 1266 | * @param h master context |
1267 | * @param ext component of the path | 1267 | * @param ext component of the path |
1268 | * @param uni name of parent | 1268 | * @param uni name of parent |
1269 | * @return NULL on errror | 1269 | * @return NULL on error |
1270 | */ | 1270 | */ |
1271 | static char * | 1271 | static char * |
1272 | make_serialization_file_name_in_dir (struct GNUNET_FS_Handle *h, | 1272 | make_serialization_file_name_in_dir (struct GNUNET_FS_Handle *h, |
@@ -2535,7 +2535,7 @@ static int | |||
2535 | deserialize_search_result (void *cls, const char *filename) | 2535 | deserialize_search_result (void *cls, const char *filename) |
2536 | { | 2536 | { |
2537 | struct GNUNET_FS_SearchContext *sc = cls; | 2537 | struct GNUNET_FS_SearchContext *sc = cls; |
2538 | char *ser; | 2538 | char *serialized; |
2539 | char *uris; | 2539 | char *uris; |
2540 | char *emsg; | 2540 | char *emsg; |
2541 | char *download; | 2541 | char *download; |
@@ -2544,19 +2544,19 @@ deserialize_search_result (void *cls, const char *filename) | |||
2544 | struct GNUNET_BIO_ReadHandle *drh; | 2544 | struct GNUNET_BIO_ReadHandle *drh; |
2545 | struct GNUNET_FS_SearchResult *sr; | 2545 | struct GNUNET_FS_SearchResult *sr; |
2546 | 2546 | ||
2547 | ser = get_serialization_short_name (filename); | 2547 | serialized = get_serialization_short_name (filename); |
2548 | rh = GNUNET_BIO_read_open_file (filename); | 2548 | rh = GNUNET_BIO_read_open_file (filename); |
2549 | if (NULL == rh) | 2549 | if (NULL == rh) |
2550 | { | 2550 | { |
2551 | if (NULL != ser) | 2551 | if (NULL != serialized) |
2552 | { | 2552 | { |
2553 | remove_sync_file_in_dir (sc->h, | 2553 | remove_sync_file_in_dir (sc->h, |
2554 | (NULL == sc->psearch_result) | 2554 | (NULL == sc->psearch_result) |
2555 | ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH | 2555 | ? GNUNET_FS_SYNC_PATH_MASTER_SEARCH |
2556 | : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, | 2556 | : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, |
2557 | sc->serialization, | 2557 | sc->serialization, |
2558 | ser); | 2558 | serialized); |
2559 | GNUNET_free (ser); | 2559 | GNUNET_free (serialized); |
2560 | } | 2560 | } |
2561 | return GNUNET_OK; | 2561 | return GNUNET_OK; |
2562 | } | 2562 | } |
@@ -2567,7 +2567,7 @@ deserialize_search_result (void *cls, const char *filename) | |||
2567 | sr = GNUNET_new (struct GNUNET_FS_SearchResult); | 2567 | sr = GNUNET_new (struct GNUNET_FS_SearchResult); |
2568 | sr->h = sc->h; | 2568 | sr->h = sc->h; |
2569 | sr->sc = sc; | 2569 | sr->sc = sc; |
2570 | sr->serialization = ser; | 2570 | sr->serialization = serialized; |
2571 | if ((GNUNET_OK != | 2571 | if ((GNUNET_OK != |
2572 | GNUNET_BIO_read_string (rh, "result-uri", &uris, 10 * 1024)) || | 2572 | GNUNET_BIO_read_string (rh, "result-uri", &uris, 10 * 1024)) || |
2573 | (NULL == (sr->uri = GNUNET_FS_uri_parse (uris, &emsg))) || | 2573 | (NULL == (sr->uri = GNUNET_FS_uri_parse (uris, &emsg))) || |
@@ -2850,32 +2850,32 @@ static int | |||
2850 | deserialize_subdownload (void *cls, const char *filename) | 2850 | deserialize_subdownload (void *cls, const char *filename) |
2851 | { | 2851 | { |
2852 | struct GNUNET_FS_DownloadContext *parent = cls; | 2852 | struct GNUNET_FS_DownloadContext *parent = cls; |
2853 | char *ser; | 2853 | char *serialized; |
2854 | char *emsg; | 2854 | char *emsg; |
2855 | struct GNUNET_BIO_ReadHandle *rh; | 2855 | struct GNUNET_BIO_ReadHandle *rh; |
2856 | 2856 | ||
2857 | ser = get_serialization_short_name (filename); | 2857 | serialized = get_serialization_short_name (filename); |
2858 | rh = GNUNET_BIO_read_open_file (filename); | 2858 | rh = GNUNET_BIO_read_open_file (filename); |
2859 | if (NULL == rh) | 2859 | if (NULL == rh) |
2860 | { | 2860 | { |
2861 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2861 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2862 | _ ( | 2862 | _ ( |
2863 | "Failed to resume sub-download `%s': could not open file `%s'\n"), | 2863 | "Failed to resume sub-download `%s': could not open file `%s'\n"), |
2864 | ser, | 2864 | serialized, |
2865 | filename); | 2865 | filename); |
2866 | GNUNET_free (ser); | 2866 | GNUNET_free (serialized); |
2867 | return GNUNET_OK; | 2867 | return GNUNET_OK; |
2868 | } | 2868 | } |
2869 | deserialize_download (parent->h, rh, parent, NULL, ser); | 2869 | deserialize_download (parent->h, rh, parent, NULL, serialized); |
2870 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) | 2870 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) |
2871 | { | 2871 | { |
2872 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2872 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2873 | _ ("Failed to resume sub-download `%s': %s\n"), | 2873 | _ ("Failed to resume sub-download `%s': %s\n"), |
2874 | ser, | 2874 | serialized, |
2875 | emsg); | 2875 | emsg); |
2876 | GNUNET_free (emsg); | 2876 | GNUNET_free (emsg); |
2877 | } | 2877 | } |
2878 | GNUNET_free (ser); | 2878 | GNUNET_free (serialized); |
2879 | return GNUNET_OK; | 2879 | return GNUNET_OK; |
2880 | } | 2880 | } |
2881 | 2881 | ||
@@ -3146,7 +3146,7 @@ static int | |||
3146 | deserialize_search_file (void *cls, const char *filename) | 3146 | deserialize_search_file (void *cls, const char *filename) |
3147 | { | 3147 | { |
3148 | struct GNUNET_FS_Handle *h = cls; | 3148 | struct GNUNET_FS_Handle *h = cls; |
3149 | char *ser; | 3149 | char *set; |
3150 | char *emsg; | 3150 | char *emsg; |
3151 | struct GNUNET_BIO_ReadHandle *rh; | 3151 | struct GNUNET_BIO_ReadHandle *rh; |
3152 | struct GNUNET_FS_SearchContext *sc; | 3152 | struct GNUNET_FS_SearchContext *sc; |
@@ -3159,21 +3159,21 @@ deserialize_search_file (void *cls, const char *filename) | |||
3159 | } | 3159 | } |
3160 | if (S_ISDIR (buf.st_mode)) | 3160 | if (S_ISDIR (buf.st_mode)) |
3161 | return GNUNET_OK; /* skip directories */ | 3161 | return GNUNET_OK; /* skip directories */ |
3162 | ser = get_serialization_short_name (filename); | 3162 | set = get_serialization_short_name (filename); |
3163 | rh = GNUNET_BIO_read_open_file (filename); | 3163 | rh = GNUNET_BIO_read_open_file (filename); |
3164 | if (NULL == rh) | 3164 | if (NULL == rh) |
3165 | { | 3165 | { |
3166 | if (NULL != ser) | 3166 | if (NULL != set) |
3167 | { | 3167 | { |
3168 | GNUNET_FS_remove_sync_file_ (h, GNUNET_FS_SYNC_PATH_MASTER_SEARCH, ser); | 3168 | GNUNET_FS_remove_sync_file_ (h, GNUNET_FS_SYNC_PATH_MASTER_SEARCH, set); |
3169 | GNUNET_free (ser); | 3169 | GNUNET_free (set); |
3170 | } | 3170 | } |
3171 | return GNUNET_OK; | 3171 | return GNUNET_OK; |
3172 | } | 3172 | } |
3173 | sc = deserialize_search (h, rh, NULL, ser); | 3173 | sc = deserialize_search (h, rh, NULL, set); |
3174 | if (NULL != sc) | 3174 | if (NULL != sc) |
3175 | sc->top = GNUNET_FS_make_top (h, &GNUNET_FS_search_signal_suspend_, sc); | 3175 | sc->top = GNUNET_FS_make_top (h, &GNUNET_FS_search_signal_suspend_, sc); |
3176 | GNUNET_free (ser); | 3176 | GNUNET_free (set); |
3177 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) | 3177 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) |
3178 | { | 3178 | { |
3179 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3179 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -3198,21 +3198,21 @@ static int | |||
3198 | deserialize_download_file (void *cls, const char *filename) | 3198 | deserialize_download_file (void *cls, const char *filename) |
3199 | { | 3199 | { |
3200 | struct GNUNET_FS_Handle *h = cls; | 3200 | struct GNUNET_FS_Handle *h = cls; |
3201 | char *ser; | 3201 | char *set; |
3202 | char *emsg; | 3202 | char *emsg; |
3203 | struct GNUNET_BIO_ReadHandle *rh; | 3203 | struct GNUNET_BIO_ReadHandle *rh; |
3204 | 3204 | ||
3205 | ser = get_serialization_short_name (filename); | 3205 | set = get_serialization_short_name (filename); |
3206 | rh = GNUNET_BIO_read_open_file (filename); | 3206 | rh = GNUNET_BIO_read_open_file (filename); |
3207 | if (NULL == rh) | 3207 | if (NULL == rh) |
3208 | { | 3208 | { |
3209 | if (0 != unlink (filename)) | 3209 | if (0 != unlink (filename)) |
3210 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", filename); | 3210 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", filename); |
3211 | GNUNET_free (ser); | 3211 | GNUNET_free (set); |
3212 | return GNUNET_OK; | 3212 | return GNUNET_OK; |
3213 | } | 3213 | } |
3214 | deserialize_download (h, rh, NULL, NULL, ser); | 3214 | deserialize_download (h, rh, NULL, NULL, set); |
3215 | GNUNET_free (ser); | 3215 | GNUNET_free (set); |
3216 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) | 3216 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) |
3217 | { | 3217 | { |
3218 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3218 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -3226,7 +3226,7 @@ deserialize_download_file (void *cls, const char *filename) | |||
3226 | 3226 | ||
3227 | 3227 | ||
3228 | /** | 3228 | /** |
3229 | * Deserialize informatin about pending operations. | 3229 | * Deserialize information about pending operations. |
3230 | * | 3230 | * |
3231 | * @param master_path which master directory should be scanned | 3231 | * @param master_path which master directory should be scanned |
3232 | * @param proc function to call for each entry (will get @a h for 'cls') | 3232 | * @param proc function to call for each entry (will get @a h for 'cls') |