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

Add curl speed limit for low bandwidth server #29

Merged
merged 7 commits into from
Aug 29, 2020
Merged

Add curl speed limit for low bandwidth server #29

merged 7 commits into from
Aug 29, 2020

Conversation

Kxnrl
Copy link
Contributor

@Kxnrl Kxnrl commented Aug 14, 2020

No description provided.

{"HTTPClient.MaxSendSpeed.get", GetClientMaxSendSpeed},
{"HTTPClient.MaxSendSpeed.set", SetClientMaxSendSpeed},
{"HTTPClient.MaxRecvSpeed.get", GetClientMaxRecvSpeed},
{"HTTPClient.MaxRecvSpeed.set", SetClientMaxRecvSpeed},
Copy link
Owner

Choose a reason for hiding this comment

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

You need to add these properties to the HTTPClient methodmap in http.inc as well.
Preferably with documentation indicating that the value is in bytes/sec.

}
if (maxSendSpeed > 0)
{
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, maxSendSpeed);
Copy link
Owner

Choose a reason for hiding this comment

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

CURLOPT_MAX_SEND_SPEED_LARGE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha, my bad.

@@ -49,6 +50,8 @@ class HTTPFileContext : public IHTTPContext
long connectTimeout;
long followLocation;
long timeout;
long maxSendSpeed;
long maxRecvSpeed;
Copy link
Owner

Choose a reason for hiding this comment

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

According to the cURL documentation these should be of type curl_off_t.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeap, i will change it later, curl_off_t is int64_t I think.

@@ -174,4 +174,16 @@ methodmap HTTPClient < Handle
public native get();
public native set(int timeout);
}

// Max Send speed in bytes per seconed.

Choose a reason for hiding this comment

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

second*

Same typo below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

::cry::

@Kxnrl
Copy link
Contributor Author

Kxnrl commented Aug 23, 2020

@ErikMinekus

@ErikMinekus ErikMinekus merged commit 841f89e into ErikMinekus:master Aug 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants