httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r958157 - in /httpd/httpd/trunk: include/ap_mmn.h include/ap_socache.h modules/cache/mod_socache_dbm.c modules/cache/mod_socache_dc.c modules/cache/mod_socache_memcache.c modules/cache/mod_socache_shmcb.c
Date Sat, 26 Jun 2010 00:26:02 GMT
Author: wrowe
Date: Sat Jun 26 00:26:01 2010
New Revision: 958157

URL: http://svn.apache.org/viewvc?rev=958157&view=rev
Log:
Introduce an socache iterator 'userctx' for the user to track the
context of their own callback.

Breaks API, but we probably wanted an mmn reset between .6 and .7
betas for unintentional/unnoticed ABI breaks.

Modified:
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/include/ap_socache.h
    httpd/httpd/trunk/modules/cache/mod_socache_dbm.c
    httpd/httpd/trunk/modules/cache/mod_socache_dc.c
    httpd/httpd/trunk/modules/cache/mod_socache_memcache.c
    httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=958157&r1=958156&r2=958157&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Sat Jun 26 00:26:01 2010
@@ -230,12 +230,13 @@
  * 20100609.0 (2.3.6-dev)  Dropped ap_args_to_table due to missing constraints.
  * 20100609.1 (2.3.7-dev)  Introduce ap_log_cserror()
  * 20100609.2 (2.3.7-dev)  Add deferred write pool to core_output_filter_ctx
+ * 20100625.0 (2.3.7-dev)  Add 'userctx' to socache iterator callback prototype
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20100609
+#define MODULE_MAGIC_NUMBER_MAJOR 20100625
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 2                     /* 0...n */
 

Modified: httpd/httpd/trunk/include/ap_socache.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_socache.h?rev=958157&r1=958156&r2=958157&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_socache.h (original)
+++ httpd/httpd/trunk/include/ap_socache.h Sat Jun 26 00:26:01 2010
@@ -61,25 +61,27 @@ struct ap_socache_hints {
 
 /**
  * Iterator callback prototype for the ap_socache_provider_t->iterate() method
- * @param instance The cache instance (passed through)
- * @param s Associated server structure (passed through)
+ * @param instance The cache instance
+ * @param s Associated server context (for logging)
+ * @param userctx User defined pointer passed from the iterator call
  * @param id Unique ID for the object (binary blob)
  * with a trailing null char for convenience
  * @param idlen Length of id blob
  * @param data Output buffer to place retrieved data (binary blob)
  * with a trailing null char for convenience
  * @param datalen Length of data buffer
- * @param pool Pool for temporary allocations (passed through)
+ * @param pool Pool for temporary allocations
  * @return APR status value; return APR_SUCCESS or the iteration will halt;
  * this value is returned to the ap_socache_provider_t->iterate() caller
  */
-typedef apr_status_t (*ap_socache_iterator_t)(ap_socache_instance_t *instance,
-                                              server_rec *s,
-                                              const unsigned char *id,
-                                              unsigned int idlen,
-                                              const unsigned char *data,
-                                              unsigned int datalen,
-                                              apr_pool_t *pool);
+typedef apr_status_t (ap_socache_iterator_t)(ap_socache_instance_t *instance,
+                                             server_rec *s,
+                                             void *userctx,
+                                             const unsigned char *id,
+                                             unsigned int idlen,
+                                             const unsigned char *data,
+                                             unsigned int datalen,
+                                             apr_pool_t *pool);
 
 /** A socache provider structure.  socache providers are registered
  * with the ap_provider.h interface using the AP_SOCACHE_PROVIDER_*
@@ -193,15 +195,16 @@ typedef struct ap_socache_provider_t {
     /**
      * Dump all cached objects through an iterator callback.
      * @param instance The cache instance
-     * @param s Associated server structure (for logging purposes)
-     * @param iterator The user provided callback which will receive
+     * @param s Associated server context (for processing and logging)
+     * @param userctx User defined pointer passed through to the iterator
+     * @param iterator The user provided callback function which will receive
      * individual calls for each unexpired id/data pair
      * @param pool Pool for temporary allocations.
      * @return APR status value; APR_NOTFOUND if the object was not
      * found
      */
     apr_status_t (*iterate)(ap_socache_instance_t *instance, server_rec *s,
-                            ap_socache_iterator_t *iterator,
+                            void *userctx, ap_socache_iterator_t *iterator,
                             apr_pool_t *pool);
 
 } ap_socache_provider_t;

