From f8b944f325ff8f1c741fd6eaafd170c9e423695f Mon Sep 17 00:00:00 2001 From: zimoch Date: Thu, 3 Feb 2011 16:27:14 +0000 Subject: [PATCH] I/O Intr bugfix: lines where lost when not read in one chunk --- src/AsynDriverInterface.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/AsynDriverInterface.cc b/src/AsynDriverInterface.cc index 347e45e..2052802 100644 --- a/src/AsynDriverInterface.cc +++ b/src/AsynDriverInterface.cc @@ -841,6 +841,16 @@ readHandler() asynStatusStr[status]); } // pasynOctet->read() has already cut off terminator. + + if (status == asynTimeout && + pasynUser->timeout == 0.0 && + received > 0) + { + // Jens Eden (PTB) pointed out that polling asynInterposeEos + // with timeout = 0.0 returns asynTimeout even when bytes + // have been received, but not yet the terminator. + status = asynSuccess; + } switch (status) { @@ -922,8 +932,8 @@ readHandler() // read timeout #ifndef NO_TEMPORARY debug("AsynDriverInterface::readHandler(%s): " - "ioAction=%s, timeout after %d of %d bytes \"%s\"\n", - clientName(), ioActionStr[ioAction], + "ioAction=%s, timeout [%f seconds] after %d of %d bytes \"%s\"\n", + clientName(), ioActionStr[ioAction], pasynUser->timeout, (int)received, bytesToRead, StreamBuffer(buffer, received).expand()()); #endif