1
0
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:
James Hillyerd
2023-11-13 11:34:05 -08:00
committed by GitHub
parent e22ed26633
commit 535438342e
5 changed files with 15 additions and 20 deletions

View File

@@ -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) {

View File

@@ -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 {