kristapsdz / kcgi

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

automated testing with regress ... curl always returns the CURLINFO_RESPONSE_CODE to be 0 #32

Closed ghost closed 6 years ago

ghost commented 6 years ago

I've tried to run the sample test from,

https://kristaps.bsd.lv/kcgi/kcgiregress.3.html

in a litte different way, instead of using the kcgi_regress_cgi I've used the kcgi_regress_fcgi function. the result of the test, is that it may not be a very good example, for me the tests always return 0 even if it should not because the CURLINFO_RESPONSE_CODE is always 0, even if the fcgi script returns 200 or 404.

did you had the same experience?

ghost commented 6 years ago

for more details you can have a look at:

https://github.com/evalgo/eve-cgi/blob/master/test/cgi_test.c

kristapsdz commented 6 years ago

I'm looking into this now. You should be aware that I'm making some bigger changes to the FastCGI handler pursant to https://github.com/kristapsdz/kcgi/issues/27, so I'd be wary in using FastCGI right now. At least with nginx. (I've had no problems with OpenBSD's httpd.) (In general, I don't like FastCGI, as I think its complexities even in terms of deployment outweigh the benefits.) kcgiregress(3) is fairly limited regarding FastCGI: it can't do multiple FastCGI requests within the FastCGI request loop.

ghost commented 6 years ago

well, it is also not my favourite way, but as far i understand it is the most performant one ... from my perspective the better way would be to have a built in web server and use nginx, httpd, apache or whatever other server als proxy ... but i guess you do not think about this solution, or do you ?

kristapsdz commented 6 years ago

I do think about those solutions---it's my job. :) At the end of the day, it's up to however you define "performant". As of the last commits, I've put a lot of focus in getting FastCGI to be intuitive. I'll continue to polish them up before the coming release. (There are a lot of moving parts to FastCGI. A lot...)

ghost commented 6 years ago

ok, i will wait for the next release. would you like to share some ideas what you think about the mentioned solutions (web server, etc.?), that's also my daily business ... :-) ... to think about such solutions ... so if you like we can share some experiences