aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
commitbe4c79e4cd4a8f118c5577874f0c95e253359595 (patch)
tree7fd74fb0cf6921c4e35a43f2593396bb4805f154 /src/fs/gnunet-service-fs_pr.c
parent15ccd7a167bcce0dde4331092975a6401393610f (diff)
downloadgnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz
gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip
Rename mesh->cadet
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r--src/fs/gnunet-service-fs_pr.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 0af19d537..67c935acd 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -31,7 +31,7 @@
31#include "gnunet-service-fs_indexing.h" 31#include "gnunet-service-fs_indexing.h"
32#include "gnunet-service-fs_pe.h" 32#include "gnunet-service-fs_pe.h"
33#include "gnunet-service-fs_pr.h" 33#include "gnunet-service-fs_pr.h"
34#include "gnunet-service-fs_mesh.h" 34#include "gnunet-service-fs_cadet.h"
35 35
36 36
37/** 37/**
@@ -65,10 +65,10 @@
65#define INSANE_STATISTICS GNUNET_NO 65#define INSANE_STATISTICS GNUNET_NO
66 66
67/** 67/**
68 * If obtaining a block via mesh fails, how often do we retry it before 68 * If obtaining a block via cadet fails, how often do we retry it before
69 * giving up for good (and sticking to non-anonymous transfer)? 69 * giving up for good (and sticking to non-anonymous transfer)?
70 */ 70 */
71#define MESH_RETRY_MAX 3 71#define CADET_RETRY_MAX 3
72 72
73 73
74/** 74/**
@@ -117,9 +117,9 @@ struct GSF_PendingRequest
117 struct GNUNET_DHT_GetHandle *gh; 117 struct GNUNET_DHT_GetHandle *gh;
118 118
119 /** 119 /**
120 * Mesh request handle for this request (or NULL for none). 120 * Cadet request handle for this request (or NULL for none).
121 */ 121 */
122 struct GSF_MeshRequest *mesh_request; 122 struct GSF_CadetRequest *cadet_request;
123 123
124 /** 124 /**
125 * Function to call upon completion of the local get 125 * Function to call upon completion of the local get
@@ -174,10 +174,10 @@ struct GSF_PendingRequest
174 uint64_t first_uid; 174 uint64_t first_uid;
175 175
176 /** 176 /**
177 * How often have we retried this request via 'mesh'? 177 * How often have we retried this request via 'cadet'?
178 * (used to bound overall retries). 178 * (used to bound overall retries).
179 */ 179 */
180 unsigned int mesh_retry_count; 180 unsigned int cadet_retry_count;
181 181
182 /** 182 /**
183 * Number of valid entries in the 'replies_seen' array. 183 * Number of valid entries in the 'replies_seen' array.
@@ -595,11 +595,11 @@ clean_request (void *cls, const struct GNUNET_HashCode *key, void *value)
595 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 595 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
596 "Cleaning up pending request for `%s'.\n", 596 "Cleaning up pending request for `%s'.\n",
597 GNUNET_h2s (key)); 597 GNUNET_h2s (key));
598 if (NULL != pr->mesh_request) 598 if (NULL != pr->cadet_request)
599 { 599 {
600 pr->mesh_retry_count = MESH_RETRY_MAX; 600 pr->cadet_retry_count = CADET_RETRY_MAX;
601 GSF_mesh_query_cancel (pr->mesh_request); 601 GSF_cadet_query_cancel (pr->cadet_request);
602 pr->mesh_request = NULL; 602 pr->cadet_request = NULL;
603 } 603 }
604 if (NULL != (cont = pr->llc_cont)) 604 if (NULL != (cont = pr->llc_cont))
605 { 605 {
@@ -668,11 +668,11 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup)
668 * but do NOT remove from our data-structures, we still need it there 668 * but do NOT remove from our data-structures, we still need it there
669 * to prevent the request from looping */ 669 * to prevent the request from looping */
670 pr->rh = NULL; 670 pr->rh = NULL;
671 if (NULL != pr->mesh_request) 671 if (NULL != pr->cadet_request)
672 { 672 {
673 pr->mesh_retry_count = MESH_RETRY_MAX; 673 pr->cadet_retry_count = CADET_RETRY_MAX;
674 GSF_mesh_query_cancel (pr->mesh_request); 674 GSF_cadet_query_cancel (pr->cadet_request);
675 pr->mesh_request = NULL; 675 pr->cadet_request = NULL;
676 } 676 }
677 if (NULL != (cont = pr->llc_cont)) 677 if (NULL != (cont = pr->llc_cont))
678 { 678 {
@@ -1139,7 +1139,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr)
1139 1139
1140 1140
1141/** 1141/**
1142 * Function called with a reply from the mesh. 1142 * Function called with a reply from the cadet.
1143 * 1143 *
1144 * @param cls the pending request struct 1144 * @param cls the pending request struct
1145 * @param type type of the block, ANY on error 1145 * @param type type of the block, ANY on error
@@ -1148,7 +1148,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr)
1148 * @param data reply block data, NULL on error 1148 * @param data reply block data, NULL on error
1149 */ 1149 */
1150static void 1150static void
1151mesh_reply_proc (void *cls, 1151cadet_reply_proc (void *cls,
1152 enum GNUNET_BLOCK_Type type, 1152 enum GNUNET_BLOCK_Type type,
1153 struct GNUNET_TIME_Absolute expiration, 1153 struct GNUNET_TIME_Absolute expiration,
1154 size_t data_size, 1154 size_t data_size,
@@ -1158,22 +1158,22 @@ mesh_reply_proc (void *cls,
1158 struct ProcessReplyClosure prq; 1158 struct ProcessReplyClosure prq;
1159 struct GNUNET_HashCode query; 1159 struct GNUNET_HashCode query;
1160 1160
1161 pr->mesh_request = NULL; 1161 pr->cadet_request = NULL;
1162 if (GNUNET_BLOCK_TYPE_ANY == type) 1162 if (GNUNET_BLOCK_TYPE_ANY == type)
1163 { 1163 {
1164 GNUNET_break (NULL == data); 1164 GNUNET_break (NULL == data);
1165 GNUNET_break (0 == data_size); 1165 GNUNET_break (0 == data_size);
1166 pr->mesh_retry_count++; 1166 pr->cadet_retry_count++;
1167 if (pr->mesh_retry_count >= MESH_RETRY_MAX) 1167 if (pr->cadet_retry_count >= CADET_RETRY_MAX)
1168 return; /* give up on mesh */ 1168 return; /* give up on cadet */
1169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1170 "Error retrieiving block via mesh\n"); 1170 "Error retrieiving block via cadet\n");
1171 /* retry -- without delay, as this is non-anonymous 1171 /* retry -- without delay, as this is non-anonymous
1172 and mesh/mesh connect will take some time anyway */ 1172 and cadet/cadet connect will take some time anyway */
1173 pr->mesh_request = GSF_mesh_query (pr->public_data.target, 1173 pr->cadet_request = GSF_cadet_query (pr->public_data.target,
1174 &pr->public_data.query, 1174 &pr->public_data.query,
1175 pr->public_data.type, 1175 pr->public_data.type,
1176 &mesh_reply_proc, 1176 &cadet_reply_proc,
1177 pr); 1177 pr);
1178 return; 1178 return;
1179 } 1179 }
@@ -1189,7 +1189,7 @@ mesh_reply_proc (void *cls,
1189 return; 1189 return;
1190 } 1190 }
1191 GNUNET_STATISTICS_update (GSF_stats, 1191 GNUNET_STATISTICS_update (GSF_stats,
1192 gettext_noop ("# Replies received from MESH"), 1, 1192 gettext_noop ("# Replies received from CADET"), 1,
1193 GNUNET_NO); 1193 GNUNET_NO);
1194 memset (&prq, 0, sizeof (prq)); 1194 memset (&prq, 0, sizeof (prq));
1195 prq.data = data; 1195 prq.data = data;
@@ -1204,27 +1204,27 @@ mesh_reply_proc (void *cls,
1204 1204
1205 1205
1206/** 1206/**
1207 * Consider downloading via mesh (if possible) 1207 * Consider downloading via cadet (if possible)
1208 * 1208 *
1209 * @param pr the pending request to process 1209 * @param pr the pending request to process
1210 */ 1210 */
1211void 1211void
1212GSF_mesh_lookup_ (struct GSF_PendingRequest *pr) 1212GSF_cadet_lookup_ (struct GSF_PendingRequest *pr)
1213{ 1213{
1214 if (0 != pr->public_data.anonymity_level) 1214 if (0 != pr->public_data.anonymity_level)
1215 return; 1215 return;
1216 if (0 == pr->public_data.target) 1216 if (0 == pr->public_data.target)
1217 { 1217 {
1218 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1218 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1219 "Cannot do mesh-based download, target peer not known\n"); 1219 "Cannot do cadet-based download, target peer not known\n");
1220 return; 1220 return;
1221 } 1221 }
1222 if (NULL != pr->mesh_request) 1222 if (NULL != pr->cadet_request)
1223 return; 1223 return;
1224 pr->mesh_request = GSF_mesh_query (pr->public_data.target, 1224 pr->cadet_request = GSF_cadet_query (pr->public_data.target,
1225 &pr->public_data.query, 1225 &pr->public_data.query,
1226 pr->public_data.type, 1226 pr->public_data.type,
1227 &mesh_reply_proc, 1227 &cadet_reply_proc,
1228 pr); 1228 pr);
1229} 1229}
1230 1230
@@ -1553,7 +1553,7 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
1553 GSF_LocalLookupContinuation cont, void *cont_cls) 1553 GSF_LocalLookupContinuation cont, void *cont_cls)
1554{ 1554{
1555 GNUNET_assert (NULL == pr->gh); 1555 GNUNET_assert (NULL == pr->gh);
1556 GNUNET_assert (NULL == pr->mesh_request); 1556 GNUNET_assert (NULL == pr->cadet_request);
1557 GNUNET_assert (NULL == pr->llc_cont); 1557 GNUNET_assert (NULL == pr->llc_cont);
1558 pr->llc_cont = cont; 1558 pr->llc_cont = cont;
1559 pr->llc_cont_cls = cont_cls; 1559 pr->llc_cont_cls = cont_cls;