From: hama Date: Wed, 18 Mar 2015 22:52:16 +0000 (+0100) Subject: min/max fixes, tcp send log X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=3d673eadca7343e7036e33007dd6d92102c852e3;p=crepublib min/max fixes, tcp send log --- diff --git a/base/rebase.hpp b/base/rebase.hpp index 6a109f0..a358798 100644 --- a/base/rebase.hpp +++ b/base/rebase.hpp @@ -61,8 +61,6 @@ inline int getLastOSError() { # include # include # include -#undef min -#undef max # define _memcmp(t,s,n) memcmp(t,s,n) # define lstat stat # define millisecSleep(msec) Sleep(msec) @@ -102,6 +100,8 @@ public: public: virtual void process() = 0; }; +#undef min +#undef max /** Returns the minimum of 2 values. * @param a first value * @param b 2nd value diff --git a/net/ReTCP.cpp b/net/ReTCP.cpp index acd5871..6374762 100644 --- a/net/ReTCP.cpp +++ b/net/ReTCP.cpp @@ -317,13 +317,12 @@ void ReTCPConnection::send(const char* command, const char* data, int length) { ++m_noSent; m_toSend.setLength(0); int flags = 0x7b; - length += 8; + int rest = length + 8; m_toSend.appendInt(length | (flags << 24), "%08x"); m_toSend.appendFix(command, -1, 8, 8, NULL); m_toSend.append(data, length); - length += 8; + rest += 8; int sent = 0; - int rest = length; const char* buf = m_toSend.str(); int rounds = 0; while (rest > 0) { @@ -339,8 +338,8 @@ void ReTCPConnection::send(const char* command, const char* data, int length) { } if (rest == 0) m_loggerOwner->logger()->sayF(LOG_DEBUG | CAT_NETWORK, LC_WRITE_2, - i18n("sent: $1 bytes in $2 round(s): $3")).arg(length).arg(rounds) - .arg(ReByteBuffer().appendDump(data, length, 80).str()).end(); + i18n("sent: $1 bytes in $2 round(s): $3 $4")).arg(length).arg(rounds) + .arg(command).arg(ReByteBuffer().appendDump(data, length, 80).str()).end(); } /**