mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +02:00
Add asserts
This commit is contained in:
@@ -125,14 +125,20 @@ void Client::disconnect()
|
|||||||
|
|
||||||
void Client::writeCommand(const Array& command, bool flush)
|
void Client::writeCommand(const Array& command, bool flush)
|
||||||
{
|
{
|
||||||
|
poco_assert(_output);
|
||||||
|
|
||||||
std::string commandStr = command.toString();
|
std::string commandStr = command.toString();
|
||||||
|
|
||||||
_output->write(commandStr.c_str(), commandStr.length());
|
_output->write(commandStr.c_str(), commandStr.length());
|
||||||
if ( flush ) _output->flush();
|
if ( flush ) _output->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
RedisType::Ptr Client::readReply()
|
RedisType::Ptr Client::readReply()
|
||||||
{
|
{
|
||||||
RedisType::Ptr result = RedisType::createRedisType(_input->get());
|
poco_assert(_input);
|
||||||
|
|
||||||
|
int c = _input->get();
|
||||||
|
RedisType::Ptr result = RedisType::createRedisType(c);
|
||||||
if ( result.isNull() )
|
if ( result.isNull() )
|
||||||
{
|
{
|
||||||
throw RedisException("Invalid Redis type returned");
|
throw RedisException("Invalid Redis type returned");
|
||||||
|
|||||||
Reference in New Issue
Block a user