return;
}
msize = ntohs (msg->size);
+#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing message of type %u and size %u from core service\n",
ntohs (msg->type), msize);
+#endif
switch (ntohs (msg->type))
{
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT:
break;
}
cnm = (const struct ConnectNotifyMessage *) msg;
+ h->connects (h->cls,
+ &cnm->peer);
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT:
if (NULL == h->disconnects)
break;
}
cnm = (const struct ConnectNotifyMessage *) msg;
+ h->disconnects (h->cls,
+ &cnm->peer);
break;
case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND:
if (msize <
}
ntm = (const struct NotifyTrafficMessage *) msg;
em = (const struct GNUNET_MessageHeader *) &ntm[1];
+#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received message of type %u from peer `%4s'\n",
ntohs (em->type), GNUNET_i2s (&ntm->peer));
+#endif
if ((GNUNET_NO == h->inbound_hdr_only) &&
(msize != ntohs (em->size) + sizeof (struct NotifyTrafficMessage)))
{
}
m = (const struct InitReplyMessage *) msg;
/* start our message processing loop */
+#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
_
("Successfully connected to core service, starting processing loop.\n"));
+#endif
h->currently_down = GNUNET_NO;
trigger_next_request (h);
GNUNET_CLIENT_receive (h->client,
{
/* mark so we don't call init on reconnect */
h->init = NULL;
+#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Successfully connected to core service.\n"));
+#endif
GNUNET_CRYPTO_hash (&m->publicKey,
sizeof (struct
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
GNUNET_CLIENT_receive (h->client,
&init_reply_handler,
h,
- GNUNET_TIME_absolute_get_remaining (h->
- startup_timeout));
+ GNUNET_TIME_absolute_get_remaining
+ (h->startup_timeout));
return sizeof (struct InitMessage) + h->hcnt * sizeof (uint16_t);
}
GNUNET_assert (h->hcnt <
(GNUNET_SERVER_MAX_MESSAGE_SIZE -
sizeof (struct InitMessage)) / sizeof (uint16_t));
+#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Trying to connect to core service in next %llu ms.\n",
timeout.value);
+#endif
h->th =
GNUNET_CLIENT_notify_transmit_ready (h->client,
sizeof (struct InitMessage) +
struct GNUNET_TIME_Relative timeout,
unsigned int bpm_out,
int amount,
- double preference,
+ unsigned long long preference,
GNUNET_CORE_PeerConfigurationInfoCallback info,
void *info_cls)
{
rcm->reserved = htonl (0);
rcm->limit_outbound_bpm = htonl (bpm_out);
rcm->reserve_inbound = htonl (amount);
- rcm->preference_change = preference;
+ rcm->preference_change = GNUNET_htonll(preference);
rcm->peer = *peer;
if (handle->pending_head == th)
trigger_next_request (handle);