Project

General

Profile

Mod scgi » History » Revision 8

Revision 7 (Anonymous, 2008-03-12 12:59) → Revision 8/17 (guidod, 2008-11-23 09:51)

[[TracNav(DocsToc)]] 

 

 <pre> 

 

 #!rst 
 ================== 
 the SCGI Interface 
 ================== 

 ------------------- 
 Module: mod_scgi 
 ------------------- 

 .. meta:: 
   :keywords: lighttpd, FastCGI 
  
 .. contents:: Table of Contents 

 Description 
 =========== 

 The SCGI module is heavily based on the FastCGI when it comes 
 to configuration. Only the internal protocol between server 
 and client has been replaced. Please check the documentation  
 of the FastCGI module for more information. 

 History 
 ======= 

 Added in lighttpd 1.3.14 as it was really simple to do. 
 </pre> 

 *C/C++ SCGI on named socket* 
 Up to lightty 1.4.19 there is a bug in that the pre-opened socket handle is not on descriptor 0 (as it is for FastCGI FCGI_LISTENSOCK_FILENO) but any later file descriptor. Since 1.4.20 you can take over your testfastcgi program and replace FCGX_Accept() by a standard Unix accept(LISTENSOCK_FILENO, &addr, &addrlen) - then pthread_create/fork for your handler. The SCGI parameter block at the start of the socket stream is easy to read and to decode - no third-party library is required anymore. Just write() to the accept'ed socket handle to return the result page to the lightty webserver and close() the accept'ed handle to signal that the request has finished.