servlib/bundling/BundleDaemon.cc
changeset 66 e1101c5d54a1
parent 64 1296a0283271
child 67 cfe2328ba1c6
--- a/servlib/bundling/BundleDaemon.cc	Wed Oct 26 13:33:11 2011 +0100
+++ b/servlib/bundling/BundleDaemon.cc	Fri Jan 06 17:28:36 2012 +0000
@@ -923,14 +923,15 @@
 
     }
 
-    // try to handle a BPQ block
-    if ( event->source_ == EVENTSRC_APP   || 
-         event->source_ == EVENTSRC_PEER  || 
-         event->source_ == EVENTSRC_STORE ||
-         event->source_ == EVENTSRC_FRAGMENTATION) {
-
-		handle_bpq_block(bundle, event);
-
+    if ( bpq_cache_->cache_enabled_ ) {
+    	// try to handle a BPQ block
+    	if ( event->source_ == EVENTSRC_APP   ||
+			 event->source_ == EVENTSRC_PEER  ||
+			 event->source_ == EVENTSRC_STORE ||
+			 event->source_ == EVENTSRC_FRAGMENTATION) {
+
+			handle_bpq_block(bundle, event);
+		}
     }
 
     // If the bundle contains a BPQ query that was successfully answered
@@ -2690,8 +2691,7 @@
 
     } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE) {
     	// don't accept local responses
-    	if (!local_bundle &&
-    		!bundle->is_fragment()	) {//TODO: remove this temp frag exclusion
+    	if (!local_bundle) {
 
     		if (bpq_cache()->add_response_bundle(bundle, &bpq_block) &&
     			event->source_ != EVENTSRC_STORE) {
@@ -2700,8 +2700,8 @@
 				actions_->store_add(bundle);
     		}
     	}
+
     } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE_DO_NOT_CACHE_FRAG) {
-
     	// don't accept local responses
     	if (!local_bundle &&
     		!bundle->is_fragment()	) {
@@ -2714,8 +2714,6 @@
     		}
     	}
 
-
-    	log_info_p("/dtn/daemon/bpq", "Query: %s answered completely");
     } else {
         log_err_p("/dtn/daemon/bpq", "ERROR - BPQ Block: invalid kind %d", 
             bpq_block.kind());