Changeset 41f9bcb in mod_gnutls
- Timestamp:
- Apr 25, 2018, 5:28:35 AM (4 years ago)
- Branches:
- asyncio, debian/master, master, proxy-ticket
- Children:
- adf36c3
- Parents:
- ded2291
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
rded2291 r41f9bcb 112 112 113 113 114 int mgs_cache_store(mgs_cache_t cache __attribute__((unused)),115 server_rec *server, gnutls_datum_t key,116 gnutls_datum_t data,apr_time_t expiry)114 int mgs_cache_store(mgs_cache_t cache, server_rec *server, 115 gnutls_datum_t key, gnutls_datum_t data, 116 apr_time_t expiry) 117 117 { 118 118 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) … … 122 122 apr_pool_create(&spool, NULL); 123 123 124 if ( sc->cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE)125 apr_global_mutex_lock( sc->cache->mutex);126 apr_status_t rv = sc->cache->prov->store(sc->cache->socache, server,127 128 129 130 131 if ( sc->cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE)132 apr_global_mutex_unlock( sc->cache->mutex);124 if (cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE) 125 apr_global_mutex_lock(cache->mutex); 126 apr_status_t rv = cache->prov->store(cache->socache, server, 127 key.data, key.size, 128 expiry, 129 data.data, data.size, 130 spool); 131 if (cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE) 132 apr_global_mutex_unlock(cache->mutex); 133 133 134 134 if (rv != APR_SUCCESS) 135 135 { 136 // TODO: clean up sc->cache_config reference 136 137 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, server, 137 138 "error storing in cache '%s:%s'", 138 sc->cache->prov->name, sc->cache_config);139 cache->prov->name, sc->cache_config); 139 140 apr_pool_destroy(spool); 140 141 return -1; 141 142 } 142 143 144 // TODO: clean up sc->cache_config reference 143 145 ap_log_error(APLOG_MARK, APLOG_TRACE1, rv, server, 144 146 "stored %u bytes of data (%u byte key) in cache '%s:%s'", 145 147 data.size, key.size, 146 sc->cache->prov->name, sc->cache_config);148 cache->prov->name, sc->cache_config); 147 149 apr_pool_destroy(spool); 148 150 return 0; … … 186 188 apr_pool_create(&spool, pool); 187 189 188 if ( sc->cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE)189 apr_global_mutex_lock( sc->cache->mutex);190 apr_status_t rv = sc->cache->prov->retrieve(sc->cache->socache, server,191 192 193 194 if ( sc->cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE)195 apr_global_mutex_unlock( sc->cache->mutex);190 if (cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE) 191 apr_global_mutex_lock(cache->mutex); 192 apr_status_t rv = cache->prov->retrieve(cache->socache, server, 193 key.data, key.size, 194 data.data, &data.size, 195 spool); 196 if (cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE) 197 apr_global_mutex_unlock(cache->mutex); 196 198 197 199 if (rv != APR_SUCCESS) 198 200 { 201 // TODO: clean up sc->cache_config references 199 202 /* APR_NOTFOUND means there's no such object. */ 200 203 if (rv == APR_NOTFOUND) 201 204 ap_log_error(APLOG_MARK, APLOG_TRACE1, rv, server, 202 205 "requested entry not found in cache '%s:%s'.", 203 sc->cache->prov->name, sc->cache_config);206 cache->prov->name, sc->cache_config); 204 207 else 205 208 ap_log_error(APLOG_MARK, APLOG_WARNING, rv, server, 206 209 "error fetching from cache '%s:%s'", 207 sc->cache->prov->name, sc->cache_config);210 cache->prov->name, sc->cache_config); 208 211 /* free unused buffer */ 209 212 gnutls_free(data.data); … … 213 216 else 214 217 { 218 // TODO: clean up sc->cache_config reference 215 219 ap_log_error(APLOG_MARK, APLOG_TRACE1, rv, server, 216 220 "fetched %u bytes from cache '%s:%s'", 217 data.size, sc->cache->prov->name, sc->cache_config);221 data.size, cache->prov->name, sc->cache_config); 218 222 } 219 223 apr_pool_destroy(spool);
Note: See TracChangeset
for help on using the changeset viewer.