changeset 1170:3a0f58d09ee7

add use_jetty
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 11 Feb 2018 02:34:35 -0700
parents 96e7b49ce013
children 794ddcfbee20
files src/luan/host/Init.luan src/luan/modules/http/Http.luan src/luan/modules/http/Implementation.luan src/luan/modules/http/Server.luan src/luan/modules/http/impl/Http.luan src/luan/modules/http/impl/LuanHandler.java src/luan/modules/http/jetty/Http.luan src/luan/modules/http/jetty/serve.luan src/luan/modules/http/jetty/use_jetty.luan
diffstat 9 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/host/Init.luan	Thu Feb 08 22:00:45 2018 -0700
+++ b/src/luan/host/Init.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -1,3 +1,4 @@
+require "luan:http/jetty/use_jetty.luan"
 local Luan = require "luan:Luan.luan"
 local error = Luan.error
 local String = require "luan:String.luan"
--- a/src/luan/modules/http/Http.luan	Thu Feb 08 22:00:45 2018 -0700
+++ b/src/luan/modules/http/Http.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -1,2 +1,1 @@
-local Implementation = require "luan:http/Implementation.luan"
-return require(Implementation.luan.."Http.luan")
+return require "luan:http/impl/Http.luan"
--- a/src/luan/modules/http/Implementation.luan	Thu Feb 08 22:00:45 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-return {
-	luan = "luan:http/jetty/"
---	luan = "luan:http/impl/"
-}
--- a/src/luan/modules/http/Server.luan	Thu Feb 08 22:00:45 2018 -0700
+++ b/src/luan/modules/http/Server.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -1,2 +1,1 @@
-local Implementation = require "luan:http/Implementation.luan"
-return require(Implementation.luan.."Server.luan")
+return require "luan:http/impl/Server.luan"
--- a/src/luan/modules/http/impl/Http.luan	Thu Feb 08 22:00:45 2018 -0700
+++ b/src/luan/modules/http/impl/Http.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -25,6 +25,8 @@
 
 local Http = {}
 
+Http.version = "impl"
+
 function Http.new_request(java)
 	local this = {}
 	Http.request = this
--- a/src/luan/modules/http/impl/LuanHandler.java	Thu Feb 08 22:00:45 2018 -0700
+++ b/src/luan/modules/http/impl/LuanHandler.java	Sun Feb 11 02:34:35 2018 -0700
@@ -7,8 +7,6 @@
 import java.net.BindException;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import luan.webserver.Request;
--- a/src/luan/modules/http/jetty/Http.luan	Thu Feb 08 22:00:45 2018 -0700
+++ b/src/luan/modules/http/jetty/Http.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -19,6 +19,8 @@
 
 local Http = {}
 
+Http.version = "jetty"
+
 local function sent_error(_,_,_)
 	error "headers are not accessible after you start writing content"
 end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/luan/modules/http/jetty/serve.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -0,0 +1,3 @@
+require "luan:http/jetty/use_jetty.luan"
+local Luan = require "luan:Luan.luan"
+Luan.load_file("luan:http/serve.luan")(...)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/luan/modules/http/jetty/use_jetty.luan	Sun Feb 11 02:34:35 2018 -0700
@@ -0,0 +1,4 @@
+local Package = require "luan:Package.luan"
+Package.loaded["luan:http/Http.luan"] = require "luan:http/jetty/Http.luan"
+Package.loaded["luan:http/Server.luan"] = require "luan:http/jetty/Server.luan"
+return true