[svn] gpgme - r1309 - trunk/gpgme
svn author marcus
cvs at cvs.gnupg.org
Tue Apr 22 13:20:52 CEST 2008
Author: marcus
Date: 2008-04-22 13:20:50 +0200 (Tue, 22 Apr 2008)
New Revision: 1309
Modified:
trunk/gpgme/ChangeLog
trunk/gpgme/kdpipeiodevice.cpp
trunk/gpgme/w32-qt-io.cpp
Log:
2008-04-22 Marcus Brinkmann <marcus at g10code.de>
* w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
Osterfeld, implement blocking select.
Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog 2008-03-11 16:05:40 UTC (rev 1308)
+++ trunk/gpgme/ChangeLog 2008-04-22 11:20:50 UTC (rev 1309)
@@ -1,3 +1,8 @@
+2008-04-22 Marcus Brinkmann <marcus at g10code.de>
+
+ * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
+ Osterfeld, implement blocking select.
+
2008-03-11 Marcus Brinkmann <marcus at g10code.de>
* data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
Modified: trunk/gpgme/kdpipeiodevice.cpp
===================================================================
--- trunk/gpgme/kdpipeiodevice.cpp 2008-03-11 16:05:40 UTC (rev 1308)
+++ trunk/gpgme/kdpipeiodevice.cpp 2008-04-22 11:20:50 UTC (rev 1309)
@@ -480,8 +480,8 @@
LOCKED( r );
if ( r->bytesInBuffer() != 0 || r->eof || r->error )
return true;
- assert( false );
- return r->bufferNotEmptyCondition.wait( &r->mutex, msecs ) ;
+
+ return msecs >= 0 ? r->bufferNotEmptyCondition.wait( &r->mutex, msecs ) : r->bufferNotEmptyCondition.wait( &r->mutex );
}
template <typename T>
Modified: trunk/gpgme/w32-qt-io.cpp
===================================================================
--- trunk/gpgme/w32-qt-io.cpp 2008-03-11 16:05:40 UTC (rev 1308)
+++ trunk/gpgme/w32-qt-io.cpp 2008-04-22 11:20:50 UTC (rev 1309)
@@ -573,9 +573,6 @@
TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_select", fds,
"nfds=%u, nonblock=%u", nfds, nonblock);
- /* We only implement the special case of nonblock == true. */
- assert (nonblock);
-
int count = 0;
TRACE_SEQ (dbg_help, "select on [ ");
@@ -587,9 +584,12 @@
}
else if (fds[i].for_read )
{
- const KDPipeIODevice * const chan = find_channel (fds[i].fd, 0);
- assert (chan);
- fds[i].signaled = chan->readWouldBlock() ? 0 : 1;
+ KDPipeIODevice * const chan = find_channel (fds[i].fd, 0);
+ assert (chan);
+ if ( nonblock )
+ fds[i].signaled = chan->readWouldBlock() ? 0 : 1;
+ else
+ fds[i].signaled = chan->waitForReadyRead( 1000 ) ? 1 : 0;
TRACE_ADD1 (dbg_help, "w0x%x ", fds[i].fd);
if ( fds[i].signaled )
count++;
@@ -598,7 +598,7 @@
{
const KDPipeIODevice * const chan = find_channel (fds[i].fd, 0);
assert (chan);
- fds[i].signaled = chan->writeWouldBlock() ? 0 : 1;
+ fds[i].signaled = nonblock ? ( chan->writeWouldBlock() ? 0 : 1 ) : 1;
TRACE_ADD1 (dbg_help, "w0x%x ", fds[i].fd);
if ( fds[i].signaled )
count++;
More information about the Gnupg-commits
mailing list