apps/dtnrespond/dtnrespond.c
changeset 2 9daf757dfa63
parent 1 44c5e3fa6d30
--- 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;
             }                
         }