Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix dataTimeout in std.net.curl #797

Merged
merged 1 commit into from

2 participants

@jpf91
  • std.net.curl: Added operationTimeout.
  • std.net.curl: dataTimeout fixed. (Used to set operation timeout instead of inactivity timeout)
@jpf91 jpf91 Fix dataTimeout in std.net.curl
* std.net.curl: Added operationTimeout.
* std.net.curl: dataTimeout fixed. (Used to set operation
  timeout instead of inactivity timeout)
184cc82
@andralex andralex merged commit f39d7c5 into from
@andralex
Owner

merged

@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 17, 2012
  1. @jpf91

    Fix dataTimeout in std.net.curl

    jpf91 authored
    * std.net.curl: Added operationTimeout.
    * std.net.curl: dataTimeout fixed. (Used to set operation
      timeout instead of inactivity timeout)
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 0 deletions.
  1. +3 −0  changelog.dd
  2. +24 −0 std/net/curl.d
View
3  changelog.dd
@@ -5,11 +5,14 @@ $(VERSION 061, ddd mm, 2012, =================================================,
$(LI std.digest.sha: Added SHA1 digest implementation.)
$(LI std.uuid: Support SHA1 UUIDs.)
$(LI std.uuid: md5UUID and sha1UUID can now be used in pure code.)
+ $(LI std.net.curl: Added operationTimeout.)
$(LI std.md5 has been scheduled for deprecation (Use std.digest.md instead).)
$(LI crc32 has been scheduled for deprecation (Use std.digest.crc instead).)
)
$(LIBBUGSFIXED
+ $(LI Unlisted Bug: std.net.curl dataTimeout fixed. (Used to set operation timeout
+ instead of inactivity timeout))
)
)
View
24 std/net/curl.d
@@ -1544,6 +1544,15 @@ private mixin template Protocol()
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d)
{
+ p.curl.set(CurlOption.low_speed_limit, 1);
+ p.curl.set(CurlOption.low_speed_time, d.total!"seconds"());
+ }
+
+ /** Set maximum time an operation is allowed to take.
+ This includes dns resolution, connecting, data transfer, etc.
+ */
+ @property void operationTimeout(Duration d)
+ {
p.curl.set(CurlOption.timeout_ms, d.total!"msecs"());
}
@@ -2090,6 +2099,11 @@ struct HTTP
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d);
+ /** Set maximum time an operation is allowed to take.
+ This includes dns resolution, connecting, data transfer, etc.
+ */
+ @property void operationTimeout(Duration d);
+
/// Set timeout for connecting.
@property void connectTimeout(Duration d);
@@ -2729,6 +2743,11 @@ struct FTP
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d);
+ /** Set maximum time an operation is allowed to take.
+ This includes dns resolution, connecting, data transfer, etc.
+ */
+ @property void operationTimeout(Duration d);
+
/// Set timeout for connecting.
@property void connectTimeout(Duration d);
@@ -3013,6 +3032,11 @@ struct SMTP
/// Set timeout for activity on connection.
@property void dataTimeout(Duration d);
+ /** Set maximum time an operation is allowed to take.
+ This includes dns resolution, connecting, data transfer, etc.
+ */
+ @property void operationTimeout(Duration d);
+
/// Set timeout for connecting.
@property void connectTimeout(Duration d);
Something went wrong with that request. Please try again.