mirror of
https://github.com/schollz/croc.git
synced 2024-12-18 11:11:29 +03:00
only compress if its not a directory
This commit is contained in:
parent
c6374da410
commit
232f3375b1
@ -168,7 +168,7 @@ func receive(c *websocket.Conn, codephrase string, noPrompt bool, useStdout bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
// do decompression
|
// do decompression
|
||||||
if fstats.IsCompressed {
|
if fstats.IsCompressed && !fstats.IsDir {
|
||||||
decrypted = compress.Decompress(decrypted)
|
decrypted = compress.Decompress(decrypted)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ func send(c *websocket.Conn, fname string, codephrase string, useCompression boo
|
|||||||
if bytesread > 0 {
|
if bytesread > 0 {
|
||||||
// do compression
|
// do compression
|
||||||
var compressedBytes []byte
|
var compressedBytes []byte
|
||||||
if useCompression {
|
if useCompression && !fstats.IsDir {
|
||||||
compressedBytes = compress.Compress(buffer[:bytesread])
|
compressedBytes = compress.Compress(buffer[:bytesread])
|
||||||
} else {
|
} else {
|
||||||
compressedBytes = buffer[:bytesread]
|
compressedBytes = buffer[:bytesread]
|
||||||
|
Loading…
Reference in New Issue
Block a user