[PHP-CVS] cvs: php4 /ext/rpc rpc.c

2003-02-11 Thread Zeev Suraski
zeevTue Feb 11 08:46:29 2003 EDT

  Modified files:  
/php4/ext/rpc   rpc.c 
  Log:
  Fix random crashes
  
  
Index: php4/ext/rpc/rpc.c
diff -u php4/ext/rpc/rpc.c:1.23 php4/ext/rpc/rpc.c:1.24
--- php4/ext/rpc/rpc.c:1.23 Mon Feb 10 19:55:26 2003
+++ php4/ext/rpc/rpc.c  Tue Feb 11 08:46:29 2003
@@ -396,6 +396,7 @@
zif-handler = ZEND_FN(rpc_call);
zif-scope = intern-ce;
zif-type = ZEND_INTERNAL_FUNCTION;
+   zif-fn_flags = ZEND_ACC_PUBLIC;
 
/* add new method to the method table */
zend_ts_hash_add(intern-function_table, method, method_len + 1, zif, 
sizeof(zend_function), function);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/rpc rpc.c

2003-02-10 Thread Wez Furlong
wez Mon Feb 10 07:36:06 2003 EDT

  Modified files:  
/php4/ext/rpc   rpc.c 
  Log:
  Newly created objects should use a separate function_table from the global class 
entry table.
  For objects instantiated via new, make sure that intern-function_table uses the 
newly created table when the class is registered.
  For generic per-object hashing, copy the ce-function_table into 
intern-function_table.
  
Index: php4/ext/rpc/rpc.c
diff -u php4/ext/rpc/rpc.c:1.20 php4/ext/rpc/rpc.c:1.21
--- php4/ext/rpc/rpc.c:1.20 Sun Feb  9 18:17:41 2003
+++ php4/ext/rpc/rpc.c  Mon Feb 10 07:36:06 2003
@@ -369,7 +369,7 @@
unsigned char *ref_types = NULL;
GET_INTERNAL(intern);
 
-   if (zend_ts_hash_find((intern-function_table), method, method_len + 1, 
function) != SUCCESS) {
+   if (zend_ts_hash_find(intern-function_table, method, method_len + 1, 
+function) != SUCCESS) {
zend_internal_function *zif;
 
/* get reftypes */
@@ -391,7 +391,7 @@
zif-type = ZEND_INTERNAL_FUNCTION;
 
/* add new method to the method table */
-   zend_ts_hash_add((intern-function_table), method, method_len + 1, 
zif, sizeof(zend_function), function);
+   zend_ts_hash_add(intern-function_table, method, method_len + 1, zif, 
+sizeof(zend_function), function);
efree(zif);
}
 
@@ -518,6 +518,7 @@
overloaded_class_entry.name_length = 
class_val.len;
class_hash-ce = 
zend_register_internal_class_ex(overloaded_class_entry, intern-ce, NULL TSRMLS_CC);
intern-ce = class_hash-ce;
+   intern-function_table.hash = 
+intern-ce-function_table;
 
/* register with non-hashed key
 * also track all instaces in a llist for 
destruction later on, because there might be duplicate entries in
@@ -545,6 +546,7 @@
/* overload class entry */
INIT_CLASS_ENTRY(overloaded_class_entry, 
class_val.str, NULL);
intern-ce = 
zend_register_internal_class_ex(overloaded_class_entry, intern-ce, NULL TSRMLS_CC);
+   intern-function_table.hash = 
+intern-ce-function_table;
}
}
} else {
@@ -568,6 +570,7 @@
INIT_CLASS_ENTRY(overloaded_class_entry, class_val.str, NULL);
class_hash-ce = 
zend_register_internal_class_ex(overloaded_class_entry, intern-ce, NULL TSRMLS_CC);
intern-ce = class_hash-ce;
+   intern-function_table.hash = intern-ce-function_table;
 
/* register int hashcode, we don't know more */
zend_ts_hash_index_update(classes, class_hash-name.len, 
class_hash, sizeof(rpc_class_hash *), NULL);
@@ -805,7 +808,7 @@
 
intern-ce = class_type;
intern-data = NULL;
-   intern-function_table.hash = intern-ce-function_table;
+   intern-function_table.hash = intern-ce-function_table;   
intern-function_table.reader = 0;
intern-function_table.mx_reader = tsrm_mutex_alloc();
intern-function_table.mx_writer = tsrm_mutex_alloc();
@@ -914,6 +917,11 @@
class_hash-singleton = FALSE;
class_hash-poolable = FALSE;
class_hash-data = NULL;
+
+   /* Copy the function table hash for this object, so that it is 
+separated
+* from the global table */
+   zend_ts_hash_init(intern-function_table, 0, NULL, NULL, TRUE);
+   zend_hash_copy(intern-function_table.hash, ce-function_table, 
+NULL, NULL, 0);
}
 
RPC_CLASS(intern) = class_hash;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/rpc rpc.c

2003-02-09 Thread Harald Radi
phanto  Sun Feb  9 18:17:42 2003 EDT

  Modified files:  
/php4/ext/rpc   rpc.c 
  Log:
  fix a memleak
  
Index: php4/ext/rpc/rpc.c
diff -u php4/ext/rpc/rpc.c:1.19 php4/ext/rpc/rpc.c:1.20
--- php4/ext/rpc/rpc.c:1.19 Sun Feb  9 16:37:40 2003
+++ php4/ext/rpc/rpc.c  Sun Feb  9 18:17:41 2003
@@ -794,12 +794,11 @@
 
 ZEND_API zend_object_value rpc_objects_new(zend_class_entry *class_type TSRMLS_DC)
 {
-   zend_object_value *zov;
+   zend_object_value zov;
rpc_internal *intern;

/* set up the object value struct */
-   zov = (zend_object_value*) pemalloc(sizeof(zend_object_value), TRUE);
-   zov-handlers = rpc_handlers;
+   zov.handlers = rpc_handlers;
 
/* set up the internal representation of our rpc instance */
intern = (rpc_internal *) pecalloc(1, sizeof(rpc_internal), TRUE);
@@ -816,9 +815,9 @@
/* TODO: exception */
}
 
