aboutsummaryrefslogtreecommitdiff
path: root/mx_recv.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-13 15:11:07 +0800
committerRunxi Yu <me@runxiyu.org>2025-01-13 15:11:07 +0800
commit1c2ca837538468b080e20acf2460959ed98c0e07 (patch)
tree45ccf03c062dc8bfb8bb95e3ce9af5331cf353e1 /mx_recv.go
parentUpdate logging code (diff)
downloadmaild-1c2ca837538468b080e20acf2460959ed98c0e07.tar.gz
maild-1c2ca837538468b080e20acf2460959ed98c0e07.tar.zst
maild-1c2ca837538468b080e20acf2460959ed98c0e07.zip
Log EOF differently from other errors
Diffstat (limited to 'mx_recv.go')
-rw-r--r--mx_recv.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/mx_recv.go b/mx_recv.go
index ef8c2cc..33b4012 100644
--- a/mx_recv.go
+++ b/mx_recv.go
@@ -6,6 +6,7 @@ import (
"context"
"crypto/tls"
"errors"
+ "io"
"net"
"slices"
"strings"
@@ -49,6 +50,9 @@ func (session *mx_recv_session) handle(ctx context.Context) error {
for {
line, err := session.buf_conn.ReadString('\n')
if err != nil {
+ if err == io.EOF {
+ return err_connection_handler_eof
+ }
return err
}
line = strings.TrimSuffix(line, "\n")