10000 SettableActionProvider constructs have problems · Issue #34 · j6mes/httplib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

SettableActionProvider constructs have problems #34

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

Closed
hucongquan opened this issue Jul 4, 2019 · 4 comments
Closed

SettableActionProvider constructs have problems #34

hucongquan opened this issue Jul 4, 2019 · 4 comments

Comments

@hucongquan
Copy link
` private NonActionProvider nonaction = new NonActionProvider();

    public SettableActionProvider(Action<WebHeaderCollection, Stream> success, Action<WebException> fail, Action<HttpWebRequest> make = null)
    {
        if (success == null)
        {
            this.success = nonaction.Success;
        }
        if (fail == null)
        {
            this.fail = nonaction.Fail;
        }  
        if (make == null)
        {
            this.make = nonaction.Make;
        }

        this.success = success;
        this.fail = fail;
        this.make = make;
    }

`
delegate success/fail/make ,although the default value is assigned, it will eventually be replaced by null;

I think the better way may like this:
` private NonActionProvider nonaction = new NonActionProvider();

    public SettableActionProvider(Action<WebHeaderCollection, Stream> success, Action<WebException> fail, Action<HttpWebRequest> make = null)
    {
        this.success = success;
        this.fail = fail;
        this.make = make;

        if (success == null)
        {
            this.success = nonaction.Success;
        }
        if (fail == null)
        {
            this.fail = nonaction.Fail;
        }  
        if (make == null)
        {
            this.make = nonaction.Make;
        }
    }`
@hucongquan
Copy link
Author

@j6mes

@j6mes
Copy link
Owner
j6mes commented Jul 4, 2019

Can you send a pull request?

@hucongquan
Copy link
Author
hucongquan commented Jul 5, 2019

@j6mes

Sound good, but haven't write permissions to the repository. also can't fork 2.0.16.83

@hucongquan
Copy link
Author

fixed by #37

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

No branches or pull requests

2 participants
0