Skip to content

potential bugs in _send_command and _read #7

Closed
@awestendorf

Description

@awestendorf

I was browsing the driver source in the course of reviewing Redis for work and found a few potential bugs in the socket code.

The _read() method is calling "return self._fp.readline()", but this is bypassing the code at the end of the method which should be checking to see if self._sock.recv()=='', so a disconnect will likely not be handled correctly. It seems that _get_response() might handle this correctly, but _get_value() will raise a ValueError instead of a ConnectionError.

In the _send_command() method, if an EPIPE is raised, it won't work across platforms because it's checking if the value is 32, and not errno.EPIPE. I've had trouble with this in the past, as Linux and OSX use different enumerations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions