fields in /proc/net/tcp* are not always delimited by single space
This commit is contained in:
parent
7f611468a8
commit
eae233efe4
1 changed files with 1 additions and 1 deletions
|
@ -228,7 +228,7 @@ class LinuxTCPConnectionInfo(TCPConnectionInfo):
|
||||||
active_connections = 0
|
active_connections = 0
|
||||||
f = open(self.source_file[self.family])
|
f = open(self.source_file[self.family])
|
||||||
for tcp_connection in f.readlines():
|
for tcp_connection in f.readlines():
|
||||||
tcp_connection = tcp_connection.strip().split(' ')
|
tcp_connection = tcp_connection.strip().split()
|
||||||
if tcp_connection[self.local_address_field] == 'local_address':
|
if tcp_connection[self.local_address_field] == 'local_address':
|
||||||
continue
|
continue
|
||||||
if tcp_connection[self.connection_state_field] not in self.connection_states:
|
if tcp_connection[self.connection_state_field] not in self.connection_states:
|
||||||
|
|
Loading…
Reference in a new issue