This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch 3.6.x-rpm-debug in repository nx-libs. from 54ebf96 nxcomp/src/Log.h: reorder initializer lists to silence compiler warnings. new be06f21 nxcomp/src/Log.h: handle errors due to missing buffers more gracefully. new f26b8fa nxcomp/src/Loop.cpp: don't flush data out mid-append. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: nxcomp/src/Log.h | 43 ++++++++++++++++++++++++++++++------------- nxcomp/src/Loop.cpp | 10 +++++----- 2 files changed, 35 insertions(+), 18 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch 3.6.x-rpm-debug in repository nx-libs. commit f26b8fa382a112b9ee680eccc86769b43a86ea93 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Dec 25 03:50:30 2017 +0100 nxcomp/src/Loop.cpp: don't flush data out mid-append. Doing so will lead to the next append operation failing. --- nxcomp/src/Loop.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index 436250e..465eaee 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -14028,13 +14028,13 @@ static void handleCheckSelectInLoop(int &setFDs, fd_set &readSet, { i = 0; - nxinfo << "Loop: Selected for read are "; + nxinfo << "Loop: Selected for read are"; for (int j = 0; j < setFDs; j++) { if (FD_ISSET(j, &readSet)) { - nxinfo_append << "[" << j << "]" << std::flush; + nxinfo_append << " [" << j << "]"; i++; } @@ -14057,7 +14057,7 @@ static void handleCheckSelectInLoop(int &setFDs, fd_set &readSet, { if (FD_ISSET(j, &writeSet)) { - nxinfo_append << "[" << j << "]" << std::flush; + nxinfo_append << " [" << j << "]"; i++; } @@ -14115,7 +14115,7 @@ static void handleCheckResultInLoop(int &resultFDs, int &errorFDs, int &setFDs, { if (FD_ISSET(j, &readSet)) { - nxinfo_append << "[" << j << "]" << std::flush; + nxinfo_append << " [" << j << "]"; i++; } @@ -14138,7 +14138,7 @@ static void handleCheckResultInLoop(int &resultFDs, int &errorFDs, int &setFDs, { if (FD_ISSET(j, &writeSet)) { - nxinfo_append << "[" << j << "]" << std::flush; + nxinfo_append << " [" << j << "]"; i++; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch 3.6.x-rpm-debug in repository nx-libs. commit be06f2156b16006fc0cb01c08fe2b5b04c108d7b Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Dec 25 03:49:09 2017 +0100 nxcomp/src/Log.h: handle errors due to missing buffers more gracefully. This error is surprisingly easy to trigger, so we should make sure that the program does not crash. --- nxcomp/src/Log.h | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/nxcomp/src/Log.h b/nxcomp/src/Log.h index e6fb815..ab1807c 100644 --- a/nxcomp/src/Log.h +++ b/nxcomp/src/Log.h @@ -447,10 +447,19 @@ class NXLog { if ( synchronized() ) { - per_thread_data *pdt = get_data(); - assert (!pdt->buffer.empty ()); - (*pdt->buffer.top()) << F; - flush(); + /* Verbosely discard data if we don't have a buffer. */ + if (!(out.has_buffer())) + { + std::cerr << "WARNING: no buffer available! " + << "Internal state error!\n" << "Log hunk will be discarded!" << std::endl; + } + else + { + per_thread_data *pdt = get_data(); + assert (!pdt->buffer.empty ()); + (*pdt->buffer.top()) << F; + flush(); + } } else { @@ -532,16 +541,24 @@ NXLog& operator<<(NXLog& out, const T& value) { if ( out.synchronized() ) { - // In synchronized mode, we buffer data until a newline, std::flush, or the buffer - // gets full. Then we dump the whole thing at once to the output stream, synchronizing - // with a mutex. - NXLog::per_thread_data *pdt = out.get_data(); - assert (!pdt->buffer.empty ()); - (*pdt->buffer.top()) << value; - - if ( ss_length(pdt->buffer.top()) >= out.thread_buffer_size_ || has_newline(value) ) - out.flush(); + /* Verbosely discard data if we don't have a buffer. */ + if (!(out.has_buffer())) + { + std::cerr << "WARNING: no buffer available! " + << "Internal state error!\n" << "Log hunk will be discarded!" << std::endl; + } + else + { + // In synchronized mode, we buffer data until a newline, std::flush, or the buffer + // gets full. Then we dump the whole thing at once to the output stream, synchronizing + // with a mutex. + NXLog::per_thread_data *pdt = out.get_data(); + assert (!pdt->buffer.empty ()); + (*pdt->buffer.top()) << value; + if ( ss_length(pdt->buffer.top()) >= out.thread_buffer_size_ || has_newline(value) ) + out.flush(); + } } else { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git