Application and session functions


Defines

#define rxv_spin_app_strget(ctx, key)   rxv_spin_single_get(rxv_spin_app_get((ctx),(key)))
#define rxv_spin_app_strset(ctx, key, val)   rxv_spin_app_set((ctx),(key),rxv_spin_single((ctx)->pool,(val)))
#define rxv_spin_ses_strget(ctx, key)   rxv_spin_single_get(rxv_spin_ses_get((ctx),(key)))
#define rxv_spin_ses_strset(ctx, key, val)   rxv_spin_ses_set((ctx),(key),rxv_spin_single((ctx)->pool,(val)))

Functions

rxv_spin_data_trxv_spin_app_get (rxv_spin_context_t *ctx, const char *key)
rxv_spin_data_trxv_spin_app_set (rxv_spin_context_t *ctx, const char *key, rxv_spin_data_t *val)
apr_status_t rxv_spin_app_del (rxv_spin_context_t *ctx, const char *key)
rxv_spin_data_trxv_spin_ses_get (rxv_spin_context_t *ctx, const char *key)
rxv_spin_data_trxv_spin_ses_set (rxv_spin_context_t *ctx, const char *key, rxv_spin_data_t *val)
apr_status_t rxv_spin_ses_del (rxv_spin_context_t *ctx, const char *key)
char * rxv_spin_ses_idget (rxv_spin_context_t *ctx)
int rxv_spin_ses_valid (rxv_spin_context_t *ctx)

Detailed Description

Application and session functions (mod_spin API)

Define Documentation

#define rxv_spin_app_strget ( ctx,
key   )     rxv_spin_single_get(rxv_spin_app_get((ctx),(key)))

get a string from application instead of single

#define rxv_spin_app_strset ( ctx,
key,
val   )     rxv_spin_app_set((ctx),(key),rxv_spin_single((ctx)->pool,(val)))

set string into application instead of single

#define rxv_spin_ses_strget ( ctx,
key   )     rxv_spin_single_get(rxv_spin_ses_get((ctx),(key)))

get a string from session instead of single

#define rxv_spin_ses_strset ( ctx,
key,
val   )     rxv_spin_ses_set((ctx),(key),rxv_spin_single((ctx)->pool,(val)))

set string into application instead of single


Function Documentation

rxv_spin_data_t* rxv_spin_app_get ( rxv_spin_context_t ctx,
const char *  key 
)

Retrieve a value from the application database.

Parameters:
ctx Context
key Unique key by which this value is identified
Returns:
pointer to a copy of the value, NULL on error
Example:
 rxv_spin_app_get(ctx,"some application key");

rxv_spin_data_t* rxv_spin_app_set ( rxv_spin_context_t ctx,
const char *  key,
rxv_spin_data_t val 
)

Put value in the application database.

Parameters:
ctx Context
key Unique key by which this value is identified
val Value to be placed in the database (single)
Returns:
pointer to the value, NULL on error
Example:
 rxv_spin_app_set(ctx,"some application key",
                      rxv_spin_str_single(ctx->pool,"some application value"));

apr_status_t rxv_spin_app_del ( rxv_spin_context_t ctx,
const char *  key 
)

Delete a record in the application database.

Parameters:
ctx Context
key Unique key by which record is identified
Returns:
APR_SUCCESS on success, otherwise an error
Example:
 rxv_spin_app_del(ctx,"some application key");
Remarks:
It is not an error to delete and non-existent record.

rxv_spin_data_t* rxv_spin_ses_get ( rxv_spin_context_t ctx,
const char *  key 
)

Retrieve a value from the session database.

Parameters:
ctx Context
key Unique key by which this value is identified
Returns:
pointer to a copy of the value, NULL on error
Example:
 rxv_spin_app_get(ctx,"some session key");

rxv_spin_data_t* rxv_spin_ses_set ( rxv_spin_context_t ctx,
const char *  key,
rxv_spin_data_t val 
)

Put value in the session database.

Parameters:
ctx Context
key Unique key by which this value is identified
val Value to be placed in the database (single)
Returns:
pointer to a copy of the value, NULL on error
Example:
 rxv_spin_app_set(ctx,"some session key",
                      rxv_spin_str_single(ctx->pool,"some session value"));

apr_status_t rxv_spin_ses_del ( rxv_spin_context_t ctx,
const char *  key 
)

Delete a record in the session database.

Parameters:
ctx Context
key Unique key by which record is identified
Returns:
APR_SUCCESS on success, otherwise an error
Example:
 rxv_spin_ses_del(ctx,"some session key");
Remarks:
It is not an error to delete and non-existent record.

char* rxv_spin_ses_idget ( rxv_spin_context_t ctx  ) 

Get session id

Parameters:
ctx Context
Returns:
Session id or NULL if no session support exists
Example:
Remarks:
This function fetches a string representation of the session id, which draws is origin from mod_unique_id. If mod_unique_id isn't present in Apache, this function returns NULL. Note that the fact that one can get a session id does not mean that there is a valid session in existence (that is to say, that the client accepted the session). Use rxv_spin_ses_valid() function to find that out.

int rxv_spin_ses_valid ( rxv_spin_context_t ctx  ) 

Find out if the session is valid.

Parameters:
ctx Context
Returns:
1 if valid, otherwise 0
Example:
Remarks:
If the client accepted this session, this function returns 1. This will only be true if the client submitted a valid session id and its relevant hash to mod_spin. Also, the session will not be considered valid if there are path tricks in the session id (this is unlikely to happen, due to hash checking, but nevertheless).


Generated on Sun Sep 9 04:54:12 2007 for mod_spin by  doxygen 1.5.3