Index: /branches/1.2/NEWS
===================================================================
--- /branches/1.2/NEWS	(revision 373)
+++ /branches/1.2/NEWS	(revision 377)
@@ -7,4 +7,5 @@
 == ChangeLog ==
  * #86: remove/edit variable in admin page
+ * fixed #77: hits/misses was not updated
  * fixed #56: xcache_set segfaults when xcache.var_size=0
  
Index: /branches/1.2/xcache.c
===================================================================
--- /branches/1.2/xcache.c	(revision 368)
+++ /branches/1.2/xcache.c	(revision 377)
@@ -1768,4 +1768,5 @@
 	xc_entry_data_var_t var;
 	zval *name;
+	int found = 0;
 
 	if (!xc_var_caches) {
@@ -1784,4 +1785,5 @@
 		if (stored_xce) {
 			if (!VAR_ENTRY_EXPIRED(stored_xce)) {
+				found = 1;
 				xc_processor_restore_zval(return_value, stored_xce->data.var->value, stored_xce->have_references TSRMLS_CC);
 				/* return */
@@ -1795,4 +1797,10 @@
 		RETVAL_NULL();
 	} LEAVE_LOCK(xce.cache);
+	if (found) {
+		xce.cache->hits ++;
+	}
+	else {
+		xce.cache->misses ++;
+	}
 }
 /* }}} */
@@ -1841,4 +1849,5 @@
 	xc_entry_data_var_t var;
 	zval *name;
+	int found = 0;
 
 	if (!xc_var_caches) {
@@ -1857,4 +1866,5 @@
 		if (stored_xce) {
 			if (!VAR_ENTRY_EXPIRED(stored_xce)) {
+				found = 1;
 				RETVAL_TRUE;
 				/* return */
@@ -1868,4 +1878,10 @@
 		RETVAL_FALSE;
 	} LEAVE_LOCK(xce.cache);
+	if (found) {
+		xce.cache->hits ++;
+	}
+	else {
+		xce.cache->misses ++;
+	}
 }
 /* }}} */
