mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
Fixed mod_lua.
Added some casts to make picky compilers happy; changed vm_release() proto and call. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -368,7 +368,7 @@ static apr_status_t vm_destruct(void *vm, void *params, apr_pool_t *pool)
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
static apr_status_t vm_release(lua_State* vm)
|
||||
static apr_status_t vm_release(void *vm)
|
||||
{
|
||||
apr_reslist_t* reslist;
|
||||
lua_pushlightuserdata(vm,vm);
|
||||
@@ -391,7 +391,8 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
|
||||
if (spec->scope == APL_SCOPE_SERVER) {
|
||||
apr_reslist_t *reslist;
|
||||
|
||||
if (apr_pool_userdata_get(&reslist,"mod_lua",spec->pool)==APR_SUCCESS) {
|
||||
if (apr_pool_userdata_get((void **)&reslist,
|
||||
"mod_lua", spec->pool) == APR_SUCCESS) {
|
||||
if(reslist==NULL) {
|
||||
if(apr_reslist_create(&reslist,
|
||||
spec->vm_server_pool_min,
|
||||
@@ -404,23 +405,25 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
|
||||
spec->pool)!=APR_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
apr_pool_userdata_set(reslist, "mod_lua", vm_reslist_destroy, spec->pool);
|
||||
apr_pool_userdata_set(reslist, "mod_lua",
|
||||
vm_reslist_destroy, spec->pool);
|
||||
}
|
||||
apr_reslist_acquire(reslist, &L);
|
||||
apr_reslist_acquire(reslist, (void **)&L);
|
||||
lua_pushlightuserdata(L, L);
|
||||
lua_pushlightuserdata(L, reslist);
|
||||
lua_rawset(L,LUA_REGISTRYINDEX);
|
||||
apr_pool_userdata_set(L, spec->file, vm_release, lifecycle_pool);
|
||||
apr_pool_userdata_set(L, spec->file, &vm_release, lifecycle_pool);
|
||||
}
|
||||
} else {
|
||||
if (apr_pool_userdata_get((void **) &L, spec->file, lifecycle_pool)==APR_SUCCESS) {
|
||||
if (apr_pool_userdata_get((void **)&L, spec->file,
|
||||
lifecycle_pool) == APR_SUCCESS) {
|
||||
|
||||
if(L==NULL) {
|
||||
ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, lifecycle_pool,
|
||||
"creating lua_State with file %s", spec->file);
|
||||
/* not available, so create */
|
||||
|
||||
if(!vm_construct(&L, spec, lifecycle_pool))
|
||||
if(!vm_construct((void **)&L, spec, lifecycle_pool))
|
||||
apr_pool_userdata_set(L, spec->file, &cleanup_lua, lifecycle_pool);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user