You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2008/04/09 01:12:13 UTC
svn commit: r646126 - in /httpd/httpd/trunk/modules/session: mod_session.c
mod_session_cookie.c mod_session_crypto.c mod_session_dbd.c
Author: minfrin
Date: Tue Apr 8 16:12:12 2008
New Revision: 646126
URL: http://svn.apache.org/viewvc?rev=646126&view=rev
Log:
Insert prototypes to remove compiler warnings. [Joe Orton]
Modified:
httpd/httpd/trunk/modules/session/mod_session.c
httpd/httpd/trunk/modules/session/mod_session_cookie.c
httpd/httpd/trunk/modules/session/mod_session_crypto.c
httpd/httpd/trunk/modules/session/mod_session_dbd.c
Modified: httpd/httpd/trunk/modules/session/mod_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.c?rev=646126&r1=646125&r2=646126&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session.c Tue Apr 8 16:12:12 2008
@@ -40,13 +40,18 @@
(request_rec * r, session_rec * z), (r, z), OK, DECLINED)
AP_IMPLEMENT_HOOK_RUN_ALL(int, session_decode,
(request_rec * r, session_rec * z), (r, z), OK, DECLINED)
+
+AP_DECLARE(int) ap_session_identity_encode(request_rec * r, session_rec * z);
+AP_DECLARE(int) ap_session_identity_decode(request_rec * r, session_rec * z);
+AP_DECLARE(int) ap_session_fixups(request_rec * r);
+
/**
* Should the session be included within this URL.
*
* This function tests whether a session is valid for this URL. It uses the
* include and exclude arrays to determine whether they should be included.
*/
- static int session_included(request_rec * r, session_dir_conf * conf)
+static int session_included(request_rec * r, session_dir_conf * conf)
{
const char **includes = (const char **) conf->includes->elts;
Modified: httpd/httpd/trunk/modules/session/mod_session_cookie.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session_cookie.c?rev=646126&r1=646125&r2=646126&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session_cookie.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session_cookie.c Tue Apr 8 16:12:12 2008
@@ -39,6 +39,9 @@
int remove_set;
} session_cookie_dir_conf;
+AP_DECLARE(int) ap_session_cookie_save(request_rec * r, session_rec * z);
+AP_DECLARE(int) ap_session_cookie_load(request_rec * r, session_rec ** z);
+
/**
* Set the cookie and embed the session within it.
*
Modified: httpd/httpd/trunk/modules/session/mod_session_crypto.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session_crypto.c?rev=646126&r1=646125&r2=646126&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session_crypto.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session_crypto.c Tue Apr 8 16:12:12 2008
@@ -46,6 +46,11 @@
int engine_set;
} session_crypto_dir_conf;
+AP_DECLARE(int) ap_session_crypto_encode(request_rec * r, session_rec * z);
+AP_DECLARE(int) ap_session_crypto_decode(request_rec * r, session_rec * z);
+AP_DECLARE(int) ap_session_crypto_init(apr_pool_t *p, apr_pool_t *plog,
+ apr_pool_t *ptemp, server_rec *s);
+
/**
* Initialise the encryption as per the current config.
*
Modified: httpd/httpd/trunk/modules/session/mod_session_dbd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session_dbd.c?rev=646126&r1=646125&r2=646126&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session_dbd.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session_dbd.c Tue Apr 8 16:12:12 2008
@@ -48,6 +48,10 @@
const char *deletelabel;
} session_dbd_dir_conf;
+AP_DECLARE(int) ap_session_dbd_load(request_rec * r, session_rec ** z);
+AP_DECLARE(int) ap_session_dbd_save(request_rec * r, session_rec * z);
+AP_DECLARE(int) ap_session_dbd_monitor(apr_pool_t *p);
+
/* optional function - look it up once in post_config */
static ap_dbd_t *(*session_dbd_acquire_fn) (request_rec *) = NULL;
static void (*session_dbd_prepare_fn) (server_rec *, const char *, const char *) = NULL;
Re: svn commit: r646126 - in
/httpd/httpd/trunk/modules/session:mod_session.c
mod_session_cookie.c mod_session_crypto.c mod_session_dbd.c
Posted by Guenter Knauf <fu...@apache.org>.
Hi Ruediger,
> 1. Why using AP_DECLARE for functions that seem to be clearly used as
> functions
> local to this file. IMHO static int would be better.
> 2. Why using an ap_ prefix for a local function? IMHO only exported
> function
> should get this prefix. Otherwise you might get confused reading the
> code
> by assuming that these functions get exported.
> BTW: This comment is valid for all session stuff.
from what I see mod_session does indeed export at least these:
ap_hook_session_decode
ap_hook_session_encode
ap_hook_session_load
ap_hook_session_save
and f.e. mod_session_crypt does then consume them;
on NetWare I need to manually control these exports / imports and tell them to the linker.
Guenter.
Re: svn commit: r646126 - in /httpd/httpd/trunk/modules/session:
mod_session.c mod_session_cookie.c mod_session_crypto.c mod_session_dbd.c
Posted by Ruediger Pluem <rp...@apache.org>.
On 09.04.2008 01:12, minfrin@apache.org wrote:
> Author: minfrin
> Date: Tue Apr 8 16:12:12 2008
> New Revision: 646126
>
> URL: http://svn.apache.org/viewvc?rev=646126&view=rev
> Log:
> Insert prototypes to remove compiler warnings. [Joe Orton]
>
> Modified:
> httpd/httpd/trunk/modules/session/mod_session.c
> httpd/httpd/trunk/modules/session/mod_session_cookie.c
> httpd/httpd/trunk/modules/session/mod_session_crypto.c
> httpd/httpd/trunk/modules/session/mod_session_dbd.c
>
> Modified: httpd/httpd/trunk/modules/session/mod_session.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.c?rev=646126&r1=646125&r2=646126&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/session/mod_session.c (original)
> +++ httpd/httpd/trunk/modules/session/mod_session.c Tue Apr 8 16:12:12 2008
> @@ -40,13 +40,18 @@
> (request_rec * r, session_rec * z), (r, z), OK, DECLINED)
> AP_IMPLEMENT_HOOK_RUN_ALL(int, session_decode,
> (request_rec * r, session_rec * z), (r, z), OK, DECLINED)
> +
> +AP_DECLARE(int) ap_session_identity_encode(request_rec * r, session_rec * z);
> +AP_DECLARE(int) ap_session_identity_decode(request_rec * r, session_rec * z);
> +AP_DECLARE(int) ap_session_fixups(request_rec * r);
> +
Two questions:
1. Why using AP_DECLARE for functions that seem to be clearly used as functions
local to this file. IMHO static int would be better.
2. Why using an ap_ prefix for a local function? IMHO only exported function
should get this prefix. Otherwise you might get confused reading the code
by assuming that these functions get exported.
BTW: This comment is valid for all session stuff.
Regards
RĂ¼diger
P.S.: Please add an appropriate [auto-props] config to your subversion client
config to avoid the eol-style mess we had recently in the future.