summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9/transport_test.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2018-08-08 22:22:40 -0700
committerShentubot <shentubot@google.com>2018-08-08 22:23:47 -0700
commit48b5b35b2bd46ecd043f95d5f470da71046af760 (patch)
tree393d8558b65a73ccd5bb59f8ad0648d181cd2803 /pkg/p9/transport_test.go
parentea1e39a314d3a248d8b682a9f63e686530597d61 (diff)
Fix error handling for bad message sizes.
The message size check is legitimate: the size must be negotiated, which relies on the fixed message limit up front. Sending a message larger than that indicates that the connection is out of sync and is considered a socket error (disconnect). Similarly, sending a size that is too small indicates that the stream is out-of-sync or invalid. PiperOrigin-RevId: 207996551 Change-Id: Icd8b513d5307e9d5953dbb957ee70ceea111098d
Diffstat (limited to 'pkg/p9/transport_test.go')
-rw-r--r--pkg/p9/transport_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/p9/transport_test.go b/pkg/p9/transport_test.go
index e3ee3e9bd..d6d4b6365 100644
--- a/pkg/p9/transport_test.go
+++ b/pkg/p9/transport_test.go
@@ -73,8 +73,8 @@ func TestRecvOverrun(t *testing.T) {
t.Fatalf("send got err %v expected nil", err)
}
- if _, _, err := recv(server, maximumLength, messageByType); err != ErrNoValidMessage {
- t.Fatalf("recv got err %v expected ErrNoValidMessage", err)
+ if _, _, err := recv(server, maximumLength, messageByType); err == nil {
+ t.Fatalf("recv got err %v expected ErrSocket{ErrNoValidMessage}", err)
}
}