Commit merge jocelyn changes

This commit is contained in:
Javier Velilla
2011-05-30 23:16:58 -03:00
6 changed files with 59 additions and 61 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
EIFGENs

View File

@@ -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>

View File

@@ -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 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
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)

View File

@@ -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)
@@ -136,13 +137,20 @@ feature -- Parsing
end_of_stream
loop
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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
note
note
description : "nino application root class"
date : "$Date$"
revision : "$Revision$"
@@ -35,3 +35,4 @@ feature -- Access
default_document_root: STRING = "webroot"
end