Skip to content

method _bulk_reply is not returning the correct data #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DaLt0n opened this issue Oct 22, 2014 · 3 comments
Closed

method _bulk_reply is not returning the correct data #57

DaLt0n opened this issue Oct 22, 2014 · 3 comments

Comments

@DaLt0n
Copy link

DaLt0n commented Oct 22, 2014

Redis protocol sends a "CRLF" when it returns a string with zero length ($0), but when it returns a string "-1" ($-1) length it does not have a "CRLF". Solution is to remove "CRLF" when its a zero length string.

-- CIRedis::_bulk_reply --
remove: if ($value_length <= 0) return NULL;
add: if ($value_length <= 0) {
add: if ($value_length == 0) {
add: fgets($this->_connection);
add: }
add: return NULL;
add: }

@danhunsaker
Copy link
Contributor

See also #53.

Please submit a PR for this, since you have a fix already figured out.

@eranhazout
Copy link

Tried that. and now I'm getting null response..

    if ($value_length <= 0){
        if ($value_length == 0){
        fgets($this->_connection, $value_length + 1);
        }
        return NULL;
    }

@DaLt0n
Copy link
Author

DaLt0n commented Oct 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants