mirror of
https://github.com/dlang/phobos.git
synced 2025-05-13 07:39:15 +03:00
Merge pull request #797 from jpf91/timeoutCURL
Fix dataTimeout in std.net.curl
This commit is contained in:
commit
f39d7c58cc
2 changed files with 27 additions and 0 deletions
|
@ -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))
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1543,6 +1543,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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue