Closed olsonanl closed 5 years ago
This looks good to me, any idea why the CI tests are failing?
Hm, no. I'll see if I can get the test environment going here and replicate the problem. I'm actually not sure if the defined test is completely correct; it might be safer to check for '' since there are places in the code where '' is assigned (but they may come after the initial initialization where this problem crops up).
I pulled your change locally to see if the failure is CI specific and got the same failure.
I think the issue is that it's only checking defined
and inputbuf could be empty (""
).
Right; I noticed that there are other cases in the existing code that has the defined check. I can go thru and make a PR using the empty check instead.
It would be nice if you can add a unit test to illustrate the original problem (where content body is "0").
OK - I'll try to do that as well.
OK, my latest code has a new test single_zero.t that works with the new code as do all the other tests. However in the failure case it just hangs; I’m not sure how you properly handle that in the test harness.
On May 20, 2019, at 2:05 PM, Tatsuhiko Miyagawa notifications@github.com<mailto:notifications@github.com> wrote:
It would be nice if you can add a unit test to illustrate the original problem (where content body is "0").
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/miyagawa/Starman/pull/133?email_source=notifications&email_token=AAQNOITOSYDYATXFWG57PE3PWLY7LA5CNFSM4HNXD7FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZY6RY#issuecomment-494112583, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAQNOIWAYDZALD5ZK4CBZXTPWLY7LANCNFSM4HNXD7FA.
Like that?
thanks!
This patch fixes the case where a POST request is the single character "0" (zero). Stock starman will hang in that case trying to read from a stream which will contain no more data.