Create a cache for the session by making the session's userData member point
to an osrfHash instance.
*/
-static void initSessionCache( osrfMethodContext* ctx ) {
+static osrfHash* initSessionCache( osrfMethodContext* ctx ) {
ctx->session->userData = osrfNewHash();
osrfHashSetCallback( (osrfHash*) ctx->session->userData, &sessionDataFree );
ctx->session->userDataFree = &userDataFree;
+ return ctx->session->userData;
}
/**
// If the session doesn't already have a hash, create one. Make sure
// that the application session frees the hash when it terminates.
if( NULL == cache )
- initSessionCache( ctx );
+ cache = initSessionCache( ctx );
// Save the transaction id in the hash, with the key "xact_id"
osrfHashSet( cache, strdup( session->session_id ), "xact_id" );
// If the session doesn't already have a hash, create one. Make sure
// that the application session frees the hash when it terminates.
if( NULL == cache )
- initSessionCache( ctx );
+ cache = initSessionCache( ctx );
osrfHash* pcache = osrfHashGet(cache, "pcache");
// If the session doesn't already have a hash, create one. Make sure
// that the application session frees the hash when it terminates.
if( NULL == cache )
- initSessionCache( ctx );
+ cache = initSessionCache( ctx );
if( user_login )
osrfHashSet( cache, user_login, "user_login" );
// If the session doesn't already have a hash, create one. Make sure
// that the application session frees the hash when it terminates.
if( NULL == cache )
- initSessionCache( ctx );
+ cache = initSessionCache( ctx );
// Save the transaction id in the hash, with the key "xact_id"
if( authkey && *authkey )
char* pkey = osrfHashGet( class_meta, "primarykey" );
if (!ctx->session->userData)
- initSessionCache( ctx );
+ (void) initSessionCache( ctx );
char *methodtype = osrfHashGet( (osrfHash *) ctx->method->userData, "methodtype" );
char *inside_verify = osrfHashGet( (osrfHash*) ctx->session->userData, "inside_verify" );