From: Felix Domke Date: Thu, 24 May 2007 20:09:57 +0000 (+0000) Subject: in case of short reads, re-align with blocksize X-Git-Tag: 2.6.0~2224 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/ae4d58285fffc667653197d17734d5018acef9d4?hp=88101488f95cda7aff3dadb904edff963f914bfb in case of short reads, re-align with blocksize --- diff --git a/lib/base/filepush.cpp b/lib/base/filepush.cpp index 1e5685ca..2a894cf5 100644 --- a/lib/base/filepush.cpp +++ b/lib/base/filepush.cpp @@ -174,6 +174,15 @@ void eFilePushThread::thread() } eDebug("eFilePushThread *read error* (%m) - not yet handled"); } + + /* a read might be mis-aligned in case of a short read. */ + int d = m_buf_end % m_blocksize; + if (d) + { + m_raw_source.lseek(-d, SEEK_CUR); + m_buf_end -= d; + } + if (m_buf_end == 0) { /* on EOF, try COMMITting once. */