Skip to content

Commit 0d31c1c

Browse files
author
Brent Cook
committed
Land rapid7#8945, fix issue where we can call shutdown on a closed socket
2 parents 0408979 + 71f13db commit 0d31c1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rex/proto/http/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ def connect(t = -1)
191191
# Closes the connection to the remote server.
192192
#
193193
def close
194-
if (self.conn)
194+
if self.conn && !self.conn.closed?
195195
self.conn.shutdown
196-
self.conn.close unless self.conn.closed?
196+
self.conn.close
197197
end
198198

199199
self.conn = nil

0 commit comments

Comments
 (0)