mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
gofmt
This commit is contained in:
@@ -21,7 +21,7 @@ const (
|
||||
defaultBufSize = 32768
|
||||
// Scratch buffer size for the processMsg() calls.
|
||||
msgScratchSize = 512
|
||||
msgHeadProto = "MSG "
|
||||
msgHeadProto = "MSG "
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -35,7 +35,7 @@ const (
|
||||
DEFAULT_PING_MAX_OUT = 2
|
||||
|
||||
// CRLF string
|
||||
CR_LF = "\r\n"
|
||||
CR_LF = "\r\n"
|
||||
LEN_CR_LF = len(CR_LF)
|
||||
|
||||
// Write/Flush Deadlines
|
||||
|
||||
@@ -161,10 +161,10 @@ func (c *client) parse(buf []byte) error {
|
||||
if c.msgBuf != nil {
|
||||
c.msgBuf = append(c.msgBuf, b)
|
||||
} else {
|
||||
c.msgBuf = buf[c.as:i+1]
|
||||
c.msgBuf = buf[c.as : i+1]
|
||||
}
|
||||
// strict check for proto
|
||||
if len(c.msgBuf) != c.pa.size + LEN_CR_LF {
|
||||
if len(c.msgBuf) != c.pa.size+LEN_CR_LF {
|
||||
goto parseErr
|
||||
}
|
||||
c.processMsg(c.msgBuf)
|
||||
|
||||
@@ -170,7 +170,7 @@ func TestParsePub(t *testing.T) {
|
||||
}
|
||||
|
||||
// Clear snapshots
|
||||
c.argBuf, c.msgBuf, c.state = nil, nil, OP_START
|
||||
c.argBuf, c.msgBuf, c.state = nil, nil, OP_START
|
||||
|
||||
pub = []byte("PUB foo.bar INBOX.22 11\r\nhello world\r")
|
||||
err = c.parse(pub)
|
||||
@@ -245,7 +245,7 @@ func TestParseMsg(t *testing.T) {
|
||||
}
|
||||
|
||||
// Clear snapshots
|
||||
c.argBuf, c.msgBuf, c.state = nil, nil, OP_START
|
||||
c.argBuf, c.msgBuf, c.state = nil, nil, OP_START
|
||||
|
||||
pub = []byte("MSG foo.bar RSID:1:2 INBOX.22 11\r\nhello world\r")
|
||||
err = c.parse(pub)
|
||||
|
||||
@@ -315,4 +315,4 @@ func (s *Server) numRoutes() int {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
return len(s.routes)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ var (
|
||||
|
||||
var (
|
||||
ErrInvalidSubject = errors.New("Invalid Subject")
|
||||
ErrNotFound = errors.New("No Matches Found")
|
||||
ErrNotFound = errors.New("No Matches Found")
|
||||
)
|
||||
|
||||
// split will split a subject into tokens
|
||||
|
||||
Reference in New Issue
Block a user