Properly handle and enforce max payload

This commit is contained in:
Derek Collison
2015-08-05 22:05:58 -07:00
parent 9a60bc1364
commit 075529e2fe
14 changed files with 180 additions and 50 deletions

View File

@@ -223,6 +223,15 @@ func TestParsePubArg(t *testing.T) {
testPubArg(c, t)
}
func TestParsePubBadSize(t *testing.T) {
c := dummyClient()
// Setup localized max payload
c.mpay = 32768
if err := c.processPub([]byte("foo 2222222222222222\r")); err == nil {
t.Fatalf("Expected parse error for size too large")
}
}
func TestParseMsg(t *testing.T) {
c := dummyClient()