Introduce several TODOs

This commit is contained in:
Jan Malakhovski 2018-07-01 23:26:43 +00:00 committed by iphydf
parent 669bdf23ee
commit 246165954c
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 10 additions and 0 deletions

View File

@ -1856,6 +1856,13 @@ int m_callback_rtp_packet(Messenger *m, int32_t friendnumber, uint8_t byte, m_lo
}
/* TODO(oxij): this name is confusing, because this function sends both av and custom lossy packets.
* Meanwhile, m_handle_lossy_packet routes custom packets to custom_lossy_packet_registerhandler
* as you would expect from its name.
*
* I.e. custom_lossy_packet_registerhandler's "custom lossy packet" and this "custom lossy packet"
* are not the same set of packets.
*/
int m_send_custom_lossy_packet(const Messenger *m, int32_t friendnumber, const uint8_t *data, uint32_t length)
{
if (friend_not_valid(m, friendnumber)) {
@ -1866,6 +1873,7 @@ int m_send_custom_lossy_packet(const Messenger *m, int32_t friendnumber, const u
return -2;
}
// TODO(oxij): send_lossy_cryptpacket makes this check already, similarly for other similar places
if (data[0] < PACKET_ID_RANGE_LOSSY_START || data[0] > PACKET_ID_RANGE_LOSSY_END) {
return -3;
}

View File

@ -1522,6 +1522,8 @@ bool tox_friend_send_lossy_packet(Tox *tox, uint32_t friend_number, const uint8_
return 0;
}
// TODO(oxij): this feels ugly, this is needed only because m_send_custom_lossy_packet in Messenger.c
// sends both AV and custom packets despite its name and this API hides those AV packets
if (data[0] <= PACKET_ID_RANGE_LOSSY_AV_END) {
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_CUSTOM_PACKET_INVALID);
return 0;