fields in /proc/net/tcp* are not always delimited by single space

pull/4420/head
Ashish Ranjan 2014-10-24 14:48:26 +00:00 committed by Matt Clay
parent dddc5ffd2c
commit 57ce7b1ea1
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ class LinuxTCPConnectionInfo(TCPConnectionInfo):
active_connections = 0
f = open(self.source_file[self.family])
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':
continue
if tcp_connection[self.connection_state_field] not in self.connection_states: