diff --git a/VERSION.TXT b/VERSION.TXT index 091958b..3247c46 100644 --- a/VERSION.TXT +++ b/VERSION.TXT @@ -1,5 +1,12 @@ NORM Version History +Version 1.5r6 +============= + - Fixed Protolib ProtoBitmask bug for NDEBUG (release) builds. + This is an IMPORTANT fix! (Thanks to Deepak Pengoria and + Kirill Kropivyanskiy) + - Fix to use of gmtime() call in normApp.cpp for WIN32 builds + Version 1.5r5 ============= - Added NORM_REMOTE_SENDER_RESET event to notify app when the sender diff --git a/examples/normMsgr.cpp b/examples/normMsgr.cpp index b1a6a24..cf4e9b8 100644 --- a/examples/normMsgr.cpp +++ b/examples/normMsgr.cpp @@ -528,6 +528,11 @@ bool NormMsgr::EnqueueMessageObject() NormSetWatermark(norm_session, object); norm_tx_watermark_pending = true; } + else + { + // TBD - make non-flow control acking separable option? + NormSetWatermark(norm_session, object); + } } return true; } // end NormMsgr::EnqueueMessageObject() @@ -550,8 +555,11 @@ void NormMsgr::HandleNormEvent(const NormEvent& event) if (NORM_ACK_SUCCESS == NormGetAckingStatus(norm_session)) { //fprintf(stderr, "WATERMARK COMPLETED\n"); - norm_tx_queue_count -= (norm_tx_queue_max / 2); - norm_tx_watermark_pending = false; + if (norm_tx_watermark_pending) + { + norm_tx_queue_count -= (norm_tx_queue_max / 2); + norm_tx_watermark_pending = false; + } } else { @@ -964,8 +972,6 @@ NormMsgr::Message::Message(char* buffer, unsigned int size) uint16_t msgSize = size + MSG_HEADER_SIZE; msgSize = htons(msgSize); memcpy(msg_header, &msgSize, MSG_HEADER_SIZE); - - fprintf(stderr, "output msg ctor data = %.20s\n", buffer); } NormMsgr::Message::~Message() diff --git a/include/normVersion.h b/include/normVersion.h index 685004b..38b15ae 100644 --- a/include/normVersion.h +++ b/include/normVersion.h @@ -36,6 +36,6 @@ #ifndef _NORM_VERSION #define _NORM_VERSION -#define VERSION "1.5r5" +#define VERSION "1.5r6" #endif // _NORM_VERSION diff --git a/makefiles/Makefile.linux b/makefiles/Makefile.linux index 8aa0be8..8c4f946 100644 --- a/makefiles/Makefile.linux +++ b/makefiles/Makefile.linux @@ -36,14 +36,14 @@ SYSTEM_LIBS = -ldl # SYSTEM_HAVES = -DLINUX -DECN_SUPPORT -DHAVE_IPV6 -DHAVE_GETLOGIN -D_FILE_OFFSET_BITS=64 -DHAVE_LOCKF \ --DHAVE_OLD_SIGNALHANDLER -DHAVE_DIRFD -DHAVE_ASSERT +-DHAVE_OLD_SIGNALHANDLER -DHAVE_DIRFD -DHAVE_ASSERT SYSTEM_SRC = ../protolib/src/linux/linuxCap.cpp SYSTEM = linux export CC = g++ -export SYSTEM_CFLAGS = -fPIC -Wall -Wcast-align +export SYSTEM_CFLAGS = -Wall -Wcast-align -pedantic -fPIC export SYSTEM_SOFLAGS = -shared -Wl,-soname,libnorm.so.1 SYSTEM_SOEXT = so export RANLIB = ranlib diff --git a/setup.py b/setup.py index 6bc73d2..0684a18 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,11 @@ # This Python script can be used to install the Python 'pynorm' package import platform -from distutils.core import setup +from distutils.core import setup, Extension # Note to use 'pynorm", you will need to have the libnorm shared library # (libnorm.so or libnorm.dylib, etc) installed where your Python installation # will find it with dlopen() (e.g. /usr/local/lib or something) - setup(name='pynorm', version = '1.0', packages = ['pynorm', 'pynorm.extra'], diff --git a/src/common/normApp.cpp b/src/common/normApp.cpp index c46eda2..f053f6b 100644 --- a/src/common/normApp.cpp +++ b/src/common/normApp.cpp @@ -1569,7 +1569,8 @@ void NormApp::Notify(NormController::Event event, PLOG(PL_DEBUG, "NormApp::Notify(RX_OBJECT_NEW) ...\n"); struct timeval currentTime; ProtoSystemTime(currentTime); - struct tm* timePtr = gmtime((time_t*)¤tTime.tv_sec); + time_t secs = (time_t)currentTime.tv_sec; + struct tm* timePtr = gmtime(&secs); PLOG(PL_INFO, "%02d:%02d:%02d.%06lu start rx object>%hu sender>%lu\n", timePtr->tm_hour, timePtr->tm_min, timePtr->tm_sec, (unsigned long)currentTime.tv_usec, (UINT16)object->GetId(), sender->GetId()); @@ -1870,8 +1871,8 @@ void NormApp::Notify(NormController::Event event, { struct timeval currentTime; ProtoSystemTime(currentTime); - struct tm* timePtr = gmtime((time_t*)¤tTime.tv_sec); - + time_t secs = (time_t)currentTime.tv_sec; + struct tm* timePtr = gmtime(&secs); PLOG(PL_INFO, "%02d:%02d:%02d.%06u completed rx object>%hu ", (int)timePtr->tm_hour, (int)timePtr->tm_min, (int)timePtr->tm_sec, (unsigned int)currentTime.tv_usec, (UINT16)object->GetId()); @@ -1910,7 +1911,8 @@ void NormApp::Notify(NormController::Event event, PLOG(PL_FATAL, "NormApp::Notify(RX_OBJECT_ABORTED) ...\n"); struct timeval currentTime; ProtoSystemTime(currentTime); - struct tm* timePtr = gmtime((time_t*)¤tTime.tv_sec); + time_t secs = (time_t)currentTime.tv_sec; + struct tm* timePtr = gmtime(&secs); PLOG(PL_INFO, "%02d:%02d:%02d.%06lu aborted rx object>%hu sender>%lu\n", timePtr->tm_hour, timePtr->tm_min, timePtr->tm_sec, (unsigned long)currentTime.tv_usec, (UINT16)object->GetId(), sender->GetId()); @@ -2031,7 +2033,8 @@ bool NormApp::OnIntervalTimeout(ProtoTimer& /*theTimer*/) struct timeval currentTime; ProtoSystemTime(currentTime); - struct tm* timePtr = gmtime((time_t*)¤tTime.tv_sec); + time_t secs = (time_t)currentTime.tv_sec; + struct tm* timePtr = gmtime(&secs); PLOG(PL_INFO, "%02d:%02d:%02d.%06lu enqueued tx object>%hu sender>%lu\n", timePtr->tm_hour, timePtr->tm_min, timePtr->tm_sec, (unsigned long)currentTime.tv_usec, (UINT16)obj->GetId(), session->LocalNodeId()); diff --git a/src/common/normObject.cpp b/src/common/normObject.cpp index 6718d21..c3c8e4b 100644 --- a/src/common/normObject.cpp +++ b/src/common/normObject.cpp @@ -1627,6 +1627,7 @@ NormBlock* NormObject::StealOldestBlock(bool excludeBlock, NormBlockId excludeId bool NormObject::NextSenderMsg(NormObjectMsg* msg) { + // Init() the message if (pending_info) { @@ -1815,9 +1816,10 @@ bool NormObject::NextSenderMsg(NormObjectMsg* msg) if (!block->GetFirstPending(segmentId)) { PLOG(PL_ERROR, "NormObject::NextSenderMsg() nothing pending!?\n"); + fprintf(stderr, "NormObject::NextSenderMsg() nothing pending!?\n"); ASSERT(0); + return false; } - // Try to read segment if (segmentId < numData) { @@ -1901,7 +1903,7 @@ bool NormObject::NextSenderMsg(NormObjectMsg* msg) if (!block->IsPending()) { // End of block reached - block->ResetParityCount(nparity); + block->ResetParityCount(nparity); pending_mask.Unset(blockId); // for EMCON sending, mark NORM_INFO for re-transmission, if applicable if (session.SndrEmcon() && HaveInfo()) diff --git a/src/common/normSession.cpp b/src/common/normSession.cpp index 129332a..e498cdf 100644 --- a/src/common/normSession.cpp +++ b/src/common/normSession.cpp @@ -5037,7 +5037,6 @@ bool NormSession::OnReportTimeout(ProtoTimer& /*theTimer*/) #else time_t secs = (time_t)currentTime.tv_sec; struct tm timeStruct; - //struct tm* ct = gmtime(&secs); #ifdef WIN32 gmtime_s(&timeStruct, &secs); struct tm* ct = &timeStruct; diff --git a/wscript b/wscript index 019941a..3618163 100644 --- a/wscript +++ b/wscript @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env ''' wscript - Waf build script for NORM See http://waf.googlecode.com/ for more information.