Closed stevefan1999-personal closed 6 months ago
so if I read this correctly, this is actually an inline command, which is left unparsed
I was using this for an implementation of Redis, so I suppose you didn't expect to parse inline commands since it will never be sent from server, right? A workaround is to, well convert the inline command to equivalent RESP array of course, but it will be egregious. Basically what you need to do is split string by space associating each split string with length as prefix and tag it as bulk string, then treat the split strings into RESP arrays
Hey @stevefan1999-personal,
Yeah that's correct, I didn't expect to have to parse HELLO since the server never sends it. However, I did end up implementing a silly parsing function for it.
HELLO
doesn't have a byte prefix in RESP, which makes detecting it pretty brittle. The parsing logic is written, but it'll never be called. I'll probably add a feature flag for parsing it that just switches on the leading H
and go from there.
For what it's worth, if you're using this directly it's probably worth noting that I was only able to get the encoding to work by testing against a live server since the docs are pretty sparse on this. Based on my testing it looks like client should send the command like this:
HELLO [protocol number] [AUTH username [password]]\r\n
Hope that helps, and I'll try to get a new release with this FF up in the next couple days.
Added in 5.0.0
Using the streaming codec example:
With this processor function:
I was not able to decode Hello message:
It turns out the message does not have a tag?
I have to put it in issue because there is no discussion tab, it is way better to put it there imo