diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-22 15:52:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-22 15:52:40 +0000 |
commit | 48436941449d867ef9a32ddf29439c5017d37775 (patch) | |
tree | a34b1230ba7e4d2e9deea743dcfdb283f7f7b605 /src/fs | |
parent | 87487477c67697355c79d2fe079d23a5b31c7ab6 (diff) | |
download | gnunet-48436941449d867ef9a32ddf29439c5017d37775.tar.gz gnunet-48436941449d867ef9a32ddf29439c5017d37775.zip |
stuff
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index b8855632c..fa83eb889 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -961,9 +961,9 @@ signal_index_ok (struct IndexInfo *ii) | |||
961 | ii->filename, | 961 | ii->filename, |
962 | (const char*) GNUNET_CONTAINER_multihashmap_get (ifm, | 962 | (const char*) GNUNET_CONTAINER_multihashmap_get (ifm, |
963 | &ii->file_id)); | 963 | &ii->file_id)); |
964 | GNUNET_SERVER_transmit_context_append (ii->tc, | 964 | GNUNET_SERVER_transmit_context_append_data (ii->tc, |
965 | NULL, 0, | 965 | NULL, 0, |
966 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); | 966 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); |
967 | GNUNET_SERVER_transmit_context_run (ii->tc, | 967 | GNUNET_SERVER_transmit_context_run (ii->tc, |
968 | GNUNET_TIME_UNIT_MINUTES); | 968 | GNUNET_TIME_UNIT_MINUTES); |
969 | GNUNET_free (ii); | 969 | GNUNET_free (ii); |
@@ -972,9 +972,9 @@ signal_index_ok (struct IndexInfo *ii) | |||
972 | ii->next = indexed_files; | 972 | ii->next = indexed_files; |
973 | indexed_files = ii; | 973 | indexed_files = ii; |
974 | write_index_list (); | 974 | write_index_list (); |
975 | GNUNET_SERVER_transmit_context_append (ii->tc, | 975 | GNUNET_SERVER_transmit_context_append_data (ii->tc, |
976 | NULL, 0, | 976 | NULL, 0, |
977 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); | 977 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); |
978 | GNUNET_SERVER_transmit_context_run (ii->tc, | 978 | GNUNET_SERVER_transmit_context_run (ii->tc, |
979 | GNUNET_TIME_UNIT_MINUTES); | 979 | GNUNET_TIME_UNIT_MINUTES); |
980 | ii->tc = NULL; | 980 | ii->tc = NULL; |
@@ -1009,9 +1009,9 @@ hash_for_index_val (void *cls, | |||
1009 | "Wanted `%s'\n", | 1009 | "Wanted `%s'\n", |
1010 | GNUNET_h2s (&ii->file_id)); | 1010 | GNUNET_h2s (&ii->file_id)); |
1011 | #endif | 1011 | #endif |
1012 | GNUNET_SERVER_transmit_context_append (ii->tc, | 1012 | GNUNET_SERVER_transmit_context_append_data (ii->tc, |
1013 | NULL, 0, | 1013 | NULL, 0, |
1014 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED); | 1014 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED); |
1015 | GNUNET_SERVER_transmit_context_run (ii->tc, | 1015 | GNUNET_SERVER_transmit_context_run (ii->tc, |
1016 | GNUNET_TIME_UNIT_MINUTES); | 1016 | GNUNET_TIME_UNIT_MINUTES); |
1017 | GNUNET_free (ii); | 1017 | GNUNET_free (ii); |
@@ -1110,17 +1110,13 @@ handle_index_list_get (void *cls, | |||
1110 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 1110 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; |
1111 | size_t slen; | 1111 | size_t slen; |
1112 | const char *fn; | 1112 | const char *fn; |
1113 | struct GNUNET_MessageHeader *msg; | ||
1114 | struct IndexInfo *pos; | 1113 | struct IndexInfo *pos; |
1115 | 1114 | ||
1116 | tc = GNUNET_SERVER_transmit_context_create (client); | 1115 | tc = GNUNET_SERVER_transmit_context_create (client); |
1117 | iim = (struct IndexInfoMessage*) buf; | 1116 | iim = (struct IndexInfoMessage*) buf; |
1118 | msg = &iim->header; | ||
1119 | pos = indexed_files; | 1117 | pos = indexed_files; |
1120 | while (NULL != pos) | 1118 | while (NULL != pos) |
1121 | { | 1119 | { |
1122 | iim->reserved = 0; | ||
1123 | iim->file_id = pos->file_id; | ||
1124 | fn = pos->filename; | 1120 | fn = pos->filename; |
1125 | slen = strlen (fn) + 1; | 1121 | slen = strlen (fn) + 1; |
1126 | if (slen + sizeof (struct IndexInfoMessage) > | 1122 | if (slen + sizeof (struct IndexInfoMessage) > |
@@ -1129,18 +1125,18 @@ handle_index_list_get (void *cls, | |||
1129 | GNUNET_break (0); | 1125 | GNUNET_break (0); |
1130 | break; | 1126 | break; |
1131 | } | 1127 | } |
1128 | iim->header.type = htons (GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY); | ||
1129 | iim->header.size = htons (slen + sizeof (struct IndexInfoMessage)); | ||
1130 | iim->reserved = 0; | ||
1131 | iim->file_id = pos->file_id; | ||
1132 | memcpy (&iim[1], fn, slen); | 1132 | memcpy (&iim[1], fn, slen); |
1133 | GNUNET_SERVER_transmit_context_append | 1133 | GNUNET_SERVER_transmit_context_append_message (tc, |
1134 | (tc, | 1134 | &iim->header); |
1135 | &msg[1], | ||
1136 | sizeof (struct IndexInfoMessage) | ||
1137 | - sizeof (struct GNUNET_MessageHeader) + slen, | ||
1138 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY); | ||
1139 | pos = pos->next; | 1135 | pos = pos->next; |
1140 | } | 1136 | } |
1141 | GNUNET_SERVER_transmit_context_append (tc, | 1137 | GNUNET_SERVER_transmit_context_append_data (tc, |
1142 | NULL, 0, | 1138 | NULL, 0, |
1143 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END); | 1139 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END); |
1144 | GNUNET_SERVER_transmit_context_run (tc, | 1140 | GNUNET_SERVER_transmit_context_run (tc, |
1145 | GNUNET_TIME_UNIT_MINUTES); | 1141 | GNUNET_TIME_UNIT_MINUTES); |
1146 | } | 1142 | } |
@@ -1198,9 +1194,9 @@ handle_unindex (void *cls, | |||
1198 | if (GNUNET_YES == found) | 1194 | if (GNUNET_YES == found) |
1199 | write_index_list (); | 1195 | write_index_list (); |
1200 | tc = GNUNET_SERVER_transmit_context_create (client); | 1196 | tc = GNUNET_SERVER_transmit_context_create (client); |
1201 | GNUNET_SERVER_transmit_context_append (tc, | 1197 | GNUNET_SERVER_transmit_context_append_data (tc, |
1202 | NULL, 0, | 1198 | NULL, 0, |
1203 | GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK); | 1199 | GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK); |
1204 | GNUNET_SERVER_transmit_context_run (tc, | 1200 | GNUNET_SERVER_transmit_context_run (tc, |
1205 | GNUNET_TIME_UNIT_MINUTES); | 1201 | GNUNET_TIME_UNIT_MINUTES); |
1206 | } | 1202 | } |