Skip to content
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

Implement Redis protocol #202

Merged
merged 1 commit into from
Feb 28, 2018
Merged

Implement Redis protocol #202

merged 1 commit into from
Feb 28, 2018

Conversation

CapacitorSet
Copy link
Contributor

As mentioned in #201, the current Redis implementation is not compatible with Redis clients - it only implements the inline commands, which (as far as I know) isn't widely used.

This PR implements the Redis protocol with a simple parser, but does not support the "inline commands". If needed, it can also be implemented.

@nl5887
Copy link
Contributor

nl5887 commented Feb 28, 2018

Nice, thanks a lot!

@nl5887 nl5887 merged commit ae8b14d into honeytrap:master Feb 28, 2018
func (d *redisDatum) ToString() (value string, success bool) {
switch d.DataType {
case 0x2b:
fallthrough
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CapacitorSet Why do you use a fallthrough here? Ty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parser will put a string in Content both if it receives a simple string 0x2b (line 120, it uses cmd which is of type string) or if it receives a bulk string 0x24 (line 129, str is of type string). Therefore, in both cases we use the same logic, a type assertion to string.

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

Successfully merging this pull request may close these issues.

3 participants