From 232f3375b1c08daf748ceaededf9ba443abe0411 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 22 Sep 2018 10:59:45 -0700 Subject: [PATCH] only compress if its not a directory --- src/recipient/recipient.go | 2 +- src/sender/sender.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/recipient/recipient.go b/src/recipient/recipient.go index 9a77ad9..bb40e27 100644 --- a/src/recipient/recipient.go +++ b/src/recipient/recipient.go @@ -168,7 +168,7 @@ func receive(c *websocket.Conn, codephrase string, noPrompt bool, useStdout bool } // do decompression - if fstats.IsCompressed { + if fstats.IsCompressed && !fstats.IsDir { decrypted = compress.Decompress(decrypted) } diff --git a/src/sender/sender.go b/src/sender/sender.go index 3f717bc..0791b5c 100644 --- a/src/sender/sender.go +++ b/src/sender/sender.go @@ -179,7 +179,7 @@ func send(c *websocket.Conn, fname string, codephrase string, useCompression boo if bytesread > 0 { // do compression var compressedBytes []byte - if useCompression { + if useCompression && !fstats.IsDir { compressedBytes = compress.Compress(buffer[:bytesread]) } else { compressedBytes = buffer[:bytesread]