GNUNET_i2s (&n->peer));
#endif
size = sizeof (struct PeerStatusNotifyMessage) +
- (n->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
n->ats_count,
0);
size = sizeof (struct PeerStatusNotifyMessage) +
- (n->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
}
psnm = (struct PeerStatusNotifyMessage*) buf;
psnm->header.size = htons (size);
n->ats_count,
0);
size = sizeof (struct PeerStatusNotifyMessage) +
- (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
}
cnm = (struct ConnectNotifyMessage*) buf;
cnm->header.size = htons (size);
if (ats_count == 0)
return;
- for (i=0;i<ats_count;i++)
+ for (i = 0; i < ats_count; i++)
{
- for (j=0;j<n->ats_count;j++)
+ for (j=0;j < n->ats_count; j++)
{
if (n->ats[j].type == ats[i].type)
{
break;
}
}
- if (j == n->ats_count)
- GNUNET_array_append (n->ats,
- n->ats_count,
- *ats);
+ if (j == n->ats_count)
+ {
+ GNUNET_array_append (n->ats,
+ n->ats_count,
+ ats[i]);
+ }
}
}
n->ats_count,
0);
size = sizeof (struct PeerStatusNotifyMessage) +
- (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
}
cnm = (struct ConnectNotifyMessage*) buf;
cnm->header.size = htons (size);
cnm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
cnm->ats_count = htonl (n->ats_count);
+ cnm->peer = n->peer;
mats = &cnm->ats;
memcpy (mats,
n->ats,
const void *m, size_t msize)
{
size_t size = msize + sizeof (struct NotifyTrafficMessage) +
- (sender->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (sender->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
char buf[size];
struct NotifyTrafficMessage *ntm;
struct GNUNET_TRANSPORT_ATS_Information *ats;
sender->ats_count,
0);
size = msize + sizeof (struct NotifyTrafficMessage) +
- (sender->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (sender->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
}
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,