httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r664224 - in /httpd/httpd/trunk/modules/session: mod_session.c mod_session.h
Date Sat, 07 Jun 2008 00:59:04 GMT
Author: wrowe
Date: Fri Jun  6 17:59:04 2008
New Revision: 664224

URL: http://svn.apache.org/viewvc?rev=664224&view=rev
Log:
You don't export the local registered functions
when using optional fn's and hooks.

Modified:
    httpd/httpd/trunk/modules/session/mod_session.c
    httpd/httpd/trunk/modules/session/mod_session.h

Modified: httpd/httpd/trunk/modules/session/mod_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.c?rev=664224&r1=664223&r2=664224&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session.c Fri Jun  6 17:59:04 2008
@@ -32,13 +32,13 @@
                 APR_HOOK_LINK(session_encode)
                 APR_HOOK_LINK(session_decode)
 )
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(session, SESSION, int, session_load,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, SESSION, int, session_load,
                       (request_rec * r, session_rec ** z), (r, z), DECLINED)
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(session, SESSION, int, session_save,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, SESSION, int, session_save,
                        (request_rec * r, session_rec * z), (r, z), DECLINED)
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(session, SESSION, int, session_encode,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ap, SESSION, int, session_encode,
                    (request_rec * r, session_rec * z), (r, z), OK, DECLINED)
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(session, SESSION, int, session_decode,
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ap, SESSION, int, session_decode,
                    (request_rec * r, session_rec * z), (r, z), OK, DECLINED)
 
 static int session_identity_encode(request_rec * r, session_rec * z);
