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

telnet error #29

Open
alexist opened this issue Nov 21, 2023 · 1 comment
Open

telnet error #29

alexist opened this issue Nov 21, 2023 · 1 comment

Comments

@alexist
Copy link
Contributor

alexist commented Nov 21, 2023

Hi,

When testing SET command with telnet, i get an malformed_request

SET KEY 0 1
1
LEN 1
1
DONE
ERROR malformed_request

In unit test, we don't have the malformed_request, because "\r\n" is not send

getWriter().write("SET region:key 1 10\r\n");
getWriter().write("1234567890");
getWriter().flush();

Maybe there is a way to send the command without carriage return in telnet ?

Otherwhise, this issue can be fixed in two ways

  1. Setting an expectedMode to FrameMode.END
 else if (expectedMode == FrameMode.DATA) {
       final String result = currentCommand.executeDataPart(buffer.toString(PROTOCOL_ENCODING));
       socket.write(result, PROTOCOL_ENCODING);
       expectedMode = FrameMode.END;
       parser.delimitedMode(PROTOCOL_DELIMITER);
  }
  else {
        expectedMode = FrameMode.COMMAND;
   }

but this will make a breaking change

  1. Handling empty command in ShmProtocolHandler.handle :
    if (expectedMode == FrameMode.COMMAND && !buffer.toString(PROTOCOL_ENCODING).isEmpty()) {
    }
    but not sure allowing empty command is a good idea
@grrolland
Copy link
Owner

Hi Alexis,

Perhaps you can try telnet with disabling LINEMODE (cf. https://www.commandlinux.com/man-page/man1/telnet.1.html).

You should do this with a telnetrc file, like this :

your_dshm_host
 mode character

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

2 participants