# HG changeset patch # User aidan # Date 1303836661 -3600 # Node ID 9daf757dfa634a82b704486ca256deb7e0ccf2f5 # Parent 44c5e3fa6d30d52844cf969839cb3dda78cc05c0 small logging additions to dtnrespond matching function diff -r 44c5e3fa6d30 -r 9daf757dfa63 apps/dtnrespond/dtnrespond.c --- a/apps/dtnrespond/dtnrespond.c Tue Apr 26 14:43:43 2011 +0100 +++ b/apps/dtnrespond/dtnrespond.c Tue Apr 26 17:51:01 2011 +0100 @@ -454,7 +454,8 @@ match_bpq(const dtn_bpq_extension_block_data_t * bpq, const char * matching_filename, char * pathname, - int * found) + int * found, + int verbose) { char line[PATH_MAX]; char trim_response_path[PATH_MAX]; @@ -463,9 +464,13 @@ *found = 0; - if ((file = fopen(matching_filename, "r")) == 0) + if ((file = fopen(matching_filename, "r")) == 0) { + if (verbose) fprintf(stderr, "ERROR: Unable to open matching file: %s\n", matching_filename); return -1; + } + if (verbose) fprintf(stderr, "trying to match the query: %s\n", bpq->query.query_val); + memset(line, 0 , PATH_MAX); while (fgets(line, PATH_MAX, file) != NULL) { strtok(line, ","); @@ -782,7 +787,7 @@ return ret; } - match_bpq(&bpq_block_data, matching_filename, pathname, &found); + match_bpq(&bpq_block_data, matching_filename, pathname, &found, verbose); break; } } diff -r 44c5e3fa6d30 -r 9daf757dfa63 apps/dtnrespond/matching_file.csv --- a/apps/dtnrespond/matching_file.csv Tue Apr 26 14:43:43 2011 +0100 +++ b/apps/dtnrespond/matching_file.csv Tue Apr 26 17:51:01 2011 +0100 @@ -1,1 +1,2 @@ -matching_rule,encoding,query,/home/aidan/Desktop,300 +1,asd,qwe,/home/aidan/bpq_files,2011-01-01 +1,asd,qwe,/home/aidan/more bpq files/,2011-03-01