Commit merge jocelyn changes
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
EIFGENs
|
||||
6
nino.ecf
6
nino.ecf
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="nino" uuid="32C1D67D-33DE-4F1E-864B-D45388F2E3E6" library_target="nino">
|
||||
<target name="nino">
|
||||
<root class="APPLICATION" feature="make"/>
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
<exclude>/.git$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
@@ -15,7 +15,7 @@
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net-safe.ecf"/>
|
||||
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
|
||||
<cluster name="nino" location=".\src" recursive="true">
|
||||
<cluster name="nino" location=".\src\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>head_request_handler.e</exclude>
|
||||
<exclude>shared_http_request_handlers.e</exclude>
|
||||
|
||||
16
src/README
16
src/README
@@ -1,17 +1,5 @@
|
||||
Eiffel Web Nino is an HTTPD server. It's a work in progress, so maybe it will be refactored.
|
||||
The goal of is to provide a simple web server for development (like Java, Python and Ruby provide).
|
||||
Eiffel Web Nino is and HTTPD server. It's a work in progress, so maybe it will be refactored.
|
||||
The goal of is to provide a simple web server for development (like Java, Python and Ruby provide)
|
||||
|
||||
|
||||
Eiffel Web Nino Directory Structure (WIP: Work in Progress)
|
||||
====================================
|
||||
src
|
||||
configuration -- Classes to handle the httpd server configuration, single/multithread setup
|
||||
io -- Classes to handle the input and output string to/from the server
|
||||
request -- Classes to handle different types of request.
|
||||
response
|
||||
|
||||
web_server
|
||||
test
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ feature -- Execution
|
||||
l_remote_info.addr := l_addr.host_address.host_address
|
||||
l_remote_info.hostname := l_addr.host_address.host_name
|
||||
l_remote_info.port := l_addr.port
|
||||
remote_info := l_remote_info
|
||||
end
|
||||
|
||||
analyze_request_message (l_input)
|
||||
@@ -117,9 +118,9 @@ feature -- Parsing
|
||||
input_readable: a_input /= Void and then a_input.is_readable
|
||||
local
|
||||
end_of_stream : BOOLEAN
|
||||
pos : INTEGER
|
||||
pos,n : INTEGER
|
||||
line : STRING
|
||||
val: STRING
|
||||
k, val: STRING
|
||||
txt: STRING
|
||||
do
|
||||
create txt.make (64)
|
||||
@@ -135,14 +136,21 @@ feature -- Parsing
|
||||
until
|
||||
end_of_stream
|
||||
loop
|
||||
line := a_input.last_string
|
||||
line := a_input.last_string
|
||||
n := line.count
|
||||
print ("%N" +line+ "%N")
|
||||
pos := line.index_of (':',1)
|
||||
val := line.substring (pos + 1, line.count)
|
||||
if val[val.count] = '%R' then
|
||||
val.remove_tail (1)
|
||||
if pos > 0 then
|
||||
k := line.substring(1, pos-1)
|
||||
if line[pos+1].is_space then
|
||||
pos := pos + 1
|
||||
end
|
||||
if line[n] = '%R' then
|
||||
n := n - 1
|
||||
end
|
||||
val := line.substring (pos + 1, n)
|
||||
request_header_map.put (val, k)
|
||||
end
|
||||
request_header_map.put (val, line.substring (1,pos-1))
|
||||
txt.append (line)
|
||||
txt.append_character ('%N')
|
||||
if line.is_empty or else line[1] = '%R' then
|
||||
|
||||
@@ -18,6 +18,7 @@ feature -- Initialization
|
||||
make (cfg: like configuration)
|
||||
do
|
||||
configuration := cfg
|
||||
set_server_configuration (configuration)
|
||||
end
|
||||
|
||||
setup (a_http_handler : HTTP_HANDLER)
|
||||
@@ -27,7 +28,6 @@ feature -- Initialization
|
||||
print("%N%N%N")
|
||||
print ("Starting Web Application Server (port="+ configuration.http_server_port.out +"):%N")
|
||||
stop_requested := False
|
||||
set_server_configuration (configuration)
|
||||
if configuration.force_single_threaded then
|
||||
a_http_handler.execute
|
||||
else
|
||||
|
||||
@@ -1,37 +1,38 @@
|
||||
note
|
||||
description : "nino application root class"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
note
|
||||
description : "nino application root class"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
ARGUMENTS
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
local
|
||||
l_server : HTTP_SERVER
|
||||
l_cfg: HTTP_SERVER_CONFIGURATION
|
||||
l_http_handler : HTTP_HANDLER
|
||||
do
|
||||
create l_cfg.make
|
||||
l_cfg.http_server_port := 9_000
|
||||
l_cfg.document_root := default_document_root
|
||||
|
||||
create l_server.make (l_cfg)
|
||||
create {APPLICATION_CONNECTION_HANDLER} l_http_handler.make (l_server, "HTTP_HANDLER")
|
||||
l_server.setup (l_http_handler)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
default_document_root: STRING = "webroot"
|
||||
|
||||
end
|
||||
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
ARGUMENTS
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
local
|
||||
l_server : HTTP_SERVER
|
||||
l_cfg: HTTP_SERVER_CONFIGURATION
|
||||
l_http_handler : HTTP_HANDLER
|
||||
do
|
||||
create l_cfg.make
|
||||
l_cfg.http_server_port := 9_000
|
||||
l_cfg.document_root := default_document_root
|
||||
|
||||
create l_server.make (l_cfg)
|
||||
create {APPLICATION_CONNECTION_HANDLER} l_http_handler.make (l_server, "HTTP_HANDLER")
|
||||
l_server.setup (l_http_handler)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
default_document_root: STRING = "webroot"
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user