diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-08-17 10:52:04 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-08-18 00:01:53 +0100 |
commit | a5e35180c7b42d30c82825cd67c8118ce048f65a (patch) | |
tree | b74e8ece4f78a988ab0a1300cc08bd35fcd63662 /toxcore/TCP_connection.h | |
parent | db22522741cccdeba657776844538c71cf8e8e7a (diff) |
Make tox_callback_friend_name stateless.
See #27 and #40 for details.
Diffstat (limited to 'toxcore/TCP_connection.h')
-rw-r--r-- | toxcore/TCP_connection.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h index 7bc34f86..f45e804c 100644 --- a/toxcore/TCP_connection.h +++ b/toxcore/TCP_connection.h | |||
@@ -90,14 +90,14 @@ typedef struct { | |||
90 | TCP_con *tcp_connections; | 90 | TCP_con *tcp_connections; |
91 | uint32_t tcp_connections_length; /* Length of tcp_connections array. */ | 91 | uint32_t tcp_connections_length; /* Length of tcp_connections array. */ |
92 | 92 | ||
93 | int (*tcp_data_callback)(void *object, int id, const uint8_t *data, uint16_t length); | 93 | int (*tcp_data_callback)(void *object, int id, const uint8_t *data, uint16_t length, void *userdata); |
94 | void *tcp_data_callback_object; | 94 | void *tcp_data_callback_object; |
95 | 95 | ||
96 | int (*tcp_oob_callback)(void *object, const uint8_t *public_key, unsigned int tcp_connections_number, | 96 | int (*tcp_oob_callback)(void *object, const uint8_t *public_key, unsigned int tcp_connections_number, |
97 | const uint8_t *data, uint16_t length); | 97 | const uint8_t *data, uint16_t length); |
98 | void *tcp_oob_callback_object; | 98 | void *tcp_oob_callback_object; |
99 | 99 | ||
100 | int (*tcp_onion_callback)(void *object, const uint8_t *data, uint16_t length); | 100 | int (*tcp_onion_callback)(void *object, const uint8_t *data, uint16_t length, void *userdata); |
101 | void *tcp_onion_callback_object; | 101 | void *tcp_onion_callback_object; |
102 | 102 | ||
103 | TCP_Proxy_Info proxy_info; | 103 | TCP_Proxy_Info proxy_info; |
@@ -151,12 +151,12 @@ int tcp_send_oob_packet(TCP_Connections *tcp_c, unsigned int tcp_connections_num | |||
151 | /* Set the callback for TCP data packets. | 151 | /* Set the callback for TCP data packets. |
152 | */ | 152 | */ |
153 | void set_packet_tcp_connection_callback(TCP_Connections *tcp_c, int (*tcp_data_callback)(void *object, int id, | 153 | void set_packet_tcp_connection_callback(TCP_Connections *tcp_c, int (*tcp_data_callback)(void *object, int id, |
154 | const uint8_t *data, uint16_t length), void *object); | 154 | const uint8_t *data, uint16_t length, void *userdata), void *object); |
155 | 155 | ||
156 | /* Set the callback for TCP onion packets. | 156 | /* Set the callback for TCP onion packets. |
157 | */ | 157 | */ |
158 | void set_onion_packet_tcp_connection_callback(TCP_Connections *tcp_c, int (*tcp_onion_callback)(void *object, | 158 | void set_onion_packet_tcp_connection_callback(TCP_Connections *tcp_c, int (*tcp_onion_callback)(void *object, |
159 | const uint8_t *data, uint16_t length), void *object); | 159 | const uint8_t *data, uint16_t length, void *userdata), void *object); |
160 | 160 | ||
161 | /* Set the callback for TCP oob data packets. | 161 | /* Set the callback for TCP oob data packets. |
162 | */ | 162 | */ |
@@ -239,7 +239,7 @@ unsigned int tcp_copy_connected_relays(TCP_Connections *tcp_c, Node_format *tcp_ | |||
239 | */ | 239 | */ |
240 | TCP_Connections *new_tcp_connections(const uint8_t *secret_key, TCP_Proxy_Info *proxy_info); | 240 | TCP_Connections *new_tcp_connections(const uint8_t *secret_key, TCP_Proxy_Info *proxy_info); |
241 | 241 | ||
242 | void do_tcp_connections(TCP_Connections *tcp_c); | 242 | void do_tcp_connections(TCP_Connections *tcp_c, void *userdata); |
243 | void kill_tcp_connections(TCP_Connections *tcp_c); | 243 | void kill_tcp_connections(TCP_Connections *tcp_c); |
244 | 244 | ||
245 | #endif | 245 | #endif |