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
WriteOutputAndSignAsync hangs on "await literalOut.WriteAsync(buf, 0, length)" #44
Comments
I think this is because your outputMemoryStream is positioned at the end, you need to reset the read position to the start. The below code works for me in my test script.
|
Thanks for the quick response! Let me try that, for sure, thanks for the suggestion. But it actually never exits pgp.SignStream(). I pulled in your source (instead of just the binary) and was able to put a breakpoint in the WriteOutputAndSignAsync method and noticed that it never exited literalOut.WriteAsync (line 484). |
Update: it hangs occasionally, but not always. Sometimes running it will return a valid signed pgp message, without restarting server process (but new http request). I might need to look at the state of those memory streams each run. |
Strange that it only hangs occasionally, I find that when PgpCore goes wrong it tends to go consistently wrong :). Maybe it's an issue with not disposing of the request streams correctly? |
Using the async methods (await pgp.SignStreamAsync) works much better for us. 🤷♂ Thanks again for everything! |
Calling code:
Given "foobar" for unsignedString, SignStream hangs at the point of writing out to literalOut, whereas unsignedString=string.Empty returns instantly (with string.Empty).
Am I doing anything wrong? No error decoding my key, which was my main reason for testing this before handing it real values. Could it be the key itself?
The text was updated successfully, but these errors were encountered: