Fix forge connection.

This commit is contained in:
TomatoPuddin
2024-10-20 08:22:55 +08:00
committed by GitHub
parent 48cea3d046
commit 095d69d8a3

View File

@@ -8,6 +8,7 @@ import (
"os"
"sync"
"time"
"strings"
"github.com/fsnotify/fsnotify"
"github.com/rs/zerolog/log"
@@ -211,5 +212,11 @@ func GetMcHost(buf []byte) string {
return ""
}
return string(buf[1 : host_len+1])
host := string(buf[1 : host_len+1])
if spliterIndex := strings.IndexRune(host, 0); spliterIndex != -1 {
return host[0:spliterIndex]
} else {
return host
}
}