mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 22:43:41 +08:00
trim out trailing return character
This commit is contained in:
parent
38fc200e56
commit
8363be8548
@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -21,9 +22,12 @@ func (vs *VolumeServer) HandleTcpConnection(c net.Conn) {
|
|||||||
for {
|
for {
|
||||||
cmd, err := bufReader.ReadString('\n')
|
cmd, err := bufReader.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("read command from %s: %v", c.RemoteAddr().String(), err)
|
if err != io.EOF {
|
||||||
|
glog.Errorf("read command from %s: %v", c.RemoteAddr().String(), err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
cmd = cmd[:len(cmd)-1]
|
||||||
switch cmd[0] {
|
switch cmd[0] {
|
||||||
case '+':
|
case '+':
|
||||||
fileId := cmd[1:]
|
fileId := cmd[1:]
|
||||||
|
Loading…
Reference in New Issue
Block a user