to cache up to 'maxCacheSeconds' as set by osrfCacheInit()
@return 0 on success, -1 on error
*/
-int osrfCachePutObject( char* key, const jsonObject* obj, time_t seconds );
+int osrfCachePutObject( const char* key, const jsonObject* obj, time_t seconds );
/**
Puts a string into the cache
to cache up to 'maxCacheSeconds' as set by osrfCacheInit()
@return 0 on success, -1 on error
*/
-int osrfCachePutString( char* key, const char* value, time_t seconds);
+int osrfCachePutString( const char* key, const char* value, time_t seconds);
/**
Grabs an object from the cache.
jsonObjectSetKey(cacheObj, "ip", jsonNewObject(trans->remoteHost));
jsonObjectSetKey(cacheObj, "jid", jsonNewObject(jid));
jsonObjectSetKey(cacheObj, "service", jsonNewObject(trans->service));
- osrfCachePutObject((char*) trans->thread, cacheObj, CACHE_TIME);
+ osrfCachePutObject(trans->thread, cacheObj, CACHE_TIME);
}
return 0;
}
-int osrfCachePutObject( char* key, const jsonObject* obj, time_t seconds ) {
+int osrfCachePutObject( const char* key, const jsonObject* obj, time_t seconds ) {
if( !(key && obj) ) return -1;
char* s = jsonObjectToJSON( obj );
osrfLogInternal( OSRF_LOG_MARK, "osrfCachePut(): Putting object (key=%s): %s", key, s);
return 0;
}
-int osrfCachePutString( char* key, const char* value, time_t seconds ) {
+int osrfCachePutString( const char* key, const char* value, time_t seconds ) {
memcached_return rc;
if( !(key && value) ) return -1;
seconds = (seconds <= 0 || seconds > _osrfCacheMaxSeconds) ? _osrfCacheMaxSeconds : seconds;