Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Null result in echo response when echo request is with empty params array #20

Closed
hsinyishen opened this issue May 8, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hsinyishen
Copy link

When the peer sends echo request with empty params array:
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 7b 22 69 64 22 3a 22 65 63 68 6f 22 2c 22 6d 65 |{"id":"echo","me|
|00000010| 74 68 6f 64 22 3a 22 65 63 68 6f 22 2c 22 70 61 |thod":"echo","pa|
|00000020| 72 61 6d 73 22 3a 5b 5d 7d |rams":[]} |
+--------+-------------------------------------------------+----------------+

The library constructs null result in response message:
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 7b 22 72 65 73 75 6c 74 22 3a 6e 75 6c 6c 2c 22 |{"result":null,"|
|00000010| 65 72 72 6f 72 22 3a 6e 75 6c 6c 2c 22 69 64 22 |error":null,"id"|
|00000020| 3a 22 65 63 68 6f 22 7d |:"echo"} |
+--------+-------------------------------------------------+----------------+

This causes peer disconnecting and reconnecting continuously due to protocol error.

hechaoli added a commit that referenced this issue May 8, 2018
Issue: #20

Signed-off-by: Hechao Li <hechaol@outlook.com>
@hechaoli hechaoli closed this as completed May 8, 2018
@hechaoli
Copy link
Contributor

hechaoli commented May 8, 2018

Please apply this patch or wait for the next patch release.

@hechaoli hechaoli added the bug Something isn't working label May 10, 2018
@hechaoli hechaoli self-assigned this May 10, 2018
@hechaoli hechaoli added this to the 1.0.1 milestone May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants