Changeset 350
- Timestamp:
- 06/20/08 11:20:20 (2 years ago)
- Location:
- eaccelerator/trunk
- Files:
-
- 5 edited
-
cache.c (modified) (1 diff)
-
content.c (modified) (3 diffs)
-
ea_restore.c (modified) (1 diff)
-
eaccelerator.h (modified) (1 diff)
-
session.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eaccelerator/trunk/cache.c
r332 r350 252 252 q->create = EAG(req_start); 253 253 /* set the refcount to 1 */ 254 q->value.refcount = 1;254 RESET_PZVAL_REFCOUNT(&q->value); 255 255 store_zval(&EAG(mem), &q->value TSRMLS_CC); 256 256 zend_hash_destroy(&EAG(strings)); -
eaccelerator/trunk/content.c
r344 r350 157 157 memcpy(cache_content, content, sizeof(zval)); 158 158 zval_copy_ctor(cache_content); 159 cache_content->is_ref = 0; 160 cache_content->refcount = 1; 159 INIT_PZVAL(cache_content); 161 160 add_assoc_zval(&cache_array, "content", cache_content); 162 161 eaccelerator_put(key, key_len , &cache_array, ttl, eaccelerator_content_cache_place TSRMLS_CC); … … 493 492 char* zkey; 494 493 int zkey_len; 494 #ifdef ZEND_ENGINE_2_3 495 ALLOCA_FLAG(use_heap) 496 #endif 495 497 496 498 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, … … 501 503 RETURN_NULL(); 502 504 } 505 #ifdef ZEND_ENGINE_2_3 506 zkey = do_alloca(key_len+16, use_heap); 507 #else 503 508 zkey = do_alloca(key_len+16); 509 #endif 504 510 eaccelerator_rm(key, key_len, eaccelerator_content_cache_place TSRMLS_CC); 505 511 zkey_len = sizeof("gzip_") + key_len - 1; -
eaccelerator/trunk/ea_restore.c
r348 r350 48 48 #if HARDENING_PATCH_HASH_PROTECT 49 49 extern unsigned int zend_hash_canary; 50 #endif51 52 #ifdef ZEND_ENGINE_2_353 #define RESET_PZVAL_REFCOUNT(z) Z_SET_REFCOUNT_P(z, 1)54 #else55 #define RESET_PZVAL_REFCOUNT(z) (z)->refcount = 1;56 50 #endif 57 51 -
eaccelerator/trunk/eaccelerator.h
r348 r350 186 186 #define EA_SIZE_ALIGN(n) (n) = ((((size_t)(n)-1) & ~(EACCELERATOR_PLATFORM_ALIGNMENT-1)) + EACCELERATOR_PLATFORM_ALIGNMENT) 187 187 188 #ifdef ZEND_ENGINE_2_3 189 #define RESET_PZVAL_REFCOUNT(z) Z_SET_REFCOUNT_P(z, 1) 190 #else 191 #define RESET_PZVAL_REFCOUNT(z) (z)->refcount = 1; 192 #endif 188 193 189 194 #define MAX_DUP_STR_LEN 256 -
eaccelerator/trunk/session.c
r286 r350 116 116 int len; 117 117 zval ret; 118 #ifdef ZEND_ENGINE_2_3 119 ALLOCA_FLAG(use_heap); 120 #endif 118 121 119 122 len = sizeof("sess_") + strlen(key); 123 #ifdef ZEND_ENGINE_2_3 124 skey = do_alloca(len + 1, use_heap); 125 #else 120 126 skey = do_alloca(len + 1); 127 #endif 121 128 strcpy(skey, "sess_"); 122 129 strcat(skey, key); … … 132 139 *vallen = 0; 133 140 } 141 #ifdef ZEND_ENGINE_2_3 142 free_alloca(skey, use_heap); 143 #else 134 144 free_alloca(skey); 145 #endif 135 146 return SUCCESS; 136 147 } … … 140 151 char *skey; 141 152 int len; 153 int result; 142 154 time_t ttl = INI_INT("session.gc_maxlifetime"); 143 155 zval sval; 156 #ifdef ZEND_ENGINE_2_3 157 ALLOCA_FLAG(use_heap); 158 #endif 144 159 145 160 len = sizeof("sess_") + strlen(key); 161 #ifdef ZEND_ENGINE_2_3 162 skey = do_alloca(len + 1, use_heap); 163 #else 146 164 skey = do_alloca(len + 1); 165 #endif 147 166 strcpy(skey, "sess_"); 148 167 strcat(skey, key); … … 156 175 do_session_lock(skey TSRMLS_CC); 157 176 if (eaccelerator_put(skey, len, &sval, ttl, eaccelerator_sessions_cache_place TSRMLS_CC)) { 158 free_alloca(skey); 159 return SUCCESS; 177 result = SUCCESS; 160 178 } else { 161 free_alloca(skey); 162 return FAILURE; 163 } 179 result = FAILURE; 180 } 181 182 #ifdef ZEND_ENGINE_2_3 183 free_alloca(skey, use_heap); 184 #else 185 free_alloca(skey); 186 #endif 187 188 return result; 164 189 } 165 190 … … 168 193 char *skey; 169 194 int len; 195 int result; 196 #ifdef ZEND_ENGINE_2_3 197 ALLOCA_FLAG(use_heap); 198 #endif 170 199 171 200 len = sizeof("sess_") + strlen(key); 201 #ifdef ZEND_ENGINE_2_3 202 skey = do_alloca(len + 1, use_heap); 203 #else 172 204 skey = do_alloca(len + 1); 205 #endif 173 206 strcpy(skey, "sess_"); 174 207 strcat(skey, key); 175 208 if (eaccelerator_rm(skey, len, eaccelerator_sessions_cache_place TSRMLS_CC)) { 176 free_alloca(skey); 177 return SUCCESS; 209 result = SUCCESS; 178 210 } else { 179 free_alloca(skey); 180 return FAILURE; 181 } 211 result = FAILURE; 212 } 213 214 #ifdef ZEND_ENGINE_2_3 215 free_alloca(skey, use_heap); 216 #else 217 free_alloca(skey); 218 #endif 219 220 return result; 182 221 } 183 222
Note: See TracChangeset
for help on using the changeset viewer.