aboutsummaryrefslogtreecommitdiff
path: root/src/gns/plugin_block_gns.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-19 21:59:30 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-19 21:59:30 +0000
commit5c9791cbb128494bcaf1544c3e89195e4007207c (patch)
tree86c9ba0a140c34efbe7462cfa25a167a84f0a211 /src/gns/plugin_block_gns.c
parent0970f98adb25e2ec8076ddf61b3437b5003af0b2 (diff)
downloadgnunet-5c9791cbb128494bcaf1544c3e89195e4007207c.tar.gz
gnunet-5c9791cbb128494bcaf1544c3e89195e4007207c.zip
-towards enabling relative expiration times in namestore
Diffstat (limited to 'src/gns/plugin_block_gns.c')
-rw-r--r--src/gns/plugin_block_gns.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c
index ba1fd56e1..f033811ee 100644
--- a/src/gns/plugin_block_gns.c
+++ b/src/gns/plugin_block_gns.c
@@ -135,7 +135,8 @@ block_plugin_gns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
135 { 135 {
136 struct GNUNET_NAMESTORE_RecordData rd[rd_count]; 136 struct GNUNET_NAMESTORE_RecordData rd[rd_count];
137 unsigned int i; 137 unsigned int i;
138 struct GNUNET_TIME_Absolute exp = GNUNET_TIME_UNIT_FOREVER_ABS; 138 uint64_t exp = UINT64_MAX;
139 struct GNUNET_TIME_Absolute et;
139 140
140 if (GNUNET_SYSERR == GNUNET_NAMESTORE_records_deserialize (rd_len, 141 if (GNUNET_SYSERR == GNUNET_NAMESTORE_records_deserialize (rd_len,
141 rd_data, 142 rd_data,
@@ -154,26 +155,25 @@ block_plugin_gns_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
154 record_xquery = ntohl(*((uint32_t*)xquery)); 155 record_xquery = ntohl(*((uint32_t*)xquery));
155 156
156 for (i=0; i<rd_count; i++) 157 for (i=0; i<rd_count; i++)
157 { 158 {
158 159 GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION));
159 exp = GNUNET_TIME_absolute_min (exp, rd[i].expiration); 160 exp = GNUNET_MIN (exp, rd[i].expiration_time);
160
161 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 161 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
162 "Got record of size %d\n", rd[i].data_size); 162 "Got record of size %d\n", rd[i].data_size);
163
164 if ((record_xquery != 0) 163 if ((record_xquery != 0)
165 && (rd[i].record_type == record_xquery)) 164 && (rd[i].record_type == record_xquery))
166 { 165 {
167 record_match++; 166 record_match++;
168 } 167 }
169 } 168 }
169 et.abs_value = exp;
170 170
171 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 171 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
172 "Verifying signature of %d records for name %s\n", 172 "Verifying signature of %d records for name %s\n",
173 rd_count, name); 173 rd_count, name);
174 174
175 if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature (&nrb->public_key, 175 if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature (&nrb->public_key,
176 exp, 176 et,
177 name, 177 name,
178 rd_count, 178 rd_count,
179 rd, 179 rd,