aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_lc.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-02-08 00:10:36 +0000
committerChristian Grothoff <christian@grothoff.org>2011-02-08 00:10:36 +0000
commit1a11ec73bfe097463b60b41ceed503e3d2924a44 (patch)
tree7bf27c684adefa0af13fae69ad1c547bc568085b /src/fs/gnunet-service-fs_lc.c
parent86d7f49fc64f0c766d4bec6b3f34879f108fc8a9 (diff)
downloadgnunet-1a11ec73bfe097463b60b41ceed503e3d2924a44.tar.gz
gnunet-1a11ec73bfe097463b60b41ceed503e3d2924a44.zip
stuff
Diffstat (limited to 'src/fs/gnunet-service-fs_lc.c')
-rw-r--r--src/fs/gnunet-service-fs_lc.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index 2113a4498..9c9c0d568 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -181,13 +181,12 @@ GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client)
181/** 181/**
182 * Handle START_SEARCH-message (search request from local client). 182 * Handle START_SEARCH-message (search request from local client).
183 * 183 *
184 * @param cls closure
185 * @param client identification of the client 184 * @param client identification of the client
186 * @param message the actual message 185 * @param message the actual message
186 * @return pending request handle for the request, NULL on error
187 */ 187 */
188void 188struct GSF_PendingRequest *
189GSF_local_client_start_search_handler_ (void *cls, 189GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
190 struct GNUNET_SERVER_Client *client,
191 const struct GNUNET_MessageHeader *message) 190 const struct GNUNET_MessageHeader *message)
192{ 191{
193 static GNUNET_HashCode all_zeros; 192 static GNUNET_HashCode all_zeros;
@@ -207,7 +206,7 @@ GSF_local_client_start_search_handler_ (void *cls,
207 GNUNET_break (0); 206 GNUNET_break (0);
208 GNUNET_SERVER_receive_done (client, 207 GNUNET_SERVER_receive_done (client,
209 GNUNET_SYSERR); 208 GNUNET_SYSERR);
210 return; 209 return NULL;
211 } 210 }
212 GNUNET_STATISTICS_update (stats, 211 GNUNET_STATISTICS_update (stats,
213 gettext_noop ("# client searches received"), 212 gettext_noop ("# client searches received"),
@@ -224,7 +223,6 @@ GSF_local_client_start_search_handler_ (void *cls,
224#endif 223#endif
225 lc = GSF_local_client_lookup_ (client); 224 lc = GSF_local_client_lookup_ (client);
226 225
227
228 /* detect duplicate KBLOCK requests */ 226 /* detect duplicate KBLOCK requests */
229 if ( (type == GNUNET_BLOCK_TYPE_FS_KBLOCK) || 227 if ( (type == GNUNET_BLOCK_TYPE_FS_KBLOCK) ||
230 (type == GNUNET_BLOCK_TYPE_FS_NBLOCK) || 228 (type == GNUNET_BLOCK_TYPE_FS_NBLOCK) ||
@@ -252,7 +250,7 @@ GSF_local_client_start_search_handler_ (void *cls,
252 GNUNET_NO); 250 GNUNET_NO);
253 GNUNET_SERVER_receive_done (client, 251 GNUNET_SERVER_receive_done (client,
254 GNUNET_OK); 252 GNUNET_OK);
255 return; 253 return NULL;
256 } 254 }
257 } 255 }
258 256
@@ -268,25 +266,24 @@ GSF_local_client_start_search_handler_ (void *cls,
268 options = GSF_PRO_LOCAL_REQUEST; 266 options = GSF_PRO_LOCAL_REQUEST;
269 if (0 != (1 & ntohl (sm->options))) 267 if (0 != (1 & ntohl (sm->options)))
270 options |= GSF_PRO_LOCAL_ONLY; 268 options |= GSF_PRO_LOCAL_ONLY;
271 cr->pr = GSF_pending_request_create (options, 269 cr->pr = GSF_pending_request_create_ (options,
272 270 type,
273 type, 271 &sm->query,
274 &sm->query, 272 (type == GNUNET_BLOCK_TYPE_SBLOCK)
275 (type == GNUNET_BLOCK_TYPE_SBLOCK) 273 ? &sm->target /* namespace */
276 ? &sm->target /* namespace */ 274 : NULL,
277 : NULL, 275 (0 != memcmp (&sm->target,
278 (0 != memcmp (&sm->target, 276 &all_zeros,
279 &all_zeros, 277 sizeof (GNUNET_HashCode)))
280 sizeof (GNUNET_HashCode))) 278 ? &sm->target,
281 ? &sm->target, 279 : NULL,
282 : NULL, 280 NULL /* bf */, 0 /* mingle */,
283 NULL /* bf */, 0 /* mingle */, 281 ntohl (sm->anonymity_level),
284 ntohl (sm->anonymity_level), 282 0 /* priority */,
285 0 /* priority */, 283 &sm[1], sc,
286 &sm[1], sc, 284 &client_response_handler,
287 &client_response_handler, 285 cr);
288 cr); 286 return cr->pr;
289 // FIXME: start local processing and/or P2P processing?
290} 287}
291 288
292 289