@@ -157,6 +157,8 @@ Distributed under the Boost Software License, Version 1.0.
157
157
module std.net.curl ;
158
158
159
159
public import etc.c.curl : CurlOption;
160
+ import core.time : dur;
161
+ import etc.c.curl : CURLcode;
160
162
import std.concurrency : Tid;
161
163
import std.range.primitives ;
162
164
import std.encoding : EncodingScheme;
@@ -165,6 +167,8 @@ import std.typecons : Flag, Yes, No, Tuple;
165
167
166
168
version (unittest )
167
169
{
170
+ import std.socket : Socket ;
171
+
168
172
// Run unit test with the PHOBOS_TEST_ALLOW_NET=1 set in order to
169
173
// allow net traffic
170
174
private struct TestServer
@@ -232,11 +236,8 @@ version(unittest)
232
236
immutable (T)[] bdy;
233
237
}
234
238
235
- private Request! T recvReq (T=char , S)(S s)
239
+ private Request! T recvReq (T=char )( Socket s)
236
240
{
237
- import std.socket : Socket ;
238
- static assert (is (S == Socket ), " Invalid type used. Use std.socket.Socket." );
239
-
240
241
import std.algorithm.comparison : min;
241
242
import std.algorithm.searching : find, canFind;
242
243
import std.conv : to;
@@ -313,11 +314,7 @@ version(unittest)
313
314
version (StdDdoc) import std.stdio ;
314
315
315
316
// Default data timeout for Protocols
316
- private auto _defaultDataTimeout () {
317
- import core.time : dur;
318
- static res = dur! " minutes" (2 );
319
- return res;
320
- }
317
+ enum _defaultDataTimeout = dur! " minutes" (2 );
321
318
322
319
/**
323
320
Macros:
@@ -4144,7 +4141,6 @@ class HTTPStatusException : CurlException
4144
4141
immutable int status; // / The HTTP status code
4145
4142
}
4146
4143
4147
- import etc.c.curl : CURLcode;
4148
4144
// / Equal to $(REF CURLcode, etc,c,curl)
4149
4145
alias CurlCode = CURLcode;
4150
4146
@@ -4352,7 +4348,7 @@ struct Curl
4352
4348
interleavefunction, chunk_data, chunk_bgn_function,
4353
4349
chunk_end_function, fnmatch_data, fnmatch_function, cookiejar, postfields);
4354
4350
4355
- static foreach (option; tt)
4351
+ foreach (option; tt)
4356
4352
copy.clear(option);
4357
4353
}
4358
4354
0 commit comments