1313 | [email protected] so we can mail you a copy immediately. | 1414 +----------------------------------------------------------------------+
1515 | Authors: Zeev Suraski <[email protected] > | 16- | Ben Mansell <[email protected] > (Zeus Support) | 1716 +----------------------------------------------------------------------+
1817 */
1918/* $Id$ */
3837#endif
3938
4039
41- #ifdef WITH_ZEUS
42- # include "httpext.h"
43- # include <errno.h>
44- # define GetLastError () errno
45- #endif
46-
4740#ifdef PHP_WIN32
4841// #define PHP_ENABLE_SEH
4942#endif
@@ -67,9 +60,7 @@ static zend_bool bTerminateThreadsOnError=0;
6760static char * isapi_special_server_variable_names [] = {
6861 "ALL_HTTP" ,
6962 "HTTPS" ,
70- #ifndef WITH_ZEUS
7163 "SCRIPT_NAME" ,
72- #endif
7364 NULL
7465};
7566
@@ -94,17 +85,13 @@ static char *isapi_server_variable_names[] = {
9485 "SERVER_PORT" ,
9586 "SERVER_PROTOCOL" ,
9687 "SERVER_SOFTWARE" ,
97- #ifndef WITH_ZEUS
9888 "APPL_MD_PATH" ,
9989 "APPL_PHYSICAL_PATH" ,
10090 "INSTANCE_ID" ,
10191 "INSTANCE_META_PATH" ,
10292 "LOGON_USER" ,
10393 "REQUEST_URI" ,
10494 "URL" ,
105- #else
106- "DOCUMENT_ROOT" ,
107- #endif
10895 NULL
10996};
11097
@@ -124,22 +111,6 @@ static char *isapi_secure_server_variable_names[] = {
124111 "HTTPS_SERVER_ISSUER" ,
125112 "HTTPS_SERVER_SUBJECT" ,
126113 "SERVER_PORT_SECURE" ,
127- #ifdef WITH_ZEUS
128- "SSL_CLIENT_CN" ,
129- "SSL_CLIENT_EMAIL" ,
130- "SSL_CLIENT_OU" ,
131- "SSL_CLIENT_O" ,
132- "SSL_CLIENT_L" ,
133- "SSL_CLIENT_ST" ,
134- "SSL_CLIENT_C" ,
135- "SSL_CLIENT_I_CN" ,
136- "SSL_CLIENT_I_EMAIL" ,
137- "SSL_CLIENT_I_OU" ,
138- "SSL_CLIENT_I_O" ,
139- "SSL_CLIENT_I_L" ,
140- "SSL_CLIENT_I_ST" ,
141- "SSL_CLIENT_I_C" ,
142- #endif
143114 NULL
144115};
145116
@@ -378,112 +349,6 @@ static char *sapi_isapi_read_cookies(void)
378349 return NULL ;
379350}
380351
381-
382- #ifdef WITH_ZEUS
383-
384- static void sapi_isapi_register_zeus_ssl_variables (LPEXTENSION_CONTROL_BLOCK lpECB , zval * track_vars_array )
385- {
386- char static_variable_buf [ISAPI_SERVER_VAR_BUF_SIZE ];
387- DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
388- char static_cons_buf [ISAPI_SERVER_VAR_BUF_SIZE ];
389- /*
390- * We need to construct the /C=.../ST=...
391- * DN's for SSL_CLIENT_DN and SSL_CLIENT_I_DN
392- */
393- strcpy ( static_cons_buf , "/C=" );
394- if ( lpECB -> GetServerVariable ( lpECB -> ConnID , "SSL_CLIENT_C" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
395- strlcat ( static_cons_buf , static_variable_buf , ISAPI_SERVER_VAR_BUF_SIZE );
396- }
397- strlcat ( static_cons_buf , "/ST=" , ISAPI_SERVER_VAR_BUF_SIZE );
398- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
399- if ( lpECB -> GetServerVariable ( lpECB -> ConnID , "SSL_CLIENT_ST" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
400- strlcat ( static_cons_buf , static_variable_buf , ISAPI_SERVER_VAR_BUF_SIZE );
401- }
402- php_register_variable ( "SSL_CLIENT_DN" , static_cons_buf , track_vars_array );
403-
404- strcpy ( static_cons_buf , "/C=" );
405- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
406- if ( lpECB -> GetServerVariable ( lpECB -> ConnID , "SSL_CLIENT_I_C" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
407- strlcat ( static_cons_buf , static_variable_buf , ISAPI_SERVER_VAR_BUF_SIZE );
408- }
409- strlcat ( static_cons_buf , "/ST=" , ISAPI_SERVER_VAR_BUF_SIZE );
410- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
411- if ( lpECB -> GetServerVariable ( lpECB -> ConnID , "SSL_CLIENT_I_ST" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
412- strlcat ( static_cons_buf , static_variable_buf , ISAPI_SERVER_VAR_BUF_SIZE );
413- }
414- php_register_variable ( "SSL_CLIENT_I_DN" , static_cons_buf , track_vars_array );
415- }
416-
417- static void sapi_isapi_register_zeus_variables (LPEXTENSION_CONTROL_BLOCK lpECB , zval * track_vars_array )
418- {
419- char static_variable_buf [ISAPI_SERVER_VAR_BUF_SIZE ];
420- DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
421- DWORD scriptname_len = ISAPI_SERVER_VAR_BUF_SIZE ;
422- DWORD pathinfo_len = 0 ;
423- char * strtok_buf = NULL ;
424-
425- /* Get SCRIPT_NAME, we use this to work out which bit of the URL
426- * belongs in PHP's version of PATH_INFO
427- */
428- lpECB -> GetServerVariable (lpECB -> ConnID , "SCRIPT_NAME" , static_variable_buf , & scriptname_len );
429-
430- /* Adjust Zeus' version of PATH_INFO, set PHP_SELF,
431- * and generate REQUEST_URI
432- */
433- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "PATH_INFO" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
434-
435- /* PHP_SELF is just PATH_INFO */
436- php_register_variable ( "PHP_SELF" , static_variable_buf , track_vars_array );
437-
438- /* Chop off filename to get just the 'real' PATH_INFO' */
439- pathinfo_len = variable_len - scriptname_len ;
440- php_register_variable ( "PATH_INFO" , static_variable_buf + scriptname_len - 1 , track_vars_array );
441- /* append query string to give url... extra byte for '?' */
442- if ( strlen (lpECB -> lpszQueryString ) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) {
443- /* append query string only if it is present... */
444- if ( strlen (lpECB -> lpszQueryString ) ) {
445- static_variable_buf [ variable_len - 1 ] = '?' ;
446- strcpy ( static_variable_buf + variable_len , lpECB -> lpszQueryString );
447- }
448- php_register_variable ( "URL" , static_variable_buf , track_vars_array );
449- php_register_variable ( "REQUEST_URI" , static_variable_buf , track_vars_array );
450- }
451- }
452-
453- /* Get and adjust PATH_TRANSLATED to what PHP wants */
454- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
455- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "PATH_TRANSLATED" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
456- static_variable_buf [ variable_len - pathinfo_len - 1 ] = '\0' ;
457- php_register_variable ( "PATH_TRANSLATED" , static_variable_buf , track_vars_array );
458- }
459-
460- /* Bring in the AUTHENTICATION stuff as needed */
461- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
462- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "AUTH_USER" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
463- php_register_variable ( "PHP_AUTH_USER" , static_variable_buf , track_vars_array );
464- }
465- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
466- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "AUTH_PASSWORD" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
467- php_register_variable ( "PHP_AUTH_PW" , static_variable_buf , track_vars_array );
468- }
469- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
470- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "AUTH_TYPE" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
471- php_register_variable ( "AUTH_TYPE" , static_variable_buf , track_vars_array );
472- }
473-
474- /* And now, for the SSL variables (if applicable) */
475- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
476- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "CERT_COOKIE" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
477- sapi_isapi_register_zeus_ssl_variables ( lpECB , track_vars_array );
478- }
479- /* Copy some of the variables we need to meet Apache specs */
480- variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
481- if ( lpECB -> GetServerVariable (lpECB -> ConnID , "SERVER_SOFTWARE" , static_variable_buf , & variable_len ) && static_variable_buf [0 ] ) {
482- php_register_variable ( "SERVER_SIGNATURE" , static_variable_buf , track_vars_array );
483- }
484- }
485- #else
486-
487352static void sapi_isapi_register_iis_variables (LPEXTENSION_CONTROL_BLOCK lpECB , zval * track_vars_array )
488353{
489354 char static_variable_buf [ISAPI_SERVER_VAR_BUF_SIZE ];
@@ -560,7 +425,6 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z
560425 php_register_variable ("PHP_AUTH_PW" , SG (request_info ).auth_password , track_vars_array );
561426 }
562427}
563- #endif
564428
565429static void sapi_isapi_register_server_variables2 (char * * server_variables , LPEXTENSION_CONTROL_BLOCK lpECB , zval * track_vars_array , char * * recorded_values )
566430{
@@ -628,12 +492,7 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array)
628492 efree (isapi_special_server_variables [SPECIAL_VAR_HTTPS ]);
629493 }
630494
631-
632- #ifdef WITH_ZEUS
633- sapi_isapi_register_zeus_variables (lpECB , track_vars_array );
634- #else
635495 sapi_isapi_register_iis_variables (lpECB , track_vars_array );
636- #endif
637496
638497 /* PHP_SELF support */
639498 if (isapi_special_server_variables [SPECIAL_VAR_PHP_SELF ]) {
@@ -738,9 +597,7 @@ static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB)
738597{
739598 DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE ;
740599 char static_variable_buf [ISAPI_SERVER_VAR_BUF_SIZE ];
741- #ifndef WITH_ZEUS
742600 HSE_URL_MAPEX_INFO humi ;
743- #endif
744601
745602 SG (request_info ).request_method = lpECB -> lpszMethod ;
746603 SG (request_info ).query_string = lpECB -> lpszQueryString ;
@@ -752,22 +609,13 @@ static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB)
752609 SG (request_info ).auth_user = SG (request_info ).auth_password = SG (request_info ).auth_digest = NULL ;
753610 }
754611
755- #ifdef WITH_ZEUS
756- /* PATH_TRANSLATED can contain extra PATH_INFO stuff after the
757- * file being loaded, so we must use SCRIPT_FILENAME instead
758- */
759- if (lpECB -> GetServerVariable (lpECB -> ConnID , "SCRIPT_FILENAME" , static_variable_buf , & variable_len )) {
760- SG (request_info ).path_translated = estrdup (static_variable_buf );
761- } else
762- #else
763612 /* happily, IIS gives us SCRIPT_NAME which is correct (without PATH_INFO stuff)
764613 so we can just map that to the physical path and we have our filename */
765614
766615 lpECB -> GetServerVariable (lpECB -> ConnID , "SCRIPT_NAME" , static_variable_buf , & variable_len );
767616 if (lpECB -> ServerSupportFunction (lpECB -> ConnID , HSE_REQ_MAP_URL_TO_PATH_EX , static_variable_buf , & variable_len , (LPDWORD ) & humi )) {
768617 SG (request_info ).path_translated = estrdup (humi .lpszPath );
769618 } else
770- #endif
771619 /* if mapping fails, default to what the server tells us */
772620 SG (request_info ).path_translated = estrdup (lpECB -> lpszPathTranslated );
773621
@@ -803,11 +651,7 @@ static void php_isapi_report_exception(char *message, int message_len)
803651BOOL WINAPI GetExtensionVersion (HSE_VERSION_INFO * pVer )
804652{
805653 pVer -> dwExtensionVersion = HSE_VERSION ;
806- #ifdef WITH_ZEUS
807- strncpy ( pVer -> lpszExtensionDesc , isapi_sapi_module .name , HSE_MAX_EXT_DLL_NAME_LEN );
808- #else
809654 lstrcpyn (pVer -> lpszExtensionDesc , isapi_sapi_module .name , HSE_MAX_EXT_DLL_NAME_LEN );
810- #endif
811655 return TRUE;
812656}
813657
0 commit comments