diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp index 0b37e985f1071c92b5e5d5bccc6da6413d474c89..99e4a564ffffd4b73510526449705a1d8eaeb045 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 c6f4f1e5abd1fceea13b0e97006c90644014350e..3347ec6684280c8847b6ab2848b4016fe90187f3 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);