Modified: httpd/httpd/trunk/modules/cache/mod_socache_dbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_dbm.c?rev=958157&r1=958156&r2=958157&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_dbm.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_dbm.c Sat Jun 26 00:26:01 2010
@@ -503,7 +503,7 @@ static void socache_dbm_status(ap_socach
 }
 
 static apr_status_t socache_dbm_iterate(ap_socache_instance_t *ctx,
-                                        server_rec *s,
+                                        server_rec *s, void *userctx,
                                         ap_socache_iterator_t *iterator,
                                         apr_pool_t *pool)
 {
@@ -539,7 +539,8 @@ static apr_status_t socache_dbm_iterate(
                 expired = TRUE;
         }
         if (!expired) {
-            rv = (*iterator)(ctx, s, (unsigned char *)dbmkey.dptr, dbmkey.dsize,
+            rv = (*iterator)(ctx, s, userctx,
+                             (unsigned char *)dbmkey.dptr, dbmkey.dsize,
                              (unsigned char *)dbmval.dptr + sizeof(apr_time_t),
                              dbmval.dsize - sizeof(apr_time_t), pool);
             ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s,

Modified: httpd/httpd/trunk/modules/cache/mod_socache_dc.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_dc.c?rev=958157&r1=958156&r2=958157&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_dc.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_dc.c Sat Jun 26 00:26:01 2010
@@ -155,7 +155,7 @@ static void socache_dc_status(ap_socache
 }
 
 static apr_status_t socache_dc_iterate(ap_socache_instance_t *instance,
-                                       server_rec *s,
+                                       server_rec *s, void *userctx,
                                        ap_socache_iterator_t *iterator,
                                        apr_pool_t *pool)
 {

Modified: httpd/httpd/trunk/modules/cache/mod_socache_memcache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_memcache.c?rev=958157&r1=958156&r2=958157&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_memcache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_memcache.c Sat Jun 26 00:26:01 2010
@@ -288,7 +288,7 @@ static void socache_mc_status(ap_socache
 }
 
 static apr_status_t socache_mc_iterate(ap_socache_instance_t *instance,
-                                       server_rec *s,
+                                       server_rec *s, void *userctx,
                                        ap_socache_iterator_t *iterator,
                                        apr_pool_t *pool)
 {

Modified: httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c?rev=958157&r1=958156&r2=958157&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_socache_shmcb.c Sat Jun 26 00:26:01 2010
@@ -259,6 +259,7 @@ static int shmcb_subcache_remove(server_
 /* Returns result of the (iterator)() call, zero is success (continue) */
 static apr_status_t shmcb_subcache_iterate(ap_socache_instance_t *instance,
                                            server_rec *s,
+                                           void *userctx,
                                            SHMCBHeader *header,
                                            SHMCBSubcache *subcache,
                                            ap_socache_iterator_t *iterator,
@@ -634,7 +635,7 @@ static void socache_shmcb_status(ap_soca
 }
 
 static apr_status_t socache_shmcb_iterate(ap_socache_instance_t *instance,
-                                          server_rec *s,
+                                          server_rec *s, void *userctx,
                                           ap_socache_iterator_t *iterator,
                                           apr_pool_t *pool)
 {
@@ -651,8 +652,8 @@ static apr_status_t socache_shmcb_iterat
     /* Iterate over the subcaches */
     for (loop = 0; loop < header->subcache_num && rv == APR_SUCCESS; loop++)
{
         SHMCBSubcache *subcache = SHMCB_SUBCACHE(header, loop);
-        rv = shmcb_subcache_iterate(instance, s, header, subcache, iterator,
-                                    &buf, &buflen, pool, now);
+        rv = shmcb_subcache_iterate(instance, s, userctx, header, subcache,
+                                    iterator, &buf, &buflen, pool, now);
     }
     return rv;
 }
@@ -911,6 +912,7 @@ static int shmcb_subcache_remove(server_
 
 static apr_status_t shmcb_subcache_iterate(ap_socache_instance_t *instance,
                                            server_rec *s,
+                                           void *userctx,
                                            SHMCBHeader *header,
                                            SHMCBSubcache *subcache,
                                            ap_socache_iterator_t *iterator,
@@ -970,7 +972,7 @@ static apr_status_t shmcb_subcache_itera
                                          data_offset, dest_len);
                 dest[dest_len] = '\0';
 
-                rv = (*iterator)(instance, s, id, idx->id_len,
+                rv = (*iterator)(instance, s, userctx, id, idx->id_len,
                                  dest, dest_len, pool);
                 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s,
                              "shmcb entry iterated");



Mime
View raw message