Skip to content

Quotes around the error reason in the tcp_server protocol are missing #37

@rickardraysearch

Description

@rickardraysearch

In the documentation for the tcp_server, the format for error messages are given as follows:

  • Given: SET_LEARNING_MODE
    * Returned error: SET_LEARNING_MODE:KO,"Incorrect number of parameter(s) given."

In the implementation, there are no quotes around the error message. This makes it impossible to detect the end of the response. That also exposes a larger problem with the protocol, which is that it is difficult to resynchronize after reading a partial message, since there are no delimiters between responses. Adding a line break after the response would greatly simplify resynchronization.

The python client assumes incorrectly that reads from a tcp socket will return full messages, and will thus break if a partial read is returned. See https://docs.python.org/3/howto/sockets.html , specifically the last 3 paragraphs of the "Using a Socket" section.

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