Skip to content

Commit

Permalink
Remove PROCESS_RECEIVE_NO_TRUDP callback that was never called.
Browse files Browse the repository at this point in the history
  • Loading branch information
Si1ver committed Apr 19, 2020
1 parent bb21ebf commit 9a9ca03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
20 changes: 10 additions & 10 deletions src/trudp.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,17 @@ void trudpProcessReceived(trudpData* td, uint8_t* data, size_t data_length) {
}

// Process received packet
if(recvlen > 0) {
if (recvlen > 0) {
// Non-trudp data is sent to channel 0.
trudpChannelData *tcd = trudpGetChannelCreate(td, (__CONST_SOCKADDR_ARG) &remaddr, 0);
// FIXME: non trudp data it's return value == 0, not -1. Investigate why
// it works and fix appropriately
if(tcd == (void *)-1 || trudpChannelProcessReceivedPacket(tcd, data, recvlen) == -1) {
if(tcd == (void *)-1) {
printf("!!! can't PROCESS_RECEIVE_NO_TRUDP\n");
} else {
trudpChannelSendEvent(tcd, PROCESS_RECEIVE_NO_TRUDP, data, recvlen, NULL);

if (tcd == (void *)-1) {
LTRACK_E("Trudp", "Failed to process received data.");
} else {
int process_result = trudpChannelProcessReceivedPacket(tcd, data, recvlen);

if (process_result == -1) {
LTRACK_I("Trudp", "Received Trudp packet have unknown type.");
}
}
}
Expand Down Expand Up @@ -644,8 +646,6 @@ const char *STRING_trudpEvent(trudpEvent val) {
return "GOT_DATA";
case PROCESS_RECEIVE:
return "PROCESS_RECEIVE";
case PROCESS_RECEIVE_NO_TRUDP:
return "PROCESS_RECEIVE_NO_TRUDP";
case PROCESS_SEND:
return "PROCESS_SEND";
case GOT_DATA_NO_TRUDP:
Expand Down
8 changes: 0 additions & 8 deletions src/trudp.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,6 @@ typedef enum trudpEvent {
*/
PROCESS_RECEIVE,

/** Process received not TR-UDP data
* @param tcd Pointer to trudpData
* @param data Pointer to receive buffer
* @param data_length Receive buffer length
* @param user_data NULL
*/
PROCESS_RECEIVE_NO_TRUDP,

/** Process send data
* @param data Pointer to send data
* @param data_length Length of send
Expand Down

0 comments on commit 9a9ca03

Please sign in to comment.