Moving inbound tracing to the caller (client.parse)

Tracing for outgoing operations is always done while
holding the client lock.

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2020-03-04 17:31:18 -05:00
parent fe373ac597
commit 6a1c3fc29b
7 changed files with 130 additions and 131 deletions

View File

@@ -301,7 +301,7 @@ func TestParsePubArg(t *testing.T) {
subject: "foo", reply: "", size: 2222, szb: "2222"},
} {
t.Run(test.arg, func(t *testing.T) {
if err := c.processPub([]byte(test.arg), false); err != nil {
if err := c.processPub([]byte(test.arg)); err != nil {
t.Fatalf("Unexpected parse error: %v\n", err)
}
if !bytes.Equal(c.pa.subject, []byte(test.subject)) {
@@ -324,7 +324,7 @@ func TestParsePubBadSize(t *testing.T) {
c := dummyClient()
// Setup localized max payload
c.mpay = 32768
if err := c.processPub([]byte("foo 2222222222222222"), false); err == nil {
if err := c.processPub([]byte("foo 2222222222222222")); err == nil {
t.Fatalf("Expected parse error for size too large")
}
}