This commit is contained in:
Hedy Li 2021-08-02 17:38:28 +08:00
parent 87a57d48fb
commit 70f0c6683e
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ type Request struct {
user string
path string // Requested path
filePath string // Actual file path that does not include the content dir name
data string
data string
}
const (
@ -136,11 +136,11 @@ func handleConnection(netConn net.Conn, conf *Config) {
var newData string
for s.Scan() {
newData = s.Text()
if len(data) + len(newData) == dataLen {
if len(data)+len(newData) == dataLen {
data += newData
break
}
if len(data) + len(newData) > dataLen {
if len(data)+len(newData) > dataLen {
data += newData[:dataLen-len(data)-1]
}
data += newData