From 4a1ce9360546c1d8f2570051e929a46d3c8a9dca Mon Sep 17 00:00:00 2001 From: benthompson15 Date: Mon, 7 Oct 2019 13:04:58 -0500 Subject: [PATCH] MCOL-3547: cleanup compile warnings from storagemanager. --- storage-manager/src/SessionManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/storage-manager/src/SessionManager.cpp b/storage-manager/src/SessionManager.cpp index 4c109141d..1c21d9229 100644 --- a/storage-manager/src/SessionManager.cpp +++ b/storage-manager/src/SessionManager.cpp @@ -300,7 +300,8 @@ int SessionManager::start() //read this snippet and keep going len = ::read(fds[socketIncr].fd, &recv_buffer[remainingBytes], peakLength); remainingBytes = endOfData; - assert(len == peakLength); + if (len != peakLength) + logger->log(LOG_ERR,"Read returned length != peakLength. ( %i != %i )", len, peakLength); continue; } @@ -327,7 +328,8 @@ int SessionManager::start() { //logger->log(LOG_DEBUG,"No SM_MSG_START"); len = ::read(fds[socketIncr].fd, &recv_buffer[remainingBytes], peakLength); - assert(len == peakLength); + if (len != peakLength) + logger->log(LOG_ERR,"Read returned length != peakLength. ( %i != %i )", len, peakLength); // we know the msg header isn't in position [0, endOfData - i), so throw that out // and copy [i, endOfData) to the front of the buffer to be // checked by the next iteration. @@ -351,6 +353,8 @@ int SessionManager::start() { //logger->log(LOG_DEBUG,"SM_MSG_START data is next message"); len = ::read(fds[socketIncr].fd, &recv_buffer[remainingBytes], peakLength); + if (len != peakLength) + logger->log(LOG_ERR,"Read returned length != peakLength. ( %i != %i )", len, peakLength); } //Disable polling on this socket fds[socketIncr].events = 0;