aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/namestore_api_monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/namestore_api_monitor.c')
-rw-r--r--src/namestore/namestore_api_monitor.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c
index 6c441d786..b26389718 100644
--- a/src/namestore/namestore_api_monitor.c
+++ b/src/namestore/namestore_api_monitor.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -129,6 +129,8 @@ static int
129check_result (void *cls, 129check_result (void *cls,
130 const struct RecordResultMessage *lrm) 130 const struct RecordResultMessage *lrm)
131{ 131{
132 static struct GNUNET_CRYPTO_EcdsaPrivateKey zero;
133 struct GNUNET_NAMESTORE_ZoneMonitor *zm = cls;
132 size_t lrm_len; 134 size_t lrm_len;
133 size_t exp_lrm_len; 135 size_t exp_lrm_len;
134 size_t name_len; 136 size_t name_len;
@@ -138,6 +140,16 @@ check_result (void *cls,
138 const char *rd_ser_tmp; 140 const char *rd_ser_tmp;
139 141
140 (void) cls; 142 (void) cls;
143 if ( (0 != memcmp (&lrm->private_key,
144 &zm->zone,
145 sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
146 (0 != memcmp (&zero,
147 &zm->zone,
148 sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
149 {
150 GNUNET_break (0);
151 return GNUNET_SYSERR;
152 }
141 lrm_len = ntohs (lrm->gns_header.header.size); 153 lrm_len = ntohs (lrm->gns_header.header.size);
142 rd_len = ntohs (lrm->rd_len); 154 rd_len = ntohs (lrm->rd_len);
143 rd_count = ntohs (lrm->rd_count); 155 rd_count = ntohs (lrm->rd_count);
@@ -284,7 +296,6 @@ reconnect (struct GNUNET_NAMESTORE_ZoneMonitor *zm)
284} 296}
285 297
286 298
287
288/** 299/**
289 * Begin monitoring a zone for changes. If @a iterate_first is set, 300 * Begin monitoring a zone for changes. If @a iterate_first is set,
290 * we Will first call the @a monitor function on all existing records 301 * we Will first call the @a monitor function on all existing records