Browse Source

Resolving merge conflict

Sajin Sasy 1 year ago
parent
commit
2466f062ed
2 changed files with 4 additions and 1 deletions
  1. 2 1
      App/net.cpp
  2. 2 0
      App/net.hpp

+ 2 - 1
App/net.cpp

@@ -21,7 +21,7 @@ size_t client_count = 0;
 NodeIO::NodeIO(tcp::socket &&socket, nodenum_t nodenum) :
     sock(std::move(socket)), node_num(nodenum), msgsize_inflight(0),
     chunksize_inflight(0), recv_msgsize_inflight(0),
-    recv_chunksize_inflight(0)
+    recv_chunksize_inflight(0), bytes_sent(0)
 {
 }
 
@@ -88,6 +88,7 @@ void NodeIO::async_send_commands()
             commands_deque_lock.lock();
             assert(!commands_inflight.empty() &&
                 &(commands_inflight.front()) == commandp);
+            bytes_sent = bytes_sent + 5 + std::get<2>(*commandp);
             uint8_t *data = std::get<1>(*commandp);
             commands_inflight.pop_front();
             if (commands_inflight.size() > 0) {

+ 2 - 0
App/net.hpp

@@ -92,6 +92,8 @@ class NodeIO {
     // The static frame used to receive a chunk
     uint8_t receive_frame[FRAME_SIZE];
 
+    uint64_t bytes_sent; // count bytes sent
+
     void send_header_data(uint64_t header, uint8_t *data, size_t len);
 
     // Asynchronously send the first message from the command queue.