return;
if (GNUNET_OK != is_connection_allowed (pos))
return;
- if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).value > 0)
+ if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).rel_value > 0)
return;
if (GNUNET_YES == pos->is_friend)
rem = GREYLIST_AFTER_ATTEMPT_FRIEND;
pos->greylist_clean_task = GNUNET_SCHEDULER_NO_TASK;
rem = GNUNET_TIME_absolute_get_remaining (pos->greylisted_until);
- if (rem.value == 0)
+ if (rem.rel_value == 0)
{
attempt_connect (pos);
}
if (pos->hello == NULL)
return GNUNET_YES;
rst_time = GNUNET_TIME_absolute_get_remaining (pos->filter_expiration);
- if (0 == rst_time.value)
+ if (0 == rst_time.rel_value)
{
/* time to discard... */
GNUNET_CONTAINER_bloomfilter_free (pos->filter);
return;
next_want = GNUNET_HELLO_size (fah.result->hello);
delay = GNUNET_TIME_absolute_get_remaining (pl->next_hello_allowed);
- if (delay.value == 0)
+ if (delay.rel_value == 0)
{
/* now! */
pl->hello_req = GNUNET_CORE_notify_transmit_ready (handle, 0,
else
{
GNUNET_assert (GNUNET_NO == pos->is_connected);
- pos->greylisted_until.value = 0; /* remove greylisting */
+ pos->greylisted_until.abs_value = 0; /* remove greylisting */
}
pos->is_connected = GNUNET_YES;
pos->connect_attempts = 0; /* re-set back-off factor */
dt = GNUNET_HELLO_equals (peer->hello,
hello,
GNUNET_TIME_absolute_get());
- if (dt.value == GNUNET_TIME_UNIT_FOREVER_ABS.value)
+ if (dt.abs_value == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value)
return; /* nothing new here */
}
#if DEBUG_TOPOLOGY
}
if ( (! pos->is_connected) &&
(! pos->is_friend) &&
- (0 == GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).value) )
+ (0 == GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).rel_value) )
free_peer (NULL, &pos->pid.hashPubKey, pos);
}
return;
#endif
return;
}
- if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).value > 0)
+ if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).rel_value > 0)
{
#if DEBUG_TOPOLOGY
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
addresses = head->addresses;
while (addresses != NULL)
{
- if ( (addresses->timeout.value < now.value) &&
+ if ( (addresses->timeout.abs_value < now.abs_value) &&
(addresses->connected == GNUNET_YES) )
{
#if DEBUG_TRANSPORT
addresses->in_transmit,
addresses->validated,
addresses->connect_attempts,
- (unsigned long long) addresses->timeout.value,
+ (unsigned long long) addresses->timeout.abs_value,
(unsigned int) addresses->distance);
#endif
if ( ( (best_address == NULL) ||
(best_address->connected == GNUNET_NO) ) &&
(addresses->in_transmit == GNUNET_NO) &&
( (best_address == NULL) ||
- (addresses->latency.value < best_address->latency.value)) )
+ (addresses->latency.rel_value < best_address->latency.rel_value)) )
best_address = addresses;
/* FIXME: also give lower-latency addresses that are not
connected a chance some times... */
best_address->addr,
best_address->addrlen)
: "<inbound>",
- best_address->latency.value);
+ best_address->latency.abs_value);
#endif
}
else
1,
GNUNET_NO);
timeout = GNUNET_TIME_absolute_get_remaining (mq->timeout);
- if (timeout.value == 0)
+ if (timeout.rel_value == 0)
{
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"No validated destination address available to transmit message of size %u to peer `%4s', will wait %llums to find an address.\n",
mq->message_buf_size,
GNUNET_i2s (&mq->neighbour_id),
- timeout.value);
+ timeout.abs_value);
#endif
/* FIXME: might want to trigger peerinfo lookup here
(unless that's already pending...) */
plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK;
now = GNUNET_TIME_absolute_get ();
min_remaining = GNUNET_TIME_UNIT_FOREVER_REL;
- expired = (GNUNET_TIME_absolute_get_duration (last_update).value > (HELLO_ADDRESS_EXPIRATION.value / 4));
+ expired = (GNUNET_TIME_absolute_get_duration (last_update).rel_value > (HELLO_ADDRESS_EXPIRATION.rel_value / 4));
prev = NULL;
pos = plugin->addresses;
while (pos != NULL)
{
next = pos->next;
- if (pos->expires.value < now.value)
+ if (pos->expires.abs_value < now.abs_value)
{
expired = GNUNET_YES;
if (prev == NULL)
else
{
remaining = GNUNET_TIME_absolute_get_remaining (pos->expires);
- if (remaining.value < min_remaining.value)
+ if (remaining.rel_value < min_remaining.rel_value)
min_remaining = remaining;
prev = pos;
}
{
if ((addrlen == al->addrlen) && (0 == memcmp (addr, &al[1], addrlen)))
{
- if (al->expires.value < abex.value)
+ if (al->expires.abs_value < abex.abs_value)
al->expires = abex;
return;
}
a2s (tname, addr, addrlen),
tname,
GNUNET_i2s (&n->id),
- expiration.value);
+ expiration.abs_value);
#endif
fal = add_peer_address (n, tname, NULL, addr, addrlen);
if (fal == NULL)
if (fal->revalidate_task != GNUNET_SCHEDULER_NO_TASK)
return;
delay = GNUNET_TIME_absolute_get_remaining (fal->expires);
- delay.value /= 2; /* do before expiration */
+ delay.rel_value /= 2; /* do before expiration */
delay = GNUNET_TIME_relative_min (delay,
LATENCY_EVALUATION_MAX_DELAY);
if (GNUNET_YES != fal->estimated)
delay = GNUNET_TIME_relative_max (delay,
GNUNET_TIME_UNIT_SECONDS);
/* randomize a bit (to avoid doing all at the same time) */
- delay.value += GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000);
+ delay.rel_value += GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000);
fal->revalidate_task = GNUNET_SCHEDULER_add_delayed(sched,
delay,
&send_periodic_ping,
GNUNET_break_op (0);
return GNUNET_NO;
}
- if (GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh (pong->expiration)).value == 0)
+ if (GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh (pong->expiration)).rel_value == 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received expired signature. Check system time.\n"));
GNUNET_NO);
fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time);
schedule_next_ping (fal);
- if (n->latency.value == GNUNET_TIME_UNIT_FOREVER_REL.value)
+ if (n->latency.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
n->latency = fal->latency;
else
- n->latency.value = (fal->latency.value + n->latency.value) / 2;
+ n->latency.rel_value = (fal->latency.rel_value + n->latency.rel_value) / 2;
n->distance = fal->distance;
if (GNUNET_NO == n->received_pong)
{
if (GNUNET_HELLO_equals (hello,
chvc->hello,
- GNUNET_TIME_absolute_get ()).value > 0)
+ GNUNET_TIME_absolute_get ()).abs_value > 0)
{
#if DEBUG_TRANSPORT_HELLO > 2
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
memcpy (&((char*)&pong[1])[slen],
sender_address,
sender_address_len);
- if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires).value < PONG_SIGNATURE_LIFETIME.value / 4)
+ if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires).rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4)
{
/* create / update cached sig */
#if DEBUG_TRANSPORT
memcpy (&pong[1], plugin->short_name, slen);
memcpy (&((char*)&pong[1])[slen], addr, alen);
if ( (oal != NULL) &&
- (GNUNET_TIME_absolute_get_remaining (oal->pong_sig_expires).value < PONG_SIGNATURE_LIFETIME.value / 4) )
+ (GNUNET_TIME_absolute_get_remaining (oal->pong_sig_expires).rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4) )
{
/* create / update cached sig */
#if DEBUG_TRANSPORT
}
}
ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 0);
- if (ret.value > 0)
+ if (ret.rel_value > 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Throttling read (%llu bytes excess at %u b/s), waiting %llums before reading more.\n",
(unsigned long long) n->in_tracker.consumption_since_last_update__,
(unsigned int) n->in_tracker.available_bytes_per_s__,
- (unsigned long long) ret.value);
+ (unsigned long long) ret.rel_value);
GNUNET_STATISTICS_update (stats,
gettext_noop ("# ms throttling suggested"),
- (int64_t) ret.value,
+ (int64_t) ret.rel_value,
GNUNET_NO);
}
return ret;
if (pc->reset_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (pc->plugin->env->sched, pc->reset_task);
- if (delay.value > 0)
+ if (delay.rel_value > 0)
{
#if DEBUG_HTTP
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.rel_value);
#endif
pc->reset_task = GNUNET_SCHEDULER_add_delayed (pc->plugin->env->sched, delay, &reset_inbound_quota_delay, pc);
}
/* Recieving data */
if ((*upload_data_size > 0) && (ps->recv_active == GNUNET_YES))
{
- if (pc->delay.value == 0)
+ if (pc->delay.rel_value == 0)
{
#if DEBUG_HTTP
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: PUT with %u bytes forwarded to MST\n", ps, *upload_data_size);
else
{
#if DEBUG_HTTP
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.rel_value);
#endif
}
return MHD_YES;
&max));
haveto = MHD_get_timeout (daemon_handle, &timeout);
if (haveto == MHD_YES)
- tv.value = (uint64_t) timeout;
+ tv.rel_value = (uint64_t) timeout;
else
tv = GNUNET_TIME_UNIT_SECONDS;
GNUNET_NETWORK_fdset_copy_native (wrs, &rs, max + 1);
if (pc->reset_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (pc->plugin->env->sched, pc->reset_task);
- if (delay.value > 0)
+ if (delay.rel_value > 0)
{
#if DEBUG_HTTP
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.abs_value);
#endif
pc->reset_task = GNUNET_SCHEDULER_add_delayed (pc->plugin->env->sched, delay, &reset_inbound_quota_delay, pc);
}
{
struct Session * ps = ptr;
- if (ps->peercontext->delay.value > 0)
+ if (ps->peercontext->delay.rel_value > 0)
{
#if DEBUG_HTTP
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.rel_value);
#endif
return (0);
}
curl_easy_setopt(ps->recv_endpoint, CURLOPT_READDATA, ps);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_WRITEFUNCTION, curl_receive_cb);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_WRITEDATA, ps);
- curl_easy_setopt(ps->recv_endpoint, CURLOPT_TIMEOUT, (long) timeout.value);
+ curl_easy_setopt(ps->recv_endpoint, CURLOPT_TIMEOUT, (long) timeout.rel_value);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_PRIVATE, ps);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_CONNECTTIMEOUT, HTTP_CONNECT_TIMEOUT);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_BUFFERSIZE, 2*GNUNET_SERVER_MAX_MESSAGE_SIZE);
curl_easy_setopt(ps->send_endpoint, CURLOPT_READDATA, ps);
curl_easy_setopt(ps->send_endpoint, CURLOPT_WRITEFUNCTION, curl_receive_cb);
curl_easy_setopt(ps->send_endpoint, CURLOPT_READDATA, ps);
- curl_easy_setopt(ps->send_endpoint, CURLOPT_TIMEOUT, (long) timeout.value);
+ curl_easy_setopt(ps->send_endpoint, CURLOPT_TIMEOUT, (long) timeout.rel_value);
curl_easy_setopt(ps->send_endpoint, CURLOPT_PRIVATE, ps);
curl_easy_setopt(ps->send_endpoint, CURLOPT_CONNECTTIMEOUT, HTTP_CONNECT_TIMEOUT);
curl_easy_setopt(ps->send_endpoint, CURLOPT_BUFFERSIZE, 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE);
GNUNET_assert ((port > 0) && (port <= 65535));
plugin->port_inbound = port;
gn_timeout = GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT;
- unsigned int timeout = (gn_timeout.value) / 1000;
+ unsigned int timeout = (gn_timeout.rel_value) / 1000;
if ((plugin->http_server_daemon_v6 == NULL) && (plugin->use_ipv6 == GNUNET_YES) && (port != 0))
{
struct sockaddr * tmp = (struct sockaddr *) plugin->bind6_address;
ret = 0;
now = GNUNET_TIME_absolute_get ();
while ( (NULL != (pos = session->pending_messages_head)) &&
- (pos->timeout.value <= now.value) )
+ (pos->timeout.abs_value <= now.abs_value) )
{
GNUNET_CONTAINER_DLL_remove (session->pending_messages_head,
session->pending_messages_tail,
if ( (s1->expecting_welcome == GNUNET_YES) &&
(s2->expecting_welcome == GNUNET_NO) )
return s2;
- if (s1->last_activity.value < s2->last_activity.value)
+ if (s1->last_activity.abs_value < s2->last_activity.abs_value)
return s2;
- if (s1->last_activity.value > s2->last_activity.value)
+ if (s1->last_activity.abs_value > s2->last_activity.abs_value)
return s1;
if ( (GNUNET_YES == s1->inbound) &&
(GNUNET_NO == s2->inbound) )
NULL, 0,
session,
NULL, 0);
- if (delay.value == 0)
+ if (delay.rel_value == 0)
GNUNET_SERVER_receive_done (session->client, GNUNET_OK);
else
session->receive_delay_task =
session,
(GNUNET_YES == session->inbound) ? NULL : session->connect_addr,
(GNUNET_YES == session->inbound) ? 0 : session->connect_alen);
- if (delay.value == 0)
+ if (delay.rel_value == 0)
GNUNET_SERVER_receive_done (client, GNUNET_OK);
else
session->receive_delay_task =
struct GNUNET_TIME_Relative timeout;
struct Sessionqueue * nextsession = NULL;
- timeout.value = FRAGMENT_TIMEOUT;
+ timeout.rel_value = FRAGMENT_TIMEOUT;
nextsend = GNUNET_TIME_absolute_get_forever();
queue = plugin->pending_Sessions;
//save next session
nextsession = queue->next;
// test if message timed out
- while (GNUNET_TIME_absolute_get_remaining(pm->timeout).value == 0){
+ while (GNUNET_TIME_absolute_get_remaining(pm->timeout).rel_value == 0){
//remove message
//free the acks
free_acks (pm);
nextsession = NULL;
// test if retransmit is needed
- if (GNUNET_TIME_absolute_get_duration(pm->last_ack).value < FRAGMENT_TIMEOUT) {
+ if (GNUNET_TIME_absolute_get_duration(pm->last_ack).rel_value < FRAGMENT_TIMEOUT) {
// get last offset for this message
copyoffset = pm->message_size /(WLAN_MTU - sizeof(struct FragmentationHeader));
// one more is the end
if (pm->message_size > WLAN_MTU) {
size += sizeof(struct FragmentationHeader);
// check for retransmission
- if (GNUNET_TIME_absolute_get_duration(pm->last_ack).value > FRAGMENT_TIMEOUT) {
+ if (GNUNET_TIME_absolute_get_duration(pm->last_ack).rel_value > FRAGMENT_TIMEOUT) {
// TODO retransmit
// be positive and try again later :-D
pm->last_ack = GNUNET_TIME_absolute_get();
*/
#define TOTAL_MSGS (10000 * 2)
-#define MEASUREMENT_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
-#define MEASUREMENT_MSG_SIZE 1024
+#define MEASUREMENT_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
+#define MEASUREMENT_MSG_SIZE 10000
#define MEASUREMENT_MSG_SIZE_BIG 32768
-#define MEASUREMENT_MAX_QUOTA 1024*1024*1024
-#define MEASUREMENT_MIN_QUOTA 1024
-
+#define MEASUREMENT_MAX_QUOTA 50000
+/*#define MEASUREMENT_MAX_QUOTA 1000000*/
+#define MEASUREMENT_MIN_QUOTA 1000
+#define SEND_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
/**
* Testcase timeout
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 200)
+
#define MTYPE 11111
struct PeerContext
#endif
};
+/**
+ * Handle for a transmission-ready request.
+ */
+struct GNUNET_TRANSPORT_TransmitHandle
+{
+
+ /**
+ * Neighbour for this handle, NULL for control-traffic.
+ */
+ struct NeighbourList *neighbour;
+
+ /**
+ * Function to call when notify_size bytes are available
+ * for transmission.
+ */
+ GNUNET_CONNECTION_TransmitReadyNotify notify;
+
+ /**
+ * Closure for notify.
+ */
+ void *notify_cls;
+
+ /**
+ * transmit_ready task Id. The task is used to introduce the
+ * artificial delay that may be required to maintain the bandwidth
+ * limits. Later, this will be the ID of the "transmit_timeout"
+ * task which is used to signal a timeout if the transmission could
+ * not be done in a timely fashion.
+ */
+ GNUNET_SCHEDULER_TaskIdentifier notify_delay_task;
+
+ /**
+ * Timeout for this request.
+ */
+ struct GNUNET_TIME_Absolute timeout;
+
+ /**
+ * How many bytes is our notify callback waiting for?
+ */
+ size_t notify_size;
+
+ /**
+ * How important is this message?
+ */
+ unsigned int priority;
+
+};
+
static struct PeerContext p1;
static struct PeerContext p2;
};
static unsigned int
-get_size_new (unsigned int iter)
+get_size (unsigned int iter)
{
return MEASUREMENT_MSG_SIZE + sizeof (struct TestMessage);
}
const struct TestMessage *hdr;
hdr = (const struct TestMessage*) message;
- s = get_size_new (n);
+ s = get_size (n);
if (MTYPE != ntohs (message->type))
return;
#if DEBUG_MEASUREMENT
return 0;
ret = 0;
- s = get_size_new (n);
+ s = get_size (n);
GNUNET_assert (size >= s);
GNUNET_assert (buf != NULL);
cbuf = buf;
}
#endif
n++;
- s = get_size_new (n);
+ s = get_size (n);
if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
break; /* sometimes pack buffer full, sometimes not */
}
while (size - ret >= s);
transmit_handle = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
&p1.id,
- s, 0, TIMEOUT,
+ s, 0, SEND_TIMEOUT,
¬ify_ready_new,
NULL);
total_bytes += s;
GNUNET_TRANSPORT_notify_transmit_ready_cancel(transmit_handle);
transmit_handle = NULL;
}
- if (current_quota_p1 < total_bytes/(duration.value / 1000))
+ if ((total_bytes/(duration.rel_value / 1000)) > (current_quota_p1 + (current_quota_p1 / 10)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"\nQuota compliance failed: \n"\
- "Quota allowed: %10llu kb/s\n"\
- "Throughput : %10llu kb/s\n", (current_quota_p1 / (1024)) , (total_bytes/(duration.value / 1000)/1024));
+ "Quota allowed: %10llu kB/s\n"\
+ "Throughput : %10llu kB/s\n", (current_quota_p1 / (1024)) , (total_bytes/(duration.rel_value / 1000)/1024));
ok = 1;
- end();
+ //end();
return;
}
else
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"\nQuota compliance ok: \n"\
- "Quota allowed: %10llu kb/s\n"\
- "Throughput : %10llu kb/s\n", (current_quota_p1 / (1024)) , (total_bytes/(duration.value / 1000)/1024));
+ "Quota allowed: %10llu kB/s\n"\
+ "Throughput : %10llu kB/s\n", (current_quota_p1 / (1024)) , (total_bytes/(duration.rel_value / 1000)/1024));
ok = 0;
}
- if (current_quota_p1 < (MEASUREMENT_MIN_QUOTA))
+ if (current_quota_p1 < MEASUREMENT_MIN_QUOTA)
end();
else
- measure (current_quota_p1/100, current_quota_p2/100);
+
+ measure (current_quota_p1- 1000, current_quota_p2- 1000);
}
static void measure (unsigned long long quota_p1, unsigned long long quota_p2 )
current_quota_p2 = quota_p2;
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Starting transport level measurement: Duration: %u Quota: %u\n", MEASUREMENT_INTERVALL, current_quota_p1);
+ "Starting transport level measurement: Duration: %u Quota: %llu\n", MEASUREMENT_INTERVALL, current_quota_p1);
#endif
GNUNET_TRANSPORT_set_quota (p1.th,
&p2.id,
transmit_handle = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
&p1.id,
- get_size_new (0), 0, TIMEOUT,
+ get_size (0), 0, SEND_TIMEOUT,
¬ify_ready_new,
NULL);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Transports disconnected, returning success!\n");
#endif
- delta = GNUNET_TIME_absolute_get_duration (start_time).value;
+ delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
fprintf (stderr,
"\nThroughput was %llu kb/s\n",
total_bytes * 1000 / 1024 / delta);
duration = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker,
th->notify_size - sizeof (struct OutboundMessage));
struct GNUNET_TIME_Absolute duration_abs = GNUNET_TIME_relative_to_absolute (duration);
- if (th->timeout.value < duration_abs.value)
+ if (th->timeout.abs_value < duration_abs.abs_value)
{
/* signal timeout! */
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Would need %llu ms before bandwidth is available for delivery to `%4s', that is too long. Signaling timeout.\n",
- duration.value,
+ duration.abs_value,
GNUNET_i2s (&n->id));
#endif
if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
continue;
}
- if (duration.value > 0)
+ if (duration.rel_value > 0)
{
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
(unsigned int) n->out_tracker.available_bytes_per_s__,
(unsigned int) th->notify_size - sizeof (struct OutboundMessage),
GNUNET_i2s (&n->id),
- duration.value);
+ duration.abs_value);
#endif
retry_time = GNUNET_TIME_relative_min (retry_time,
duration);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Message of %u bytes with timeout %llums constructed for `%4s'\n",
(unsigned int) mret,
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (th->timeout).value,
+ (unsigned long long) GNUNET_TIME_absolute_get_remaining (th->timeout).abs_value,
GNUNET_i2s (&n->id));
#endif
if (mret != 0)
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Control transmit of %u bytes within %llums requested\n",
- size, (unsigned long long) timeout.value);
+ size, (unsigned long long) timeout.abs_value);
#endif
th = GNUNET_malloc (sizeof (struct ControlMessage));
th->h = h;
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Scheduling task to reconnect to transport service in %llu ms.\n",
- h->reconnect_delay.value);
+ h->reconnect_delay.abs_value);
#endif
GNUNET_assert (h->client == NULL);
GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
h->reconnect_task
= GNUNET_SCHEDULER_add_delayed (h->sched,
h->reconnect_delay, &reconnect, h);
- if (h->reconnect_delay.value == 0)
+ if (h->reconnect_delay.rel_value == 0)
{
h->reconnect_delay = GNUNET_TIME_UNIT_MILLISECONDS;
}
GNUNET_break (0);
return NULL;
}
-
+#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asking transport service for transmission of %u bytes to peer `%4s' within %llu ms.\n",
size, GNUNET_i2s (target),
- (unsigned long long) timeout.value);
-
+ (unsigned long long) timeout.abs_value);
+#endif
n = neighbour_find (handle, target);
if (n == NULL)
{