maintenance

This commit is contained in:
2025-12-05 09:22:45 -05:00
parent ebb7628498
commit 5c5f4d7d8f
4 changed files with 4 additions and 14 deletions

View File

@@ -176,18 +176,6 @@ bool Utility::fmod(double dividend, double divisor)
return std::fabs(remainder) < epsilon;
}
// inline
// size_t Utility::getAvailableDiskSpace(const String& path)
// {
// struct statvfs stat;
// if (::statvfs(path, &stat) != 0)
// {
// throw new Exception("Error calling statvfs to get available disk space.");
// }
// // Calculate available space in bytes. Multiply Number of free inodes * Fragment size
// return (size_t)stat.f_bavail * stat.f_frsize;
// }
inline
size_t Utility::getAvailableDiskSpace(const String& path)
{

View File

@@ -1,4 +1,5 @@
#include <sstp/clientsocketsender.hpp>
#include <common/utility.hpp>
/// @brief This is to provide a definition for SmartPointer
ClientSocketSender::ClientSocketSender()
@@ -69,6 +70,7 @@ bool ClientSocketSender::sendFile(String &pathFileName)
sendPutIndicator(pathFileName, fileLength);
Array<char> readBuffer;
readBuffer.size(BUFFER_LENGTH);
std::cout << "Sending file " << pathFileName << Utility::byteCountToString(fileLength, false) << std::endl;
while(true)
{
size_t bytesRead = readFile.read(&readBuffer[0], readBuffer.size());

View File

@@ -25,7 +25,7 @@ int main(int argc, char **argv)
{
int returnCode(0);
Profiler profiler;
String version = "1.0.0.6"; // major version, minor version, patch, build
String version = "1.0.0.7"; // major version, minor version, patch, build
std::cout << "sstp version " << version.str() << std::endl;
if(!registerSignalHandler())

View File

@@ -149,7 +149,7 @@ bool SocketConnectionReceiver::handlePut(Block<String> &commands)
double elapsedTimeSeconds = profiler.elapsed()/1000.00;
double bytesPerSecond = totalBytesRead / elapsedTimeSeconds;
String strBytesPerSecond = Utility::byteCountToString(bytesPerSecond);
std::cout << "Transferred " << Utility::byteCountToString(totalBytesRead,false) << " of " << Utility::byteCountToString(fileLength,false) << " " << percent << " percent " << strBytesPerSecond << std::endl;
std::cout << "Received " << Utility::byteCountToString(totalBytesRead,false) << " of " << Utility::byteCountToString(fileLength,false) << " " << percent << " percent " << strBytesPerSecond << std::endl;
}
}
writeFile.close();