Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolay168 committed Sep 3, 2024
1 parent 3324b43 commit 42237a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions toxav/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ int rtp_send_data(RTPSession *session, const uint8_t *data, uint32_t length,
memcpy(rdata + 1 + RTP_HEADER_SIZE, data + sent, piece);

error = rtp_send_custom_lossy_packet(session->tox, session->friend_number,
rdata, piece + RTP_HEADER_SIZE + 1);
rdata, piece + RTP_HEADER_SIZE + 1);
rtp_report_error_maybe(error, session, piece + RTP_HEADER_SIZE + 1);

sent += piece;
Expand All @@ -847,7 +847,7 @@ int rtp_send_data(RTPSession *session, const uint8_t *data, uint32_t length,
memcpy(rdata + 1 + RTP_HEADER_SIZE, data + sent, piece);

error = rtp_send_custom_lossy_packet(session->tox, session->friend_number, rdata,
piece + RTP_HEADER_SIZE + 1);
piece + RTP_HEADER_SIZE + 1);
rtp_report_error_maybe(error, session, piece + RTP_HEADER_SIZE + 1);
}
}
Expand All @@ -861,14 +861,15 @@ int rtp_send_data(RTPSession *session, const uint8_t *data, uint32_t length,
*
* @param error the error from rtp_send_custom_lossy_packet.
* @param session The A/V session to send the data for.
* @param length The package length to be shown in the log.
* @param rdata_size The package length to be shown in the log.
*/
void rtp_report_error_maybe(Tox_Err_Friend_Custom_Packet error, RTPSession *session, uint16_t rdata_size){
if (TOX_ERR_FRIEND_CUSTOM_PACKET_OK != error) {
char *netstrerror = net_new_strerror(net_error());
const char *toxerror = tox_err_friend_custom_packet_to_string(error);
LOGGER_WARNING(session->m->log, "RTP send failed (len: %u)! tox error: %s net error: %s",
rdata_size, toxerror, netstrerror);
net_kill_strerror(netstrerror);
}
void rtp_report_error_maybe(Tox_Err_Friend_Custom_Packet error, RTPSession *session, uint16_t rdata_size)
{
if (TOX_ERR_FRIEND_CUSTOM_PACKET_OK != error) {
char *netstrerror = net_new_strerror(net_error());
const char *toxerror = tox_err_friend_custom_packet_to_string(error);
LOGGER_WARNING(session->m->log, "RTP send failed (len: %u)! tox error: %s net error: %s",
rdata_size, toxerror, netstrerror);
net_kill_strerror(netstrerror);
}
}
2 changes: 1 addition & 1 deletion toxav/rtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int rtp_send_data(RTPSession *session, const uint8_t *data, uint32_t length,
*
* @param error the error from rtp_send_custom_lossy_packet.
* @param session The A/V session to send the data for.
* @param length The package length to be shown in the log.
* @param rdata_size The package length to be shown in the log.
*/
void rtp_report_error_maybe(Tox_Err_Friend_Custom_Packet error, RTPSession *session, uint16_t rdata_size);

Expand Down

0 comments on commit 42237a2

Please sign in to comment.