#include "gnunet_transport_service.h"
#define VERBOSE GNUNET_YES
+#define DEBUG_TRANSMISSION GNUNET_NO
#define START_ARM GNUNET_YES
p1.th = NULL;
GNUNET_TRANSPORT_disconnect (p2.th);
p2.th = NULL;
- ok = 0;
}
measure_task = GNUNET_SCHEDULER_NO_TASK;
fprintf(stdout,"\n");
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "FINIIISH!\n");
running = GNUNET_NO;
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
else
quota_delta = max_quota_out / 10;
- if ((throughput < max_quota_out)&& (throughput < max_quota_in))
+ if ((throughput < (max_quota_out/1024)) && (throughput < (max_quota_in/1024)))
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Throughput: %llu kb/s\n",throughput);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Max. inbound quota allowed: %llu kb/s\n",max_quota_in/1024);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Max. outbound quota allowed: %llu kb/s\n",max_quota_out/1024);
+ ok = 0;
}
+ else
+ {
+ ok = 1;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Throughput: %llu kb/s\n",throughput);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Max. inbound quota allowed: %llu kb/s\n",max_quota_in/1024);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Max. outbound quota allowed: %llu kb/s\n",max_quota_out/1024);
+
GNUNET_SCHEDULER_cancel (err_task);
GNUNET_SCHEDULER_add_now (&terminate_task, NULL);
cbuf = buf;
do
{
-#if VERBOSE
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending message %u of size %u at offset %u\n",
tr_n,
&terminate_task_error,
NULL);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Returning total message block of size %u\n",
- ret);
total_bytes += ret;
return ret;
}
pc->connect_status = 1;
if (pc == &p1)
{
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Encrypted connection established to peer `%4s'\n",
GNUNET_i2s (peer));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asking core (1) for transmission to peer `%4s'\n",
GNUNET_i2s (&p2.id));
+#endif
err_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
&terminate_task_error,
NULL);
{
struct PeerContext *pc = cls;
pc->connect_status = 0;
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer));
+#endif
}
const struct GNUNET_MessageHeader *message,
const struct GNUNET_TRANSPORT_ATS_Information *atsi)
{
-#if VERBOSE
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Core provides inbound data from `%4s'.\n", GNUNET_i2s (other));
#endif
const struct GNUNET_MessageHeader *message,
const struct GNUNET_TRANSPORT_ATS_Information *atsi)
{
-#if VERBOSE
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Core notifies about outbound data for `%4s'.\n",
GNUNET_i2s (other));
err_task = GNUNET_SCHEDULER_add_now (&terminate_task_error, NULL);
return GNUNET_SYSERR;
}
-#if VERBOSE
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Got message %u of size %u\n",
ntohl (hdr->num),
GNUNET_assert (ok == 3);
OKPP;
GNUNET_assert (cls == &p2);
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asking core (1) to connect to peer `%4s'\n",
GNUNET_i2s (&p2.id));
+#endif
GNUNET_CORE_peer_request_connect (p1.ch,
GNUNET_TIME_UNIT_SECONDS,
&p2.id,
struct PeerContext *p = cls;
GNUNET_TRANSPORT_get_hello_cancel (p->th, &process_hello, p);
+
+#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received (my) `%s' from transport service\n",
"HELLO");
+#endif
GNUNET_assert (message != NULL);
p->hello = GNUNET_malloc (ntohs (message->size));
memcpy (p->hello, message, ntohs (message->size));