Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksheeep committed May 28, 2014
1 parent da242a0 commit e7ac3e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -46,7 +46,7 @@ ccn-nfn-relay: ccn-lite-relay.c \
ccnl-ext-debug.c ccnl-ext.h ccnl-platform.c ccnl-core.c \
ccnl-ext-http.c \
ccnl-ext-sched.c ccnl-pdu.c ccnl-ext-frag.c ccnl-ext-mgmt.c \
ccnl-ext-crypto.c ccnl-ext-nfn.c Makefile
ccnl-ext-crypto.c ccnl-ext-nfn.c krivine.c krivine-common.c Makefile
${CC} -o $@ ${MYCFLAGS} ${NFNFLAGS} $< ${EXTLIBS}

ccn-lite-relay: ccn-lite-relay.c \
Expand Down
1 change: 1 addition & 0 deletions ccnl-core.c
Expand Up @@ -717,6 +717,7 @@ ccnl_interest_remove_continue_computations(struct ccnl_relay_s *ccnl,
struct ccnl_interest_s *interest;
int faceid = 0;
DEBUGMSG(99, "ccnl_interest_remove_continue_computations()\n");

#ifdef CCNL_NFN
if(i != 0 && i->from != 0){
faceid = i->from->faceid;
Expand Down
11 changes: 3 additions & 8 deletions ccnl-ext-nfn.c
Expand Up @@ -162,18 +162,13 @@ ccnl_nfn(struct ccnl_relay_s *ccnl, struct ccnl_buf_s *orig,
ccnl_nfn_remove_thunk_from_prefix(config->prefix);
}
struct ccnl_content_s *c = create_content_object(ccnl, config->prefix, res, strlen((char *)res));

c->flags = CCNL_CONTENT_FLAGS_STATIC;

set_propagate_of_interests_to_1(ccnl, c->name);
ccnl_content_serve_pending(ccnl,c);
ccnl_content_add2cache(ccnl, c);
--numOfRunningComputations;
struct ccnl_interest_s *interest = NULL;
for(interest = ccnl->pit; interest; interest = interest->next){
if(!ccnl_prefix_cmp(interest->prefix, 0, c->name, CMP_EXACT)){
interest->propagate = 1;
break;
}
}

DBL_LINKED_LIST_REMOVE(configuration_list, config);
}

Expand Down
12 changes: 10 additions & 2 deletions krivine-common.c
Expand Up @@ -38,8 +38,6 @@ ccnl_prefix_to_path2(struct ccnl_prefix_s *pr)
return prefix_buf;
}



struct fox_machine_state_s *
new_machine_state(int thunk_request, int num_of_required_thunks){
struct fox_machine_state_s *ret = malloc(sizeof(struct fox_machine_state_s));
Expand Down Expand Up @@ -258,6 +256,15 @@ create_prefix_from_name(char* namestr)
}

#ifndef USE_UTIL
void
set_propagate_of_interests_to_1(struct ccnl_relay_s *ccnl, struct ccnl_prefix_s *pref){
struct ccnl_interest_s *interest = NULL;
for(interest = ccnl->pit; interest; interest = interest->next){
if(!ccnl_prefix_cmp(interest->prefix, 0, pref, CMP_EXACT)){
interest->propagate = 1;
}
}
}

struct ccnl_prefix_s *
create_prefix_for_content_on_result_stack(struct ccnl_relay_s *ccnl, struct configuration_s *config){
Expand Down Expand Up @@ -560,6 +567,7 @@ ccnl_nfn_reply_thunk(struct ccnl_relay_s *ccnl, struct configuration_s *config){
int thunk_time = (int)config->thunk_time;
sprintf(reply_content, "%d", thunk_time);
struct ccnl_content_s *c = create_content_object(ccnl, original_prefix, (unsigned char*)reply_content, strlen(reply_content));
set_propagate_of_interests_to_1(ccnl, c->name);
ccnl_content_add2cache(ccnl, c);
ccnl_content_serve_pending(ccnl,c);
return 0;
Expand Down

0 comments on commit e7ac3e7

Please sign in to comment.