diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-04 12:47:33 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-04 12:47:33 +0000 |
commit | 32819ab9c5f4366788088ff39792f4c7066c0f31 (patch) | |
tree | a54051a4f9b488a462be9f49ba03ef7a18c9a6ab /src/transport/gnunet-service-transport_neighbours.c | |
parent | e8a76652365d6c1bd6bd4903b2b4ba72447c961b (diff) | |
download | gnunet-32819ab9c5f4366788088ff39792f4c7066c0f31.tar.gz gnunet-32819ab9c5f4366788088ff39792f4c7066c0f31.zip |
fix type issue
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index d10a74e36..592dcd849 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -924,7 +924,6 @@ free_neighbour (struct NeighbourMapEntry *n, int keep_sessions) | |||
924 | GNUNET_free (n); | 924 | GNUNET_free (n); |
925 | } | 925 | } |
926 | 926 | ||
927 | |||
928 | /** | 927 | /** |
929 | * Transmit a message using the current session of the given | 928 | * Transmit a message using the current session of the given |
930 | * neighbour. | 929 | * neighbour. |
@@ -946,17 +945,20 @@ send_with_session (struct NeighbourMapEntry *n, | |||
946 | void *cont_cls) | 945 | void *cont_cls) |
947 | { | 946 | { |
948 | struct GNUNET_TRANSPORT_PluginFunctions *papi; | 947 | 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 == papi->send (papi->cls, | 952 | (-1 == (send_phys = 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); | ||
960 | GNUNET_break (NULL != papi); | 962 | GNUNET_break (NULL != papi); |
961 | } | 963 | } |
962 | 964 | ||
@@ -1520,6 +1522,7 @@ send_session_connect (struct NeighbourAddress *na) | |||
1520 | { | 1522 | { |
1521 | struct GNUNET_TRANSPORT_PluginFunctions *papi; | 1523 | struct GNUNET_TRANSPORT_PluginFunctions *papi; |
1522 | struct SessionConnectMessage connect_msg; | 1524 | struct SessionConnectMessage connect_msg; |
1525 | ssize_t send_phys; | ||
1523 | 1526 | ||
1524 | if (NULL == (papi = GST_plugins_find (na->address->transport_name))) | 1527 | if (NULL == (papi = GST_plugins_find (na->address->transport_name))) |
1525 | { | 1528 | { |
@@ -1538,12 +1541,14 @@ send_session_connect (struct NeighbourAddress *na) | |||
1538 | connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT); | 1541 | connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT); |
1539 | connect_msg.reserved = htonl (0); | 1542 | connect_msg.reserved = htonl (0); |
1540 | connect_msg.timestamp = GNUNET_TIME_absolute_hton (na->connect_timestamp); | 1543 | connect_msg.timestamp = GNUNET_TIME_absolute_hton (na->connect_timestamp); |
1541 | (void) papi->send (papi->cls, | 1544 | send_phys = papi->send (papi->cls, |
1542 | na->session, | 1545 | na->session, |
1543 | (const char *) &connect_msg, sizeof (struct SessionConnectMessage), | 1546 | (const char *) &connect_msg, sizeof (struct SessionConnectMessage), |
1544 | UINT_MAX, | 1547 | UINT_MAX, |
1545 | GNUNET_TIME_UNIT_FOREVER_REL, | 1548 | GNUNET_TIME_UNIT_FOREVER_REL, |
1546 | NULL, NULL); | 1549 | NULL, NULL); |
1550 | if (-1 != send_phys) | ||
1551 | GST_clients_communicate_bytes_used (&na->address->peer, send_phys); | ||
1547 | } | 1552 | } |
1548 | 1553 | ||
1549 | 1554 | ||
@@ -1561,6 +1566,7 @@ send_session_connect_ack_message (const struct GNUNET_HELLO_Address *address, | |||
1561 | { | 1566 | { |
1562 | struct GNUNET_TRANSPORT_PluginFunctions *papi; | 1567 | struct GNUNET_TRANSPORT_PluginFunctions *papi; |
1563 | struct SessionConnectMessage connect_msg; | 1568 | struct SessionConnectMessage connect_msg; |
1569 | ssize_t send_phys; | ||
1564 | 1570 | ||
1565 | if (NULL == (papi = GST_plugins_find (address->transport_name))) | 1571 | if (NULL == (papi = GST_plugins_find (address->transport_name))) |
1566 | { | 1572 | { |
@@ -1578,12 +1584,14 @@ send_session_connect_ack_message (const struct GNUNET_HELLO_Address *address, | |||
1578 | connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT_ACK); | 1584 | connect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT_ACK); |
1579 | connect_msg.reserved = htonl (0); | 1585 | connect_msg.reserved = htonl (0); |
1580 | connect_msg.timestamp = GNUNET_TIME_absolute_hton (timestamp); | 1586 | connect_msg.timestamp = GNUNET_TIME_absolute_hton (timestamp); |
1581 | (void) papi->send (papi->cls, | 1587 | send_phys = papi->send (papi->cls, |
1582 | session, | 1588 | session, |
1583 | (const char *) &connect_msg, sizeof (struct SessionConnectMessage), | 1589 | (const char *) &connect_msg, sizeof (struct SessionConnectMessage), |
1584 | UINT_MAX, | 1590 | UINT_MAX, |
1585 | GNUNET_TIME_UNIT_FOREVER_REL, | 1591 | GNUNET_TIME_UNIT_FOREVER_REL, |
1586 | NULL, NULL); | 1592 | NULL, NULL); |
1593 | if (-1 != send_phys) | ||
1594 | GST_clients_communicate_bytes_used (&address->peer, send_phys); | ||
1587 | } | 1595 | } |
1588 | 1596 | ||
1589 | 1597 | ||