Recently I hacked an interface together using call-ins. It works, but
is quirky
enough to render it unusable:
1. When I write using printf() before the call-in, I see the output as
expected in the browser.
2. When I write using WRITE within the M routine, the output appears
in
the apache error log. The command WRITE $IO shows 0. On my plain CGI
version it shows 1 (which makes sense given that its writing to
stdout),
so I think something may be amiss here.
3. Subsequent calls to printf() appear to send the string "nowhere."
It
doesn't appear in the browser or in the error log. (I'm thinking if I
fix #2 this will follow.)
The FastCGI library I'm using (the one available from the website)
fiddles with std{in,out,err} to maintain compatibility with old CGI
programs. This works splendidly as long as I stay in C, but GT.M
appears to manipulate the devices differently (perhaps when setting up
$P, I don't know). I feel like if I get this one last detail working,
I'd have a neat little library.
Anyways, I'd appreciate any insight into how I might make this work.
Thanks,
Sean
Why?
Rob
[KSB] GT.M does play with $P if it thinks it is a terminal device, but
not if it is a file or socket. But the difference in $IO is
interesting. It should be 0.
> 3. Subsequent calls to printf() appear to send the string "nowhere."
> It
> doesn't appear in the browser or in the error log. (I'm thinking if I
> fix #2 this will follow.)
[KSB] You're probably right.
> The FastCGI library I'm using (the one available from the website)
> fiddles with std{in,out,err} to maintain compatibility with old CGI
> programs. This works splendidly as long as I stay in C, but GT.M
> appears to manipulate the devices differently (perhaps when setting up
> $P, I don't know). I feel like if I get this one last detail working,
> I'd have a neat little library.
[KSB] Many people have experience using GT.M with CGI, but not
FastCGI.
Regards
-- Bhaskar
ks dot bhaskar at fisglobal dot com <-- send e-mail here
Thank you. Rob, I'm interested more from the perspective of general
nerdiness than anything else. Also, I wanted to experiment with call-
ins and thought this might be an interesting little project - and I
did learn a lot!