WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
{
struct ZoneIterationProcResult proc;
struct GNUNET_MQ_Envelope *env;
- struct RecordResultMessage *rrm;
+ struct GNUNET_NAMESTORE_Header *em;
struct GNUNET_TIME_Absolute start;
struct GNUNET_TIME_Relative duration;
(unsigned long long) (limit - proc.limit),
(unsigned long long) limit);
/* send empty response to indicate end of list */
- env = GNUNET_MQ_msg (rrm,
- GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT);
- rrm->gns_header.r_id = htonl (zi->request_id);
+ env = GNUNET_MQ_msg (em,
+ GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT_END);
+ em->r_id = htonl (zi->request_id);
GNUNET_MQ_send (zi->nc->mq,
env);
GNUNET_CONTAINER_DLL_remove (zi->nc->op_head,
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
check_record_result (void *cls,
const struct RecordResultMessage *msg)
{
+ static struct GNUNET_CRYPTO_EcdsaPrivateKey priv_dummy;
const char *name;
size_t msg_len;
size_t name_len;
return GNUNET_SYSERR;
}
name = (const char *) &msg[1];
- if ( (name_len > 0) &&
+ if ( (0 == name_len) ||
('\0' != name[name_len -1]) )
{
GNUNET_break (0);
return GNUNET_SYSERR;
}
+ if (0 == memcmp (&msg->private_key,
+ &priv_dummy,
+ sizeof (priv_dummy)) )
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
return check_rd (rd_len,
&name[name_len],
ntohs (msg->rd_count));
handle_record_result (void *cls,
const struct RecordResultMessage *msg)
{
- static struct GNUNET_CRYPTO_EcdsaPrivateKey priv_dummy;
struct GNUNET_NAMESTORE_Handle *h = cls;
struct GNUNET_NAMESTORE_QueueEntry *qe;
struct GNUNET_NAMESTORE_ZoneIterator *ze;
force_reconnect (h);
return;
}
- if ( (0 == name_len) &&
- (0 == (memcmp (&msg->private_key,
- &priv_dummy,
- sizeof (priv_dummy)))) )
- {
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Zone iteration completed!\n");
- if (NULL == ze)
- {
- GNUNET_break (0);
- force_reconnect (h);
- return;
- }
- if (NULL != ze->finish_cb)
- ze->finish_cb (ze->finish_cb_cls);
- free_ze (ze);
- return;
- }
-
name = (const char *) &msg[1];
rd_tmp = &name[name_len];
{
}
+/**
+ * Handle an incoming message of type
+ * #GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT_END
+ *
+ * @param cls
+ * @param msg the message we received
+ */
+static void
+handle_record_result_end (void *cls,
+ const struct GNUNET_NAMESTORE_Header *msg)
+{
+ struct GNUNET_NAMESTORE_Handle *h = cls;
+ struct GNUNET_NAMESTORE_QueueEntry *qe;
+ struct GNUNET_NAMESTORE_ZoneIterator *ze;
+
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Received RECORD_RESULT_END\n");
+ ze = find_zi (h,
+ ntohl (msg->r_id));
+ qe = find_qe (h,
+ ntohl (msg->r_id));
+ if ( (NULL == ze) &&
+ (NULL == qe) )
+ return; /* rid not found */
+ if ( (NULL != ze) &&
+ (NULL != qe) )
+ {
+ GNUNET_break (0); /* rid ambigous */
+ force_reconnect (h);
+ return;
+ }
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Zone iteration completed!\n");
+ if (NULL == ze)
+ {
+ GNUNET_break (0);
+ force_reconnect (h);
+ return;
+ }
+ if (NULL != ze->finish_cb)
+ ze->finish_cb (ze->finish_cb_cls);
+ free_ze (ze);
+}
+
+
/**
* Handle an incoming message of type
* #GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE.
GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT,
struct RecordResultMessage,
h),
+ GNUNET_MQ_hd_fixed_size (record_result_end,
+ GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT_END,
+ struct GNUNET_NAMESTORE_Header,
+ h),
GNUNET_MQ_hd_var_size (lookup_result,
GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP_RESPONSE,
struct LabelLookupResponseMessage,