Good enough

This commit is contained in:
Joren Schipman 2024-05-02 17:09:47 +02:00
parent 736310d469
commit 3b250d1058
Signed by untrusted user who does not match committer: Joren
GPG Key ID: 280E33DFBC0F1B55

View File

@ -102,7 +102,6 @@ func handleConnection(conn net.Conn, privateKey *rsa.PrivateKey) {
fmt.Println("Exchange, OK!")
// Receive and handle multiple files
for {
var chunks []string
for {
@ -120,12 +119,11 @@ func handleConnection(conn net.Conn, privateKey *rsa.PrivateKey) {
conn.Write([]byte("Received and decrypted chunk\n"))
}
go decryptAndHandle(chunks, key, iv, uid)
conn.Write([]byte("Received and decrypted\n"))
// Check if there are more files to receive
moreFiles, err := bufio.NewReader(conn).ReadString('\n')
if err != nil {
log.Printf("Error reading more files signal: %v", err)