Line 0
Link Here
|
|
|
1 |
--- fail2ban/client/csocket.py.orig 2018-04-08 10:28:39.135695000 +0200 |
2 |
+++ fail2ban/client/csocket.py 2018-04-08 10:35:39.403548000 +0200 |
3 |
@@ -43,7 +43,7 @@ |
4 |
self.__csock.connect(sock) |
5 |
|
6 |
def __del__(self): |
7 |
- self.close(False) |
8 |
+ self.close() |
9 |
|
10 |
def send(self, msg, nonblocking=False, timeout=None): |
11 |
# Convert every list member to string |
12 |
@@ -56,13 +56,18 @@ |
13 |
def settimeout(self, timeout): |
14 |
self.__csock.settimeout(timeout if timeout != -1 else self.__deftout) |
15 |
|
16 |
- def close(self, sendEnd=True): |
17 |
+ def close(self): |
18 |
if not self.__csock: |
19 |
return |
20 |
- if sendEnd: |
21 |
+ try: |
22 |
self.__csock.sendall(CSPROTO.CLOSE + CSPROTO.END) |
23 |
- self.__csock.shutdown(socket.SHUT_RDWR) |
24 |
- self.__csock.close() |
25 |
+ self.__csock.shutdown(socket.SHUT_RDWR) |
26 |
+ except socket.error: # pragma: no cover - normally unreachable |
27 |
+ pass |
28 |
+ try: |
29 |
+ self.__csock.close() |
30 |
+ except socket.error: # pragma: no cover - normally unreachable |
31 |
+ pass |
32 |
self.__csock = None |
33 |
|
34 |
@staticmethod |