table based cache working with complete bundles (as before)
authoraidan
Thu, 06 Oct 2011 12:15:22 +0100
changeset 58 574358af597b
parent 57 bb780f1beb9b
child 59 e5674a26ce74
table based cache working with complete bundles (as before)
servlib/bundling/BPQCache.cc
servlib/bundling/BPQCacheEntry.cc
servlib/bundling/BPQCacheEntry.h
--- a/servlib/bundling/BPQCache.cc	Wed Oct 05 13:57:27 2011 +0100
+++ b/servlib/bundling/BPQCache.cc	Thu Oct 06 12:15:22 2011 +0100
@@ -123,8 +123,8 @@
 										 current_fragment,
 										 local_eid);
 
-		BundleReceivedEvent e(new_response, EVENTSRC_CACHE);
-		BundleDaemon::instance()->post(&e);
+		BundleReceivedEvent* e = new BundleReceivedEvent(new_response, EVENTSRC_CACHE);
+		BundleDaemon::instance()->post(e);
 
 		if( !is_complete ){
 			BPQFragment bpq_frag( current_fragment->frag_offset(),
--- a/servlib/bundling/BPQCacheEntry.cc	Wed Oct 05 13:57:27 2011 +0100
+++ b/servlib/bundling/BPQCacheEntry.cc	Thu Oct 06 12:15:22 2011 +0100
@@ -24,7 +24,7 @@
 {
 	if ( ! bundle->is_fragment() ) {
 		log_debug("add complete response to cache entry");
-		bundle_ = bundle;
+		fragments_.insert_sorted(bundle, BundleList::SORT_FRAG_OFFSET);
 		is_complete_ = true;
 
 	} else if ( bundle->is_fragment() && ! is_complete_ ) {
--- a/servlib/bundling/BPQCacheEntry.h	Wed Oct 05 13:57:27 2011 +0100
+++ b/servlib/bundling/BPQCacheEntry.h	Thu Oct 06 12:15:22 2011 +0100
@@ -35,6 +35,7 @@
 public:
 	BPQCacheEntry() :
         Logger("BPQCacheEntry", "/dtn/bundle/bpq"),
+        bundle_(new Bundle(), "cache_entry"),
         fragments_("cache_entry") {}
 
 	int add_response(Bundle* bundle);