This repository was archived by the owner on Jul 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ type Conn struct {
3333 renameFrom string
3434 lastFilePos int64
3535 appendData bool
36+ closed bool
3637}
3738
3839func (conn * Conn ) LoginUser () string {
@@ -78,7 +79,7 @@ func (conn *Conn) Serve() {
7879 conn .receiveLine (line )
7980 // QUIT command closes connection, break to avoid error on reading from
8081 // closed socket
81- if conn .dataConn == nil {
82+ if conn .closed == true {
8283 break
8384 }
8485 }
@@ -89,6 +90,7 @@ func (conn *Conn) Serve() {
8990// Close will manually close this connection, even if the client isn't ready.
9091func (conn * Conn ) Close () {
9192 conn .conn .Close ()
93+ conn .closed = true
9294 if conn .dataConn != nil {
9395 conn .dataConn .Close ()
9496 conn .dataConn = nil
Original file line number Diff line number Diff line change @@ -172,7 +172,8 @@ func (Server *Server) ListenAndServe() error {
172172 var err error
173173
174174 if Server .ServerOpts .TLS {
175- config , err := simpleTLSConfig (Server .CertFile , Server .KeyFile )
175+ var config * tls.Config
176+ config , err = simpleTLSConfig (Server .CertFile , Server .KeyFile )
176177 if err != nil {
177178 return err
178179 }
You can’t perform that action at this time.
0 commit comments