servlib/bundling/BundleDaemon.cc
changeset 7 0a3c1a78bf75
parent 6 d1f220643814
child 10 84c85b6450de
--- a/servlib/bundling/BundleDaemon.cc	Mon May 30 19:36:18 2011 +0100
+++ b/servlib/bundling/BundleDaemon.cc	Tue May 31 17:35:55 2011 +0100
@@ -414,7 +414,7 @@
                    (char*)current_bpq.query_val());
 
         if ( bpq_block->match(&current_bpq) ) {
-            log_info("_BPQ_M MATCH SUCCESSFUL");
+            log_info("_BPQ_M MATCH SUCCESSFUL - remove & add");
             bpq_bundles_->erase(current_bundle);
             break;
         } 
@@ -477,7 +477,7 @@
                    (char*)current_bpq.query_val());
 
         if ( bpq_block->match(&current_bpq) ) {
-            log_info("_BPQ_M MATCH SUCCESSFUL");
+            log_info("_BPQ_M MATCH SUCCESSFUL - answer");
 
             Bundle* response = new Bundle();
             BPQResponse::create_bpq_response(response,
@@ -499,7 +499,7 @@
         }
     }
 
-    log_info("_BPQ_ No response was found for the BPQ query *%p", bpq_block);
+    log_info("_BPQ_ No response was found for the BPQ query");
     return false;
 }
 
@@ -515,6 +515,16 @@
          iter != bpq_bundles_->end();
          ++iter)
     {
+/*
+        Bundle* bundle = *iter;
+        if (log_enabled(oasys::LOG_DEBUG)) {
+            oasys::StaticStringBuffer<1024> buf;
+            buf.appendf("_CACHE_ BUNDLE\n");
+            bundle->format_verbose(&buf);
+            log_multiline(oasys::LOG_DEBUG, buf.c_str());
+        }
+*/
+
         Bundle* current_bundle = *iter;
 
         if ( (! current_bundle->recv_blocks().
@@ -527,9 +537,11 @@
 
         BPQBlock bpq(current_bundle);
         log_debug("_CACHE_ (%d) kind(%d) query_len(%d) query(%s)",
-                    i, bpq.kind(), bpq.query_len(), bpq.query_val());
+                    i+1, bpq.kind(), bpq.query_len(), bpq.query_val());
         i++;
     }
+    if ( i==0 )
+        log_debug("_CACHE_ empty");
 }
 
 
@@ -1130,9 +1142,9 @@
     log_debug("trying to delete xmit blocks for bundle id:%d on link %s",
               bundle->bundleid(),link->name());
 
-    if ( ! bpq_bundles_->contains(bundle) ) {
+//    if ( ! bpq_bundles_->contains(bundle) ) {
         BundleProtocol::delete_blocks(bundle, link);
-    }
+//    }
 
     blocks = NULL;
 
@@ -2625,6 +2637,8 @@
      */
     if (bpq_block.kind() == BPQBlock::KIND_QUERY) {
         if (answer_bpq_query(bundle, &bpq_block)) {
+//HACK...
+            BundleProtocol::delete_blocks(bundle, event->link_); 
             event->daemon_only_ = true;
         }