-   zov-handle = zend_objects_store_put(intern, rpc_objects_delete, NULL 
TSRMLS_CC);
+   zov.handle = zend_objects_store_put(intern, rpc_objects_delete, NULL 
+TSRMLS_CC);
 
-   return *zov;
+   return zov;
 }
 
 /***/



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/rpc rpc.c rpc_proxy.c /ext/rpc/com variant.c

2003-01-11 Thread Harald Radi
phanto  Sat Jan 11 03:59:37 2003 EDT

  Modified files:  
/php4/ext/rpc   rpc.c rpc_proxy.c 
/php4/ext/rpc/com   variant.c 
  Log:
  fix build
  
Index: php4/ext/rpc/rpc.c
diff -u php4/ext/rpc/rpc.c:1.15 php4/ext/rpc/rpc.c:1.16
--- php4/ext/rpc/rpc.c:1.15 Tue Dec 31 11:07:22 2002
+++ php4/ext/rpc/rpc.c  Sat Jan 11 03:59:36 2003
@@ -66,8 +66,6 @@
NULL,
rpc_get,
rpc_set,
-   NULL,
-   NULL,
rpc_has_property,
rpc_unset_property,
rpc_get_properties,
@@ -139,6 +137,24 @@
zend_llist_init(classes_list, sizeof(rpc_class_hash **), rpc_class_dtor, TRUE);
 
FOREACH_HANDLER {
+   /*
+   handle = DL_LOAD(path);
+   if (!handle) {
+#ifndef ZEND_WIN32
+   fprintf(stderr, Failed loading %s:  %s\n, path, DL_ERROR());
+#else
+   fprintf(stderr, Failed loading %s\n, path);
+#endif
+   return FAILURE;
+   }
+
+   extension_version_info = (zend_extension_version_info *) 
+DL_FETCH_SYMBOL(handle, extension_version_info);
+   new_extension = (zend_extension *) DL_FETCH_SYMBOL(handle, 
+zend_extension_entry);
+   if (!extension_version_info || !new_extension) {
+   fprintf(stderr, %s doesn't appear to be a valid Zend extension\n, 
+path);
+   return FAILURE;
+   }
+*/
zend_class_entry ce;
 
HANDLER.rpc_handler_init(module_number TSRMLS_CC);
@@ -155,7 +171,7 @@
 
/* register classes and functions */
*HANDLER.ce = zend_register_internal_class_ex(ce, rpc_entry, NULL 
TSRMLS_CC);
-   zend_register_functions(HANDLER.functions, NULL, MODULE_PERSISTENT 
TSRMLS_CC);
+   zend_register_functions(NULLHANDLER.functions, NULL, MODULE_PERSISTENT 
+TSRMLS_CC);
zend_register_ini_entries(HANDLER.ini, module_number TSRMLS_CC);
}
 
Index: php4/ext/rpc/rpc_proxy.c
diff -u php4/ext/rpc/rpc_proxy.c:1.5 php4/ext/rpc/rpc_proxy.c:1.6
--- php4/ext/rpc/rpc_proxy.c:1.5Tue Dec 31 11:07:22 2002
+++ php4/ext/rpc/rpc_proxy.cSat Jan 11 03:59:36 2003
@@ -52,8 +52,6 @@
NULL,
rpc_proxy_get,
rpc_proxy_set,
-   NULL,
-   NULL,
rpc_proxy_has_property,
rpc_proxy_unset_property,
rpc_proxy_get_properties,
Index: php4/ext/rpc/com/variant.c
diff -u php4/ext/rpc/com/variant.c:1.34 php4/ext/rpc/com/variant.c:1.35
--- php4/ext/rpc/com/variant.c:1.34 Tue Dec 31 11:07:23 2002
+++ php4/ext/rpc/com/variant.c  Sat Jan 11 03:59:36 2003
@@ -62,8 +62,6 @@
NULL,
NULL,
NULL,
-   NULL,
-   NULL,
variant_get_constructor,
variant_get_class_entry,
NULL,



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/rpc rpc.c

2003-01-11 Thread Sebastian Bergmann
sebastian   Sat Jan 11 04:51:52 2003 EDT

  Modified files:  
/php4/ext/rpc   rpc.c 
  Log:
  Add missing ,.
  
Index: php4/ext/rpc/rpc.c
diff -u php4/ext/rpc/rpc.c:1.16 php4/ext/rpc/rpc.c:1.17
--- php4/ext/rpc/rpc.c:1.16 Sat Jan 11 03:59:36 2003
+++ php4/ext/rpc/rpc.c  Sat Jan 11 04:51:52 2003
@@ -171,7 +171,7 @@
 
/* register classes and functions */
*HANDLER.ce = zend_register_internal_class_ex(ce, rpc_entry, NULL 
TSRMLS_CC);
-   zend_register_functions(NULLHANDLER.functions, NULL, MODULE_PERSISTENT 
TSRMLS_CC);
+   zend_register_functions(NULL, HANDLER.functions, NULL, 
+MODULE_PERSISTENT TSRMLS_CC);
zend_register_ini_entries(HANDLER.ini, module_number TSRMLS_CC);
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php