Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to return binary data to web server from VFP using C
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00773698
Message ID:
00774485
Vues:
14
Andrus,

>Since WWC cgi module is the same as MS mycgi.c, does it have the same bug by
>discarding 0xOO bytes ?
>Is it possible to appli some coding (base64) to output data so that binary
>data is not sent ?

wwcgi.exe is only roughly based on mycgi.c and it works differently. And yes it supports binary output. Instead of printf() you can use fwrite() to output a specific buffer of bytes to stdout.

Something like this:
dwSend = fwrite(lpbyBuf,1,dwRead,stdout);
>About ISAPI:
>
>How to write a MT DLL in VFP 7 which can be used instead of FOXISAPI.dll
>This may eliminate the foxisapi.dll call overhead in web server.

You really don't get it, do you?

You *need to* to have something in between your Fox application and the Web Server. foxisapi.dll is an ISAPI extension - it extends the Web Server and in essence it's part of it. You can't do things any more efficient than what it is already doing when using Visual FoxPro.

ASP is doing the same thing. asp.dll is an ISAPI extension and it calls COM objects.

CGI is out of process and it's generally slow. Although you can build a VFP app that directly responds to CGI requests it would be HORRIBLY slow and resource intensive as the VFP runtime would have to fire up on every single hit. The Web Connection CGI adapter works around this by using files to communicate what the app needs to know and pass that data to the vFP app and then returns a file. The polling that occurs incurs some slight delay (depending on how you set the polling interval) but it doesn't matter much
because surely the overhead is less than the time that it takes for the generated HTML to travel over the wire, and other requests can run simultaneously. This is different than the ancient mycgi.c file that ships with VFP which can't handle multiple requests very well.

ISAPI is more efficient than CGI because it is supposed to stay loaded in the Web Server. As far as I know Apache doesn't support this model in its ISAPI implementation which means it's not really ISAPI compliant. However, the Web Connection ISAPI connector does work with Apache in file based mode as well as working with the CGI file.


You can try to reinvent the wheel, but I would highly advise against that as it takes a lot of experience (which for the most part comes from time working with a product or technology) to really understand what goes on in a Web Server and how requests are served under all circumstances that you probably cannot even envision yet. Just think about how much time you've already wasted going down dead ends so far <g>...
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform