diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-31 11:25:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-31 11:25:31 +0000 |
commit | 281d5b7680f9b1d2adce9f69c75b38f1b1e7f177 (patch) | |
tree | 945cb90c4bb628018d3ae9e5a62a795c38b75d32 /src/transport | |
parent | 746774c9bb1df3cc5d0e731afbad8904ebb39133 (diff) | |
download | gnunet-281d5b7680f9b1d2adce9f69c75b38f1b1e7f177.tar.gz gnunet-281d5b7680f9b1d2adce9f69c75b38f1b1e7f177.zip |
fixes
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 105 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 2 | ||||
-rw-r--r-- | src/transport/test_transport_api_reliability.c | 49 | ||||
-rw-r--r-- | src/transport/test_transport_api_tcp_peer1.conf | 5 | ||||
-rw-r--r-- | src/transport/test_transport_api_tcp_peer2.conf | 5 | ||||
-rw-r--r-- | src/transport/transport.h | 6 | ||||
-rw-r--r-- | src/transport/transport_api.c | 2 |
7 files changed, 123 insertions, 51 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 44d2ff726..7d3691696 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -58,9 +58,12 @@ | |||
58 | * messages, so the number should be chosen rather generously. | 58 | * messages, so the number should be chosen rather generously. |
59 | * | 59 | * |
60 | * The expectation here is that most of the time the queue is large | 60 | * The expectation here is that most of the time the queue is large |
61 | * enough so that a drop is virtually never required. | 61 | * enough so that a drop is virtually never required. Note that |
62 | * this value must be about as large as 'TOTAL_MSGS' in the | ||
63 | * 'test_transport_api_reliability.c', otherwise that testcase may | ||
64 | * fail. | ||
62 | */ | 65 | */ |
63 | #define MAX_PENDING 128 | 66 | #define MAX_PENDING (128 * 1024) |
64 | 67 | ||
65 | /** | 68 | /** |
66 | * Size of the per-transport blacklist hash maps. | 69 | * Size of the per-transport blacklist hash maps. |
@@ -1225,6 +1228,32 @@ transmit_to_client_callback (void *cls, size_t size, void *buf) | |||
1225 | 1228 | ||
1226 | 1229 | ||
1227 | /** | 1230 | /** |
1231 | * Convert an address to a string. | ||
1232 | * | ||
1233 | * @param plugin name of the plugin responsible for the address | ||
1234 | * @param addr binary address | ||
1235 | * @param addr_len number of bytes in addr | ||
1236 | * @return NULL on error, otherwise address string | ||
1237 | */ | ||
1238 | static const char* | ||
1239 | a2s (const char *plugin, | ||
1240 | const void *addr, | ||
1241 | uint16_t addr_len) | ||
1242 | { | ||
1243 | struct TransportPlugin *p; | ||
1244 | |||
1245 | if (plugin == NULL) | ||
1246 | return NULL; | ||
1247 | p = find_transport (plugin); | ||
1248 | if (p == NULL) | ||
1249 | return NULL; | ||
1250 | return p->api->address_to_string (p->api->cls, | ||
1251 | addr, | ||
1252 | addr_len); | ||
1253 | } | ||
1254 | |||
1255 | |||
1256 | /** | ||
1228 | * Mark the given FAL entry as 'connected' (and hence preferred for | 1257 | * Mark the given FAL entry as 'connected' (and hence preferred for |
1229 | * sending); also mark all others for the same peer as 'not connected' | 1258 | * sending); also mark all others for the same peer as 'not connected' |
1230 | * (since only one can be preferred). | 1259 | * (since only one can be preferred). |
@@ -1246,9 +1275,20 @@ mark_address_connected (struct ForeignAddressList *fal) | |||
1246 | { | 1275 | { |
1247 | if (GNUNET_YES == pos->connected) | 1276 | if (GNUNET_YES == pos->connected) |
1248 | { | 1277 | { |
1278 | #if DEBUG_TRANSPORT | ||
1279 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1280 | "Marking address `%s' as no longer connected (due to connect on other address)\n", | ||
1281 | a2s (pos->ready_list->plugin->short_name, | ||
1282 | pos->addr, | ||
1283 | pos->addrlen)); | ||
1284 | #endif | ||
1249 | GNUNET_break (cnt == GNUNET_YES); | 1285 | GNUNET_break (cnt == GNUNET_YES); |
1250 | cnt = GNUNET_NO; | 1286 | cnt = GNUNET_NO; |
1251 | pos->connected = GNUNET_NO; | 1287 | pos->connected = GNUNET_NO; |
1288 | GNUNET_STATISTICS_update (stats, | ||
1289 | gettext_noop ("# connected addresses"), | ||
1290 | -1, | ||
1291 | GNUNET_NO); | ||
1252 | } | 1292 | } |
1253 | pos = pos->next; | 1293 | pos = pos->next; |
1254 | } | 1294 | } |
@@ -1284,9 +1324,15 @@ transmit_to_client (struct TransportClient *client, | |||
1284 | { | 1324 | { |
1285 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1325 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1286 | _ | 1326 | _ |
1287 | ("Dropping message, have %u messages pending (%u is the soft limit)\n"), | 1327 | ("Dropping message of type %u and size %u, have %u messages pending (%u is the soft limit)\n"), |
1288 | client->message_count, MAX_PENDING); | 1328 | ntohs (msg->type), |
1289 | /* TODO: call to statistics... */ | 1329 | ntohs (msg->size), |
1330 | client->message_count, | ||
1331 | MAX_PENDING); | ||
1332 | GNUNET_STATISTICS_update (stats, | ||
1333 | gettext_noop ("# messages dropped due to slow client"), | ||
1334 | 1, | ||
1335 | GNUNET_NO); | ||
1290 | return; | 1336 | return; |
1291 | } | 1337 | } |
1292 | msize = ntohs (msg->size); | 1338 | msize = ntohs (msg->size); |
@@ -1390,6 +1436,13 @@ transmit_send_continuation (void *cls, | |||
1390 | { | 1436 | { |
1391 | if (mq->specific_address->connected != GNUNET_NO) | 1437 | if (mq->specific_address->connected != GNUNET_NO) |
1392 | { | 1438 | { |
1439 | #if DEBUG_TRANSPORT | ||
1440 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1441 | "Marking address `%s' as no longer connected (due to transmission problem)\n", | ||
1442 | a2s (mq->specific_address->ready_list->plugin->short_name, | ||
1443 | mq->specific_address->addr, | ||
1444 | mq->specific_address->addrlen)); | ||
1445 | #endif | ||
1393 | GNUNET_STATISTICS_update (stats, | 1446 | GNUNET_STATISTICS_update (stats, |
1394 | gettext_noop ("# connected addresses"), | 1447 | gettext_noop ("# connected addresses"), |
1395 | -1, | 1448 | -1, |
@@ -1408,32 +1461,6 @@ transmit_send_continuation (void *cls, | |||
1408 | 1461 | ||
1409 | 1462 | ||
1410 | /** | 1463 | /** |
1411 | * Convert an address to a string. | ||
1412 | * | ||
1413 | * @param plugin name of the plugin responsible for the address | ||
1414 | * @param addr binary address | ||
1415 | * @param addr_len number of bytes in addr | ||
1416 | * @return NULL on error, otherwise address string | ||
1417 | */ | ||
1418 | static const char* | ||
1419 | a2s (const char *plugin, | ||
1420 | const void *addr, | ||
1421 | uint16_t addr_len) | ||
1422 | { | ||
1423 | struct TransportPlugin *p; | ||
1424 | |||
1425 | if (plugin == NULL) | ||
1426 | return NULL; | ||
1427 | p = find_transport (plugin); | ||
1428 | if (p == NULL) | ||
1429 | return NULL; | ||
1430 | return p->api->address_to_string (p->api->cls, | ||
1431 | addr, | ||
1432 | addr_len); | ||
1433 | } | ||
1434 | |||
1435 | |||
1436 | /** | ||
1437 | * Find an address in any of the available transports for | 1464 | * Find an address in any of the available transports for |
1438 | * the given neighbour that would be good for message | 1465 | * the given neighbour that would be good for message |
1439 | * transmission. This is essentially the transport selection | 1466 | * transmission. This is essentially the transport selection |
@@ -1508,7 +1535,10 @@ find_ready_address(struct NeighbourList *neighbour) | |||
1508 | { | 1535 | { |
1509 | #if DEBUG_TRANSPORT | 1536 | #if DEBUG_TRANSPORT |
1510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1537 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1511 | "Best address found has latency of %llu ms.\n", | 1538 | "Best address found (`%s') has latency of %llu ms.\n", |
1539 | a2s (best_address->ready_list->plugin->short_name, | ||
1540 | best_address->addr, | ||
1541 | best_address->addrlen), | ||
1512 | best_address->latency.value); | 1542 | best_address->latency.value); |
1513 | #endif | 1543 | #endif |
1514 | } | 1544 | } |
@@ -3228,8 +3258,9 @@ handle_payload_message (const struct GNUNET_MessageHeader *message, | |||
3228 | } | 3258 | } |
3229 | #if DEBUG_TRANSPORT | 3259 | #if DEBUG_TRANSPORT |
3230 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3260 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3231 | "Received message of type %u from `%4s', sending to all clients.\n", | 3261 | "Received message of type %u and size %u from `%4s', sending to all clients.\n", |
3232 | ntohs (message->type), | 3262 | ntohs (message->type), |
3263 | ntohs (message->size), | ||
3233 | GNUNET_i2s (&n->id)); | 3264 | GNUNET_i2s (&n->id)); |
3234 | #endif | 3265 | #endif |
3235 | if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, | 3266 | if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, |
@@ -3718,7 +3749,7 @@ check_hello_validated (void *cls, | |||
3718 | NULL); | 3749 | NULL); |
3719 | GNUNET_PEERINFO_add_peer (peerinfo, plain_hello); | 3750 | GNUNET_PEERINFO_add_peer (peerinfo, plain_hello); |
3720 | GNUNET_free (plain_hello); | 3751 | GNUNET_free (plain_hello); |
3721 | #if DEBUG_TRANSPORT || 1 | 3752 | #if DEBUG_TRANSPORT |
3722 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3753 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3723 | "PEERINFO had no `%s' message for peer `%4s', full validation needed.\n", | 3754 | "PEERINFO had no `%s' message for peer `%4s', full validation needed.\n", |
3724 | "HELLO", | 3755 | "HELLO", |
@@ -4248,8 +4279,10 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4248 | } | 4279 | } |
4249 | #if DEBUG_PING_PONG | 4280 | #if DEBUG_PING_PONG |
4250 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4281 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
4251 | "Received message of type %u from `%4s', sending to all clients.\n", | 4282 | "Received message of type %u and size %u from `%4s', sending to all clients.\n", |
4252 | ntohs (message->type), GNUNET_i2s (peer)); | 4283 | ntohs (message->type), |
4284 | ntohs (message->size), | ||
4285 | GNUNET_i2s (peer)); | ||
4253 | #endif | 4286 | #endif |
4254 | switch (ntohs (message->type)) | 4287 | switch (ntohs (message->type)) |
4255 | { | 4288 | { |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 865ca325a..f6ba584eb 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include "plugin_transport.h" | 37 | #include "plugin_transport.h" |
38 | #include "transport.h" | 38 | #include "transport.h" |
39 | 39 | ||
40 | #define DEBUG_TCP GNUNET_YES | 40 | #define DEBUG_TCP GNUNET_NO |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * How long until we give up on transmitting the welcome message? | 43 | * How long until we give up on transmitting the welcome message? |
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 9b2c167cb..fe7b6590e 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c | |||
@@ -35,12 +35,17 @@ | |||
35 | #include "gnunet_transport_service.h" | 35 | #include "gnunet_transport_service.h" |
36 | #include "transport.h" | 36 | #include "transport.h" |
37 | 37 | ||
38 | #define VERBOSE GNUNET_YES | 38 | #define VERBOSE GNUNET_NO |
39 | 39 | ||
40 | #define VERBOSE_ARM GNUNET_NO | 40 | #define VERBOSE_ARM GNUNET_NO |
41 | 41 | ||
42 | #define START_ARM GNUNET_YES | 42 | #define START_ARM GNUNET_YES |
43 | 43 | ||
44 | /** | ||
45 | * Note that this value must not significantly exceed | ||
46 | * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise | ||
47 | * messages may be dropped even for a reliable transport. | ||
48 | */ | ||
44 | #define TOTAL_MSGS (60000 * 2) | 49 | #define TOTAL_MSGS (60000 * 2) |
45 | 50 | ||
46 | /** | 51 | /** |
@@ -72,6 +77,10 @@ static int is_tcp; | |||
72 | 77 | ||
73 | static int is_http; | 78 | static int is_http; |
74 | 79 | ||
80 | static unsigned long long total_bytes; | ||
81 | |||
82 | static struct GNUNET_TIME_Absolute start_time; | ||
83 | |||
75 | static GNUNET_SCHEDULER_TaskIdentifier die_task; | 84 | static GNUNET_SCHEDULER_TaskIdentifier die_task; |
76 | 85 | ||
77 | #if VERBOSE | 86 | #if VERBOSE |
@@ -84,15 +93,23 @@ static GNUNET_SCHEDULER_TaskIdentifier die_task; | |||
84 | static void | 93 | static void |
85 | end () | 94 | end () |
86 | { | 95 | { |
87 | GNUNET_assert (ok == 6); | 96 | unsigned long long delta; |
97 | |||
88 | GNUNET_SCHEDULER_cancel (sched, die_task); | 98 | GNUNET_SCHEDULER_cancel (sched, die_task); |
99 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
100 | #if VERBOSE | ||
89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n"); | 101 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n"); |
102 | #endif | ||
90 | GNUNET_TRANSPORT_disconnect (p1.th); | 103 | GNUNET_TRANSPORT_disconnect (p1.th); |
91 | GNUNET_TRANSPORT_disconnect (p2.th); | 104 | GNUNET_TRANSPORT_disconnect (p2.th); |
92 | 105 | #if VERBOSE | |
93 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
94 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 106 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
95 | "Transports disconnected, returning success!\n"); | 107 | "Transports disconnected, returning success!\n"); |
108 | #endif | ||
109 | delta = GNUNET_TIME_absolute_get_duration (start_time).value; | ||
110 | fprintf (stderr, | ||
111 | "\nThroughput was %llu kb/s\n", | ||
112 | total_bytes * 1000 / 1024 / delta); | ||
96 | ok = 0; | 113 | ok = 0; |
97 | } | 114 | } |
98 | 115 | ||
@@ -175,11 +192,15 @@ notify_receive (void *cls, | |||
175 | die_task = GNUNET_SCHEDULER_add_now (sched, &end_badly, NULL); | 192 | die_task = GNUNET_SCHEDULER_add_now (sched, &end_badly, NULL); |
176 | return; | 193 | return; |
177 | } | 194 | } |
195 | #if VERBOSE | ||
178 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
179 | "Got message %u of size %u\n", | 197 | "Got message %u of size %u\n", |
180 | ntohl (hdr->num), | 198 | ntohl (hdr->num), |
181 | ntohs (message->size)); | 199 | ntohs (message->size)); |
200 | #endif | ||
182 | n++; | 201 | n++; |
202 | if (0 == (n % (TOTAL_MSGS/100))) | ||
203 | fprintf (stderr, "."); | ||
183 | if (n == TOTAL_MSGS) | 204 | if (n == TOTAL_MSGS) |
184 | end (); | 205 | end (); |
185 | } | 206 | } |
@@ -214,10 +235,12 @@ notify_ready (void *cls, size_t size, void *buf) | |||
214 | ret += sizeof (struct TestMessage); | 235 | ret += sizeof (struct TestMessage); |
215 | memset (&cbuf[ret], n, s - sizeof (struct TestMessage)); | 236 | memset (&cbuf[ret], n, s - sizeof (struct TestMessage)); |
216 | ret += s - sizeof (struct TestMessage); | 237 | ret += s - sizeof (struct TestMessage); |
238 | #if VERBOSE | ||
217 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 239 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
218 | "Sending message %u of size %u\n", | 240 | "Sending message %u of size %u\n", |
219 | n, | 241 | n, |
220 | s); | 242 | s); |
243 | #endif | ||
221 | n++; | 244 | n++; |
222 | s = get_size (n); | 245 | s = get_size (n); |
223 | if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16)) | 246 | if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16)) |
@@ -233,6 +256,7 @@ notify_ready (void *cls, size_t size, void *buf) | |||
233 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 256 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
234 | "Returning total message block of size %u\n", | 257 | "Returning total message block of size %u\n", |
235 | ret); | 258 | ret); |
259 | total_bytes += ret; | ||
236 | return ret; | 260 | return ret; |
237 | } | 261 | } |
238 | 262 | ||
@@ -251,6 +275,7 @@ notify_connect (void *cls, | |||
251 | GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024), | 275 | GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024), |
252 | GNUNET_TIME_UNIT_FOREVER_REL, | 276 | GNUNET_TIME_UNIT_FOREVER_REL, |
253 | NULL, NULL); | 277 | NULL, NULL); |
278 | start_time = GNUNET_TIME_absolute_get (); | ||
254 | GNUNET_TRANSPORT_notify_transmit_ready (p1.th, | 279 | GNUNET_TRANSPORT_notify_transmit_ready (p1.th, |
255 | &p2.id, | 280 | &p2.id, |
256 | get_size (0), 0, TIMEOUT, | 281 | get_size (0), 0, TIMEOUT, |
@@ -266,17 +291,21 @@ notify_connect (void *cls, | |||
266 | GNUNET_TIME_UNIT_FOREVER_REL, | 291 | GNUNET_TIME_UNIT_FOREVER_REL, |
267 | NULL, NULL); | 292 | NULL, NULL); |
268 | } | 293 | } |
294 | #if VERBOSE | ||
269 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 295 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
270 | "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls); | 296 | "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls); |
297 | #endif | ||
271 | } | 298 | } |
272 | 299 | ||
273 | 300 | ||
274 | static void | 301 | static void |
275 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | 302 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) |
276 | { | 303 | { |
304 | #if VERBOSE | ||
277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 305 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
278 | "Peer `%4s' disconnected (%p)!\n", | 306 | "Peer `%4s' disconnected (%p)!\n", |
279 | GNUNET_i2s (peer), cls); | 307 | GNUNET_i2s (peer), cls); |
308 | #endif | ||
280 | } | 309 | } |
281 | 310 | ||
282 | 311 | ||
@@ -310,8 +339,10 @@ exchange_hello_last (void *cls, | |||
310 | struct PeerContext *me = cls; | 339 | struct PeerContext *me = cls; |
311 | 340 | ||
312 | GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me); | 341 | GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me); |
342 | #if VERBOSE | ||
313 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 343 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
314 | "Exchanging HELLO with peer (%p)!\n", cls); | 344 | "Exchanging HELLO with peer (%p)!\n", cls); |
345 | #endif | ||
315 | GNUNET_assert (ok >= 3); | 346 | GNUNET_assert (ok >= 3); |
316 | OKPP; | 347 | OKPP; |
317 | GNUNET_assert (message != NULL); | 348 | GNUNET_assert (message != NULL); |
@@ -331,8 +362,10 @@ exchange_hello (void *cls, | |||
331 | struct PeerContext *me = cls; | 362 | struct PeerContext *me = cls; |
332 | 363 | ||
333 | GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me); | 364 | GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me); |
365 | #if VERBOSE | ||
334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 366 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
335 | "Exchanging HELLO with peer (%p)!\n", cls); | 367 | "Exchanging HELLO with peer (%p)!\n", cls); |
368 | #endif | ||
336 | GNUNET_assert (ok >= 2); | 369 | GNUNET_assert (ok >= 2); |
337 | OKPP; | 370 | OKPP; |
338 | GNUNET_assert (message != NULL); | 371 | GNUNET_assert (message != NULL); |
@@ -340,9 +373,11 @@ exchange_hello (void *cls, | |||
340 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) | 373 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) |
341 | message, &me->id)); | 374 | message, &me->id)); |
342 | 375 | ||
376 | #if VERBOSE | ||
343 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 377 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
344 | "Received HELLO size %d\n", GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message)); | 378 | "Received HELLO size %d\n", |
345 | 379 | GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message)); | |
380 | #endif | ||
346 | GNUNET_TRANSPORT_offer_hello (p2.th, message); | 381 | GNUNET_TRANSPORT_offer_hello (p2.th, message); |
347 | GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2); | 382 | GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2); |
348 | } | 383 | } |
@@ -399,7 +434,7 @@ check () | |||
399 | #endif | 434 | #endif |
400 | ok = 1; | 435 | ok = 1; |
401 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 436 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
402 | argv, "test-transport-api", "nohelp", | 437 | argv, "test-transport-api-reliability", "nohelp", |
403 | options, &run, &ok); | 438 | options, &run, &ok); |
404 | stop_arm (&p1); | 439 | stop_arm (&p1); |
405 | stop_arm (&p2); | 440 | stop_arm (&p2); |
diff --git a/src/transport/test_transport_api_tcp_peer1.conf b/src/transport/test_transport_api_tcp_peer1.conf index 719dc1c79..97e2111c8 100644 --- a/src/transport/test_transport_api_tcp_peer1.conf +++ b/src/transport/test_transport_api_tcp_peer1.conf | |||
@@ -1,5 +1,6 @@ | |||
1 | [transport-tcp] | 1 | [transport-tcp] |
2 | PORT = 12368 | 2 | PORT = 12368 |
3 | BINDTO = 127.0.0.1 | ||
3 | 4 | ||
4 | [fs] | 5 | [fs] |
5 | AUTOSTART = NO | 6 | AUTOSTART = NO |
@@ -31,7 +32,7 @@ MINIMUM-FRIENDS = 0 | |||
31 | 32 | ||
32 | [transport] | 33 | [transport] |
33 | PLUGINS = tcp | 34 | PLUGINS = tcp |
34 | #DEBUG = YES | 35 | DEBUG = NO |
35 | #PREFIX = xterm -T transport2 -e gdb --command=cmd --args | 36 | #PREFIX = xterm -T transport2 -e gdb --command=cmd --args |
36 | #PREFIX = valgrind --leak-check=full | 37 | #PREFIX = valgrind --leak-check=full |
37 | ACCEPT_FROM6 = ::1; | 38 | ACCEPT_FROM6 = ::1; |
@@ -73,7 +74,7 @@ HOSTNAME = localhost | |||
73 | PORT = 12367 | 74 | PORT = 12367 |
74 | 75 | ||
75 | [arm] | 76 | [arm] |
76 | DEFAULTSERVICES = | 77 | DEFAULTSERVICES = transport statistics |
77 | ACCEPT_FROM6 = ::1; | 78 | ACCEPT_FROM6 = ::1; |
78 | ACCEPT_FROM = 127.0.0.1; | 79 | ACCEPT_FROM = 127.0.0.1; |
79 | BINARY = gnunet-service-arm | 80 | BINARY = gnunet-service-arm |
diff --git a/src/transport/test_transport_api_tcp_peer2.conf b/src/transport/test_transport_api_tcp_peer2.conf index cddce5926..f6ab6c231 100644 --- a/src/transport/test_transport_api_tcp_peer2.conf +++ b/src/transport/test_transport_api_tcp_peer2.conf | |||
@@ -1,5 +1,6 @@ | |||
1 | [transport-tcp] | 1 | [transport-tcp] |
2 | PORT = 22368 | 2 | PORT = 22368 |
3 | BINDTO = 127.0.0.1 | ||
3 | 4 | ||
4 | [core] | 5 | [core] |
5 | AUTOSTART = NO | 6 | AUTOSTART = NO |
@@ -31,7 +32,7 @@ MINIMUM-FRIENDS = 0 | |||
31 | 32 | ||
32 | [transport] | 33 | [transport] |
33 | PLUGINS = tcp | 34 | PLUGINS = tcp |
34 | #DEBUG = YES | 35 | DEBUG = NO |
35 | # PREFIX = | 36 | # PREFIX = |
36 | ACCEPT_FROM6 = ::1; | 37 | ACCEPT_FROM6 = ::1; |
37 | ACCEPT_FROM = 127.0.0.1; | 38 | ACCEPT_FROM = 127.0.0.1; |
@@ -74,7 +75,7 @@ HOSTNAME = localhost | |||
74 | PORT = 22367 | 75 | PORT = 22367 |
75 | 76 | ||
76 | [arm] | 77 | [arm] |
77 | DEFAULTSERVICES = | 78 | DEFAULTSERVICES = transport statistics |
78 | ACCEPT_FROM6 = ::1; | 79 | ACCEPT_FROM6 = ::1; |
79 | ACCEPT_FROM = 127.0.0.1; | 80 | ACCEPT_FROM = 127.0.0.1; |
80 | BINARY = gnunet-service-arm | 81 | BINARY = gnunet-service-arm |
diff --git a/src/transport/transport.h b/src/transport/transport.h index b2ef01bb5..6cdbaae77 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h | |||
@@ -30,9 +30,9 @@ | |||
30 | #include "gnunet_time_lib.h" | 30 | #include "gnunet_time_lib.h" |
31 | #include "gnunet_transport_service.h" | 31 | #include "gnunet_transport_service.h" |
32 | 32 | ||
33 | #define DEBUG_TRANSPORT GNUNET_YES | 33 | #define DEBUG_TRANSPORT GNUNET_NO |
34 | #define DEBUG_TRANSPORT_TIMEOUT GNUNET_YES | 34 | #define DEBUG_TRANSPORT_TIMEOUT GNUNET_NO |
35 | #define DEBUG_TRANSPORT_DISCONNECT GNUNET_YES | 35 | #define DEBUG_TRANSPORT_DISCONNECT GNUNET_NO |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * For how long do we allow unused bandwidth | 38 | * For how long do we allow unused bandwidth |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 22f6eee51..8007c6d8e 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -548,10 +548,12 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
548 | h->control_tail, | 548 | h->control_tail, |
549 | cm); | 549 | cm); |
550 | nret = cm->notify (cm->notify_cls, size, &cbuf[ret]); | 550 | nret = cm->notify (cm->notify_cls, size, &cbuf[ret]); |
551 | #if DEBUG_TRANSPORT | ||
551 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 552 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
552 | "Added %u bytes of control message at %u\n", | 553 | "Added %u bytes of control message at %u\n", |
553 | nret, | 554 | nret, |
554 | ret); | 555 | ret); |
556 | #endif | ||
555 | GNUNET_free (cm); | 557 | GNUNET_free (cm); |
556 | ret += nret; | 558 | ret += nret; |
557 | size -= nret; | 559 | size -= nret; |