mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Whitespace
This commit is contained in:
parent
bafa98109c
commit
f6f6c4d7e6
49 changed files with 1449 additions and 1443 deletions
|
@ -45,11 +45,11 @@ function_entry crack_functions[] = {
|
|||
zend_module_entry crack_module_entry = {
|
||||
"crack",
|
||||
crack_functions,
|
||||
ZEND_MINIT(crack),
|
||||
ZEND_MSHUTDOWN(crack),
|
||||
ZEND_RINIT(crack),
|
||||
ZEND_RSHUTDOWN(crack),
|
||||
PHP_MINFO(crack),
|
||||
ZEND_MODULE_STARTUP_N(crack),
|
||||
ZEND_MODULE_SHUTDOWN_N(crack),
|
||||
ZEND_MODULE_ACTIVATE_N(crack),
|
||||
ZEND_MODULE_DEACTIVATE_N(crack),
|
||||
ZEND_MODULE_INFO_N(crack),
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
|
@ -91,7 +91,7 @@ void _close_crack_dict(PWDICT *pwdict)
|
|||
PWClose(pwdict);
|
||||
}
|
||||
|
||||
ZEND_MINIT_FUNCTION(crack)
|
||||
ZEND_MODULE_STARTUP_D(crack)
|
||||
{
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
|
@ -100,13 +100,13 @@ ZEND_MINIT_FUNCTION(crack)
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_MSHUTDOWN_FUNCTION(crack)
|
||||
ZEND_MODULE_SHUTDOWN_D(crack)
|
||||
{
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_RINIT_FUNCTION(crack)
|
||||
ZEND_MODULE_ACTIVATE_D(crack)
|
||||
{
|
||||
CRACKG(last_message) = NULL;
|
||||
CRACKG(current_id) = -1;
|
||||
|
@ -114,7 +114,7 @@ ZEND_RINIT_FUNCTION(crack)
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_RSHUTDOWN_FUNCTION(crack)
|
||||
ZEND_MODULE_DEACTIVATE_D(crack)
|
||||
{
|
||||
if (NULL != CRACKG(last_message)) {
|
||||
efree(CRACKG(last_message));
|
||||
|
@ -122,7 +122,7 @@ ZEND_RSHUTDOWN_FUNCTION(crack)
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MINFO_FUNCTION(crack)
|
||||
ZEND_MODULE_INFO_D(crack)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_header(2, "crack support", "enabled");
|
||||
|
|
|
@ -159,12 +159,12 @@ tuple2var(relf * r, tuple * t, zval **zv)
|
|||
}
|
||||
|
||||
if(element->type!=IS_NULL)
|
||||
zend_hash_update((*zv)->value.ht
|
||||
,ap->att_name
|
||||
,strlen(ap->att_name)+1
|
||||
,(void *)&element
|
||||
,sizeof(zval*)
|
||||
,NULL);
|
||||
zend_hash_update((*zv)->value.ht,
|
||||
ap->att_name,
|
||||
strlen(ap->att_name)+1,
|
||||
(void *)&element,
|
||||
sizeof(zval*),
|
||||
NULL);
|
||||
|
||||
} while (ap++, --deg);
|
||||
return 0;
|
||||
|
@ -344,9 +344,9 @@ PHP_FUNCTION(dbplus_aql)
|
|||
break;
|
||||
}
|
||||
|
||||
r = cdb_aql((argc>=2)?_STRING(server):"localhost"
|
||||
,_STRING(query)
|
||||
,(argc==3)?_STRING(dbpath):NULL);
|
||||
r = cdb_aql((argc>=2)?_STRING(server):"localhost",
|
||||
_STRING(query),
|
||||
(argc==3)?_STRING(dbpath):NULL);
|
||||
if(r == NULL) {
|
||||
/* TODO error handling */
|
||||
RETURN_FALSE;
|
||||
|
@ -652,12 +652,12 @@ PHP_FUNCTION(dbplus_info)
|
|||
|
||||
ZVAL_STRING(element, ap->att_name, 1);
|
||||
|
||||
zend_hash_update((*result)->value.ht
|
||||
,ap->att_name
|
||||
,strlen(ap->att_name)+1
|
||||
,(void *)&element
|
||||
,sizeof(zval*)
|
||||
,NULL);
|
||||
zend_hash_update((*result)->value.ht,
|
||||
ap->att_name,
|
||||
strlen(ap->att_name)+1,
|
||||
(void *)&element,
|
||||
sizeof(zval*),
|
||||
NULL);
|
||||
} while (ap++, deg--);
|
||||
RETURN_LONG(ERR_NOERR);
|
||||
}
|
||||
|
@ -1102,9 +1102,9 @@ PHP_FUNCTION(dbplus_sql)
|
|||
break;
|
||||
}
|
||||
|
||||
r = cdb_sql((argc>=2)?_STRING(server):"localhost"
|
||||
,_STRING(query)
|
||||
,(argc==3)?_STRING(dbpath):NULL);
|
||||
r = cdb_sql((argc>=2)?_STRING(server):"localhost",
|
||||
_STRING(query),
|
||||
(argc==3)?_STRING(dbpath):NULL);
|
||||
if(r == NULL) {
|
||||
/* TODO error handling */
|
||||
RETURN_FALSE;
|
||||
|
|
|
@ -17,6 +17,15 @@
|
|||
* -----------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 2000/07/02 23:46:41 sas
|
||||
* Change header protection macros to conform to standard.
|
||||
*
|
||||
* Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment"
|
||||
*
|
||||
* All identifiers that begin with an underscore and either an uppercase
|
||||
* letter or another underscore are always reserved for any use by the
|
||||
* implementation.
|
||||
*
|
||||
* Revision 1.1 1999/04/21 23:37:47 ssb
|
||||
* moved db
|
||||
*
|
||||
|
|
|
@ -403,7 +403,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
|
|||
user=php_get_current_user();
|
||||
hashed_details_length = strlen(user) + sizeof("ingres___")-1;
|
||||
hashed_details = (char *) emalloc(hashed_details_length+1);
|
||||
sprintf(hashed_details,"ingres__%s_",user);
|
||||
sprintf(hashed_details, "Ingres__%s_", user);
|
||||
} else {
|
||||
db = IIG(default_database);
|
||||
user = IIG(default_user);
|
||||
|
@ -432,7 +432,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
|
|||
|
||||
hashed_details_length = sizeof("ingres___")-1 + strlen(SAFE_STRING(db))+strlen(SAFE_STRING(user))+strlen(SAFE_STRING(pass));
|
||||
hashed_details = (char *) emalloc(hashed_details_length+1);
|
||||
sprintf(hashed_details,"ingres_%s_%s_%s",SAFE_STRING(db), SAFE_STRING(user), SAFE_STRING(pass));
|
||||
sprintf(hashed_details, "Ingres_%s_%s_%s", SAFE_STRING(db), SAFE_STRING(user), SAFE_STRING(pass));
|
||||
}
|
||||
|
||||
/* if asked for unauthorized persistency, issue a warning
|
||||
|
|
|
@ -182,7 +182,7 @@ function_entry mysql_functions[] = {
|
|||
/* {{{ mysql_module_entry
|
||||
*/
|
||||
zend_module_entry mysql_module_entry = {
|
||||
"mysql", mysql_functions, PHP_MINIT(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), PHP_RSHUTDOWN(mysql),
|
||||
"mysql", mysql_functions, ZEND_MODULE_STARTUP_N(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), PHP_RSHUTDOWN(mysql),
|
||||
PHP_MINFO(mysql), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
/* }}} */
|
||||
|
@ -308,7 +308,7 @@ static void php_mysql_init_globals(zend_mysql_globals *mysql_globals)
|
|||
|
||||
/* {{{ PHP_MINIT_FUNCTION
|
||||
*/
|
||||
PHP_MINIT_FUNCTION(mysql)
|
||||
ZEND_MODULE_STARTUP_D(mysql)
|
||||
{
|
||||
ZEND_INIT_MODULE_GLOBALS(mysql, php_mysql_init_globals, NULL);
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "ext/standard/info.h"
|
||||
#include "php_variables.h"
|
||||
#include "php_ini.h"
|
||||
#include "ext/standard/head.h"
|
||||
|
||||
#ifdef WITH_ZEUS
|
||||
# include "httpext.h"
|
||||
|
@ -61,7 +62,7 @@ exception trapping when running under a debugger
|
|||
#define ISAPI_POST_DATA_BUF 1024
|
||||
|
||||
static zend_bool bFilterLoaded=0;
|
||||
static zend_bool bTerminateThreadsOnError=0;
|
||||
static zend_bool bIgnoreCrashes=0;
|
||||
|
||||
static char *isapi_special_server_variable_names[] = {
|
||||
"ALL_HTTP",
|
||||
|
@ -297,7 +298,7 @@ static int php_isapi_startup(sapi_module_struct *sapi_module)
|
|||
|| zend_startup_module(&php_isapi_module)==FAILURE) {
|
||||
return FAILURE;
|
||||
} else {
|
||||
bTerminateThreadsOnError = (zend_bool) INI_INT("isapi.terminate_threads_on_error");
|
||||
bIgnoreCrashes = (zend_bool) INI_INT("isapi.ignore_crashes");
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -691,23 +692,28 @@ BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer)
|
|||
}
|
||||
|
||||
|
||||
static void my_endthread()
|
||||
{
|
||||
#ifdef PHP_WIN32
|
||||
if (bTerminateThreadsOnError) {
|
||||
_endthread();
|
||||
}
|
||||
#endif
|
||||
static int php_isapi_exception_handler(LPEXCEPTION_POINTERS ep TSRMLS_DC)
|
||||
{
|
||||
if (ep->ExceptionRecord->ExceptionCode==EXCEPTION_STACK_OVERFLOW) {
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
if (ep->ExceptionRecord->ExceptionCode==EXCEPTION_ACCESS_VIOLATION) {
|
||||
char buf[1024];
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
/* ep is accessible only in the context of the __except expression,
|
||||
* so we have to call this function to obtain it.
|
||||
*/
|
||||
BOOL exceptionhandler(LPEXCEPTION_POINTERS *e, LPEXCEPTION_POINTERS ep)
|
||||
{
|
||||
*e=ep;
|
||||
return TRUE;
|
||||
_snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", ep->ExceptionRecord->ExceptionAddress);
|
||||
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
|
||||
} else {
|
||||
char buf[1024];
|
||||
|
||||
_snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", ep->ExceptionRecord->ExceptionCode , ep->ExceptionRecord->ExceptionAddress);
|
||||
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
|
||||
}
|
||||
if (bIgnoreCrashes) {
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
} else {
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -715,9 +721,6 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
|
|||
{
|
||||
zend_file_handle file_handle;
|
||||
zend_bool stack_overflown=0;
|
||||
#ifdef PHP_ENABLE_SEH
|
||||
LPEXCEPTION_POINTERS e;
|
||||
#endif
|
||||
TSRMLS_FETCH();
|
||||
|
||||
zend_first_try {
|
||||
|
@ -757,8 +760,8 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
|
|||
efree(SG(request_info).cookie_data);
|
||||
}
|
||||
#ifdef PHP_ENABLE_SEH
|
||||
} __except(exceptionhandler(&e, GetExceptionInformation())) {
|
||||
char buf[1024];
|
||||
} __except(php_isapi_exception_handler(GetExceptionInformation() TSRMLS_CC)) {
|
||||
/* we only trap stack overflow exceptions */
|
||||
if (_exception_code() == EXCEPTION_STACK_OVERFLOW) {
|
||||
LPBYTE lpPage;
|
||||
static SYSTEM_INFO si;
|
||||
|
@ -787,24 +790,18 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
|
|||
}
|
||||
|
||||
CG(unclean_shutdown)=1;
|
||||
_snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow");
|
||||
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
|
||||
} else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) {
|
||||
_snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress);
|
||||
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
|
||||
my_endthread();
|
||||
} else {
|
||||
_snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress);
|
||||
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
|
||||
my_endthread();
|
||||
php_header();
|
||||
sapi_isapi_ub_write("Stack overflow", sizeof("Stack overflow")-1 TSRMLS_CC);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef PHP_ENABLE_SEH
|
||||
__try {
|
||||
php_request_shutdown(NULL);
|
||||
} __except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
my_endthread();
|
||||
} __except(php_isapi_exception_handler(GetExceptionInformation() TSRMLS_CC)) {
|
||||
/* We should only get to this block in case of a stack overflow,
|
||||
* which is very unlikely
|
||||
*/
|
||||
}
|
||||
#else
|
||||
php_request_shutdown(NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue