logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fastcgi, apache 2.4, and windows.
Author
covener



Joined: 23 Nov 2008
Posts: 59

PostPosted: Sat 07 Sep '13 22:55    Post subject: mod_fastcgi, apache 2.4, and windows. Reply with quote

For legacy reasons, I'm still using mod_fastcgi. mod_fastcgi and Apache are built side by side with the same compiler. Only under 2.4, and only on Windows, my extremely basic test handler never sees the Query string set.

I've tried both getenv() and GetEnviromnmentVariableA() in the fastcgi Program. mod_fastcgi fakes out the global environment so the normal getenv() like calls work as if you were in a CGI.

Has anyone pursued any problems in this neighborhood?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 09 Sep '13 10:28    Post subject: Reply with quote

Which scripting language do you use or do you try to use an internal function from mod_fastcgi ?
Back to top
covener



Joined: 23 Nov 2008
Posts: 59

PostPosted: Mon 09 Sep '13 14:06    Post subject: Reply with quote

James Blond wrote:
Which scripting language do you use or do you try to use an internal function from mod_fastcgi ?


I use a very simple C CGI that is linked with the libfcgi from mod_fastcgi -- the only fastcgi exploitation it has is the FCGI_Accept loop at the top. The actual call to look at the query is just getenv().
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 09 Sep '13 16:25    Post subject: Reply with quote

The documentation for FCGX_Accept_r() in fcgiapp.h says`:
Quote:

Creates a parameters data structure to be accessed via getenv(3) (if assigned to environ) or by FCGX_GetParam and assigns it to *envp.


So you might have to use

Code:

const char * query_string = FCGX_GetParam("QUERY_STRING", request.envp);


--- edit ---

See also http://www.fastcgi.com/devkit/doc/fastcgi-prog-guide/ch2c.htm
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Sun 15 Sep '13 20:05    Post subject: Reply with quote

We had to restore a backup, following post from Covener:

Unfortunately already using FCGI_Accept() which assigns the per-request environment to "environ" which allows the standard getenv/GetEnvironmentVariableA to work.

This is also broken only on Windows -- I build the same fcgi binary for multiple platforms. I do notice that mod_fastcgi does use APR to fork the children, which would maybe explain the one moving part in the upgraded 2.4 stac.
Back to top
covener



Joined: 23 Nov 2008
Posts: 59

PostPosted: Tue 26 Nov '13 2:56    Post subject: Reply with quote

mod_fastcgi after http://svn.apache.org/viewvc?view=revision&revision=568818

needs:

Index: fcgi_pm.c

@@ -513,6 +514,12 @@
if (apr_os_file_put(&file, &listen_handle, 0, tp))
goto CLEANUP;

+ /* Make sure stdout and stderr are INVALID_HANDLE_VALUE, even
+ * if under a level of APR with http://svn.apache.org/viewvc?view=revision&revision=568818
+ */
+ if (apr_procattr_io_set(procattr, APR_NO_FILE, APR_NO_FILE, APR_NO_FILE))
+ goto CLEANUP;
+

But I expect very little interest in making mod_fastcgi on 2.4
Back to top
covener



Joined: 23 Nov 2008
Posts: 59

PostPosted: Tue 26 Nov '13 2:58    Post subject: Reply with quote

to completely close the loop, query_string was not set because mod_fastcgi thought we were running as a CGI due to those handles being set, so it short circuited a lot of processing.
Back to top


Reply to topic   Topic: mod_fastcgi, apache 2.4, and windows. View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules