mirror of https://github.com/schollz/croc.git
Add more trimming
This commit is contained in:
parent
eb1b5a076c
commit
63664b7e78
|
@ -137,17 +137,17 @@ func receiveFile(id int, connection net.Conn, codePhrase string) (fileNameToRece
|
||||||
|
|
||||||
ivHex := make([]byte, BUFFERSIZE)
|
ivHex := make([]byte, BUFFERSIZE)
|
||||||
connection.Read(ivHex)
|
connection.Read(ivHex)
|
||||||
iv = strings.Trim(string(ivHex), ":")
|
iv = strings.Trim(strings.TrimSpace(string(ivHex)), ":")
|
||||||
logger.Debugf("iv: %s", iv)
|
logger.Debugf("iv: %s", iv)
|
||||||
|
|
||||||
saltHex := make([]byte, BUFFERSIZE)
|
saltHex := make([]byte, BUFFERSIZE)
|
||||||
connection.Read(saltHex)
|
connection.Read(saltHex)
|
||||||
salt = strings.Trim(string(saltHex), ":")
|
salt = strings.Trim(strings.TrimSpace(string(saltHex)), ":")
|
||||||
logger.Debugf("salt: %s", salt)
|
logger.Debugf("salt: %s", salt)
|
||||||
|
|
||||||
hashOfFileBytes := make([]byte, BUFFERSIZE)
|
hashOfFileBytes := make([]byte, BUFFERSIZE)
|
||||||
connection.Read(hashOfFileBytes)
|
connection.Read(hashOfFileBytes)
|
||||||
hashOfFile = strings.Trim(string(hashOfFileBytes), ":")
|
hashOfFile = strings.Trim(strings.TrimSpace(string(hashOfFileBytes)), ":")
|
||||||
logger.Debugf("hashOfFile: %s", hashOfFile)
|
logger.Debugf("hashOfFile: %s", hashOfFile)
|
||||||
|
|
||||||
os.Remove(fileNameToReceive + "." + strconv.Itoa(id))
|
os.Remove(fileNameToReceive + "." + strconv.Itoa(id))
|
||||||
|
|
Loading…
Reference in New Issue