From b4a6c9fe755d9283d9a79b5e5101ba136dd30f7f Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Tue, 2 Sep 2003 16:16:12 +0000 Subject: [PATCH] fetch fd correctly in fastcgi case --- sapi/cgi/cgi_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index cf1ef83e47..7a9bc5198c 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -491,8 +491,16 @@ static int php_cgi_startup(sapi_module_struct *sapi_module) static int sapi_cgi_get_fd(int *fd TSRMLS_DC) { +#if PHP_FASTCGI + FCGX_Request *request = (FCGX_Request *)SG(server_context); + + *fd = request->ipcFd; + if (*fd >= 0) return SUCCESS; + return FAILURE; +#else *fd = STDOUT_FILENO; return SUCCESS; +#endif } static int sapi_cgi_force_http_10(TSRMLS_D) -- 2.50.1