diff --git a/src/Node.cpp b/src/Node.cpp index db8d4b0e4117a22dbe376ecb98bbfa74bbbca0dd..ae531c89d42a8874dad128f408e6fca97f90772b 100644 --- a/src/Node.cpp +++ b/src/Node.cpp @@ -882,6 +882,7 @@ void Node::handleTcpMessage() } case CHUNKACK: { + cout << "[CHUNKACK] receiving the put worked!" << endl //IP, exec, start, temp, actual file, prefix if (!isLeader) { //forward to know that the file was put okay @@ -924,6 +925,7 @@ void Node::handleTcpMessage() tcpServent->sendMessage(leaderIP, TCPPORT, ackMsg.toString()); break; } + cout << "[CHUNKACK] leader confirming the chunk was received" << endl; vector<tuple<string,string>> temp; for (auto &e : mapleSending[inMsg[0]]){ if (get<0>(e).compare(inMsg[4]) == 0){ diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp index 545d9109fee99c3a5c4361ab2c76bf38086803bd..1a454828d2fdc1204efdcbe3d4d3f43742121fd8 100644 --- a/src/TcpSocket.cpp +++ b/src/TcpSocket.cpp @@ -149,6 +149,7 @@ void TcpSocket::sendLines(string ip, string port, string execfile, string readfi { lineCounter++; if (lineCounter < start) continue; + else if (lineCounter == start) cout << "[CHUNK] starting to send at line " << lineCounter << endl; if (lineCounter >= end) break; if (send(sockfd, str.c_str(), strlen(str.c_str()), 0) == -1) { perror("send"); diff --git a/src/Threads.cpp b/src/Threads.cpp index 42d2f99b861ee926b5451e59b205e35c7c75a996..df5a71fd095da75a85dc441ee64019a4d027ee18 100644 --- a/src/Threads.cpp +++ b/src/Threads.cpp @@ -38,6 +38,7 @@ void *runTcpSender(void *tcpSocket) //IP, exec, file, start, prefix, end int start = stoi(msgSplit[3]); int end = stoi(msgSplit[5]); + cout << "[CHUNK] sending : " << sdfsfilename << " from " << msgSplit[3] << " to " << msgSplit[5] << endl; tcp->sendLines(nodeIP, TCPPORT, localfilename, sdfsfilename, msgSplit[4], start, end); //exec, file, start, end } else tcp->sendFile(nodeIP, TCPPORT, localfilename, sdfsfilename, remoteLocalfilename, overwrite);