1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-30 10:38:37 +00:00

- Fix FD leak to PHP4 (from pecl-APC CVS)

- Bump PORTREVISION

PS: Maybe fix PR 122717. I need to confirm.
This commit is contained in:
Marcus Alves Grando 2008-04-19 14:17:54 +00:00
parent 061f2c543f
commit bf8618d650
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=211577
4 changed files with 62 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= APC
DISTVERSION= 3.0.18
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://pecl.php.net/get/
PKGNAMEPREFIX= pecl-

View File

@ -0,0 +1,30 @@
#
# Fix FD leak to PHP4 (from pecl-APC CVS)
#
--- apc_main.c 2008/03/29 06:38:40 3.103.2.3
+++ apc_main.c 2008/03/31 14:14:12 3.103.2.4
@@ -279,7 +279,11 @@
apc_cache_release(apc_cache, cache_entry);
/* cannot free up cache data yet, it maybe in use */
-
+
+#ifndef ZEND_ENGINE_2
+ zend_llist_del_element(&CG(open_files), h, compare_file_handles); /* We leak fds in PHP 4 without this hack */
+#endif
+
h->type = ZEND_HANDLE_FILENAME;
return NULL;
@@ -351,6 +355,11 @@
reset_opened_path = 1;
}
zend_hash_add(&EG(included_files), h->opened_path, strlen(h->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+
+#ifndef ZEND_ENGINE_2
+ zend_llist_add_element(&CG(open_files), h); /* We leak fds in PHP 4 without this hack */
+#endif
+
apc_stack_push(APCG(cache_stack), cache_entry);
op_array = cached_compile(h, type TSRMLS_CC);
if(op_array) {

View File

@ -7,6 +7,7 @@
PORTNAME= APC
DISTVERSION= 3.0.18
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://pecl.php.net/get/
PKGNAMEPREFIX= pecl-

View File

@ -0,0 +1,30 @@
#
# Fix FD leak to PHP4 (from pecl-APC CVS)
#
--- apc_main.c 2008/03/29 06:38:40 3.103.2.3
+++ apc_main.c 2008/03/31 14:14:12 3.103.2.4
@@ -279,7 +279,11 @@
apc_cache_release(apc_cache, cache_entry);
/* cannot free up cache data yet, it maybe in use */
-
+
+#ifndef ZEND_ENGINE_2
+ zend_llist_del_element(&CG(open_files), h, compare_file_handles); /* We leak fds in PHP 4 without this hack */
+#endif
+
h->type = ZEND_HANDLE_FILENAME;
return NULL;
@@ -351,6 +355,11 @@
reset_opened_path = 1;
}
zend_hash_add(&EG(included_files), h->opened_path, strlen(h->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+
+#ifndef ZEND_ENGINE_2
+ zend_llist_add_element(&CG(open_files), h); /* We leak fds in PHP 4 without this hack */
+#endif
+
apc_stack_push(APCG(cache_stack), cache_entry);
op_array = cached_compile(h, type TSRMLS_CC);
if(op_array) {