aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_interceptor.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/gnunet-service-gns_interceptor.c
parent0970f98adb25e2ec8076ddf61b3437b5003af0b2 (diff)
downloadgnunet-5c9791cbb128494bcaf1544c3e89195e4007207c.tar.gz
gnunet-5c9791cbb128494bcaf1544c3e89195e4007207c.zip
-towards enabling relative expiration times in namestore
Diffstat (limited to 'src/gns/gnunet-service-gns_interceptor.c')
-rw-r--r--src/gns/gnunet-service-gns_interceptor.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c
index 0e44755ed..5956e5223 100644
--- a/src/gns/gnunet-service-gns_interceptor.c
+++ b/src/gns/gnunet-service-gns_interceptor.c
@@ -40,13 +40,19 @@
40 */ 40 */
41struct InterceptLookupHandle 41struct InterceptLookupHandle
42{ 42{
43 /* the request handle to reply to */ 43 /**
44 * the request handle to reply to
45 */
44 struct GNUNET_DNS_RequestHandle *request_handle; 46 struct GNUNET_DNS_RequestHandle *request_handle;
45 47
46 /* the dns parser packet received */ 48 /**
49 * the dns parser packet received
50 */
47 struct GNUNET_DNSPARSER_Packet *packet; 51 struct GNUNET_DNSPARSER_Packet *packet;
48 52
49 /* the query parsed from the packet */ 53 /**
54 * the query parsed from the packet
55 */
50 struct GNUNET_DNSPARSER_Query *query; 56 struct GNUNET_DNSPARSER_Query *query;
51}; 57};
52 58
@@ -71,6 +77,7 @@ static struct GNUNET_CRYPTO_RsaPrivateKey *our_key;
71 */ 77 */
72static struct GNUNET_TIME_Relative default_lookup_timeout; 78static struct GNUNET_TIME_Relative default_lookup_timeout;
73 79
80
74/** 81/**
75 * Reply to dns request with the result from our lookup. 82 * Reply to dns request with the result from our lookup.
76 * 83 *
@@ -82,7 +89,7 @@ static void
82reply_to_dns(void* cls, uint32_t rd_count, 89reply_to_dns(void* cls, uint32_t rd_count,
83 const struct GNUNET_NAMESTORE_RecordData *rd) 90 const struct GNUNET_NAMESTORE_RecordData *rd)
84{ 91{
85 int i; 92 uint32_t i;
86 size_t len; 93 size_t len;
87 int ret; 94 int ret;
88 char *buf; 95 char *buf;
@@ -137,7 +144,8 @@ reply_to_dns(void* cls, uint32_t rd_count,
137 answer_records[i].data.raw.data_len = rd[i].data_size; 144 answer_records[i].data.raw.data_len = rd[i].data_size;
138 answer_records[i].data.raw.data = (char*)rd[i].data; 145 answer_records[i].data.raw.data = (char*)rd[i].data;
139 } 146 }
140 answer_records[i].expiration_time = rd[i].expiration; 147 GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION));
148 answer_records[i].expiration_time.abs_value = rd[i].expiration_time;
141 answer_records[i].class = GNUNET_DNSPARSER_CLASS_INTERNET;//hmmn 149 answer_records[i].class = GNUNET_DNSPARSER_CLASS_INTERNET;//hmmn
142 } 150 }
143 else 151 else
@@ -163,7 +171,8 @@ reply_to_dns(void* cls, uint32_t rd_count,
163 additional_records[i].data.raw.data_len = rd[i].data_size; 171 additional_records[i].data.raw.data_len = rd[i].data_size;
164 additional_records[i].data.raw.data = (char*)rd[i].data; 172 additional_records[i].data.raw.data = (char*)rd[i].data;
165 } 173 }
166 additional_records[i].expiration_time = rd[i].expiration; 174 GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION));
175 additional_records[i].expiration_time.abs_value = rd[i].expiration_time;
167 additional_records[i].class = GNUNET_DNSPARSER_CLASS_INTERNET;//hmmn 176 additional_records[i].class = GNUNET_DNSPARSER_CLASS_INTERNET;//hmmn
168 } 177 }
169 } 178 }