@@ -48,14 +48,19 @@ class MTCL_backend : public BackendInterface {
4848 size_t filepath_len;
4949 const auto unit = new TransportUnit ();
5050 HandlerPointer->receive (&filepath_len, sizeof (size_t ));
51+ LOG (" Incoming path of length %ld" , filepath_len);
5152 unit->_filepath .reserve (filepath_len + 1 );
5253 HandlerPointer->receive (unit->_filepath .data (), filepath_len);
54+ LOG (" Received message! Path : %s" , unit->_filepath .c_str ());
5355 HandlerPointer->receive (&unit->_buffer_size , sizeof (capio_off64_t ));
56+ LOG (" Buffer size for incoming data is %ld" , unit->_buffer_size );
5457 unit->_bytes = new char [unit->_buffer_size ];
58+ LOG (" Allocated space for incoming data" );
5559 HandlerPointer->receive (unit->_bytes , unit->_buffer_size );
60+ LOG (" Received file buffer data" );
5661 HandlerPointer->receive (&unit->_start_write_offset , sizeof (capio_off64_t ));
57- LOG (" [recv] Receiving %ld bytes of file %s" , unit-> _buffer_size , unit-> _filepath . c_str ());
58- LOG ( " [recv] Offset of received chunk is %ld " , unit->_start_write_offset );
62+ LOG (" Received chunk of data should be stored on offset %ld of file %s" ,
63+ unit-> _start_write_offset , unit->_filepath . c_str () );
5964 return unit;
6065 }
6166
@@ -69,14 +74,27 @@ class MTCL_backend : public BackendInterface {
6974 * step2: send data
7075 */
7176 const size_t file_path_length = unit->_filepath .length ();
77+
7278 HandlerPointer->send (&file_path_length, sizeof (size_t ));
79+ LOG (" Size of path that is being sent: %ld" , file_path_length);
80+
7381 HandlerPointer->send (unit->_filepath .c_str (), file_path_length);
82+ LOG (" Sent file path: %s" , unit->_filepath .c_str ());
83+
7484 HandlerPointer->send (&unit->_buffer_size , sizeof (capio_off64_t ));
85+ LOG (" Size of file buffer to be sent: %ld" , unit->_buffer_size );
86+
7587 HandlerPointer->send (unit->_bytes , unit->_buffer_size );
88+ LOG (" Sent %ld bytes of data chunk" , unit->_buffer_size );
89+
7690 HandlerPointer->send (&unit->_start_write_offset , sizeof (capio_off64_t ));
77- LOG (" [send] Sent %ld bytes of file %s with offset of %ld" , unit->_buffer_size ,
78- unit->_filepath .c_str (), unit->_start_write_offset );
91+ LOG (" Sent start write offset : %ld" , unit->_start_write_offset );
92+
93+ delete unit->_bytes ;
94+ LOG (" Freed transfer unit _bytes buffer" );
95+
7996 delete unit;
97+ LOG (" Deleted transfer unit" );
8098 }
8199
82100 /* *
0 commit comments