Skip to content

Commit 6d31a1c

Browse files
committed
fix: Exit msg processor loop when conn errors
1 parent 6bf1eec commit 6d31a1c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

constants/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package constants
22

33
const (
4-
MMAR_VERSION = "0.1.3"
4+
MMAR_VERSION = "0.1.4"
55

66
VERSION_CMD = "version"
77
SERVER_CMD = "server"

internal/server/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ func (ms *MmarServer) processTunnelMessages(ct *ClientTunnel) {
424424
tunnelMsg, err := ct.ReceiveMessage()
425425
if err != nil {
426426
logger.Log(constants.DEFAULT_COLOR, fmt.Sprintf("Receive Message from client tunnel errored: %v", err))
427+
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, net.ErrClosed) {
428+
// If error with connection, stop processing messages
429+
return
430+
}
427431
continue
428432
}
429433

0 commit comments

Comments
 (0)