{
struct GNUNET_MQ_Envelope *env;
struct RecordStoreResponseMessage *rcr_msg;
-
- if (NULL == nc)
- return;
+
+ GNUNET_assert (NULL != nc);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending RECORD_STORE_RESPONSE message\n");
GNUNET_STATISTICS_update (statistics,
}
if (0 == res_count)
{
- send_store_response (nc,
- GNUNET_OK,
- rid);
+ if (NULL != nc)
+ send_store_response (nc,
+ GNUNET_OK,
+ rid);
return; /* no data, no need to update cache */
}
if (GNUNET_YES == disable_namecache)
"Namecache updates skipped (NC disabled)",
1,
GNUNET_NO);
- send_store_response (nc,
- GNUNET_OK,
- rid);
+ if (NULL != nc)
+ send_store_response (nc,
+ GNUNET_OK,
+ rid);
return;
}
exp_time = GNUNET_GNSRECORD_record_get_expiration_time (res_count,
zi->request_id = ntohl (zis_msg->gns_header.r_id);
zi->offset = 0;
zi->nc = nc;
- zi->seq = 1;
zi->zone = zis_msg->zone;
GNUNET_CONTAINER_DLL_insert (nc->op_head,
&plugin->zone_to_name),
GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label"
" FROM ns098records"
- " WHERE zone_private_key=? AND _rowid_ >= ?"
- " ORDER BY _rowid_ ASC"
+ " WHERE zone_private_key=? AND uid >= ?"
+ " ORDER BY uid ASC"
" LIMIT ?",
&plugin->iterate_zone),
GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label,zone_private_key"
" FROM ns098records"
- " WHERE _rowid_ >= ?"
- " ORDER BY _rowid_ ASC"
+ " WHERE uid >= ?"
+ " ORDER BY uid ASC"
" LIMIT ?",
&plugin->iterate_all_zones),
GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label,zone_private_key"
zk = *zone_key;
if (NULL != iter)
iter (iter_cls,
- seq + 1,
+ seq,
&zk,
label,
record_count,
struct Plugin *plugin = cls;
sqlite3_stmt *stmt;
int err;
+ uint64_t rowid = serial + 1; //SQLite starts counting at 1
if (NULL == zone)
{
struct GNUNET_SQ_QueryParam params[] = {
- GNUNET_SQ_query_param_uint64 (&serial),
+ GNUNET_SQ_query_param_uint64 (&rowid),
GNUNET_SQ_query_param_uint64 (&limit),
GNUNET_SQ_query_param_end
};
{
struct GNUNET_SQ_QueryParam params[] = {
GNUNET_SQ_query_param_auto_from_type (zone),
- GNUNET_SQ_query_param_uint64 (&serial),
+ GNUNET_SQ_query_param_uint64 (&rowid),
GNUNET_SQ_query_param_uint64 (&limit),
GNUNET_SQ_query_param_end
};