kristapsdz / kcgi

minimal CGI and FastCGI library for C/C++
https://kristaps.bsd.lv/kcgi
ISC License
275 stars 40 forks source link

Fix regress tests for libcurl>7.66.0 #73

Closed xse closed 4 years ago

xse commented 4 years ago

This is a bad solution, it fixes the issue but the issue should be fixed differently.

Hey,

Since curl 7.66.0 (released September 11 2019):

  • http09: disable HTTP/0.9 by default in both tool and library

This makes several tests fail, with libcurl verbose option activated we can see that HTTP/0.9 is the issue.

* Received HTTP/0.9 when not allowed

* Closing connection 0
write: Connection reset by peer
wrappers.c:289: poll: POLLHUP
wrappers.c:289: poll: POLLHUP
wrappers.c:289: poll: POLLHUP

These changes are just adding the right option to all the tests that were failing. Another option would be to not use HTTP/0.9, i'm not the one that will make that call.

This fixes #72 the issue came up on Arch Linux due to it being upgraded frequently but i'll arise on others distros/OS as soon as they update curl. Actually obsd's last release is affected. I've tried building theses changes with an old libcurl version on Debian too to check if it did not break something, it also builds fine on armv6.

Note that i did not ask myself why those were HTTP/0.9, kcgi's manual states that

 +o    HTTP response headers are standardised in RFC 2616, "HTTP/1.1" and further in RFC 4229, "HTTP Header Field Registrations".

So maybe those shouldn't be HTTP/0.9 in the first place ?

Have a good day!