View | Details | Raw Unified | Return to bug 167774
Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	xcache
8
PORTNAME=	xcache
9
DISTVERSION=	2.0.0
9
DISTVERSION=	2.0.0
10
PORTREVISION=	1
10
CATEGORIES=	www
11
CATEGORIES=	www
11
MASTER_SITES=	http://xcache.lighttpd.net/pub/Releases/${DISTVERSION}/
12
MASTER_SITES=	http://xcache.lighttpd.net/pub/Releases/${DISTVERSION}/
12
13
(-)files/patch-r900 (+48 lines)
Added Link Here
1
Index: xcache.c
2
===================================================================
3
--- xcache.c	(revision 899)
4
+++ xcache.c	(revision 900)
5
@@ -839,7 +839,7 @@
6
 				while (xc_stack_count(s)) {
7
 					entry_php = (xc_entry_php_t *) xc_stack_pop(s);
8
 					TRACE("unhold %d:%s", entry_php->file_inode, entry_php->entry.name.str.val);
9
-					entry_php->refcount ++;
10
+					--entry_php->refcount;
11
 					assert(entry_php->refcount >= 0);
12
 				}
13
 			} LEAVE_LOCK(cache);
14
@@ -1939,11 +1939,16 @@
15
 
16
 		if (stored_php) {
17
 			compiler->new_entry.php = stored_php;
18
-			xc_php_addref_unlocked(stored_php);
19
 			xc_entry_php_init(&compiler->new_entry, compiler->opened_path TSRMLS_CC);
20
 			stored_entry = xc_entry_php_store_unlocked(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC);
21
-			TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val);
22
-			xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC);
23
+			if (stored_entry) {
24
+				xc_php_addref_unlocked(stored_php);
25
+				TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val);
26
+				xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC);
27
+			}
28
+			else {
29
+				gaveup = 1;
30
+			}
31
 			break;
32
 		}
33
 
34
@@ -2021,10 +2026,11 @@
35
 		}
36
 		/* entry_store */
37
 		compiler->new_entry.php = stored_php;
38
-		xc_php_addref_unlocked(stored_php);
39
 		stored_entry = xc_entry_php_store_unlocked(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC);
40
-		if (!stored_entry) {
41
-			xc_php_release_unlocked(cache, stored_php);
42
+		if (stored_entry) {
43
+			xc_php_addref_unlocked(stored_php);
44
+			TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val);
45
+			xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC);
46
 		}
47
 	} LEAVE_LOCK_EX(cache);
48
 	/* }}} */

Return to bug 167774