bpq responde fix
authoraidan
Tue, 10 Jan 2012 15:42:32 +0000
changeset 71 fdb6e00dacc9
parent 70 51693ac735a5
child 72 e978673d3bc2
bpq responde fix
apps/dtnrespond/dtnrespond.c
--- a/apps/dtnrespond/dtnrespond.c	Tue Jan 10 15:21:56 2012 +0000
+++ b/apps/dtnrespond/dtnrespond.c	Tue Jan 10 15:42:32 2012 +0000
@@ -522,10 +522,8 @@
     	// match query
         if (atoi(matching_rule) != (int)bpq->matching_rule		||
 			BPQ_MATCHING_RULE_EXACT != bpq->matching_rule		||
-			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);
+			strlen(query) != strlen(bpq->query.query_val)		||
+        	strncmp(query, bpq->query.query_val, strlen(query)) != 0) {
 
         	continue;
         }
@@ -535,7 +533,7 @@
         trim_whitespace(path, trim_path, PATH_MAX);
 
         // make sure the file exists
-        if (response_path_exists(trim_path)) {
+        if (response_path_exists(trim_path) == DTN_SUCCESS) {
         	*found = 1;
         	*response_kind = (u_int) atoi(kind);
         	*response_expiry = (dtn_timeval_t) atoi(expiry);