servlib/bundling/BPQResponse.cc
changeset 7 0a3c1a78bf75
parent 6 d1f220643814
child 10 84c85b6450de
--- a/servlib/bundling/BPQResponse.cc	Mon May 30 19:36:18 2011 +0100
+++ b/servlib/bundling/BPQResponse.cc	Tue May 31 17:35:55 2011 +0100
@@ -59,12 +59,23 @@
          iter != api_blocks->end();
          ++iter)
     {
-        BlockInfo current = *iter;    
+        BlockInfo current_bi = *iter;    
+        BlockProcessor* new_bp = BundleProtocol::find_processor(
+                                    current_bi.owner()->block_type());
 
+        BlockInfo* new_bi = new_response->api_blocks()->append_block(new_bp);
+        new_bp->init_block( new_bi,
+                            new_response->api_blocks(),
+                            current_bi.type(),
+                            current_bi.flags(),
+                            (const u_char*)current_bi.data(),
+                            current_bi.full_length() );
+/*
         BlockInfo* new_bi = new BlockInfo(current);
         new_bi->set_flag(current.flags());
 
         new_response->api_blocks()->append_block(current.owner(), new_bi);
+*/
     }
 
     // copy RECV blocks
@@ -74,8 +85,20 @@
          iter != recv_blocks->end();
          ++iter)
     {
-        BlockInfo current = *iter;       
+        BlockInfo current_bi = *iter;       
+        BlockProcessor* new_bp = BundleProtocol::find_processor(
+                                    current_bi.owner()->block_type());
 
+        BlockInfo* new_bi = new_response->api_blocks()->append_block(new_bp);
+        new_bp->init_block( new_bi,
+                            new_response->mutable_recv_blocks(),
+                            current_bi.type(),
+                            current_bi.flags(),
+                            (const u_char*)current_bi.data(),
+                            current_bi.data_length() );
+
+
+/*
         BlockInfo* new_bi = new BlockInfo(current);
         new_bi->set_flag(current.flags());
 
@@ -85,8 +108,10 @@
             log_debug_p(LOG, "_COPY_  kind(%d) query_len(%d) query(%s)",
                      bpq.kind(), bpq.query_len(), bpq.query_val());
         }
+*/
     }
     
+//   new_response->xmit_blocks()
    return true;
 }