mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 09:05:24 -04:00
Hackish changes to debug Windows Transfers...
Committing these so others can run tests. Most of these changes will be removed once the problem is fixed! * Fixed formatting of various serialiser item::print() fns. * Disabled printout of TlvBinaryData - data. * added AccurateTimeString() function to util/rsprint.cc * print serialise / deserialise of FileRequest & FileData + Timestamps. * added print + timestamp in ftFileProvider::getFileData() * #define TRANSFER_DEBUG to isolate these changes. * enabled debugging in fttransfermodule.cc git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3779 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9397491634
commit
06273fa775
6 changed files with 109 additions and 3 deletions
|
@ -80,3 +80,44 @@ std::string RsUtil::HashId(std::string id, bool reverse)
|
|||
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef WINDOWS_SYS
|
||||
#include <time.h>
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
static double getCurrentTS();
|
||||
|
||||
// Little fn to get current timestamp in an independent manner.
|
||||
std::string RsUtil::AccurateTimeString()
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << std::setprecision(15) << getCurrentTS();
|
||||
return out.str();
|
||||
}
|
||||
|
||||
static double getCurrentTS()
|
||||
{
|
||||
|
||||
#ifndef WINDOWS_SYS
|
||||
struct timeval cts_tmp;
|
||||
gettimeofday(&cts_tmp, NULL);
|
||||
double cts = (cts_tmp.tv_sec) + ((double) cts_tmp.tv_usec) / 1000000.0;
|
||||
#else
|
||||
struct _timeb timebuf;
|
||||
_ftime( &timebuf);
|
||||
double cts = (timebuf.time) + ((double) timebuf.millitm) / 1000.0;
|
||||
#endif
|
||||
return cts;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue