components/lighttpd/patches/06-fix_lua.patch
changeset 7006 eb24eb49f7c4
parent 7005 6bae9701e86a
child 7007 8aba3abf65e1
equal deleted inserted replaced
7005:6bae9701e86a 7006:eb24eb49f7c4
     1 Developed in-house, fed to community. Developed in order to
       
     2 reflect community issue.
       
     3 http://redmine.lighttpd.net/issues/2421
       
     4 Awaiting accept.
       
     5 
       
     6 --- src/mod_cml_lua.c.orig	2012-10-22 06:17:17.418886286 -0700
       
     7 +++ src/mod_cml_lua.c	2012-10-22 06:25:50.289753316 -0700
       
     8 @@ -28,6 +28,10 @@
       
     9  #include <lualib.h>
       
    10  #include <lauxlib.h>
       
    11  
       
    12 +#if LUA_VERSION_NUM >= 502
       
    13 +#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX
       
    14 +#endif
       
    15 +
       
    16  typedef struct {
       
    17  	stream st;
       
    18  	int done;
       
    19 @@ -291,7 +291,11 @@
       
    20  	lua_settable(L, LUA_GLOBALSINDEX);
       
    21  
       
    22  	/* load lua program */
       
    23 +#if LUA_VERSION_NUM >= 502
       
    24 +	if (lua_load(L, load_file, &rm, fn->ptr, NULL) || lua_pcall(L,0,1,0)) {
       
    25 +#else
       
    26  	if (lua_load(L, load_file, &rm, fn->ptr) || lua_pcall(L,0,1,0)) {
       
    27 +#endif
       
    28  		log_error_write(srv, __FILE__, __LINE__, "s",
       
    29  				lua_tostring(L,-1));
       
    30 
       
    31 --- src/mod_magnet.c	2011-06-13 04:17:01.000000000 -0700
       
    32 +++ src/mod_magnet.c2	2013-10-01 06:39:18.771549986 -0700
       
    33 @@ -24,6 +24,10 @@
       
    34  #define MAGNET_CONFIG_PHYSICAL_PATH "magnet.attract-physical-path-to"
       
    35  #define MAGNET_RESTART_REQUEST      99
       
    36  
       
    37 +#if LUA_VERSION_NUM >= 502
       
    38 +#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX
       
    39 +#endif
       
    40 +
       
    41  /* plugin config for all request/connections */
       
    42  
       
    43  static jmp_buf exceptionjmp;