From 5e9e642672ba2e639239beed9f4fe58ad377a370 Mon Sep 17 00:00:00 2001
From: afederici <ajf5@illinois.edu>
Date: Wed, 18 Nov 2020 22:42:31 -0600
Subject: [PATCH] bug fix

---
 src/TcpSocket.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp
index 82fd73a..bb59c25 100644
--- a/src/TcpSocket.cpp
+++ b/src/TcpSocket.cpp
@@ -139,6 +139,7 @@ void TcpSocket::sendLines(string ip, string port, string execfile, string readfi
 	vector<string> unDirectory = splitString(readfile, "-");
 	string toSend = execfile + "," + readfile + "," + to_string(start) + "," + prefix+"-tmp"+to_string(start)+"-"+unDirectory[1];
 	Messages msg(PUT, toSend);
+	cout << "[CHUNK] " << msg.toString() << endl;
 	string payload = msg.toString();
 	if (send(sockfd, payload.c_str(), strlen(payload.c_str()), 0) == -1) {
 		perror("send");
@@ -150,8 +151,8 @@ 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;
+		else if (lineCounter == start) cout << "[CHUNK] starting to send at line " << to_string(lineCounter) << endl;
+		if (lineCounter >= end) { cout << "Counter at " << to_string(lineCounter) << " end: " << to_string(end) << endl; break; }
 		if (send(sockfd, str.c_str(), strlen(str.c_str()), 0) == -1) {
 			perror("send");
 		}
-- 
GitLab