Skip to content

Commit

Permalink
Change compare for computation
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksheeep committed Apr 17, 2014
1 parent 6db94c6 commit 8fe5664
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions krivine-common.c
Expand Up @@ -280,8 +280,8 @@ ccnl_nfn_local_content_search(struct ccnl_relay_s *ccnl, struct ccnl_interest_s
struct ccnl_content_s *c_iter;
for(c_iter = ccnl->contents; c_iter; c_iter = c_iter->next){
unsigned char *md;
md = i->prefix->compcnt - c_iter->name->compcnt == 1 ? compute_ccnx_digest(c_iter->pkt) : NULL;
if(ccnl_prefix_cmp(c_iter->name, md, i->prefix, type)){
md = c_iter->name->compcnt; //i->prefix->compcnt - c_iter->name->compcnt == 1 ? compute_ccnx_digest(c_iter->pkt) : NULL;
if(ccnl_prefix_cmp(c_iter->name, md, i->prefix, type)){ //FIXME: discuss how to compare WHAT IS MD?
return c_iter;
}
}
Expand Down Expand Up @@ -397,7 +397,7 @@ ccnl_nfn_global_content_search(struct ccnl_relay_s *ccnl, struct configuration_s
pthread_cond_wait(&config->thread->cond, &config->thread->mutex);
//local search. look if content is now available!
DEBUGMSG(99,"Got signal CONTINUE\n");
if((c = ccnl_nfn_local_content_search(ccnl, interest, CMP_MATCH)) != NULL){
if((c = ccnl_nfn_local_content_search(ccnl, interest, CMP_EXACT)) != NULL){
DEBUGMSG(49, "Content now available: %s\n", c->content);
return c;
}
Expand Down
5 changes: 2 additions & 3 deletions krivine.c
Expand Up @@ -338,7 +338,7 @@ ccnl_nfn_handle_network_search(struct ccnl_relay_s *ccnl, struct configuration_s
//search
struct ccnl_interest_s *interest = ccnl_nfn_create_interest_object(ccnl, config, out, len, namecomp[0]); //FIXME: NAMECOMP[0]???
interest->from->faceid = config->thread->id;
if((c = ccnl_nfn_local_content_search(ccnl, interest, CMP_MATCH)) != NULL){
if((c = ccnl_nfn_local_content_search(ccnl, interest, CMP_EXACT)) != NULL){
DEBUGMSG(49, "Content locally found\n");
//ccnl_interest_remove(ccnl, interest);
return c;
Expand Down Expand Up @@ -389,10 +389,9 @@ ZAM_term(struct ccnl_relay_s *ccnl, struct configuration_s *config,
char *pending, *p, *cp;
int len;
char *prog = config->prog;
DEBUGMSG(99, "DUMMYBUF: %s \n", dummybuf);
memset(dummybuf, 0, 2000);

//pop closure

if (!prog || strlen(prog) == 0) {
if(config->result_stack){
return config->result_stack->content;
Expand Down

0 comments on commit 8fe5664

Please sign in to comment.