From b96ab8ddc4869d9ee4b97dfdf8adde87afe1dbad Mon Sep 17 00:00:00 2001
From: afederici <ajf5@illinois.edu>
Date: Mon, 30 Nov 2020 02:57:59 -0600
Subject: [PATCH] debugging

---
 src/TcpSocket.cpp | 4 ++--
 src/Threads.cpp   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp
index 0b37e98..99e4a56 100644
--- a/src/TcpSocket.cpp
+++ b/src/TcpSocket.cpp
@@ -152,8 +152,8 @@ void TcpSocket::mergeFiles(string ip, string port, string handler, string filede
 			if (fp == NULL) printf("Could not open file to send %s.", toProcess[index].c_str());
 			else {
 				int sj;
-				try { sj = stoi(toStart[index+1]); }
-				catch (...) { cout << "[ERROR] stoi: " << "send file size (" <<  toStart[index] << toStart[index+1] << ") from " << payload << endl; exit(1);}
+				try { sj = stoi(toProcess[index+1]); }
+				catch (...) { cout << "[ERROR] stoi: " << "send file size (" <<  toProcess[index] << toProcess[index+1] << ") from " << payload << endl; exit(1);}
 				sendFile(sockfd, fp, sj);
 				fclose(fp);
 			}
diff --git a/src/Threads.cpp b/src/Threads.cpp
index c6f4f1e..3347ec6 100644
--- a/src/Threads.cpp
+++ b/src/Threads.cpp
@@ -51,7 +51,7 @@ void *runTcpSender(void *tcpSocket)
 			if (overwritefilename.compare("") != 0) localfilename = overwritefilename;
 			string header = sdfsfilename + "," + msgSplit[1];
 			string toSend = msgSplit[1] + "," + to_string(size);
-			cout << "[DEBUG] " << toSend << endl;
+			//cout << "[DEBUG] " << toSend << endl;
 			string forwardMsg = msgSplit[0] + "::" + to_string(PUTACK) + "::" + localfilename + "::" + header + "::" + toSend + "::";
 			tcp->pendSendMessages.pop();
 			tcp->mergeMessages.push(forwardMsg);
-- 
GitLab