Urgent items (before announcing ng.gnunet.org):
* FS (basic anonymous FS only)
- test multi-peer search/download
+ + existing bandwidth-reservation code does not work with FS: don't get
+ DBLOCK size bandwidth for reply for a while => trouble for testcase
+ => need to more aggressively increase bandwidth per connection
+ => need to check that bandwidth is assigned properly to begin with
+ + Even with bandwidth-reservation code restricted, message is not
+ delivered to other core/peer/fs. Why?
+ + Same query is sent to the same peer in rather rapid succession (10x/minute?),
+ should tune code to reduce repetition...
* new webpage
- run peer => have a 0.9.x hostlist
- - improve basic documentation (configure, dependencies, what works, etc.)
- => get books to work, integrate Ji Lu's page in dev book!
=> Deploy(able) development network
struct GNUNET_TIME_Absolute *ts, unsigned int bpm)
{
struct GNUNET_TIME_Relative since;
+ unsigned long long increment;
since = GNUNET_TIME_absolute_get_duration (*ts);
+ increment = (bpm * since.value) / 60 / 1000;
if ( (force == GNUNET_NO) &&
- (since.value < 60 * 1000) )
+ (since.value < 60 * 1000) &&
+ (increment < 32 * 1024) )
return; /* not even a minute has passed */
*ts = GNUNET_TIME_absolute_get ();
- *window += (bpm * since.value) / 60 / 1000;
+ *window += increment;
if (*window > MAX_WINDOW_TIME * bpm)
*window = MAX_WINDOW_TIME * bpm;
}
const struct RequestInfoMessage *rcm;
struct Neighbour *n;
struct ConfigurationInfoMessage cim;
- int reserv;
+ int want_reserv;
+ int got_reserv;
unsigned long long old_preference;
struct GNUNET_SERVER_TransmitContext *tc;
n->bpm_out_internal_limit = ntohl (rcm->limit_outbound_bpm);
n->bpm_out = GNUNET_MAX (n->bpm_out_internal_limit,
n->bpm_out_external_limit);
- reserv = ntohl (rcm->reserve_inbound);
- if (reserv < 0)
+ want_reserv = ntohl (rcm->reserve_inbound);
+ if (want_reserv < 0)
{
- n->available_recv_window += reserv;
+ n->available_recv_window += want_reserv;
}
- else if (reserv > 0)
+ else if (want_reserv > 0)
{
update_window (GNUNET_NO,
&n->available_recv_window,
&n->last_arw_update, n->bpm_in);
- if (n->available_recv_window < reserv)
- reserv = n->available_recv_window;
- n->available_recv_window -= reserv;
+ if (n->available_recv_window < want_reserv)
+ got_reserv = n->available_recv_window;
+ else
+ got_reserv = want_reserv;
+ n->available_recv_window -= got_reserv;
}
old_preference = n->current_preference;
n->current_preference += GNUNET_ntohll(rcm->preference_change);
n->current_preference = (unsigned long long) -1;
}
update_preference_sum (n->current_preference - old_preference);
- cim.reserved_amount = htonl (reserv);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Received reservation request for %d bytes for peer `%4s', reserved %d bytes\n",
+ want_reserv,
+ GNUNET_i2s (&rcm->peer),
+ got_reserv);
+ cim.reserved_amount = htonl (got_reserv);
cim.bpm_in = htonl (n->bpm_in);
cim.bpm_out = htonl (n->bpm_out);
cim.preference = n->current_preference;
{
#if DEBUG_FS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Dropping reply, core too busy.\n");
+ "Dropping message, core too busy.\n");
#endif
return 0;
}
&transmit_to_peer,
pm);
}
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmitting %u bytes to peer %u.\n",
+ msize,
+ cp->pid);
+#endif
return msize;
}
}
if (cp->cth == NULL)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to schedule transmission with core!\n");
+#endif
/* FIXME: call stats (rare, bad case) */
}
}
if (cp == NULL)
{
/* Peer must have just left */
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Selected peer disconnected!\n");
+#endif
return;
}
no_route = GNUNET_NO;
- if (amount != DBLOCK_SIZE)
+ /* FIXME: check against DBLOCK_SIZE and possibly return
+ amount to reserve; however, this also needs to work
+ with testcases which currently start out with a far
+ too low per-peer bw limit, so they would never send
+ anything. Big issue. */
+ if (amount == 0)
{
if (pr->cp == NULL)
- return; /* this target round failed */
+ {
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to reserve bandwidth for reply (got %d/%u bytes only)!\n",
+ amount,
+ DBLOCK_SIZE);
+#endif
+ return; /* this target round failed */
+ }
/* FIXME: if we are "quite" busy, we may still want to skip
this round; need more load detection code! */
no_route = GNUNET_YES;
}
/* build message and insert message into priority queue */
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Forwarding request to `%4s'!\n",
+ GNUNET_i2s (peer));
+#endif
k = 0;
bm = 0;
if (GNUNET_YES == no_route)
&target_peer_select_cb,
&psc);
if (psc.target_score == DBL_MIN)
- return; /* nobody selected */
+ {
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "No peer selected for forwarding!\n");
+#endif
+ return; /* nobody selected */
+ }
/* (2) reserve reply bandwidth */
cp = GNUNET_CONTAINER_multihashmap_get (connected_peers,
pr->drq = NULL;
if (NULL == key)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Done processing local replies, forwarding request to other peers.\n");
+#endif
if (pr->client_request_list != NULL)
GNUNET_SERVER_receive_done (pr->client_request_list->client_list->client,
GNUNET_YES);
}
if (type == GNUNET_DATASTORE_BLOCKTYPE_ONDEMAND)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Found ONDEMAND block, performing on-demand encoding\n");
+#endif
if (GNUNET_OK !=
GNUNET_FS_handle_on_demand_block (key, size, data, type, priority,
anonymity, expiration, uid,
prq.priority = priority;
process_reply (&prq, key, pr);
- if ( (GNUNET_YES == test_load_too_high()) ||
- (pr->results_found > 5 + 2 * pr->priority) ||
- (type == GNUNET_DATASTORE_BLOCKTYPE_DBLOCK) )
+ if ( ( (pr->client_request_list == NULL) &&
+ ( (GNUNET_YES == test_load_too_high()) ||
+ (pr->results_found > 5 + 2 * pr->priority) ) ) ||
+ (type == GNUNET_DATASTORE_BLOCKTYPE_DBLOCK) )
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Unique reply found or load too high, done with request\n");
+#endif
GNUNET_FS_drq_get_next (GNUNET_NO);
return;
}
cp = cps;
if (cp == NULL)
{
- /* FIXME: try connect? */
+#if DEBUG_FS
+ if (0 != (bm & GET_MESSAGE_BIT_RETURN_TO))
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to find RETURN-TO peer `%4s' in connection set. Dropping query.\n",
+ GNUNET_i2s ((const struct GNUNET_PeerIdentity*) &opt[bits-1]));
+
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to find peer `%4s' in connection set. Dropping query.\n",
+ GNUNET_i2s (other));
+#endif
+ /* FIXME: try connect? */
return GNUNET_OK;
}
/* note that we can really only check load here since otherwise
/* existing request has higher TTL, drop new one! */
cdc.have->priority += pr->priority;
destroy_pending_request (pr);
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Have existing request with higher TTL, dropping new request.\n",
+ GNUNET_i2s (other));
+#endif
return GNUNET_OK;
}
else
crl = crl->next;
if (crl != NULL)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Have existing request, merging content-seen lists.\n");
+#endif
pr = crl->req;
/* Duplicate request (used to send long list of
known/blocked results); merge 'pr->replies_seen'