diff --git a/sys/shell/commands/sc_ccnl.c b/sys/shell/commands/sc_ccnl.c index 96976185b1..91f879ca79 100644 --- a/sys/shell/commands/sc_ccnl.c +++ b/sys/shell/commands/sc_ccnl.c @@ -169,8 +169,12 @@ int _ccnl_interest(int argc, char **argv) for (int cnt = 0; cnt < CCNL_INTEREST_RETRIES; cnt++) { ccnl_send_interest(CCNL_SUITE_NDNTLV, argv[1], relay_addr, addr_len, NULL, _int_buf, BUF_SIZE); - ccnl_wait_for_chunk(_cont_buf, BUF_SIZE); + if (ccnl_wait_for_chunk(_cont_buf, BUF_SIZE) > 0) { + printf("Content received: %s\n", _cont_buf); + return 0; + } } + printf("Timeout! No content received in response to the Interest for %s.\n", argv[1]); - return 0; + return -1; }