Re: Windows NT, MFC, and FastCGI

Benjamin Gavin (gavinb@supranet.net)
Wed, 03 Sep 1997 14:22:19 -0500

Message-Id: <3.0.3.32.19970903142219.0093e170@mail.supranet.net>
Date: Wed, 03 Sep 1997 14:22:19 -0500
To: fastcgi-developers@OpenMarket.com
From: Benjamin Gavin <gavinb@supranet.net>
Subject: Re: Windows NT, MFC, and FastCGI

-----BEGIN PGP SIGNED MESSAGE-----

Ok Everyone,
  Good news, and bad.  The bad news first, you cannot use the 
FCGI_Accept with MFC under NT 4.0, or at least I haven't figured out 
how.  The good news, I have gotten the 
FCGX_Accept(&in,&out,&err,&envp) to work.  This is a major pain, and 
I would suggest that we try to find a way to use FCGI_Accept.  The 
reason, as suggested by Bill Snapper, could be that MFC just blindly 
takes ahold and reassigns environment variables to seperate names, or 
to different places.  Either way it does not work.  Anyway, as long 
as you use the FCGX stuff, i.e. FCGX_Streams, ParamArrays, FPrintFs 
you are fine.
  If anyone is interested I have written a set of CGI utilities (in 
C++).  They are distributed in the public domain, freeware, all that 
stuff.  Anyway in that bundle are two sets of files, one for FastCGI, 
and one for regular CGIs.  I have tested parts of the libraries 
extensively under NT, and they perform very nicely.  I haven't 
experienced any major leaks, or problems, but of course none of this 
is under warranty of any kind.  If anyone is interested you can go to 
the following URL:

	ftp://ftp.supranet.net/pub/cgi-utilv2.zip

The CGI side of the libraries have been tested extensively under 
UNIX, but I haven't had a chance to try the FastCGI stuff there yet.  
If I can get more people using the libraries, then maybe I can get 
some help debugging them.  Please let me know if you have any 
questions.

Thanks for everyone's help,
Benjamin Gavin


At 08:12 AM 9/3/97 -0500, you wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>
>Hi,
>  I have been working on this project, one piece of which uses 
>FastCGI, and one piece of which uses MFC.  I built the kit ran the 
>echo programs no problem, or at least with a little help.  The 
>environment variables changed from call to call, the process number 
>stayed the same, all that good stuff.  However, when I cut and 
pasted 
>the code into a FastCGI app using MFC, it bombed miserably.  The 
>environment variables are no longer updating, and for CGI, that 
>basically makes the whole program worthless.  Here is what I did:
>
>1)  Downloaded files from www.fastcgi.com
>2)  Ran build_no_shell.bat
>3)  Ran the echo_nt.fcgi test program, all is working fine.
>4)  Cut the code from the echo example, and pasted it into an 
>existing
>    MFC CGI program.
>5)  This did not work.  The environment variables don't get updated.
>
>  I don't have time to debug the FastCGI portion of this program, 
and 
>I am at a loss as to what to do.  Is there something in MFC that is 
>causing these program to bomb??  Is it because using MFC forces you 
>to run Multithreaded??  I feel the the latter may be a problem.  I 
am 
>going to look into it a little further, but like I said, I don't 
have 
>that much time.  I assume, from what I have read, that the 
>libfcgi.dll file is compiled single threaded, and the cgi-fcgi.exe 
is 
>as well.
>  Anyone have any other ideas??  Oh, I am using Microsoft VC5, under 

>Windows NT 4.0, with MFC being used in a shared dll.
>
>Thanks,
>Ben
>-----BEGIN PGP SIGNATURE-----
>Version: PGP for Personal Privacy 5.0
>Charset: noconv
>
>iQCVAwUBNA1iIUtkpl99enKxAQGqRAP8CYDh9KwROY+QFfeNzipqH1400S5z6w2c
>MiUgld4vMvKfaP/gNT+LPWnceem5ZZ0pmmTIV3y4zzoxPgFFZ0x9Mdu6rxTDUE7g
>CXZX8odPT8zBIrQWrWDl6WVIlvczlG0KkuJmIOg6X1BxjH+Al19lCRZgXbzv5QiF
>OMiFtjdx8XE=
>=9keG
>-----END PGP SIGNATURE-----
>
>
>
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQCVAwUBNA24rktkpl99enKxAQFVEQP8DXPkt2w72AuSKrkZe7LfiD9uBPmZaApc
ffnSnu34vcVf65FHKXOjIEHlAYT20Xre5s4WBZlPpDXvt3COlFiP9a5rld0Wl97r
+8FFbuu6z+78W1TCMPcyg/+YESX/OBGqpAi7JlQQRTA/4T9GpzJ7csTZcQfhR4TU
sBygjElFhok=
=ri1T
-----END PGP SIGNATURE-----