From: Sergey Matveev Date: Mon, 16 Jan 2017 21:03:45 +0000 (+0300) Subject: Fix invalid sizes calculation, be compatible with Noise X-Git-Tag: 0.2^2~2 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=22bd7c793c25e17e89a14a8fe9735b247778b4d9;p=nncp.git Fix invalid sizes calculation, be compatible with Noise --- diff --git a/src/cypherpunks.ru/nncp/sp.go b/src/cypherpunks.ru/nncp/sp.go index 4cc670f..085d96f 100644 --- a/src/cypherpunks.ru/nncp/sp.go +++ b/src/cypherpunks.ru/nncp/sp.go @@ -36,7 +36,7 @@ import ( ) const ( - MaxSPSize = 2<<16 - 256 + MaxSPSize = 1<<16 - 256 PartSuffix = ".part" DefaultDeadline = 10 ) @@ -212,7 +212,7 @@ func (state *SPState) WriteSP(dst io.Writer, payload []byte) error { func (state *SPState) ReadSP(src io.Reader) ([]byte, error) { var sp SPRaw - n, err := xdr.UnmarshalLimited(src, &sp, 2<<17) + n, err := xdr.UnmarshalLimited(src, &sp, 1<<17) if err != nil { return nil, err }