# HG changeset patch # User aidan # Date 1326208916 0 # Node ID 51693ac735a5aea49509f1f76d595756708e6210 # Parent cfd4a4e36ea2a14dd22f02afd819e3e931c067c4 debug logging diff -r cfd4a4e36ea2 -r 51693ac735a5 apps/dtnrespond/dtnrespond.c --- a/apps/dtnrespond/dtnrespond.c Tue Jan 10 14:50:22 2012 +0000 +++ b/apps/dtnrespond/dtnrespond.c Tue Jan 10 15:21:56 2012 +0000 @@ -477,7 +477,8 @@ char * response_path, int response_path_len, dtn_timeval_t * response_expiry, - int * found) + int * found, + int verbose) { char line[PATH_MAX]; char trim_path[PATH_MAX]; @@ -488,9 +489,15 @@ char * expiry; FILE * file; - if ((file = fopen(matching_filename, "r")) == 0) + if ((file = fopen(matching_filename, "r")) == 0) { + fprintf(stderr, "Error opening matching file: %s\n", + matching_filename); return -1; + } + if (verbose) fprintf(stdout, "Matching query: %s\n", + bpq->query.query_val); + while (1) { memset(line, 0 , PATH_MAX); *found = 0; @@ -518,6 +525,8 @@ strlen(query) != bpq->query.query_len || strncmp(query, bpq->query.query_val, bpq->query.query_len) != 0) { + if (verbose) fprintf(stdout, "Line [%s] does not match\n",line); + continue; } @@ -1003,7 +1012,8 @@ pathname, PATH_MAX, &bundle_expiry, - &found); + &found, + verbose); break; }