Good enough
This commit is contained in:
parent
736310d469
commit
3b250d1058
@ -102,7 +102,6 @@ func handleConnection(conn net.Conn, privateKey *rsa.PrivateKey) {
|
|||||||
|
|
||||||
fmt.Println("Exchange, OK!")
|
fmt.Println("Exchange, OK!")
|
||||||
|
|
||||||
// Receive and handle multiple files
|
|
||||||
for {
|
for {
|
||||||
var chunks []string
|
var chunks []string
|
||||||
for {
|
for {
|
||||||
@ -120,12 +119,11 @@ func handleConnection(conn net.Conn, privateKey *rsa.PrivateKey) {
|
|||||||
|
|
||||||
conn.Write([]byte("Received and decrypted chunk\n"))
|
conn.Write([]byte("Received and decrypted chunk\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
go decryptAndHandle(chunks, key, iv, uid)
|
go decryptAndHandle(chunks, key, iv, uid)
|
||||||
|
|
||||||
conn.Write([]byte("Received and decrypted\n"))
|
conn.Write([]byte("Received and decrypted\n"))
|
||||||
|
|
||||||
// Check if there are more files to receive
|
|
||||||
moreFiles, err := bufio.NewReader(conn).ReadString('\n')
|
moreFiles, err := bufio.NewReader(conn).ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error reading more files signal: %v", err)
|
log.Printf("Error reading more files signal: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user