{
GNUNET_CONTAINER_DLL_remove (h->pending_head,
h->pending_tail,
- cm);
+ cm);
cm->cont (cm->cont_cls, NULL);
GNUNET_free (cm);
}
h->pending_tail,
h->pending_tail,
cm);
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Adding SEND REQUEST for peer `%s' to message queue\n",
+ GNUNET_i2s (&pr->peer));
+#endif
trigger_next_request (h, GNUNET_NO);
}
if ( (GNUNET_YES == h->currently_down) &&
(ignore_currently_down == GNUNET_NO) )
- return;
+ {
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Core connection down, not processing queue\n");
+#endif
+ return;
+ }
if (NULL != h->cth)
- return;
+ {
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Request pending, not processing queue\n");
+#endif
+ return;
+ }
if (h->pending_head != NULL)
msize = ntohs (((struct GNUNET_MessageHeader*) &h->pending_head[1])->size);
else if (h->ready_peer_head != NULL)
msize = h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage);
else
- return; /* no pending message */
+ {
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Request queue empty, not processing queue\n");
+#endif
+ return; /* no pending message */
+ }
h->cth = GNUNET_CLIENT_notify_transmit_ready (h->client,
msize,
GNUNET_TIME_UNIT_FOREVER_REL,
return NULL;
}
if (priority <= minp->priority)
- return NULL; /* priority too low */
+ {
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Dropping transmission request: priority too low\n");
+#endif
+ return NULL; /* priority too low */
+ }
GNUNET_CONTAINER_DLL_remove (pr->pending_head,
pr->pending_tail,
minp);
th);
pr->queue_size++;
/* was the request queue previously empty? */
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmission request added to queue\n");
+#endif
if (pr->pending_head == th)
request_next_transmission (pr);
return th;
GNUNET_CONTAINER_DLL_remove (pr->pending_head,
pr->pending_tail,
th);
+ pr->queue_size--;
if (th->cm != NULL)
{
/* we're currently in the control queue, remove */
ret->cont_cls = cont_cls;
cm->cont = &peer_request_connect_cont;
cm->cont_cls = ret;
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Queueing REQUEST_CONNECT request\n");
+#endif
if (h->pending_head == cm)
trigger_next_request (h, GNUNET_NO);
return ret;
rim->reserve_inbound = htonl (amount);
rim->preference_change = GNUNET_htonll(preference);
rim->peer = *peer;
+#if DEBUG_CORE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Queueing CHANGE PREFERENCE request\n");
+#endif
GNUNET_CONTAINER_DLL_insert (h->pending_head,
h->pending_tail,
cm);
pr->pcic = info;
pr->pcic_cls = info_cls;
+ if (h->pending_head == cm)
+ trigger_next_request (h, GNUNET_NO);
return irc;
}
mqe = mqe->next;
}
if (queue_size >= MAX_PEER_QUEUE_SIZE)
- return; /* queue still full */
+ {
+#if DEBUG_CORE_CLIENT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Not considering client transmission requests: queue full\n");
+#endif
+ return; /* queue still full */
+ }
/* find highest priority request */
pos = n->active_client_request_head;
car = NULL;
}
if (car == NULL)
return; /* no pending requests */
+#if DEBUG_CORE_CLIENT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Permitting client transmission request to `%s'\n",
+ GNUNET_i2s (&n->peer));
+#endif
c = car->client;
GNUNET_CONTAINER_DLL_remove (n->active_client_request_head,
n->active_client_request_tail,
/* neighbour must have disconnected since request was issued,
ignore (client will realize it once it processes the
disconnect notification) */
+#if DEBUG_CORE_CLIENT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Dropped client request for transmission (am disconnected)\n");
+#endif
GNUNET_STATISTICS_update (stats,
gettext_noop ("# send requests dropped (disconnected)"),
1,
}
if (c->requests == NULL)
c->requests = GNUNET_CONTAINER_multihashmap_create (16);
+#if DEBUG_CORE_CLIENT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received client transmission request. queueing\n");
+#endif
car = GNUNET_CONTAINER_multihashmap_get (c->requests,
&req->peer.hashPubKey);
if (car == NULL)