1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

pop3: Use config.POP3 directly in server #91

This commit is contained in:
James Hillyerd
2018-03-31 17:01:02 -07:00
parent 2c813081eb
commit 7b073562eb
2 changed files with 17 additions and 24 deletions

View File

@@ -107,12 +107,12 @@ func (s *Server) startSession(id int, conn net.Conn) {
if err := conn.Close(); err != nil {
logger.Warn().Err(err).Msg("Closing connection")
}
s.waitgroup.Done()
s.wg.Done()
}()
ssn := NewSession(s, id, conn, logger)
ssn.send(fmt.Sprintf("+OK Inbucket POP3 server ready <%v.%v@%v>", os.Getpid(),
time.Now().Unix(), s.domain))
time.Now().Unix(), s.config.Domain))
// This is our command reading loop
for ssn.state != QUIT && ssn.sendError == nil {
@@ -545,9 +545,9 @@ func (s *Session) enterState(state State) {
s.logger.Debug().Msgf("Entering state %v", state)
}
// Calculate the next read or write deadline based on maxIdleSeconds
// nextDeadline calculates the next read or write deadline based on configured timeout.
func (s *Session) nextDeadline() time.Time {
return time.Now().Add(s.server.timeout)
return time.Now().Add(s.server.config.Timeout)
}
// Send requested message, store errors in Session.sendError