cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

introduces null checks for functions in ccnl-interest.c/refactoring #307

Closed mfrey closed 5 years ago

mfrey commented 5 years ago

Contribution description

The PR introduces NULL checks for functions ccnl_interest_isSame and ccnl_interest_remove_pending, and ccnl_interest_append_pending in ccnl-interest.c and the corresponding unit tests (for now just the failing functions). It also removes dead code from ccnl-interests.c (a function called ccnl_interest_new) and moves a function ccnl_interest_new from ccnl-relay.c.

Issues/PRs references

None

mfrey commented 5 years ago

I'm note sure about moving ccnl_interest_new from ccnl-relay.c to ccnl_interest.c since the function operates on a data structure adherent to ccnl-relay. Maybe we should make new functions which are called in ccnl-relay.c and remove the "raw operation" on the data structure. However, this solution would introduce a new level of indirection and not really solve the "issue".