components/lighttpd/patches/06-fix_lua.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Tue, 05 Apr 2016 05:41:03 -0700
changeset 5738 fc0e1d002c9e
parent 1571 7422f066784c
permissions -rw-r--r--
23061200 Upgrade lighttpd to version 1.4.39
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1571
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
     1
Developed in-house, fed to community. Developed in order to
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
     2
reflect community issue.
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
     3
http://redmine.lighttpd.net/issues/2421
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
     4
Awaiting accept.
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
     5
1028
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     6
--- src/mod_cml_lua.c.orig	2012-10-22 06:17:17.418886286 -0700
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     7
+++ src/mod_cml_lua.c	2012-10-22 06:25:50.289753316 -0700
1571
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
     8
@@ -28,6 +28,10 @@
1028
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     9
 #include <lualib.h>
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    10
 #include <lauxlib.h>
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    11
 
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    12
+#if LUA_VERSION_NUM >= 502
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    13
+#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    14
+#endif
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    15
+
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    16
 typedef struct {
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    17
 	stream st;
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    18
 	int done;
5738
fc0e1d002c9e 23061200 Upgrade lighttpd to version 1.4.39
Petr Sumbera <petr.sumbera@oracle.com>
parents: 1571
diff changeset
    19
@@ -291,7 +291,11 @@
1028
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    20
 	lua_settable(L, LUA_GLOBALSINDEX);
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    21
 
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    22
 	/* load lua program */
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    23
+#if LUA_VERSION_NUM >= 502
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    24
+	if (lua_load(L, load_file, &rm, fn->ptr, NULL) || lua_pcall(L,0,1,0)) {
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    25
+#else
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    26
 	if (lua_load(L, load_file, &rm, fn->ptr) || lua_pcall(L,0,1,0)) {
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    27
+#endif
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    28
 		log_error_write(srv, __FILE__, __LINE__, "s",
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    29
 				lua_tostring(L,-1));
1571
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    30
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    31
--- src/mod_magnet.c	2011-06-13 04:17:01.000000000 -0700
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    32
+++ src/mod_magnet.c2	2013-10-01 06:39:18.771549986 -0700
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    33
@@ -24,6 +24,10 @@
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    34
 #define MAGNET_CONFIG_PHYSICAL_PATH "magnet.attract-physical-path-to"
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    35
 #define MAGNET_RESTART_REQUEST      99
1028
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    36
 
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    37
+#if LUA_VERSION_NUM >= 502
1571
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    38
+#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX
1028
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    39
+#endif
1571
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    40
+
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    41
 /* plugin config for all request/connections */
1028
30d7999e80d9 7203970 lua update breaks things
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    42
 
1571
7422f066784c 17600553 Upgrade lighttpd to version 1.4.33
Jiri Kukacka <jiri.kukacka@oracle.com>
parents: 1028
diff changeset
    43
 static jmp_buf exceptionjmp;