aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-10-04 12:55:26 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-10-04 12:55:26 +0000
commitfbdc3df2395a5ad8ab67aba4ea0f522100ea2f40 (patch)
tree39a39fa52d5e5d31baf6a2ac0995fd56cd5da78a /src/transport
parent4f3779ef40bffbadc043c4c6511b7ce0177846b9 (diff)
downloadgnunet-fbdc3df2395a5ad8ab67aba4ea0f522100ea2f40.tar.gz
gnunet-fbdc3df2395a5ad8ab67aba4ea0f522100ea2f40.zip
undo
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 592dcd849..1475270f8 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -40,6 +40,7 @@
40#include "transport.h" 40#include "transport.h"
41 41
42 42
43
43/** 44/**
44 * Size of the neighbour hash map. 45 * Size of the neighbour hash map.
45 */ 46 */
@@ -945,20 +946,17 @@ send_with_session (struct NeighbourMapEntry *n,
945 void *cont_cls) 946 void *cont_cls)
946{ 947{
947 struct GNUNET_TRANSPORT_PluginFunctions *papi; 948 struct GNUNET_TRANSPORT_PluginFunctions *papi;
948 ssize_t send_phys;
949 949
950 GNUNET_assert (n->primary_address.session != NULL); 950 GNUNET_assert (n->primary_address.session != NULL);
951 if ( ( (NULL == (papi = GST_plugins_find (n->primary_address.address->transport_name))) || 951 if ( ((NULL == (papi = GST_plugins_find (n->primary_address.address->transport_name)) ||
952 (-1 == (send_phys = papi->send (papi->cls, 952 (-1 == papi->send (papi->cls,
953 n->primary_address.session, 953 n->primary_address.session,
954 msgbuf, msgbuf_size, 954 msgbuf, msgbuf_size,
955 priority, 955 priority,
956 timeout, 956 timeout,
957 cont, cont_cls)))) && 957 cont, cont_cls)))) &&
958 (NULL != cont) ) 958 (NULL != cont))
959 cont (cont_cls, &n->id, GNUNET_SYSERR); 959 cont (cont_cls, &n->id, GNUNET_SYSERR);
960 if (-1 != send_phys)
961 GST_clients_communicate_bytes_used (&n->id, send_phys);
962 GNUNET_break (NULL != papi); 960 GNUNET_break (NULL != papi);
963} 961}
964 962
@@ -1522,8 +1520,7 @@ send_session_connect (struct NeighbourAddress *na)
1522{ 1520{
1523 struct GNUNET_TRANSPORT_PluginFunctions *papi; 1521 struct GNUNET_TRANSPORT_PluginFunctions *papi;
1524 struct SessionConnectMessage connect_msg; 1522 struct SessionConnectMessage connect_msg;
1525 ssize_t send_phys; 1523
1526
1527 if (NULL == (papi = GST_plugins_find (na->address->transport_name))) 1524 if (NULL == (papi = GST_plugins_find (na->address->transport_name)))
1528 { 1525 {
1529 GNUNET_break (0); 1526 GNUNET_break (0);
@@ -1541,14 +1538,13 @@ send_session_connect (struct NeighbourAddress *na)
1541 connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT); 1538 connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT);
1542 connect_msg.reserved = htonl (0); 1539 connect_msg.reserved = htonl (0);
1543 connect_msg.timestamp = GNUNET_TIME_absolute_hton (na->connect_timestamp); 1540 connect_msg.timestamp = GNUNET_TIME_absolute_hton (na->connect_timestamp);
1544 send_phys = papi->send (papi->cls, 1541 (void) papi->send (papi->cls,
1545 na->session, 1542 na->session,
1546 (const char *) &connect_msg, sizeof (struct SessionConnectMessage), 1543 (const char *) &connect_msg, sizeof (struct SessionConnectMessage),
1547 UINT_MAX, 1544 UINT_MAX,
1548 GNUNET_TIME_UNIT_FOREVER_REL, 1545 GNUNET_TIME_UNIT_FOREVER_REL,
1549 NULL, NULL); 1546 NULL, NULL);
1550 if (-1 != send_phys) 1547
1551 GST_clients_communicate_bytes_used (&na->address->peer, send_phys);
1552} 1548}
1553 1549
1554 1550
@@ -1566,8 +1562,7 @@ send_session_connect_ack_message (const struct GNUNET_HELLO_Address *address,
1566{ 1562{
1567 struct GNUNET_TRANSPORT_PluginFunctions *papi; 1563 struct GNUNET_TRANSPORT_PluginFunctions *papi;
1568 struct SessionConnectMessage connect_msg; 1564 struct SessionConnectMessage connect_msg;
1569 ssize_t send_phys; 1565
1570
1571 if (NULL == (papi = GST_plugins_find (address->transport_name))) 1566 if (NULL == (papi = GST_plugins_find (address->transport_name)))
1572 { 1567 {
1573 GNUNET_break (0); 1568 GNUNET_break (0);
@@ -1584,14 +1579,13 @@ send_session_connect_ack_message (const struct GNUNET_HELLO_Address *address,
1584 connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT_ACK); 1579 connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT_ACK);
1585 connect_msg.reserved = htonl (0); 1580 connect_msg.reserved = htonl (0);
1586 connect_msg.timestamp = GNUNET_TIME_absolute_hton (timestamp); 1581 connect_msg.timestamp = GNUNET_TIME_absolute_hton (timestamp);
1587 send_phys = papi->send (papi->cls, 1582 (void) papi->send (papi->cls,
1588 session, 1583 session,
1589 (const char *) &connect_msg, sizeof (struct SessionConnectMessage), 1584 (const char *) &connect_msg, sizeof (struct SessionConnectMessage),
1590 UINT_MAX, 1585 UINT_MAX,
1591 GNUNET_TIME_UNIT_FOREVER_REL, 1586 GNUNET_TIME_UNIT_FOREVER_REL,
1592 NULL, NULL); 1587 NULL, NULL);
1593 if (-1 != send_phys) 1588
1594 GST_clients_communicate_bytes_used (&address->peer, send_phys);
1595} 1589}
1596 1590
1597 1591