Skip to content

Commit

Permalink
fixed bug in server
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpatek committed Jun 24, 2024
1 parent dd78649 commit c389839
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ func (c *Client) ListNamespaces() ([]string, error) {
wg.Add(1)
sendPacket := protocol.NewPacketFromParts(protocol.CmdTCPOnlyNamespaces, messageID, []byte{}, []byte{}, c.preSharedKey)
c.sendOrCallbackErr(sendPacket, cb)
wg.Wait()
return strings.Split(namespaces, "\n"), err
}

Expand Down
6 changes: 0 additions & 6 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,5 @@ func TestClient_TcpListNamespaces(t *testing.T) {
namespaces, err := cl.ListNamespaces()
assert.Len(t, namespaces, 2)
assert.NoError(t, err) // out of order

time.Sleep(time.Second * 3)

namespaces, err = cl.ListNamespaces()
assert.Len(t, namespaces, 1)
assert.NoError(t, err) // out of order
})
}
2 changes: 1 addition & 1 deletion protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func IsRequestCmd(c byte) bool {
}

func IsTcpOnlyCmd(c byte) bool {
return c == CmdTCPOnlyKeys || c == CmdTCPOnlyRetrieve || c == CmdTCPOnlyValues || c == CmdTCPOnlyStore
return c == CmdTCPOnlyKeys || c == CmdTCPOnlyRetrieve || c == CmdTCPOnlyValues || c == CmdTCPOnlyStore || c == CmdTCPOnlyNamespaces
}

// IsResponseCmd indicates if the client should accept this as a command
Expand Down

0 comments on commit c389839

Please sign in to comment.