uint16_t et;
uint32_t ats_count;
- if (msg == NULL)
+ if (NULL == msg)
{
LOG (GNUNET_ERROR_TYPE_INFO,
_
}
/* fake 'connect to self' */
pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &h->me.hashPubKey);
- GNUNET_assert (pr == NULL);
+ GNUNET_assert (NULL == pr);
pr = GNUNET_malloc (sizeof (struct PeerRecord));
pr->peer = h->me;
pr->ch = h;
return;
}
pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &cnm->peer.hashPubKey);
- if (pr != NULL)
+ if (NULL != pr)
{
GNUNET_break (0);
reconnect_later (h);
"Received notification about disconnect from `%s'.\n",
GNUNET_i2s (&dnm->peer));
pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &dnm->peer.hashPubKey);
- if (pr == NULL)
+ if (NULL == pr)
{
GNUNET_break (0);
reconnect_later (h);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received message of type %u and size %u from peer `%4s'\n",
ntohs (em->type), ntohs (em->size), GNUNET_i2s (&ntm->peer));
- pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &ntm->peer.hashPubKey);
- if (pr == NULL)
- {
- GNUNET_break (0);
- reconnect_later (h);
- return;
- }
if ((GNUNET_NO == h->inbound_hdr_only) &&
(msize !=
ntohs (em->size) + sizeof (struct NotifyTrafficMessage) +
GNUNET_break_op (0);
continue;
}
+ pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &ntm->peer.hashPubKey);
+ if (NULL == pr)
+ {
+ GNUNET_break (0);
+ reconnect_later (h);
+ return;
+ }
if (GNUNET_OK !=
h->handlers[hpos].callback (h->cls, &ntm->peer, em, &ntm->ats,
ats_count))
return;
}
em = (const struct GNUNET_MessageHeader *) &(&ntm->ats)[ats_count + 1];
- pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &ntm->peer.hashPubKey);
- if (pr == NULL)
- {
- GNUNET_break (0);
- reconnect_later (h);
- return;
- }
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received notification about transmission to `%s'.\n",
GNUNET_i2s (&ntm->peer));
}
smr = (const struct SendMessageReady *) msg;
pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &smr->peer.hashPubKey);
- if (pr == NULL)
+ if (NULL == pr)
{
GNUNET_break (0);
reconnect_later (h);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received notification about transmission readiness to `%s'.\n",
GNUNET_i2s (&smr->peer));
- if (pr->pending_head == NULL)
+ if (NULL == pr->pending_head)
{
/* request must have been cancelled between the original request
* and the response from core, ignore core's readiness */
* ignore! (we should have already sent another request) */
break;
}
- if ((pr->prev != NULL) || (pr->next != NULL) || (h->ready_peer_head == pr))
+ if ((NULL != pr->prev) || (NULL != pr->next) || (h->ready_peer_head == pr))
{
/* we should not already be on the ready list... */
GNUNET_break (0);
{
struct GNUNET_CORE_Handle *h = cls;
- if (success == GNUNET_SYSERR)
+ if (GNUNET_SYSERR == success)
return; /* shutdown */
- if (success == GNUNET_NO)
+ if (GNUNET_NO == success)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Failed to exchange INIT with core, retrying\n");
uint16_t *ts;
unsigned int hpos;
- GNUNET_assert (h->client == NULL);
+ GNUNET_assert (NULL == h->client);
GNUNET_assert (h->currently_down == GNUNET_YES);
h->client = GNUNET_CLIENT_connect ("core", h->cfg);
- if (h->client == NULL)
+ if (NULL == h->client)
{
reconnect_later (h);
return;
uint32_t options, uint16_t type)
{
struct GSC_Client *c;
+ int tm;
for (c = client_head; c != NULL; c = c->next)
{
+ tm = type_match (type, c);
if (! ( (0 != (c->options & options)) ||
( (0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) &&
- (GNUNET_YES == type_match (type, c)) ) ) )
+ (GNUNET_YES == tm) ) ) )
continue; /* neither options nor type match permit the message */
if ( (0 != (options & GNUNET_CORE_OPTION_SEND_HDR_INBOUND)) &&
( (0 != (c->options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) ||
- (GNUNET_YES == type_match (type, c)) ) )
+ (GNUNET_YES == tm) ) )
continue;
if ( (0 != (options & GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND)) &&
(0 != (c->options & GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND)) )
options,
ntohs (msg->size),
(unsigned int) type);
- GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_contains (c->connectmap,
- &partner->hashPubKey));
+ GNUNET_assert ( (0 == (c->options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) ||
+ (GNUNET_YES != tm) ||
+ (GNUNET_YES ==
+ GNUNET_CONTAINER_multihashmap_contains (c->connectmap,
+ &partner->hashPubKey)) );
send_to_client (c, msg, can_drop);
}
}