Open
Conversation
Contributor
|
I've not looked at it yet, but please let's not merge until we fix the issue we are seeing in Dashboard with Python. Then we'll focus on adding this. |
Contributor
Author
|
absolutely agreed @radujipa - just wanted to get this code in a PR in the meantime. |
tombettany
requested changes
Oct 11, 2019
Member
tombettany
left a comment
There was a problem hiding this comment.
Great idea, just a couple of suggestions.
| namespace Mercury { | ||
| namespace HTTP { | ||
|
|
||
| #define DEFAULT_HTTP_CLIENT_TIMEOUT 15 // seconds |
Member
There was a problem hiding this comment.
Suggested change
| #define DEFAULT_HTTP_CLIENT_TIMEOUT 15 // seconds | |
| const unsigned int DEFAULT_HTTP_CLIENT_TIMEOUT = 15; // seconds |
Also, is 15 seconds too long?
| class HTTPClient : public IHTTPClient { | ||
| public: | ||
| HTTPClient(); | ||
| HTTPClient(int timeout_secs); |
Member
There was a problem hiding this comment.
Combine these two constructors into one?
Suggested change
| HTTPClient(int timeout_secs); | |
| HTTPClient(int timeout_secs = DEFAULT_HTTP_CLIENT_TIMEOUT); |
|
|
||
|
|
||
| HTTPClient::HTTPClient() { | ||
| HTTPClient::HTTPClient(int timeout_secs = DEFAULT_HTTP_CLIENT_TIMEOUT) { |
Member
There was a problem hiding this comment.
Default arguments in header definition, not implementation.
|
|
||
|
|
||
| void HTTPClient::set_http_client_timeout(int seconds) | ||
| { |
Member
There was a problem hiding this comment.
{ on same line as definition.
| } | ||
|
|
||
|
|
||
| int HTTPClient::get_http_client_timeout() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provide a means to set a timeout for the HTTP class.
It builds fine but haven't actually tested.
Also, needs a test to make sure the timeout is set and works correctly.