Closed KernelPryanic closed 6 years ago
I think we shouldn't require a request message to include a payload indeed though in this case we must require it to at least have a name:
Name | Payload | Error |
---|---|---|
✓ | ✓ | - |
- | ✓ | - |
✓ | - | - |
- | - | ProtocolError |
As of commit b498cca the webwire server will now accept request messages that either provide a name only or a payload only, or both. It'll reject request messages without both the name and the payload returning a MsgInternalError
reply (can be improved by returning a new type of special reply message "MsgReplyProtoError" that's not yet implemented in the protocol version 1.4)
The server now also won't break the connection in case of a protocol/parser error.
Request message requires a payload even though a payload shouldn't be obligatory. In some cases a request name is sufficient. For example if we just want to notify the server about an event like
client.Request("event_a_happend", wwr.Payload{})
then we won't need a payload, but currently we have to provide a payload otherwise an error is returned indicating that the request message couldn't be parsed.