aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs/fs_search.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 18e03ab61..a2346aab9 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -893,9 +893,8 @@ struct MessageBuilderContext
893 893
894 894
895/** 895/**
896 * Iterating over the known results, pick those 896 * Iterating over the known results, pick those matching the given
897 * matching the given result range and store 897 * result range and store their keys at 'xoff'.
898 * their keys at 'xoff'.
899 * 898 *
900 * @param cls the 'struct MessageBuilderContext' 899 * @param cls the 'struct MessageBuilderContext'
901 * @param key key for a result 900 * @param key key for a result
@@ -996,9 +995,8 @@ transmit_search_request (void *cls, size_t size, void *buf)
996 mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt); 995 mbc.put_cnt = GNUNET_MIN (mbc.put_cnt, sqms - mbc.skip_cnt);
997 if (sc->search_request_map_offset < sqms) 996 if (sc->search_request_map_offset < sqms)
998 GNUNET_assert (mbc.put_cnt > 0); 997 GNUNET_assert (mbc.put_cnt > 0);
999 998
1000 sm->header.size = htons (msize); 999 sm->header.size = htons (msize);
1001 sm->options = htonl (options);
1002 sm->type = htonl (GNUNET_BLOCK_TYPE_ANY); 1000 sm->type = htonl (GNUNET_BLOCK_TYPE_ANY);
1003 sm->anonymity_level = htonl (sc->anonymity); 1001 sm->anonymity_level = htonl (sc->anonymity);
1004 memset (&sm->target, 0, sizeof (GNUNET_HashCode)); 1002 memset (&sm->target, 0, sizeof (GNUNET_HashCode));
@@ -1010,9 +1008,11 @@ transmit_search_request (void *cls, size_t size, void *buf)
1010 if (sqms != sc->search_request_map_offset) 1008 if (sqms != sc->search_request_map_offset)
1011 { 1009 {
1012 /* more requesting to be done... */ 1010 /* more requesting to be done... */
1011 sm->options = htonl (options | SEARCH_MESSAGE_OPTION_CONTINUED);
1013 schedule_transmit_search_request (sc); 1012 schedule_transmit_search_request (sc);
1014 return msize; 1013 return msize;
1015 } 1014 }
1015 sm->options = htonl (options);
1016 sc->keyword_offset++; 1016 sc->keyword_offset++;
1017 if (sc->uri->data.ksk.keywordCount != sc->keyword_offset) 1017 if (sc->uri->data.ksk.keywordCount != sc->keyword_offset)
1018 { 1018 {
@@ -1026,7 +1026,6 @@ transmit_search_request (void *cls, size_t size, void *buf)
1026 GNUNET_assert (GNUNET_FS_uri_test_sks (sc->uri)); 1026 GNUNET_assert (GNUNET_FS_uri_test_sks (sc->uri));
1027 msize = sizeof (struct SearchMessage); 1027 msize = sizeof (struct SearchMessage);
1028 GNUNET_assert (size >= msize); 1028 GNUNET_assert (size >= msize);
1029 sm->options = htonl (options);
1030 sm->type = htonl (GNUNET_BLOCK_TYPE_FS_SBLOCK); 1029 sm->type = htonl (GNUNET_BLOCK_TYPE_FS_SBLOCK);
1031 sm->anonymity_level = htonl (sc->anonymity); 1030 sm->anonymity_level = htonl (sc->anonymity);
1032 sm->target = sc->uri->data.sks.namespace; 1031 sm->target = sc->uri->data.sks.namespace;
@@ -1047,9 +1046,11 @@ transmit_search_request (void *cls, size_t size, void *buf)
1047 if (sqms != sc->search_request_map_offset) 1046 if (sqms != sc->search_request_map_offset)
1048 { 1047 {
1049 /* more requesting to be done... */ 1048 /* more requesting to be done... */
1049 sm->options = htonl (options | SEARCH_MESSAGE_OPTION_CONTINUED);
1050 schedule_transmit_search_request (sc); 1050 schedule_transmit_search_request (sc);
1051 return msize; 1051 return msize;
1052 } 1052 }
1053 sm->options = htonl (options);
1053 } 1054 }
1054 GNUNET_CLIENT_receive (sc->client, &receive_results, sc, 1055 GNUNET_CLIENT_receive (sc->client, &receive_results, sc,
1055 GNUNET_TIME_UNIT_FOREVER_REL); 1056 GNUNET_TIME_UNIT_FOREVER_REL);