mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
server: resolve linter errors (#433)
Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -547,7 +547,6 @@ func (s *Session) dataHandler() {
|
||||
s.send("250 Mail accepted for delivery")
|
||||
s.logger.Info().Msgf("Message size %v bytes", mailData.Len())
|
||||
s.reset()
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Session) enterState(state State) {
|
||||
|
||||
@@ -147,8 +147,8 @@ func (s *Server) serve(ctx context.Context) {
|
||||
for sessionID := 1; ; sessionID++ {
|
||||
if conn, err := s.listener.Accept(); err != nil {
|
||||
// There was an error accepting the connection.
|
||||
if nerr, ok := err.(net.Error); ok && nerr.Temporary() {
|
||||
// Temporary error, sleep for a bit and try again.
|
||||
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
|
||||
// Timeout, sleep for a bit and try again.
|
||||
if tempDelay == 0 {
|
||||
tempDelay = 5 * time.Millisecond
|
||||
} else {
|
||||
@@ -158,7 +158,7 @@ func (s *Server) serve(ctx context.Context) {
|
||||
tempDelay = max
|
||||
}
|
||||
log.Error().Str("module", "smtp").Err(err).
|
||||
Msgf("SMTP accept error; retrying in %v", tempDelay)
|
||||
Msgf("SMTP accept timeout; retrying in %v", tempDelay)
|
||||
time.Sleep(tempDelay)
|
||||
continue
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user