Skip to content
Snippets Groups Projects
Commit 03211e4f authored by ajf5's avatar ajf5
Browse files

bug fix

parent 4eab34f3
No related branches found
No related tags found
No related merge requests found
......@@ -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){
......
......@@ -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");
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment