Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c5f4d7d8f |
@@ -176,18 +176,6 @@ bool Utility::fmod(double dividend, double divisor)
|
|||||||
return std::fabs(remainder) < epsilon;
|
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
|
inline
|
||||||
size_t Utility::getAvailableDiskSpace(const String& path)
|
size_t Utility::getAvailableDiskSpace(const String& path)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <sstp/clientsocketsender.hpp>
|
#include <sstp/clientsocketsender.hpp>
|
||||||
|
#include <common/utility.hpp>
|
||||||
|
|
||||||
/// @brief This is to provide a definition for SmartPointer
|
/// @brief This is to provide a definition for SmartPointer
|
||||||
ClientSocketSender::ClientSocketSender()
|
ClientSocketSender::ClientSocketSender()
|
||||||
@@ -69,6 +70,7 @@ bool ClientSocketSender::sendFile(String &pathFileName)
|
|||||||
sendPutIndicator(pathFileName, fileLength);
|
sendPutIndicator(pathFileName, fileLength);
|
||||||
Array<char> readBuffer;
|
Array<char> readBuffer;
|
||||||
readBuffer.size(BUFFER_LENGTH);
|
readBuffer.size(BUFFER_LENGTH);
|
||||||
|
std::cout << "Sending file " << pathFileName << Utility::byteCountToString(fileLength, false) << std::endl;
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
size_t bytesRead = readFile.read(&readBuffer[0], readBuffer.size());
|
size_t bytesRead = readFile.read(&readBuffer[0], readBuffer.size());
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int returnCode(0);
|
int returnCode(0);
|
||||||
Profiler profiler;
|
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;
|
std::cout << "sstp version " << version.str() << std::endl;
|
||||||
if(!registerSignalHandler())
|
if(!registerSignalHandler())
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ bool SocketConnectionReceiver::handlePut(Block<String> &commands)
|
|||||||
double elapsedTimeSeconds = profiler.elapsed()/1000.00;
|
double elapsedTimeSeconds = profiler.elapsed()/1000.00;
|
||||||
double bytesPerSecond = totalBytesRead / elapsedTimeSeconds;
|
double bytesPerSecond = totalBytesRead / elapsedTimeSeconds;
|
||||||
String strBytesPerSecond = Utility::byteCountToString(bytesPerSecond);
|
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();
|
writeFile.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user