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

21
test/opts_test.go Normal file
View File

@@ -0,0 +1,21 @@
// Copyright 2015 Apcera Inc. All rights reserved.
package test
import (
"testing"
)
func TestServerConfig(t *testing.T) {
srv, opts := RunServerWithConfig("./configs/override.conf")
defer srv.Shutdown()
c := createClientConn(t, opts.Host, opts.Port)
defer c.Close()
sinfo := checkInfoMsg(t, c)
if sinfo.MaxPayload != opts.MaxPayload {
t.Fatalf("Expected max_payload from server, got %d vs %d",
opts.MaxPayload, sinfo.MaxPayload)
}
}