changes to the response bundle creation (inc new timestamp value)
authoraidan
Tue, 14 Jun 2011 10:56:50 +0100
changeset 10 84c85b6450de
parent 9 b72ba16e5586
child 11 4dd7e0cb11a7
changes to the response bundle creation (inc new timestamp value)
servlib/bundling/BPQResponse.cc
servlib/bundling/BundleDaemon.cc
--- a/servlib/bundling/BPQResponse.cc	Thu Jun 09 10:57:40 2011 +0100
+++ b/servlib/bundling/BPQResponse.cc	Tue Jun 14 10:56:50 2011 +0100
@@ -19,6 +19,7 @@
 #endif
 
 #include "BPQResponse.h"
+#include "BundleTimestamp.h"
 //#include <oasys/util/ScratchBuffer.h>
 //#include "SDNV.h"
 
@@ -47,6 +48,11 @@
     // set expiry
     new_response->set_expiration(query->expiration());      // TODO: check this is ok
 
+    // reset creation timestamp (seconds = now, seqno = id)
+    BundleTimestamp* ts = new BundleTimestamp(BundleTimestamp::get_current_time(),
+                                              new_response->bundleid());
+    new_response->set_creation_ts(*ts);
+
     // set payload
     log_debug_p(LOG, "Copy response payload");
     new_response->mutable_payload()->
@@ -89,7 +95,7 @@
         BlockProcessor* new_bp = BundleProtocol::find_processor(
                                     current_bi.owner()->block_type());
 
-        BlockInfo* new_bi = new_response->api_blocks()->append_block(new_bp);
+        BlockInfo* new_bi = new_response->mutable_recv_blocks()->append_block(new_bp);
         new_bp->init_block( new_bi,
                             new_response->mutable_recv_blocks(),
                             current_bi.type(),
--- a/servlib/bundling/BundleDaemon.cc	Thu Jun 09 10:57:40 2011 +0100
+++ b/servlib/bundling/BundleDaemon.cc	Tue Jun 14 10:56:50 2011 +0100
@@ -2637,8 +2637,6 @@
      */
     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;
         }