@@ -123,9 +123,7 @@ static zend_module_entry cgi_module_entry;
123
123
124
124
static const opt_struct OPTIONS [] = {
125
125
{'a' , 0 , "interactive" },
126
- #ifndef PHP_WIN32
127
126
{'b' , 1 , "bindpath" },
128
- #endif
129
127
{'C' , 0 , "no-chdir" },
130
128
{'c' , 1 , "php-ini" },
131
129
{'d' , 1 , "define" },
@@ -630,7 +628,7 @@ static void php_cgi_usage(char *argv0)
630
628
php_printf ("Usage: %s [-q] [-h] [-s] [-v] [-i] [-f <file>]\n"
631
629
" %s <file> [args...]\n"
632
630
" -a Run interactively\n"
633
- #if PHP_FASTCGI && ! defined ( PHP_WIN32 )
631
+ #if PHP_FASTCGI
634
632
" -b <address:port>|<port> Bind Path for external FASTCGI Server mode\n"
635
633
#endif
636
634
" -C Do not chdir to the script's directory\n"
@@ -997,21 +995,6 @@ void fastcgi_cleanup(int signal)
997
995
}
998
996
#endif
999
997
1000
- #if PHP_FASTCGI
1001
- #ifndef PHP_WIN32
1002
- static int is_port_number (const char * bindpath )
1003
- {
1004
- while (* bindpath ) {
1005
- if (* bindpath < '0' || * bindpath > '9' ) {
1006
- return 0 ;
1007
- }
1008
- bindpath ++ ;
1009
- }
1010
- return 1 ;
1011
- }
1012
- #endif
1013
- #endif
1014
-
1015
998
PHP_INI_BEGIN ()
1016
999
STD_PHP_INI_ENTRY ("cgi.rfc2616_headers" , "0" , PHP_INI_ALL , OnUpdateBool , rfc2616_headers , php_cgi_globals_struct , php_cgi_globals )
1017
1000
STD_PHP_INI_ENTRY ("cgi.nph" , "0" , PHP_INI_ALL , OnUpdateBool , nph , php_cgi_globals_struct , php_cgi_globals )
@@ -1133,9 +1116,7 @@ int main(int argc, char *argv[])
1133
1116
int max_requests = 500 ;
1134
1117
int requests = 0 ;
1135
1118
int fastcgi = fcgi_is_fastcgi ();
1136
- #ifndef PHP_WIN32
1137
1119
char * bindpath = NULL ;
1138
- #endif
1139
1120
int fcgi_fd = 0 ;
1140
1121
fcgi_request request ;
1141
1122
#ifndef PHP_WIN32
@@ -1233,8 +1214,6 @@ int main(int argc, char *argv[])
1233
1214
}
1234
1215
break ;
1235
1216
}
1236
- #if PHP_FASTCGI
1237
- #ifndef PHP_WIN32
1238
1217
/* if we're started on command line, check to see if
1239
1218
we are being started as an 'external' fastcgi
1240
1219
server by accepting a bindpath parameter. */
@@ -1243,8 +1222,6 @@ int main(int argc, char *argv[])
1243
1222
bindpath = strdup (php_optarg );
1244
1223
}
1245
1224
break ;
1246
- #endif
1247
- #endif
1248
1225
}
1249
1226
1250
1227
}
@@ -1311,26 +1288,10 @@ consult the installation file that came with this distribution, or visit \n\
1311
1288
#endif /* FORCE_CGI_REDIRECT */
1312
1289
1313
1290
#if PHP_FASTCGI
1314
- #ifndef PHP_WIN32
1315
1291
/* for windows, socket listening is broken in the fastcgi library itself
1316
1292
so dissabling this feature on windows till time is available to fix it */
1317
1293
if (bindpath ) {
1318
- /* Pass on the arg to the FastCGI library, with one exception.
1319
- * If just a port is specified, then we prepend a ':' onto the
1320
- * path (it's what the fastcgi library expects)
1321
- */
1322
- if (strchr (bindpath , ':' ) == NULL && is_port_number (bindpath )) {
1323
- char * tmp ;
1324
-
1325
- tmp = malloc (strlen (bindpath ) + 2 );
1326
- tmp [0 ] = ':' ;
1327
- memcpy (tmp + 1 , bindpath , strlen (bindpath ) + 1 );
1328
-
1329
- fcgi_fd = fcgi_listen (tmp , 128 );
1330
- free (tmp );
1331
- } else {
1332
- fcgi_fd = fcgi_listen (bindpath , 128 );
1333
- }
1294
+ fcgi_fd = fcgi_listen (bindpath , 128 );
1334
1295
if (fcgi_fd < 0 ) {
1335
1296
fprintf (stderr , "Couldn't create FastCGI listen socket on port %s\n" , bindpath );
1336
1297
#ifdef ZTS
@@ -1340,7 +1301,7 @@ consult the installation file that came with this distribution, or visit \n\
1340
1301
}
1341
1302
fastcgi = fcgi_is_fastcgi ();
1342
1303
}
1343
- #endif
1304
+
1344
1305
if (fastcgi ) {
1345
1306
/* How many times to run PHP scripts before dying */
1346
1307
if (getenv ("PHP_FCGI_MAX_REQUESTS" )) {
@@ -1828,11 +1789,9 @@ consult the installation file that came with this distribution, or visit \n\
1828
1789
requests ++ ;
1829
1790
if (max_requests && (requests == max_requests )) {
1830
1791
fcgi_finish_request (& request );
1831
- #ifndef PHP_WIN32
1832
1792
if (bindpath ) {
1833
1793
free (bindpath );
1834
1794
}
1835
- #endif
1836
1795
break ;
1837
1796
}
1838
1797
/* end of fastcgi loop */
0 commit comments