From 756e00c3bb83a98c77483b2df607dc7c7d95bed9 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Wed, 24 Mar 2010 14:50:25 +0000 Subject: [PATCH] A little more work for each connection, but this should be slightly more robust git-svn-id: file:///home/svn/framework3/trunk@8895 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rapid7/nexpose.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rapid7/nexpose.rb b/lib/rapid7/nexpose.rb index 20d78eb1f8..bb62c9ae3a 100644 --- a/lib/rapid7/nexpose.rb +++ b/lib/rapid7/nexpose.rb @@ -60,6 +60,10 @@ class APIRequest attr_reader :trace def initialize(req, url) + prepare_http_client + end + + def prepare_http_client @retry_count = 0 @retry_count_max = 10 @time_out = 30 @@ -83,6 +87,7 @@ class APIRequest @conn_tries = 0 begin + prepare_http_client resp, data = @http.post(@uri.path, @req, @headers) @res = parse_xml(data)