GNUNET_CONTAINER_multihashmap_remove (h->peers, key, pr));
GNUNET_assert (pr->pending_head == NULL);
GNUNET_assert (pr->pending_tail == NULL);
- GNUNET_assert (pr->ch = h);
+ GNUNET_assert (pr->ch == h);
GNUNET_assert (pr->queue_size == 0);
GNUNET_assert (pr->timeout_task == GNUNET_SCHEDULER_NO_TASK);
GNUNET_assert (pr->ntr_task == GNUNET_SCHEDULER_NO_TASK);
const struct GNUNET_MessageHeader *em;
const struct SendMessageReady *smr;
const struct GNUNET_CORE_MessageHandler *mh;
- const struct GNUNET_ATS_Information* ats;
+ const struct GNUNET_ATS_Information *ats;
GNUNET_CORE_StartupCallback init;
struct PeerRecord *pr;
struct GNUNET_CORE_TransmitHandle *th;
cnm = (const struct ConnectNotifyMessage *) msg;
ats_count = ntohl (cnm->ats_count);
if (msize !=
- sizeof (struct ConnectNotifyMessage) +
- ats_count * sizeof (struct GNUNET_ATS_Information))
+ sizeof (struct ConnectNotifyMessage) +
+ ats_count * sizeof (struct GNUNET_ATS_Information))
{
GNUNET_break (0);
reconnect_later (h);
GNUNET_CONTAINER_multihashmap_put (h->peers,
&cnm->peer.hashPubKey, pr,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
- ats = (const struct GNUNET_ATS_Information*) &cnm[1];
+ ats = (const struct GNUNET_ATS_Information *) &cnm[1];
if (NULL != h->connects)
- h->connects (h->cls, &cnm->peer,
- ats,
- ats_count);
+ h->connects (h->cls, &cnm->peer, ats, ats_count);
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT:
if (msize != sizeof (struct DisconnectNotifyMessage))
sizeof (struct NotifyTrafficMessage) +
ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct GNUNET_MessageHeader)) ||
- (GNUNET_ATS_ARRAY_TERMINATOR !=
- ntohl ((&ntm->ats)[ats_count].type)))
+ (GNUNET_ATS_ARRAY_TERMINATOR != ntohl ((&ntm->ats)[ats_count].type)))
{
GNUNET_break (0);
reconnect_later (h);
continue;
if ((mh->expected_size != ntohs (em->size)) && (mh->expected_size != 0))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected message size for message of type %u\n",
- mh->type);
- GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unexpected message size %u for message of type %u from peer `%4s'\n",
+ htons (em->size), mh->type, GNUNET_i2s (&ntm->peer));
+ GNUNET_break_op (0);
continue;
}
if (GNUNET_OK !=
h->handlers[hpos].callback (h->cls, &ntm->peer, em, &ntm->ats,
- ats_count))
+ ats_count))
{
/* error in processing, do not process other messages! */
break;
}
}
if (NULL != h->inbound_notify)
- h->inbound_notify (h->cls, &ntm->peer, em, &ntm->ats,
- ats_count);
+ h->inbound_notify (h->cls, &ntm->peer, em, &ntm->ats, ats_count);
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND:
if (msize < sizeof (struct NotifyTrafficMessage))
sizeof (struct NotifyTrafficMessage) +
ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct GNUNET_MessageHeader)) ||
- (GNUNET_ATS_ARRAY_TERMINATOR !=
- ntohl ((&ntm->ats)[ats_count].type)))
+ (GNUNET_ATS_ARRAY_TERMINATOR != ntohl ((&ntm->ats)[ats_count].type)))
{
GNUNET_break (0);
reconnect_later (h);
GNUNET_free (minp);
}
- /* Order entries by deadline, but SKIP 'HEAD' if
- * we're in the 'ready_peer_*' DLL */
+ /* Order entries by deadline, but SKIP 'HEAD' (as we may have transmitted
+ * that request already or might even already be approved to transmit that
+ * message to core) */
pos = pr->pending_head;
- if ((pr->prev != NULL) || (pr->next != NULL) ||
- (pr == handle->ready_peer_head))
- {
- GNUNET_assert (pos != NULL);
+ if (pos != NULL)
pos = pos->next; /* skip head */
- }
/* insertion sort */
prev = pos;