Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some methods were not honoring custom Connection Timeouts #300

Merged
merged 2 commits into from
Sep 28, 2017

Conversation

sgreen-r7
Copy link
Contributor

@sgreen-r7 sgreen-r7 commented Sep 28, 2017

There were four methods that had non-standard direct calls to APIRequest.execute causing the custom set timeouts to be ignored.

The following methods have been updated to use the Connection::timeout:

@@ -179,7 +179,7 @@ def save(nsc)
end
xml.add_element(as_xml)

response = APIRequest.execute(nsc.url, xml, '1.2')
response = APIRequest.execute(nsc.url, xml, '1.2', { timeout: nsc.timeout, open_timeout: nsc.open_timeout })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant curly braces around a hash parameter.

@@ -157,7 +157,7 @@ def initialize(name, full_name, id = -1, enabled = true, scope = Scope::SILO)
def self.load(nsc, name, scope = Scope::SILO)
xml = nsc.make_xml('RoleDetailsRequest')
xml.add_element('Role', { 'name' => name, 'scope' => scope })
response = APIRequest.execute(nsc.url, xml, '1.2')
response = APIRequest.execute(nsc.url, xml, '1.2', { timeout: nsc.timeout, open_timeout: nsc.open_timeout })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant curly braces around a hash parameter.

@@ -159,7 +159,7 @@ def rescan_assets(connection)
#
def self.load(connection, id)
xml = %(<AssetGroupConfigRequest session-id="#{connection.session_id}" group-id="#{id}"/>)
r = APIRequest.execute(connection.url, xml)
r = APIRequest.execute(connection.url, xml, '1.1', { timeout: connection.timeout, open_timeout: connection.open_timeout })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant curly braces around a hash parameter.

@rapid7 rapid7 deleted a comment from houndci-bot Sep 28, 2017
@rapid7 rapid7 deleted a comment from houndci-bot Sep 28, 2017
@rapid7 rapid7 deleted a comment from houndci-bot Sep 28, 2017
@sgreen-r7 sgreen-r7 merged commit e84e383 into master Sep 28, 2017
@gperez-r7 gperez-r7 deleted the conn_timeout_fixes branch May 14, 2019 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants