mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fix parser bug around MSG protocol.
Make sure we do the right thing when no args are presented for an MSG, e.g. MSG <spc>. Also do not parse at all of this is a client, only valid for routes.
This commit is contained in:
@@ -344,6 +344,8 @@ func TestSplitDanglingArgBuf(t *testing.T) {
|
||||
|
||||
func TestSplitMsgArg(t *testing.T) {
|
||||
_, c, _ := setupClient()
|
||||
// Allow parser to process MSG
|
||||
c.typ = ROUTER
|
||||
|
||||
b := make([]byte, 1024)
|
||||
|
||||
@@ -371,7 +373,7 @@ func TestSplitMsgArg(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSplitBufferMsgOp(t *testing.T) {
|
||||
c := &client{subs: hashmap.New()}
|
||||
c := &client{subs: hashmap.New(), typ: ROUTER}
|
||||
msg := []byte("MSG foo.bar QRSID:15:3 _INBOX.22 11\r\nhello world\r")
|
||||
msg1 := msg[:2]
|
||||
msg2 := msg[2:9]
|
||||
|
||||
Reference in New Issue
Block a user