summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-05 18:05:33 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-05 23:03:21 +0100
commit8121ace449d552d53798ca768a74b9be112c7b8b (patch)
tree50170ae31fd5508cf5fb4f6b50284819a6ca54bc /toxcore/net_crypto.h
parentaa0e3974c5e1d665051ae49a4e4d547fa5f63c30 (diff)
Make packet data a ptr-to-const.
Ensure that nobody inadvertly modifies the temporary packet data buffer.
Diffstat (limited to 'toxcore/net_crypto.h')
-rw-r--r--toxcore/net_crypto.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h
index 6a3ba40f..52c6265e 100644
--- a/toxcore/net_crypto.h
+++ b/toxcore/net_crypto.h
@@ -135,7 +135,7 @@ typedef struct {
135 void *connection_status_callback_object; 135 void *connection_status_callback_object;
136 int connection_status_callback_id; 136 int connection_status_callback_id;
137 137
138 int (*connection_data_callback)(void *object, int id, uint8_t *data, uint16_t length, void *userdata); 138 int (*connection_data_callback)(void *object, int id, const uint8_t *data, uint16_t length, void *userdata);
139 void *connection_data_callback_object; 139 void *connection_data_callback_object;
140 int connection_data_callback_id; 140 int connection_data_callback_id;
141 141
@@ -275,7 +275,7 @@ int connection_status_handler(const Net_Crypto *c, int crypt_connection_id,
275 * return 0 on success. 275 * return 0 on success.
276 */ 276 */
277int connection_data_handler(const Net_Crypto *c, int crypt_connection_id, int (*connection_data_callback)(void *object, 277int connection_data_handler(const Net_Crypto *c, int crypt_connection_id, int (*connection_data_callback)(void *object,
278 int id, uint8_t *data, uint16_t length, void *userdata), void *object, int id); 278 int id, const uint8_t *data, uint16_t length, void *userdata), void *object, int id);
279 279
280 280
281/* Set function to be called when connection with crypt_connection_id receives a lossy data packet of length. 281/* Set function to be called when connection with crypt_connection_id receives a lossy data packet of length.