From fastcgi-developers at wilber.pointclark.net Tue Aug 4 10:53:14 2009 From: fastcgi-developers at wilber.pointclark.net (Matt) Date: Wed, 5 Aug 2009 00:53:14 +1000 Subject: [FASTCGI] FastCGI security consultants Message-ID: <013501ca1513$4baf1dd0$e701a8c0@cu> Gday, Just after a security consultant or security consulting company who can pour over my code and examine our setup and make recommendations as well as point out pitfalls to avoid. They would need to be technically proficient in: * Linux * Apache * FastCGI * C++ * PHP * SSI * HTML * Javascript Any help would be greatly appreciated. Thanks, Matt From wdhawes at gmail.com Fri Aug 7 06:26:58 2009 From: wdhawes at gmail.com (Will Hawes) Date: Fri, 7 Aug 2009 11:26:58 +0100 Subject: [FASTCGI] Building mod_fastcgi as a DSO on Windows Message-ID: <360eac500908070326o4d0138c6mc8218430cf25f191@mail.gmail.com> Having had various issues with binary releases of mod_fastcgi.dll, I thought I'd have a go at building my own from source to see if that makes any difference. I'm trying to build mod_fastcgi for Apache 2.2 on Windows. I've downloaded the mod_fastcgi sources from http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0811090952.tar.gz and am following the instructions in the INSTALL.AP2 file under "WIN": To build mod_fastcgi as a project you'll need M$ VC++ 6.0 (the Makefile hasn't been updated for AP2 support): Open the mod_fastcgi project file with the VC++. Edit the Project for your configuration (update the Preprocessor and the Link paths). The default assumes a complete Apache2 installation in /Apache2. Build mod_fastcgi.so. When trying to open the project file in Visual C++ 6.0 Standard Edition, I get the following message: "A corresponding workspace 'C:\work\mod_fastcgi-SNAP-0811090952\Win32\mod_fastcgi-AP2.dsw' has been found and will be opened instead of the specified project 'C:\work\mod_fastcgi-SNAP-0811090952\Win32\mod_fastcgi-AP2.dsp'. Note: If you wish to create a workspace containing only the specified project, you can do so by creating a blank workspace with the Workspaces tab on the New dialog and then adding the project to that workspace using Insert Projects into Workspace." Clicking OK results in another message: "C:\work\mod_fastcgi-SNAP-0811090952\Win32\mod_fastcgi-AP2.dsp This makefile was not generated by Developer Studio. Continuing will create a new Developer Studio project to wrap this makefile. You will be prompted to save after the new project has been created. Do you want to continue?" If I choose to continue I am then unable to set preprocessor paths etc or build the newly created project. I'm not familiar with MSVC but it appears the newly generated project is empty. The build instructions don't mention any of this - aside from using Windows, am I doing something wrong? From wdhawes at gmail.com Fri Aug 7 06:40:20 2009 From: wdhawes at gmail.com (Will Hawes) Date: Fri, 7 Aug 2009 11:40:20 +0100 Subject: [FASTCGI] Building mod_fastcgi as a DSO on Windows In-Reply-To: <360eac500908070326o4d0138c6mc8218430cf25f191@mail.gmail.com> References: <360eac500908070326o4d0138c6mc8218430cf25f191@mail.gmail.com> Message-ID: <360eac500908070340y73308730uf3aec642a471a9f8@mail.gmail.com> 2009/8/7 Will Hawes : > Having had various issues with binary releases of mod_fastcgi.dll, I > thought I'd have a go at building my own from source to see if that > makes any difference. I'm trying to build mod_fastcgi for Apache 2.2 > on Windows. Following on from my last message, I found http://www.fastcgi.com/mod_fastcgi/INSTALL and noticed that it mentions building mod_fastcgi from the command line. I did the following: 1) Downloaded the Win32 source for Apache 2.2 from http://apache.mirror.rbftpnetworks.com/httpd/httpd-2.2.12-win32-src.zip. 2) Extracted it to C:\work\httpd-2.2.12 3) Edited APACHE_SRC_DIR in Makefile.nt to point to C:\work\httpd-2.2.12. 4) Ran "nmake -f Makefile.nt CFG=release". I got the following output: C:\work\mod_fastcgi-SNAP-0811090952\Win32>nmake -f Makefile.nt CFG=release Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. Makefile.nt(71) : fatal error U1088: invalid separator '::' on inference rule Stop. There are several instances of "::" in Makefile.nt. I tried altering these to a single ":" instead on the offchance it would make a difference, after which I got the following: C:\work\mod_fastcgi-SNAP-0811090952\Win32>nmake -f Makefile.nt CFG=release Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. Warning: cannot find "mod_fastcgi.dep" cl.exe /nologo /MT /W3 /GX /O2 /I "C:\work\httpd-2.2.12\include" /I "C:\ work\httpd-2.2.12\os\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp".\Release\mod_fastcgi.pch" /YX /Fo".\Release\\" /Fd".\Release\\" /FD /c ..\fcgi_buf.c cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release cl : Command line warning D9036 : use 'EHsc' instead of 'GX' cl : Command line warning D9002 : ignoring unknown option '/YX' fcgi_buf.c c:\work\httpd-2.2.12\include\ap_config.h(25) : fatal error C1083: Cannot open include file: 'apr.h': No such file or directory NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x2' Stop. The only similarly-named files in my Apache source dir are apr.h.in and apr.hw under C:\work\httpd-2.2.12\srclib\apr\include, not sure if those are relevant somehow? From eduard at bareev.ru Mon Aug 10 11:29:48 2009 From: eduard at bareev.ru (Eduard Bareev) Date: Mon, 10 Aug 2009 19:29:48 +0400 Subject: [FASTCGI] newbie question, help heeded Message-ID: Hi! I trying to develop highspeed web-service and i have some questions, and also i am not c++ programmer and this is my first cpp project. I have this following code: --------------------------------------------------------- #include #include "fcgi_stdio.h" #include #include void handle(FCGX_Request request){ FCGX_FPrintF(request.out, "Content-type: text/html\r\n\r\nfastcgi\n

Fastcgi: Hello world!

\n"); } int main(int argc, char* const argv[] ) { std::string port=":9001"; int listenQueueBacklog = 400; FCGX_Stream *in, *out, *err; FCGX_ParamArray envp; if(FCGX_Init()) exit(1); int listen_socket = FCGX_OpenSocket(port.c_str(), listenQueueBacklog); if(listen_socket < 0) exit(1); FCGX_Request request; if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); int reqCounter = 0; while(FCGX_Accept_r(&request) == 0) { handle(request); reqCounter++; FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); FCGX_Finish_r(&request); } return 0; } --------------------------------------------------------- It works good listening 9001 port and serving resquests from nginx http server. I choose fcgi_stdio beacuse it can listen on tcp socket and it is more simple to integrate all this stuff with nginx web server. But how can i read post fields? Anyone, please point to an example of accessing and parsing post data, setting cookies, and other web stuff! I can't find any tutorials or examples on the internet! Thanks! -- Eduard Bareev eduard at bareev.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: From aron at aron.ws Tue Aug 11 12:12:10 2009 From: aron at aron.ws (Aron Szabo) Date: Tue, 11 Aug 2009 18:12:10 +0200 Subject: [FASTCGI] newbie question, help heeded In-Reply-To: References: Message-ID: <4A81985A.6000702@aron.ws> Hi! There is a patch that implements post parsing, but was not added yet(?) Check this out: http://www.fastcgi.com/archives/fastcgi-developers/2009-March/000200.html if( !strcmp(request_method, "POST") && content_length_i > 0 && !strcmp(content_type, "application/x-www-form-urlencoded") ) { buffer = Malloc(content_length_i + 1); if (buffer) { while (readed < content_length_i) { readed += FCGX_GetStr(buffer + readed, 10000, request->in); }; *(buffer + content_length_i) = 0; request->postParamsPtr = GenerateParamFromWebEscapedString(buffer); free(buffer); buffer = NULL; if (request->postParamsPtr) request->postp = request->postParamsPtr->vec; } else { return ENOMEM; }; }; Good luck, Aron Eduard Bareev wrote: > Hi! > I trying to develop highspeed web-service and i have some questions, > and also i am not c++ programmer and this is my first cpp project. > > I have this following code: > --------------------------------------------------------- > #include > #include "fcgi_stdio.h" > #include > #include > > void handle(FCGX_Request request){ > FCGX_FPrintF(request.out, "Content-type: > text/html\r\n\r\nfastcgi\n

Fastcgi: Hello > world!

\n"); > } > > int main(int argc, char* const argv[] ) > { > std::string port=":9001"; > int listenQueueBacklog = 400; > FCGX_Stream *in, *out, *err; > FCGX_ParamArray envp; > > if(FCGX_Init()) exit(1); > > int listen_socket = FCGX_OpenSocket(port.c_str(), > listenQueueBacklog); > if(listen_socket < 0) exit(1); > > FCGX_Request request; > if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); > > int reqCounter = 0; > while(FCGX_Accept_r(&request) == 0) > { > handle(request); > reqCounter++; > FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); > FCGX_Finish_r(&request); > } > return 0; > } > --------------------------------------------------------- > > It works good listening 9001 port and serving resquests from nginx > http server. I choose fcgi_stdio beacuse it can listen on tcp socket > and it is more simple to integrate all this stuff with nginx web server. > > But how can i read post fields? > Anyone, please point to an example of accessing and parsing post data, > setting cookies, and other web stuff! I can't find any tutorials or > examples on the internet! > > Thanks! > > -- > Eduard Bareev > eduard at bareev.ru > ------------------------------------------------------------------------ > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > From mike770780 at live.com Tue Aug 11 23:39:10 2009 From: mike770780 at live.com (Mike C) Date: Tue, 11 Aug 2009 23:39:10 -0400 Subject: [FASTCGI] Protocol: Scope of requestID Message-ID: I have a question about how a FastCGI record's requestID is assigned to guarantee uniqueness over multiple TCP connections to the same responder. In short, is the requestID chosen by the webserver server then issued to the FastCGI process unique to the TCP connection or is it unique to the FastCGI process? As an example, if there is a FastCGI responder running on 127.0.0.1:10000 and there are two TCP connections currently open, is it possible that in each connection there could be two identical requestIDs being used for different http requests? My intuition would be that no web server should issue two identical requestIDs at the same time regardless of TCP connection or FastCGI process, but I can't find this documented explicitly. -Mike _________________________________________________________________ More storage. Better anti-spam and antivirus protection. Hotmail makes it simple. http://go.microsoft.com/?linkid=9671357 From blgl at hagernas.com Wed Aug 12 02:27:58 2009 From: blgl at hagernas.com (Bo Lindbergh) Date: Wed, 12 Aug 2009 08:27:58 +0200 Subject: [FASTCGI] Protocol: Scope of requestID In-Reply-To: References: Message-ID: <29093A7E-C339-4715-9B96-E80163089E6B@hagernas.com> 2009-08-12 kl. 05.39 skrev Mike C: > > I have a question about how a FastCGI record's requestID is > assigned to guarantee uniqueness over multiple TCP connections to > the same responder. > > In short, is the requestID chosen by the webserver server then > issued to the FastCGI process unique to the TCP connection or is it > unique to the FastCGI process? > > As an example, if there is a FastCGI responder running on > 127.0.0.1:10000 and there are two TCP connections currently open, > is it possible that in each connection there could be two identical > requestIDs being used for different http requests? > > My intuition would be that no web server should issue two identical > requestIDs at the same time regardless of TCP connection or FastCGI > process, but I can't find this documented explicitly. The specification says "the application keeps track of the current state of each request ID on a given transport connection", which I interpret as request ids being per connection. /Bo Lindbergh From Jfarcet at gerap.fr Thu Aug 6 08:53:48 2009 From: Jfarcet at gerap.fr (Farcet Jerome) Date: Thu, 6 Aug 2009 14:53:48 +0200 Subject: [FASTCGI] mod_fcgi on HP-Ux Message-ID: <1A90ED5543BC1F40A2D608738D5BA93E0127D23C@SRVEXCH.domvie.fr> Hello, We would like to use mod_fcgi with apache server on HP-UX 11iv2 on itanium 64b platform. I did not found any testimony of the availability or previous experience on this kind platform. Hp support was not able to say if it was possible. Do you know if that will be possible to do that ? Thanks in advance for your reply, Bests regards, Jerome FARCET -------------- next part -------------- An HTML attachment was scrubbed... URL: From ricsal at gmail.com Mon Aug 10 13:15:43 2009 From: ricsal at gmail.com (Ricardo Sal) Date: Mon, 10 Aug 2009 18:15:43 +0100 Subject: [FASTCGI] FastCGI-developers Digest, Vol 13, Issue 3 In-Reply-To: References: Message-ID: <3f9606c30908101015n4aedc11fk7bbabf0c22efeda7@mail.gmail.com> Hi, I think you just won the lottery because i have implemented this recently and had the same problem. Lucky for you, you get an answer with what you need. 1º read this page http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S2.3 These are some sniff and screen shots in attach with the data been transferred between a test web server with fastcgi enabled and php-cgi.exe in listening mode. Feel free to ask whatever you need since i have implement all the protocol with my hands :) The implementation isn't hard, and with this data you will be able to start. regards On Mon, Aug 10, 2009 at 5:00 PM, < fastcgi-developers-request at mailman.fastcgi.com> wrote: > Send FastCGI-developers mailing list submissions to > fastcgi-developers at mailman.fastcgi.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > or, via email, send a message with subject or body 'help' to > fastcgi-developers-request at mailman.fastcgi.com > > You can reach the person managing the list at > fastcgi-developers-owner at mailman.fastcgi.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of FastCGI-developers digest..." > > > Today's Topics: > > 1. newbie question, help heeded (Eduard Bareev) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 10 Aug 2009 19:29:48 +0400 > From: Eduard Bareev > Subject: [FASTCGI] newbie question, help heeded > To: fastcgi-developers at mailman.fastcgi.com > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi! > I trying to develop highspeed web-service and i have some questions, and > also i am not c++ programmer and this is my first cpp project. > > I have this following code: > --------------------------------------------------------- > #include > #include "fcgi_stdio.h" > #include > #include > > void handle(FCGX_Request request){ > FCGX_FPrintF(request.out, "Content-type: > text/html\r\n\r\nfastcgi\n

Fastcgi: Hello > world!

\n"); > } > > int main(int argc, char* const argv[] ) > { > std::string port=":9001"; > int listenQueueBacklog = 400; > FCGX_Stream *in, *out, *err; > FCGX_ParamArray envp; > > if(FCGX_Init()) exit(1); > > int listen_socket = FCGX_OpenSocket(port.c_str(), listenQueueBacklog); > if(listen_socket < 0) exit(1); > > FCGX_Request request; > if(FCGX_InitRequest(&request, listen_socket, 0)) exit(1); > > int reqCounter = 0; > while(FCGX_Accept_r(&request) == 0) > { > handle(request); > reqCounter++; > FCGX_FPrintF(request.out, "\n\r\n\r counter: %d", reqCounter); > FCGX_Finish_r(&request); > } > return 0; > } > --------------------------------------------------------- > > It works good listening 9001 port and serving resquests from nginx http > server. I choose fcgi_stdio beacuse it can listen on tcp socket and it is > more simple to integrate all this stuff with nginx web server. > > But how can i read post fields? > Anyone, please point to an example of accessing and parsing post data, > setting cookies, and other web stuff! I can't find any tutorials or > examples > on the internet! > > Thanks! > > -- > Eduard Bareev > eduard at bareev.ru > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20090810/99d4f519/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > > End of FastCGI-developers Digest, Vol 13, Issue 3 > ************************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Upload php.rar Type: application/octet-stream Size: 312080 bytes Desc: not available URL: From fastcgi-developers at wilber.pointclark.net Wed Aug 12 16:41:42 2009 From: fastcgi-developers at wilber.pointclark.net (Matt) Date: Thu, 13 Aug 2009 06:41:42 +1000 Subject: [FASTCGI] mod_fcgi on HP-Ux References: <1A90ED5543BC1F40A2D608738D5BA93E0127D23C@SRVEXCH.domvie.fr> Message-ID: <050101ca1b8d$4c9f56d0$e701a8c0@cu> Hello there, I'm succesfully running FastCGI on a 64bit environment: [root at stagingarea ~]# uname -s -r -v -m -p -i -o Linux 2.6.18-128.1.16.el5 #1 SMP Tue Jun 30 06:07:26 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux [root at stagingarea ~]# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 26 model name : Intel(R) Xeon(R) CPU E5520 @ 2.27GHz stepping : 5 cpu MHz : 2259.864 cache size : 8192 KB fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up ida nonstop_tsc pni cx16 popcnt lahf_lm bogomips : 4525.89 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: [8] [root at stagingarea ~]# If you search the archives or subscribe to the newsgroup to access earlier postings(2/7/2009) there was a Japanese group who were running FastCGI on Windows 64bit and had contributed a patch as well. Regards, Matt ----- Original Message ----- From: Farcet Jerome To: fastcgi-developers at mailman.fastcgi.com Sent: Thursday, August 06, 2009 10:53 PM Subject: [FASTCGI] mod_fcgi on HP-Ux Hello, We would like to use mod_fcgi with apache server on HP-UX 11iv2 on itanium 64b platform. I did not found any testimony of the availability or previous experience on this kind platform. Hp support was not able to say if it was possible. Do you know if that will be possible to do that ? Thanks in advance for your reply, Bests regards, Jerome FARCET ------------------------------------------------------------------------------ _______________________________________________ FastCGI-developers mailing list FastCGI-developers at mailman.fastcgi.com http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidb at pins.net Thu Aug 13 12:44:46 2009 From: davidb at pins.net (David Birnbaum) Date: Thu, 13 Aug 2009 12:44:46 -0400 (EDT) Subject: [FASTCGI] Patches for SNAP Message-ID: Folks, There's been some patches/comments posted to the list regarding getting an updated SNAP put together so we can test and release a new version. Unfortunately, there's been some issues with the mailing list, and Rob (the current maintainer) has been all-consumed with his day job. If those of you with patches could forward them to me, I'll get them consolidated and then Rob and I will try to get a SNAP put together for testing in the next few weeks. Cheers, David. From ekenny at efsdata.com Mon Aug 17 18:15:55 2009 From: ekenny at efsdata.com (Ed Kenny) Date: Mon, 17 Aug 2009 18:15:55 -0400 Subject: [FASTCGI] External Server shared socket Message-ID: <014901ca1f88$4d1d9c80$e758d580$@com> My fastcgi setup has about 300 fastcgi applications running on an external server listening on about 300 ports. Not a big deal, just a big config file. Now I want to implement LVS with this server using 3 load balanced nodes. Those huge LVS config files needed would be unpractical. So my question is this: Is it possible to configure the 300 or so external server AppClass directives to listen on a shared socket (one port)? Just using the same port number throws the bound socket errors. Any ideas out there? -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke at eversosoft.com Wed Aug 19 18:00:51 2009 From: luke at eversosoft.com (Luke Evans) Date: Wed, 19 Aug 2009 15:00:51 -0700 Subject: [FASTCGI] n00b question, fastcgi returning JSON Message-ID: <1A28EE23-7FAF-40C8-B5EE-91DF8BEF12FA@eversosoft.com> Apologies in advance as I have a feeling this is a super 'duh' question, and may only be obliquely related to fastcgi. However... Having traversed the mires of getting my first FastCGI server built and successfully hosted by Apache to return HTML, I thought I would make a trivial change to the MIME type to have it return a JSON string instead. Here's part of the code, patterned after the fastcgi C sample code: ... FCGX_FPrintF(out, //"Content-type: application/json\r\n" "Content-type: text/html\r\n" "\r\n" "%s", responseCString); ... Now, the code as it stands works fine, and my browser displays the contents of "responseCString", which is some JSON text. However, if I comment out the second line, and uncomment the first (to change the content type to befit the actual payload), I suddenly get web errors logged: [Wed Aug 19 14:33:33 2009] [error] [client 192.168.1.5] FastCGI: incomplete headers (32 bytes) received from server "/Library/WebServer/ CGI-Executables/MyServer.fcgi" AFAICT the change to the header is correct and there's no change to the overal structure of the response. Yet this change is sufficient to induce an error. It could be that I'm flying by the seat of my pants somehow with it working in the text/html case, or perhaps application/json is disallowed for some reason? Anyway, I'm sure there's a rather trivial reason for the failure and I'm hoping that someone with even a little more experience in things "web servery" will see the problem right away. Cheers -- Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke at eversosoft.com Wed Aug 19 20:10:27 2009 From: luke at eversosoft.com (Luke Evans) Date: Wed, 19 Aug 2009 17:10:27 -0700 Subject: [FASTCGI] n00b question, fastcgi returning JSON In-Reply-To: <1A28EE23-7FAF-40C8-B5EE-91DF8BEF12FA@eversosoft.com> References: <1A28EE23-7FAF-40C8-B5EE-91DF8BEF12FA@eversosoft.com> Message-ID: OK, well I gave up on "application/json". Google appears to serve JSON responses with "Content-type: text/ javascript; charset=ISO-8859-1\r\n" in the header, so I've gone for that. The header parser in the apache fastCGI module is clearly a particular kind of beast, and it chokes in a variety of ways that cause a n00b like myself to wonder what the heck is going on. Also seemed to need to restart Apache at times, after errors, but the circumstances are lost in the fog of war. Anyway, it seems that this all had very little to do with FastCGI per se. -- Luke On 19-Aug-09, at 3:00 PM, Luke Evans wrote: > Apologies in advance as I have a feeling this is a super 'duh' > question, and may only be obliquely related to fastcgi. However... > > Having traversed the mires of getting my first FastCGI server built > and successfully hosted by Apache to return HTML, I thought I would > make a trivial change to the MIME type to have it return a JSON > string instead. > Here's part of the code, patterned after the fastcgi C sample code: > > ... > FCGX_FPrintF(out, > //"Content-type: application/json\r\n" > "Content-type: text/html\r\n" > "\r\n" > "%s", > responseCString); > ... > > Now, the code as it stands works fine, and my browser displays the > contents of "responseCString", which is some JSON text. > However, if I comment out the second line, and uncomment the first > (to change the content type to befit the actual payload), I suddenly > get web errors logged: > > [Wed Aug 19 14:33:33 2009] [error] [client 192.168.1.5] FastCGI: > incomplete headers (32 bytes) received from server "/Library/ > WebServer/CGI-Executables/MyServer.fcgi" > > AFAICT the change to the header is correct and there's no change to > the overal structure of the response. Yet this change is sufficient > to induce an error. > > It could be that I'm flying by the seat of my pants somehow with it > working in the text/html case, or perhaps application/json is > disallowed for some reason? > Anyway, I'm sure there's a rather trivial reason for the failure and > I'm hoping that someone with even a little more experience in things > "web servery" will see the problem right away. > > Cheers > > -- Luke > > > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From agalkin at audible.com Fri Aug 21 11:07:52 2009 From: agalkin at audible.com (Alexander Galkin (Audible US)) Date: Fri, 21 Aug 2009 11:07:52 -0400 Subject: [FASTCGI] How to specify HTTP status with FastCGI Message-ID: <8AD089992055F0408126B89B3E407B6709910BC9@EXVS02.HESungard.local> I seem not to be able to specify HTTP status line with FastCGI. I have Apache 2.2 on Solaris 10. If I send back "HTTP/1.1 200 OK\nContent-Type: text/plain;charset=UTF-8\n\nDummy text" Apache does not recognize it as valid output and sends client standard error and I see in Apache log file FastCGI: comm with server "/opt/apache/cgi-bin/my_test.fcgi" aborted: error parsing headers: malformed header 'HTTP/1.1 200 OK' I tried outher HTTP status and the same error. If I remove status line and send "Content-Type: text/plain;charset=UTF-8\n\nDummy text" Everything works fine. Sasha -------------- next part -------------- An HTML attachment was scrubbed... URL: From aron at aron.ws Fri Aug 21 11:13:46 2009 From: aron at aron.ws (Aron Szabo) Date: Fri, 21 Aug 2009 17:13:46 +0200 Subject: [FASTCGI] How to specify HTTP status with FastCGI In-Reply-To: <8AD089992055F0408126B89B3E407B6709910BC9@EXVS02.HESungard.local> References: <8AD089992055F0408126B89B3E407B6709910BC9@EXVS02.HESungard.local> Message-ID: <4A8EB9AA.2070901@aron.ws> Hi! I'm not sure, but i think you should do this instead: "Status: 200 OK\r\nContent-Type: text/plain;charset=UTF-8\r\n\r\nDummy text" Give it a try ;) Aron Alexander Galkin (Audible US) wrote: > > I seem not to be able to specify HTTP status line with FastCGI. I have > Apache 2.2 on Solaris 10. > > If I send back > > "HTTP/1.1 200 OK\nContent-Type: text/plain;charset=UTF-8\n\nDummy text? > > Apache does not recognize it as valid output and sends client standard > error and I see in Apache log file > > FastCGI: comm with server "/opt/apache/cgi-bin/my_test.fcgi" aborted: > error parsing headers: malformed header 'HTTP/1.1 200 OK' > > I tried outher HTTP status and the same error. If I remove status line > and send > > "Content-Type: text/plain;charset=UTF-8\n\nDummy text? > > Everything works fine. > > Sasha > > ------------------------------------------------------------------------ > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > From till at tuxen.de Fri Aug 21 14:08:16 2009 From: till at tuxen.de (Till Schuberth) Date: Fri, 21 Aug 2009 20:08:16 +0200 Subject: [FASTCGI] fcgio: int instead of int_type Message-ID: <4D21DA0E-7DAB-4C13-B0EB-5E268585DC1E@tuxen.de> Hello everyone, I think I've found a bug. I'm using FastCGI on an embedded platform and therefore don't have enough space for the GNU libstdc++. Hence I tried to link FastCGI against uClibc++, but it didn't compile, because in the files fcgi-2.4.0/libfcgi/fcgio.[cpp|h] some functions are overridden using int as return type. The GNU libstdc++ and uClibc++ are using here int_type instead, which is in the case of uClibc++ defined as short int. I have attached a patch which solves the problem. Regards, Till Schuberth -------------- next part -------------- A non-text attachment was scrubbed... Name: fcgi-int_type.patch Type: application/octet-stream Size: 3050 bytes Desc: not available URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: Signierter Teil der Nachricht URL: From sauda.furkhana at wipro.com Thu Aug 27 06:04:59 2009 From: sauda.furkhana at wipro.com (sauda.furkhana at wipro.com) Date: Thu, 27 Aug 2009 15:34:59 +0530 Subject: [FASTCGI] Compilation error in "FastCGI using C" Message-ID: Hi, Can someone help me out with this? I'm getting "error C2065: 'FCGI_Accept' : undeclared identifier" when I try to compile the code below: #include "fcgi_stdio.h" #include "fcgiapp.h" #include #include "stdafx.h" int main(int argc, char* argv[]) { while (FCGI_Accept() >= 0) { printf("Hello World!\n"); } return 0; } Details: 1) Build environment: MS VC++ 6.0 2) Downloaded the FastCGI SDK from http://www.fastcgi.com/drupal/node/5. Unzipped the contents to "C:\Program Files\fcgi-2.4.0". 3) Downloaded libfcgi.dll from: "http://download.corruptedfilerepair.com/post/2008/08/14/libfcgidll-Down load-File-libfcgidll.aspx" 4) Downloaded "dll to lib" software from "http://www.binary-soft.com/download.htm" - converted libfcgi.dll to libfcgi.lib and placed at "C:\Program Files\Microsoft Visual Studio\VC98\Lib" 5) IDE Settings: Tools->Options->Directories->IncludeFiles has entry pointing to C:\Program Files\fcgi-2.4.0\Include Tools->Options->Directories->LibraryFiles has entry pointing to C:\Program Files\Microsoft Visual Studio\VC98\Lib Regards, Sauda Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists.drrngrvy at gmail.com Thu Aug 27 06:25:28 2009 From: lists.drrngrvy at gmail.com (Darren Garvey) Date: Thu, 27 Aug 2009 11:25:28 +0100 Subject: [FASTCGI] Compilation error in "FastCGI using C" In-Reply-To: References: Message-ID: <4509b54b0908270325l4929243ej3f2708d97c36fab1@mail.gmail.com> Hi Sauda, Do you need to include "fastcgi.h" ? Regards, Darren 2009/8/27 > Hi, > > > > Can someone help me out with this? I?m getting ?error C2065: 'FCGI_Accept' > : undeclared identifier? when I try to compile the code below: > > > > #include "fcgi_stdio.h" > > #include "fcgiapp.h" > > #include > > #include "stdafx.h" > > > > int main(int argc, char* argv[]) > > { > > while (FCGI_Accept() >= 0) > > { > > printf("Hello World!\n"); > > } > > return 0; > > } > > > > Details: > > 1) Build environment: MS VC++ 6.0 > > 2) Downloaded the FastCGI SDK from http://www.fastcgi.com/drupal/node/5. Unzipped > the contents to ?C:\Program Files\fcgi-2.4.0?. > > 3) Downloaded libfcgi.dll from: ? > http://download.corruptedfilerepair.com/post/2008/08/14/libfcgidll-Download-File-libfcgidll.aspx > ? > > 4) Downloaded ?dll to lib? software from ? > http://www.binary-soft.com/download.htm? - converted libfcgi.dllto libfcgi.lib and placed at ?C:\Program > Files\Microsoft Visual Studio\VC98\Lib? > > 5) IDE Settings: > > Tools->Options->Directories->IncludeFiles has entry pointing to C:\Program > Files\fcgi-2.4.0\Include > > Tools->Options->Directories->LibraryFiles has entry pointing to C:\Program > Files\Microsoft Visual Studio\VC98\Lib > > > > Regards, > > Sauda > > > > * Please do not print this email unless it is absolutely necessary. * > > The information contained in this electronic message and any attachments to > this message are intended for the exclusive use of the addressee(s) and may > contain proprietary, confidential or privileged information. If you are not > the intended recipient, you should not disseminate, distribute or copy this > e-mail. Please notify the sender immediately and destroy all copies of this > message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus transmitted > by this email. > > www.wipro.com > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: