diff options
author | Gabor X Toth <*@tg-x.net> | 2014-07-24 07:59:21 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2014-07-24 07:59:21 +0000 |
commit | a0a1be272163eb4dfbe73450cc08dc236f4e62fc (patch) | |
tree | 0a978a11b4ba5676ca7f1aed8792ffa0a85a972b /src/psyc | |
parent | aab770ce9a17e4ad2e608b4974008e0269914408 (diff) | |
download | gnunet-a0a1be272163eb4dfbe73450cc08dc236f4e62fc.tar.gz gnunet-a0a1be272163eb4dfbe73450cc08dc236f4e62fc.zip |
social: guest_talk test; multicast: fix member_to_origin_resume()
Diffstat (limited to 'src/psyc')
-rw-r--r-- | src/psyc/gnunet-service-psyc.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/psyc/gnunet-service-psyc.c b/src/psyc/gnunet-service-psyc.c index 8fc080baf..35579fcfc 100644 --- a/src/psyc/gnunet-service-psyc.c +++ b/src/psyc/gnunet-service-psyc.c | |||
@@ -102,6 +102,12 @@ struct TransmitMessage | |||
102 | */ | 102 | */ |
103 | uint8_t state; | 103 | uint8_t state; |
104 | 104 | ||
105 | /** | ||
106 | * Whether a message ACK has already been sent to the client. | ||
107 | * #GNUNET_YES or #GNUNET_NO | ||
108 | */ | ||
109 | uint8_t ack_sent; | ||
110 | |||
105 | /* Followed by message */ | 111 | /* Followed by message */ |
106 | }; | 112 | }; |
107 | 113 | ||
@@ -396,7 +402,7 @@ struct Slave | |||
396 | }; | 402 | }; |
397 | 403 | ||
398 | 404 | ||
399 | static inline void | 405 | static void |
400 | transmit_message (struct Channel *chn); | 406 | transmit_message (struct Channel *chn); |
401 | 407 | ||
402 | 408 | ||
@@ -1689,7 +1695,8 @@ transmit_notify (void *cls, size_t *data_size, void *data) | |||
1689 | memcpy (data, &tmit_msg[1], *data_size); | 1695 | memcpy (data, &tmit_msg[1], *data_size); |
1690 | 1696 | ||
1691 | int ret = (MSG_STATE_END < chn->tmit_state) ? GNUNET_NO : GNUNET_YES; | 1697 | int ret = (MSG_STATE_END < chn->tmit_state) ? GNUNET_NO : GNUNET_YES; |
1692 | if (NULL != tmit_msg->client) | 1698 | |
1699 | if (NULL != tmit_msg->client && GNUNET_NO == tmit_msg->ack_sent) | ||
1693 | send_message_ack (chn, tmit_msg->client); | 1700 | send_message_ack (chn, tmit_msg->client); |
1694 | 1701 | ||
1695 | GNUNET_CONTAINER_DLL_remove (chn->tmit_head, chn->tmit_tail, tmit_msg); | 1702 | GNUNET_CONTAINER_DLL_remove (chn->tmit_head, chn->tmit_tail, tmit_msg); |
@@ -1781,7 +1788,7 @@ slave_transmit_message (struct Slave *slv) | |||
1781 | } | 1788 | } |
1782 | 1789 | ||
1783 | 1790 | ||
1784 | static inline void | 1791 | static void |
1785 | transmit_message (struct Channel *chn) | 1792 | transmit_message (struct Channel *chn) |
1786 | { | 1793 | { |
1787 | chn->is_master | 1794 | chn->is_master |
@@ -1849,7 +1856,7 @@ slave_queue_message (struct Slave *slv, struct TransmitMessage *tmit_msg, | |||
1849 | * @param first_ptype First message part type in @a data. | 1856 | * @param first_ptype First message part type in @a data. |
1850 | * @param last_ptype Last message part type in @a data. | 1857 | * @param last_ptype Last message part type in @a data. |
1851 | */ | 1858 | */ |
1852 | static void | 1859 | static struct TransmitMessage * |
1853 | queue_message (struct Channel *chn, | 1860 | queue_message (struct Channel *chn, |
1854 | struct GNUNET_SERVER_Client *client, | 1861 | struct GNUNET_SERVER_Client *client, |
1855 | size_t data_size, | 1862 | size_t data_size, |
@@ -1872,6 +1879,7 @@ queue_message (struct Channel *chn, | |||
1872 | first_ptype, last_ptype) | 1879 | first_ptype, last_ptype) |
1873 | : slave_queue_message ((struct Slave *) chn, tmit_msg, | 1880 | : slave_queue_message ((struct Slave *) chn, tmit_msg, |
1874 | first_ptype, last_ptype); | 1881 | first_ptype, last_ptype); |
1882 | return tmit_msg; | ||
1875 | } | 1883 | } |
1876 | 1884 | ||
1877 | 1885 | ||
@@ -1951,6 +1959,7 @@ client_recv_psyc_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
1951 | queue_message (chn, client, size - sizeof (*msg), &msg[1], | 1959 | queue_message (chn, client, size - sizeof (*msg), &msg[1], |
1952 | first_ptype, last_ptype); | 1960 | first_ptype, last_ptype); |
1953 | transmit_message (chn); | 1961 | transmit_message (chn); |
1962 | /* FIXME: send a few ACKs even before transmit_notify is called */ | ||
1954 | 1963 | ||
1955 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1964 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1956 | }; | 1965 | }; |