Changeset 3aff94d in mod_gnutls


Ignore:
Timestamp:
Oct 31, 2018, 3:20:28 AM (8 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master, master
Children:
b47dc70
Parents:
267a27a
Message:

Include cache status in mod_status reports

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    r267a27a r3aff94d  
    3434
    3535#include <ap_socache.h>
     36#include <mod_status.h>
    3637#include <apr_escape.h>
    3738#include <util_mutex.h>
     
    519520    return 0;
    520521}
     522
     523
     524
     525int mgs_cache_status(mgs_cache_t cache, const char *header_title,
     526                     request_rec *r, int flags)
     527{
     528    if (!(flags & AP_STATUS_SHORT))
     529        ap_rprintf(r, "<h3>%s:</h3>\n", header_title);
     530    else
     531        ap_rprintf(r, "%s:\n", header_title);
     532
     533    if (cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE)
     534        apr_global_mutex_lock(cache->mutex);
     535    cache->prov->status(cache->socache, r, flags);
     536    if (cache->prov->flags & AP_SOCACHE_FLAG_NOTMPSAFE)
     537        apr_global_mutex_unlock(cache->mutex);
     538
     539    return OK;
     540}
  • src/gnutls_cache.h

    r267a27a r3aff94d  
    163163};
    164164
     165/**
     166 * Write cache status to a mod_status report
     167 *
     168 * @param cache the cache to report on
     169 *
     170 * @param header_title string to prefix the report with to distinguish
     171 * caches
     172 *
     173 * @param r status output is added to the response for this request
     174 *
     175 * @param flags request flags, used to toggle "short status" mode
     176 *
     177 * @return request status, currently always `OK`
     178 */
     179int mgs_cache_status(mgs_cache_t cache, const char *header_title,
     180                     request_rec *r, int flags);
     181
    165182#endif /** __MOD_GNUTLS_CACHE_H__ */
  • src/gnutls_hooks.c

    r267a27a r3aff94d  
    2828#include "http_vhost.h"
    2929#include "ap_mpm.h"
    30 #include "mod_status.h"
     30#include <mod_status.h>
    3131#include <util_mutex.h>
    3232#include <apr_escape.h>
     
    19951995        ap_rputs("</dl>\n", r);
    19961996
     1997    if (sc->ocsp_cache)
     1998        mgs_cache_status(sc->ocsp_cache, "GnuTLS OCSP Cache", r, flags);
     1999    if (sc->cache_enable)
     2000        mgs_cache_status(sc->cache, "GnuTLS Session Cache", r, flags);
     2001
    19972002    return OK;
    19982003}
Note: See TracChangeset for help on using the changeset viewer.