@@ -671,11 +671,12 @@ return [_stream fileDescriptorForReading]; } - (bool)hasDataInReadBuffer { - return ([super hasDataInReadBuffer] || [_stream hasDataInReadBuffer]); + return ([super hasDataInReadBuffer] || [_stream hasDataInReadBuffer] || + _bufferLength - _bufferIndex > 0); } - (void)close { /* Give back our buffer to the stream, in case it's shared */