From: Marcus Brinkmann Date: Thu, 11 Oct 2007 13:03:59 +0000 (+0000) Subject: 2007-10-11 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~109 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=442a54dba0534d79e35b32062ddae0ff33817593;p=gpgme.git 2007-10-11 Marcus Brinkmann * kdpipeiodevice.cpp: New version from Frank Osterfeld. --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 580b606..dbe43fd 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,7 @@ +2007-10-11 Marcus Brinkmann + + * kdpipeiodevice.cpp: New version from Frank Osterfeld. + 2007-10-09 Marcus Brinkmann * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc diff --git a/trunk/gpgme/kdpipeiodevice.cpp b/trunk/gpgme/kdpipeiodevice.cpp index 032b62b..67f8bf5 100644 --- a/trunk/gpgme/kdpipeiodevice.cpp +++ b/trunk/gpgme/kdpipeiodevice.cpp @@ -728,7 +728,12 @@ void Reader::run() { DWORD numRead; const bool ok = ReadFile( handle, buffer + wptr, numBytes, &numRead, 0 ); mutex.lock(); - if ( !ok ) { + if ( ok ) { + if ( numRead == 0 ) { + qDebug( "%p: Reader::run: got eof (numRead==0)", this ); + eof = true; + } + } else { // !ok errorCode = static_cast( GetLastError() ); if ( errorCode == ERROR_BROKEN_PIPE ) { assert( numRead == 0 ); @@ -758,7 +763,7 @@ void Reader::run() { } #endif qDebug( "%p: Reader::run: read %ld bytes", this, static_cast(numRead) ); - qDebug( "%p (fd=%d): KDPipeIODevice::readData: %s", this, fd, buffer ); + qDebug( "%p: Reader::run(fd=%d): %s", this, fd, buffer ); if ( numRead > 0 ) { qDebug( "%p: Reader::run: buffer before: rptr=%4d, wptr=%4d", this, rptr, wptr );