tcp: send error on fail

This commit is contained in:
Zack Scholl 2022-02-23 08:03:45 -08:00
parent 53f35c1da0
commit 635b362ca0
1 changed files with 1 additions and 1 deletions

View File

@ -226,7 +226,7 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er
}
if strings.TrimSpace(string(passwordBytes)) != s.password {
err = fmt.Errorf("bad password")
enc, _ := crypt.Decrypt([]byte(err.Error()), strongKeyForEncryption)
enc, _ := crypt.Encrypt([]byte(err.Error()), strongKeyForEncryption)
if err := c.Send(enc); err != nil {
return "", fmt.Errorf("send error: %w", err)
}