@@ -82,54 +82,6 @@
 }
 
 /**
- * Get a particular value from the session.
- * @param r The current request.
- * @param z The current session. If this value is NULL, the session will be
- * looked up in the request, created if necessary, and saved to the request
- * notes.
- * @param key The key to get.
- * @param value The buffer to write the value to.
- */
-SESSION_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *key, const
char **value)
-{
-    if (!z) {
-        ap_session_load(r, &z);
-    }
-    if (z && z->entries) {
-        *value = apr_table_get(z->entries, key);
-    }
-}
-
-/**
- * Set a particular value to the session.
- *
- * Using this method ensures that the dirty flag is set correctly, so that
- * the session can be saved efficiently.
- * @param r The current request.
- * @param z The current session. If this value is NULL, the session will be
- * looked up in the request, created if necessary, and saved to the request
- * notes.
- * @param key The key to set. The existing key value will be replaced.
- * @param value The value to set.
- */
-SESSION_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
-                                const char *key, const char *value)
-{
-    if (!z) {
-        ap_session_load(r, &z);
-    }
-    if (z) {
-        if (value) {
-            apr_table_set(z->entries, key, value);
-        }
-        else {
-            apr_table_unset(z->entries, key);
-        }
-        z->dirty = 1;
-    }
-}
-
-/**
  * Load the session.
  *
  * If the session doesn't exist, a blank one will be created.
@@ -137,7 +89,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-SESSION_DECLARE(int) ap_session_load(request_rec * r, session_rec ** z)
+static int ap_session_load(request_rec * r, session_rec ** z)
 {
 
     session_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
@@ -216,7 +168,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-SESSION_DECLARE(int) ap_session_save(request_rec * r, session_rec * z)
+static int ap_session_save(request_rec * r, session_rec * z)
 {
     if (z) {
         apr_time_t now = apr_time_now();
@@ -268,6 +220,54 @@
 
 }
 
+/**
+ * Get a particular value from the session.
+ * @param r The current request.
+ * @param z The current session. If this value is NULL, the session will be
+ * looked up in the request, created if necessary, and saved to the request
+ * notes.
+ * @param key The key to get.
+ * @param value The buffer to write the value to.
+ */
+static void ap_session_get(request_rec * r, session_rec * z, const char *key, const char
**value)
+{
+    if (!z) {
+        ap_session_load(r, &z);
+    }
+    if (z && z->entries) {
+        *value = apr_table_get(z->entries, key);
+    }
+}
+
+/**
+ * Set a particular value to the session.
+ *
+ * Using this method ensures that the dirty flag is set correctly, so that
+ * the session can be saved efficiently.
+ * @param r The current request.
+ * @param z The current session. If this value is NULL, the session will be
+ * looked up in the request, created if necessary, and saved to the request
+ * notes.
+ * @param key The key to set. The existing key value will be replaced.
+ * @param value The value to set.
+ */
+static void ap_session_set(request_rec * r, session_rec * z,
+                                const char *key, const char *value)
+{
+    if (!z) {
+        ap_session_load(r, &z);
+    }
+    if (z) {
+        if (value) {
+            apr_table_set(z->entries, key, value);
+        }
+        else {
+            apr_table_unset(z->entries, key);
+        }
+        z->dirty = 1;
+    }
+}
+
 static int identity_count(int *count, const char *key, const char *val)
 {
     *count += strlen(key) * 3 + strlen(val) * 3 + 1;
@@ -396,7 +396,7 @@
  * The same session might appear in more than one request. The first
  * attempt to save the session will be called
  */
-static apr_status_t ap_session_output_filter(ap_filter_t * f,
+static apr_status_t session_output_filter(ap_filter_t * f,
                                                     apr_bucket_brigade * in)
 {
 
@@ -446,7 +446,7 @@
 /**
  * Insert the output filter.
  */
-static void ap_session_insert_output_filter(request_rec * r)
+static void session_insert_output_filter(request_rec * r)
 {
     ap_add_output_filter("MOD_SESSION_OUT", NULL, r, r->connection);
 }
@@ -599,14 +599,17 @@
 
 static void register_hooks(apr_pool_t * p)
 {
-    ap_register_output_filter("MOD_SESSION_OUT", ap_session_output_filter,
+    ap_register_output_filter("MOD_SESSION_OUT", session_output_filter,
                               NULL, AP_FTYPE_CONTENT_SET);
-    ap_hook_insert_filter(ap_session_insert_output_filter, NULL, NULL, APR_HOOK_MIDDLE);
-    ap_hook_insert_error_filter(ap_session_insert_output_filter,
+    ap_hook_insert_filter(session_insert_output_filter, NULL, NULL,
+                          APR_HOOK_MIDDLE);
+    ap_hook_insert_error_filter(session_insert_output_filter,
                                 NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_fixups(session_fixups, NULL, NULL, APR_HOOK_MIDDLE);
-    ap_hook_session_encode(session_identity_encode, NULL, NULL, APR_HOOK_REALLY_FIRST);
-    ap_hook_session_decode(session_identity_decode, NULL, NULL, APR_HOOK_REALLY_LAST);
+    ap_hook_session_encode(session_identity_encode, NULL, NULL,
+                           APR_HOOK_REALLY_FIRST);
+    ap_hook_session_decode(session_identity_decode, NULL, NULL,
+                           APR_HOOK_REALLY_LAST);
     APR_REGISTER_OPTIONAL_FN(ap_session_get);
     APR_REGISTER_OPTIONAL_FN(ap_session_set);
     APR_REGISTER_OPTIONAL_FN(ap_session_load);

Modified: httpd/httpd/trunk/modules/session/mod_session.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.h?rev=664224&r1=664223&r2=664224&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session.h (original)
+++ httpd/httpd/trunk/modules/session/mod_session.h Fri Jun  6 17:59:04 2008
@@ -118,42 +118,6 @@
 } session_dir_conf;
 
 /**
- * Get a particular value from the session.
- * @param r The current request.
- * @param z The current session. If this value is NULL, the session will be
- * looked up in the request, created if necessary, and saved to the request
- * notes.
- * @param key The key to get.
- * @param value The buffer to write the value to.
- */
-SESSION_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *key, const
char **value);
-
-/**
- * Set a particular value to the session.
- *
- * Using this method ensures that the dirty flag is set correctly, so that
- * the session can be saved efficiently.
- * @param r The current request.
- * @param z The current session. If this value is NULL, the session will be
- * looked up in the request, created if necessary, and saved to the request
- * notes.
- * @param key The key to set. The existing key value will be replaced.
- * @param value The value to set.
- */
-SESSION_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
-                                const char *key, const char *value);
-
-/**
- * Load the session.
- *
- * If the session doesn't exist, a blank one will be created.
- *
- * @param r The request
- * @param z A pointer to where the session will be written.
- */
-SESSION_DECLARE(int) ap_session_load(request_rec * r, session_rec ** z);
-
-/**
  * Hook to load the session.
  *
  * If the session doesn't exist, a blank one will be created.
@@ -161,21 +125,10 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_load,
+APR_DECLARE_EXTERNAL_HOOK(ap, SESSION, int, session_load,
                           (request_rec * r, session_rec ** z))
 
 /**
- * Save the session.
- *
- * In most implementations the session is only saved if the dirty flag is
- * true. This prevents the session being saved unnecessarily.
- *
- * @param r The request
- * @param z A pointer to where the session will be written.
- */
-SESSION_DECLARE(int) ap_session_save(request_rec * r, session_rec * z);
-
-/**
  * Hook to save the session.
  *
  * In most implementations the session is only saved if the dirty flag is
@@ -184,7 +137,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_save,
+APR_DECLARE_EXTERNAL_HOOK(ap, SESSION, int, session_save,
                           (request_rec * r, session_rec * z))
 
 /**
@@ -197,7 +150,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_encode,
+APR_DECLARE_EXTERNAL_HOOK(ap, SESSION, int, session_encode,
                           (request_rec * r, session_rec * z))
 
 /**
@@ -210,7 +163,7 @@
  * @param r The request
  * @param z A pointer to where the session will be written.
  */
-APR_DECLARE_EXTERNAL_HOOK(session, SESSION, int, session_decode,
+APR_DECLARE_EXTERNAL_HOOK(ap, SESSION, int, session_decode,
                           (request_rec * r, session_rec * z))
 
 APR_DECLARE_OPTIONAL_FN(void, ap_session_get, (request_rec * r, session_rec * z,



Mime
View raw message