[gnome-keysign: 48/65] bluetoothoffer: close client socket to avoid possible waste of resources



commit 540ec8028a937a7f65dd5fa77b42714852914fa5
Author: RyuzakiKK <aasonykk gmail com>
Date:   Fri Aug 25 15:30:36 2017 +0200

    bluetoothoffer: close client socket to avoid possible waste of resources

 keysign/bluetoothoffer.py | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/keysign/bluetoothoffer.py b/keysign/bluetoothoffer.py
index 17b30cd..d048a0c 100644
--- a/keysign/bluetoothoffer.py
+++ b/keysign/bluetoothoffer.py
@@ -59,6 +59,8 @@ class BluetoothOffer:
                     kd_decoded = key_data.decode('utf-8')
                     yield threads.deferToThread(client_socket.sendall, kd_decoded)
                     log.info("Key has been sent")
+                    client_socket.shutdown(socket.SHUT_RDWR)
+                    client_socket.close()
                     success = True
                     message = None
         except Exception as e:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]