Changeset 1de1026 in mod_gnutls
- Timestamp:
- Dec 5, 2017, 1:18:49 PM (5 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
- Children:
- fe21671
- Parents:
- 994a5fb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_ocsp.c
r994a5fb r1de1026 742 742 { 743 743 mgs_handle_t *ctxt = gnutls_session_get_ptr(session); 744 if (!ctxt->sc->ocsp_staple || ctxt->sc->cache == NULL) 744 mgs_srvconf_rec *sc = ctxt->sc; 745 746 if (!sc->ocsp_staple || sc->cache == NULL) 745 747 { 746 748 /* OCSP must be enabled and caching requires a cache. */ … … 748 750 } 749 751 750 *ocsp_response = ctxt->sc->cache->fetch(ctxt,751 ctxt->sc->ocsp->fingerprint);752 *ocsp_response = sc->cache->fetch(ctxt, 753 sc->ocsp->fingerprint); 752 754 if (ocsp_response->size == 0) 753 755 { … … 775 777 "No valid OCSP response in cache, trying to update."); 776 778 777 apr_status_t rv = apr_global_mutex_trylock( ctxt->sc->ocsp_mutex);779 apr_status_t rv = apr_global_mutex_trylock(sc->ocsp_mutex); 778 780 if (APR_STATUS_IS_EBUSY(rv)) 779 781 { 780 782 /* Another thread is currently holding the mutex, wait. */ 781 apr_global_mutex_lock( ctxt->sc->ocsp_mutex);783 apr_global_mutex_lock(sc->ocsp_mutex); 782 784 /* Check if this other thread updated the response we need. It 783 785 * would be better to have a vhost specific mutex, but at the 784 786 * moment there's no good way to integrate that with the 785 787 * Apache Mutex directive. */ 786 *ocsp_response = ctxt->sc->cache->fetch(ctxt,787 ctxt->sc->ocsp->fingerprint);788 *ocsp_response = sc->cache->fetch(ctxt, 789 sc->ocsp->fingerprint); 788 790 if (ocsp_response->size > 0) 789 791 { 790 792 /* Got a valid response now, unlock mutex and return. */ 791 apr_global_mutex_unlock( ctxt->sc->ocsp_mutex);793 apr_global_mutex_unlock(sc->ocsp_mutex); 792 794 return GNUTLS_E_SUCCESS; 793 795 } … … 806 808 /* cache failure to rate limit retries */ 807 809 mgs_cache_ocsp_failure(ctxt->c->base_server); 808 apr_global_mutex_unlock( ctxt->sc->ocsp_mutex);810 apr_global_mutex_unlock(sc->ocsp_mutex); 809 811 goto fail_cleanup; 810 812 } 811 apr_global_mutex_unlock( ctxt->sc->ocsp_mutex);813 apr_global_mutex_unlock(sc->ocsp_mutex); 812 814 813 815 /* retry reading from cache */ 814 *ocsp_response = ctxt->sc->cache->fetch(ctxt,815 ctxt->sc->ocsp->fingerprint);816 *ocsp_response = sc->cache->fetch(ctxt, 817 sc->ocsp->fingerprint); 816 818 if (ocsp_response->size == 0) 817 819 {
Note: See TracChangeset
for help on using the changeset viewer.