forked from External/ergo
fix #190
This commit is contained in:
parent
8fd1446627
commit
d1f5c59eef
6 changed files with 34 additions and 23 deletions
|
|
@ -86,7 +86,9 @@ type Client struct {
|
|||
// NewClient returns a client with all the appropriate info setup.
|
||||
func NewClient(server *Server, conn net.Conn, isTLS bool) *Client {
|
||||
now := time.Now()
|
||||
socket := NewSocket(conn, server.MaxSendQBytes)
|
||||
limits := server.Limits()
|
||||
fullLineLenLimit := limits.LineLen.Tags + limits.LineLen.Rest
|
||||
socket := NewSocket(conn, fullLineLenLimit*2, server.MaxSendQBytes())
|
||||
go socket.RunSocketWriter()
|
||||
client := &Client{
|
||||
atime: now,
|
||||
|
|
@ -230,7 +232,11 @@ func (client *Client) run() {
|
|||
|
||||
line, err = client.socket.Read()
|
||||
if err != nil {
|
||||
client.Quit("connection closed")
|
||||
quitMessage := "connection closed"
|
||||
if err == errReadQ {
|
||||
quitMessage = "readQ exceeded"
|
||||
}
|
||||
client.Quit(quitMessage)
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue