Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4003 invoked by uid 1010); 20 Mar 2006 10:46:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3965 invoked from network); 20 Mar 2006 10:46:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2006 10:46:07 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:44883] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B4/D2-55982-EE78E144 for ; Mon, 20 Mar 2006 05:46:07 -0500 Received: (qmail 23834 invoked from network); 20 Mar 2006 10:45:41 -0000 Received: from internal.zend.office (HELO thinkpad) (10.1.1.1) by internal.zend.office with SMTP; 20 Mar 2006 10:45:41 -0000 To: "'Rostislav Krasny'" , Date: Mon, 20 Mar 2006 13:44:30 +0300 Message-ID: <001f01c64c0b$49036bb0$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <20060320104602.9e202787.rosti.bsd@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Importance: Normal Subject: RE: [PHP-DEV] FastCGI unix sockets support patch From: dmitry@zend.com ("Dmitry Stogov") References: <20060320104602.9e202787.rosti.bsd@gmail.com> Hi Rostislav, PHP HEAD and PHP_5_1 (5.1.3) don't use libfcgi any more. They use simplest and smallest replacement library. Please look into CVS code and provide a patch for it (if necessary). Thanks. Dmitry. > -----Original Message----- > From: Rostislav Krasny [mailto:rosti.bsd@gmail.com] > Sent: Monday, March 20, 2006 11:46 AM > To: internals@lists.php.net > Subject: [PHP-DEV] FastCGI unix sockets support patch > > > Hi, > > According to a 'php -h' output of php-cgi 5.1.2 the FastCGI > can be used only by TCP/IP: > > -b | Bind Path for external FASTCGI Server mode > > But according to the code FastCGI could also be used by UNIX > sockets. According to the code if the "-b " > option is used and the port number is illegal or omitted then > all the "address:port" string assumed as a UNIX socket name. > That means that the UNIX socket should allways include a ":" > in its filename. My patch eliminate this limitation. After > applying it one should use "-b socket:" for UNIX sockets and > "-b address:port" or "-b port" for TCP/IP. And if the port > number is illegal, an error message is printed. If the "-b > socket:" format is used the ":" is not added to the UNIX > socket filename. > > What do you think about following patch? > > --- sapi/cgi/libfcgi/os_unix.c.orig Sun Dec 7 14:59:54 2003 > +++ sapi/cgi/libfcgi/os_unix.c Mon Mar 20 09:28:28 2006 > @@ -299,13 +299,15 @@ > char host[MAXPATHLEN]; > > strlcpy(host, bindPath, MAXPATHLEN-1); > - if((tp = strchr(host, ':')) != 0) { > + if((tp = strrchr(host, ':')) != 0) { > *tp++ = 0; > - if((port = atoi(tp)) == 0) { > - *--tp = ':'; > - } else { > + if (*tp != '\0') { > + if((port = atoi(tp)) == 0) { > + fprintf(stderr, "%s is illegal port number!\n", tp); > + return -1; > + } > tcp = TRUE; > - } > + } > } > if(tcp) { > if (!*host || !strcmp(host,"*")) { > @@ -357,7 +359,7 @@ > servLen = sizeof(sa.inetVariant); > } else { > unlink(bindPath); > - if(OS_BuildSockAddrUn(bindPath, &sa.unixVariant, &servLen)) { > + if(OS_BuildSockAddrUn(host, &sa.unixVariant, &servLen)) { > fprintf(stderr, "Listening socket's path name is > too long.\n"); > return -1; > } > > > This patch changes an OS_CreateLocalIpcFd() function. The > same change of OS_FcgiConnect() should probably be done as > well. I didn't because the OS_FcgiConnect() isn't used > anywhere by php. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > >