AsyncPluggableProtocol icon indicating copy to clipboard operation
AsyncPluggableProtocol copied to clipboard

IInternetProtocolSink.ReportResult() dwError arg

Open samkho opened this issue 6 years ago • 2 comments

Hello.

Thank you for this awesome project of yours.

I believe that line 120 of Protocol.cs:

https://github.com/mganss/AsyncPluggableProtocol/blob/7bd88c29df5ae4530905bd95a5893faa4bddcfd5/Protocol.cs#L120

should not hardcode the 2nd argument (dwError) to zero. If hardcoding, 200 would be a more suitable value (it will get passed to the javascript xhr.status). But best would be if it's settable by the protocol implementation -- e.g. if somehow there's a way for ResourceProtocol.cs to specify this value.

samkho avatar May 20 '19 21:05 samkho

Thanks for pointing this out. I think it would be best if IProtocol had a method GetResultAsync that returned a Task<IResult> where IResult looked something like this:

public interface IResult
{
    Stream Response { get; set; }
    int Status { get; set; }
    string StatusText { get; set; }
}

Can you provide a PR?

mganss avatar May 21 '19 10:05 mganss

I will try to provide a PR

samkho avatar May 24 '19 03:05 samkho