Skip to content

Conversation

@wilzbach
Copy link
Contributor

A first step for #5916 - there's still much work to do.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

import std.range.primitives;
import std.encoding : EncodingScheme;
import std.traits : isSomeChar;
import std.typecons : Flag, Yes, No, Tuple;
Copy link
Contributor Author

@wilzbach wilzbach Dec 15, 2017

Choose a reason for hiding this comment

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

So when do we get DIP1005? :)

std/net/curl.d Outdated
private Request!T recvReq(T=char, S)(S s)
{
import std.socket : Socket;
static assert (is(S == Socket), "Invalid type used. Use std.socket.Socket.");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I really wanted to avoid that there are different imports available during the unittest mode, hence this workaround.

Copy link
Member

Choose a reason for hiding this comment

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

Ew.

I think this cure is worse than the disease.

std/net/curl.d Outdated
chunk_end_function, fnmatch_data, fnmatch_function, cookiejar, postfields);

foreach (option; tt)
static foreach (option; tt)
Copy link
Member

Choose a reason for hiding this comment

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

I would generally advise against mixing different kinds of changes in one commit.

std/net/curl.d Outdated
private enum _defaultDataTimeout = dur!"minutes"(2);
private auto _defaultDataTimeout() {
import core.time : dur;
static res = dur!"minutes"(2);
Copy link
Member

Choose a reason for hiding this comment

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

static is now going to make it take up space in TLS (and be initialized for each new thread), for something that should be a manifest constant...

std/net/curl.d Outdated
private Request!T recvReq(T=char, S)(S s)
{
import std.socket : Socket;
static assert (is(S == Socket), "Invalid type used. Use std.socket.Socket.");
Copy link
Member

Choose a reason for hiding this comment

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

Ew.

I think this cure is worse than the disease.

std/net/curl.d Outdated
immutable int status; /// The HTTP status code
}

import etc.c.curl : CURLcode;
Copy link
Contributor

Choose a reason for hiding this comment

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

should be at the top of the file

@wilzbach wilzbach merged commit 550f590 into dlang:master Dec 18, 2017
@wilzbach wilzbach deleted the std-net-curl-lazy branch December 18, 2017 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants