Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/tabstractwebsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ bool TAbstractWebSocket::searchEndpoint(const THttpRequestHeader &header)

int TAbstractWebSocket::parse(QByteArray &recvData)
{
tSystemDebug("parse enter data len:%ld sid:%lld", (int64_t)recvData.length(), socketDescriptor());
tSystemDebug("parse enter data len:%lld sid:%lld", (int64_t)recvData.length(), socketDescriptor());
if (websocketFrames().isEmpty()) {
websocketFrames().append(TWebSocketFrame());
} else {
Expand Down Expand Up @@ -259,7 +259,7 @@ int TAbstractWebSocket::parse(QByteArray &recvData)
}

tSystemDebug("WebSocket parse header pos: %lld", devhdr->pos());
tSystemDebug("WebSocket payload length:%ld", pfrm->payloadLength());
tSystemDebug("WebSocket payload length:%lld", pfrm->payloadLength());

int hdrlen = hdr.length() - devhdr->bytesAvailable();
ds.skipRawData(hdrlen); // Forwards the pos
Expand All @@ -269,7 +269,7 @@ int TAbstractWebSocket::parse(QByteArray &recvData)
case TWebSocketFrame::HeaderParsed: // fall through
case TWebSocketFrame::MoreData: {
tSystemDebug("WebSocket reading payload: available length:%lld", dev->bytesAvailable());
tSystemDebug("WebSocket parsing length to read:%lu current buf len:%ld", pfrm->payloadLength(), (int64_t)pfrm->payload().size());
tSystemDebug("WebSocket parsing length to read:%llu current buf len:%lld", pfrm->payloadLength(), (int64_t)pfrm->payload().size());
uint64_t size = std::min((uint64_t)(pfrm->payloadLength() - pfrm->payload().size()), (uint64_t)dev->bytesAvailable());
if (Q_UNLIKELY(size == 0)) {
Q_ASSERT(0);
Expand All @@ -293,14 +293,14 @@ int TAbstractWebSocket::parse(QByteArray &recvData)
}
}
pfrm->payload().resize(pfrm->payload().size() + size);
tSystemDebug("WebSocket payload curent buf len: %ld", (int64_t)pfrm->payload().length());
tSystemDebug("WebSocket payload curent buf len: %lld", (int64_t)pfrm->payload().length());

if ((uint64_t)pfrm->payload().size() == pfrm->payloadLength()) {
pfrm->setState(TWebSocketFrame::Completed);
tSystemDebug("Parse Completed payload len: %ld", (int64_t)pfrm->payload().size());
tSystemDebug("Parse Completed payload len: %lld", (int64_t)pfrm->payload().size());
} else {
pfrm->setState(TWebSocketFrame::MoreData);
tSystemDebug("Parse MoreData payload len: %ld", (int64_t)pfrm->payload().size());
tSystemDebug("Parse MoreData payload len: %lld", (int64_t)pfrm->payload().size());
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tactioncontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ int64_t TActionContext::writeResponse(THttpResponseHeader &header, QIODevice *bo
{

header.setContentLength(length);
tSystemDebug("content-length: %ld", (int64_t)header.contentLength());
tSystemDebug("content-length: %lld", (int64_t)header.contentLength());
header.setRawHeader(QByteArrayLiteral("Server"), QByteArrayLiteral("TreeFrog server"));
header.setCurrentDate();

Expand Down
2 changes: 1 addition & 1 deletion src/tactionthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void TActionThread::run()
try {
for (;;) {
QList<THttpRequest> requests = readRequest(_httpSocket);
tSystemDebug("HTTP request count: %ld", (int64_t)requests.count());
tSystemDebug("HTTP request count: %lld", (int64_t)requests.count());

if (requests.isEmpty()) {
break;
Expand Down
4 changes: 1 addition & 3 deletions src/test/test.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ SUBDIRS += mailmessage multipartformdata smtpmailer viewhelper paginator
SUBDIRS += fieldnametovariablename rand urlrouter urlrouter2
SUBDIRS += buildtest stack queue forlist
SUBDIRS += jscontext compression sqlitedb url malloc
!mac {
SUBDIRS += sharedmemoryhash sharedmemorymutex
}
SUBDIRS += sharedmemoryhash sharedmemorymutex
unix {
SUBDIRS += redis memcached
}
Expand Down
2 changes: 1 addition & 1 deletion src/tkvsdatabasepool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void TKvsDatabasePool::pool(TKvsDatabase &database)
if (database.isOpen()) {
cachedDatabase[engine].push(database.connectionName());
lastCachedTime[engine].store((uint)std::time(nullptr));
tSystemDebug("Pooled KVS database: %s count:%ld", qUtf8Printable(database.connectionName()), (int64_t)cachedDatabase->count());
tSystemDebug("Pooled KVS database: %s count:%lld", qUtf8Printable(database.connectionName()), (int64_t)cachedDatabase->count());
} else {
tSystemWarn("Closed KVS database connection, name: %s", qUtf8Printable(database.connectionName()));
availableNames[engine].push(database.connectionName());
Expand Down
4 changes: 2 additions & 2 deletions src/tpublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void TPublisher::unsubscribeFromAll(TAbstractWebSocket *socket)
}
}

tSystemDebug("total topics: %ld", (int64_t)pubobj.count());
tSystemDebug("total topics: %lld", (int64_t)pubobj.count());
}


Expand Down Expand Up @@ -282,6 +282,6 @@ void TPublisher::release(const QString &topic)
Pub *pub = pubobj.take(topic);
if (pub) {
delete pub;
tSystemDebug("release topic: %s (total topics:%ld)", qUtf8Printable(topic), (int64_t)pubobj.count());
tSystemDebug("release topic: %s (total topics:%lld)", qUtf8Printable(topic), (int64_t)pubobj.count());
}
}
2 changes: 1 addition & 1 deletion src/tredisdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool TRedisDriver::request(const QByteArrayList &command, QVariantList &response

for (;;) {
if (!readReply()) {
tSystemError("Redis read error pos:%d buflen:%ld", _pos, (int64_t)_buffer.length());
tSystemError("Redis read error pos:%d buflen:%lld", _pos, (int64_t)_buffer.length());
close();
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tsharedmemory_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TSharedMemory::~TSharedMemory()
bool TSharedMemory::create(size_t size)
{
static const header_t INIT_HEADER = []() {
header_t header;
static header_t header;
rwlock_init(&header.rwlock);
return header;
}();
Expand Down
6 changes: 3 additions & 3 deletions src/tsharedmemoryallocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void TSharedMemoryAllocator::setbrk(bool initial)
pb_header->endg = _sharedMemory->size();
pb_header->checksum = (uint64_t)_sharedMemory->size() * (uint64_t)_sharedMemory->size();
}
tSystemDebug("checksum = %lu", pb_header->checksum);
tSystemDebug("checksum = %llu", pb_header->checksum);

_origin = pb_header->start() + sizeof(Tf::alloc_header_t);
}
Expand Down Expand Up @@ -427,7 +427,7 @@ void TSharedMemoryAllocator::summary() const
}

tSystemDebug("-- memory block summary --");
tSystemDebug("table info: blocks = %d, free = %d, used = %lu", countBlocks(), countFreeBlocks(), pb_header->at.used);
tSystemDebug("table info: blocks = %d, free = %d, used = %llu", countBlocks(), countFreeBlocks(), pb_header->at.used);
}

// Debug function to print the entire link list
Expand All @@ -441,7 +441,7 @@ void TSharedMemoryAllocator::dump() const
Tf::alloc_header_t *cur = pb_header->alloc_head();

tSystemDebug("-- memory block information --");
tSystemDebug("table info: blocks = %d, free = %d, used = %lu, free-size = %lu, segment-size = %lu", countBlocks(), countFreeBlocks(), pb_header->at.used, sizeOfFreeBlocks(), dataSegmentSize());
tSystemDebug("table info: blocks = %d, free = %d, used = %llu, free-size = %lu, segment-size = %lu", countBlocks(), countFreeBlocks(), pb_header->at.used, sizeOfFreeBlocks(), dataSegmentSize());
tSystemDebug("block info: head = %p, tail = %p", pb_header->alloc_head(), pb_header->alloc_tail());
while (cur) {
tSystemDebug("addr = %p, size = %u, freed = %u, next = %p, prev = %p",
Expand Down
2 changes: 1 addition & 1 deletion src/tsystembus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void TSystemBus::readBus()
void TSystemBus::writeBus()
{
QMutexLocker locker(&mutexWrite);
tSystemDebug("TSystemBus::writeBus len:%ld", (int64_t)sendBuffer.length());
tSystemDebug("TSystemBus::writeBus len:%lld", (int64_t)sendBuffer.length());

for (;;) {
int len = busSocket->write(sendBuffer.data(), sendBuffer.length());
Expand Down
8 changes: 4 additions & 4 deletions src/twebsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void TWebSocket::close()

void TWebSocket::sendTextForPublish(const QString &text, const QObject *except)
{
tSystemDebug("sendText text len:%ld (pid:%d)", (int64_t)text.length(), (int)QCoreApplication::applicationPid());
tSystemDebug("sendText text len:%lld (pid:%d)", (int64_t)text.length(), (int)QCoreApplication::applicationPid());
if (except != this) {
TAbstractWebSocket::sendText(text);
}
Expand All @@ -70,7 +70,7 @@ void TWebSocket::sendTextForPublish(const QString &text, const QObject *except)

void TWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *except)
{
tSystemDebug("sendBinary binary len:%ld (pid:%d)", (int64_t)binary.length(), (int)QCoreApplication::applicationPid());
tSystemDebug("sendBinary binary len:%lld (pid:%d)", (int64_t)binary.length(), (int)QCoreApplication::applicationPid());
if (except != this) {
TAbstractWebSocket::sendBinary(binary);
}
Expand All @@ -79,7 +79,7 @@ void TWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *e

void TWebSocket::sendPong(const QByteArray &data)
{
tSystemDebug("sendPong data len:%ld (pid:%d)", (int64_t)data.length(), (int)QCoreApplication::applicationPid());
tSystemDebug("sendPong data len:%lld (pid:%d)", (int64_t)data.length(), (int)QCoreApplication::applicationPid());
TAbstractWebSocket::sendPong(data);
}

Expand All @@ -98,7 +98,7 @@ bool TWebSocket::canReadRequest() const
void TWebSocket::readRequest()
{
if (myWorkerCounter > 0) {
tSystemWarn("Worker already running (sd:%ld)", (uint64_t)socketDescriptor());
tSystemWarn("Worker already running (sd:%llu)", (uint64_t)socketDescriptor());
return;
}

Expand Down
6 changes: 3 additions & 3 deletions tools/tfmanager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ int killTreeFrogProcess(const QString &cmd)
SystemBusDaemon::releaseResource(pid);
tf_unlink(pidFilePath().toLatin1().data());
tf_unlink(oldPidFilePath().toLatin1().data());
tSystemInfo("Killed TreeFrog manager process pid:%ld", (int64_t)pid);
tSystemInfo("Killed TreeFrog manager process pid:%lld", (int64_t)pid);

TProcessInfo::kill(pids); // kills the server process
tSystemInfo("Killed TreeFrog application server processes");
Expand All @@ -456,7 +456,7 @@ void showProcessId()
{
int64_t pid = readPidOfApplication();
if (pid > 0) {
std::printf("%ld\n", pid);
std::printf("%lld\n", (int64_t)pid);
}
}

Expand Down Expand Up @@ -587,7 +587,7 @@ int managerMain(int argc, char *argv[])
// Check TreeFrog processes are running
int64_t pid = runningApplicationPid();
if (pid > 0) {
std::fprintf(stderr, "Already running pid:%ld\n", pid);
std::fprintf(stderr, "Already running pid:%lld\n", (int64_t)pid);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/tfmanager/systembusdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void SystemBusDaemon::readSocket()
}

QByteArray buf = socket->readAll();
tSystemDebug("SystemBusDaemon::read len : %ld", (int64_t)buf.size());
tSystemDebug("SystemBusDaemon::read len : %lld", (int64_t)buf.size());
if (maxServers <= 1) {
// do nothing
return;
Expand Down
Loading