Compare commits

..

5 Commits

Author SHA1 Message Date
80254b2278 When possible keep ecf location relative within the same EiffelWeb directory structure. 2016-08-06 10:07:42 +02:00
8b172b5d33 Revisited WSF_REQUEST.read_input_data* functions:
- read_input_data_into_file now accepts a IO_MEDIUM argument instead of just FILE.
- cleaned the implementation, and make sure that eventual `raw_input_data` is containing only the raw input data.
2016-08-05 11:32:14 +02:00
cc2d7dbb1c Ignore empty header line. 2016-08-05 11:28:59 +02:00
c88394b9fd Added support for category in ATOM format (input and output). 2016-06-24 13:03:09 +02:00
4283662f43 Removed unwanted .ecf file. 2016-06-22 10:55:41 +02:00
11 changed files with 45 additions and 66 deletions

View File

@@ -180,10 +180,12 @@ feature -- Header: adding
if line [line.count] = '%R' then if line [line.count] = '%R' then
line.remove_tail (1) line.remove_tail (1)
end end
if not line.is_empty then
add_header (line) add_header (line)
end end
end end
end end
end
append_array (a_headers: ARRAY [TUPLE [key: READABLE_STRING_8; value: READABLE_STRING_8]]) append_array (a_headers: ARRAY [TUPLE [key: READABLE_STRING_8; value: READABLE_STRING_8]])
-- Append array of key,value headers -- Append array of key,value headers

View File

@@ -11,7 +11,6 @@
</option> </option>
<setting name="concurrency" value="thread"/> <setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder.ecf"/>
<library name="net" location="$ISE_LIBRARY\library\net\net.ecf"/> <library name="net" location="$ISE_LIBRARY\library\net\net.ecf"/>
<library name="net_ssl" location="$ISE_LIBRARY\unstable\library\network\socket\netssl\net_ssl.ecf"> <library name="net_ssl" location="$ISE_LIBRARY\unstable\library\network\socket\netssl\net_ssl.ecf">
<condition> <condition>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="connector_standalone_websocket" uuid="38E6F413-E001-4774-9B4C-E0C08753D9F7" library_target="connector_standalone_websocket">
<target name="connector_standalone_websocket">
<root all_classes="true"/>
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option debug="true" warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
<debug name="dbglog" enabled="true"/>
<assertions precondition="true"/>
</option>
<setting name="concurrency" value="scoop"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder-safe.ecf"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="httpd" location="lib\httpd\httpd-safe.ecf" readonly="false"/>
<cluster name="src" location=".\src\">
<cluster name="implementation" location="$|implementation\" hidden="true"/>
</cluster>
</target>
</system>

View File

@@ -261,10 +261,12 @@ feature -- Access: Input
local local
l_input: WGI_INPUT_STREAM l_input: WGI_INPUT_STREAM
n: INTEGER n: INTEGER
buf_initial_size: INTEGER
do do
if raw_input_data_recorded and then attached raw_input_data as d then if raw_input_data_recorded and then attached raw_input_data as d then
buf.append (d) buf.append (d)
else else
buf_initial_size := buf.count
l_input := input l_input := input
if is_chunked_input then if is_chunked_input then
from from
@@ -286,59 +288,42 @@ feature -- Access: Input
end end
end end
if raw_input_data_recorded then if raw_input_data_recorded then
set_raw_input_data (buf) set_raw_input_data (buf.substring (buf_initial_size + 1, buf.count))
-- Only the input data! And differente reference.
end end
end end
end end
read_input_data_into_file (a_file: FILE) read_input_data_into_file (a_medium: IO_MEDIUM)
-- retrieve the content from the `input' stream into `s' -- retrieve the content from the `input' stream into `s'
-- warning: if the input data has already been retrieved -- warning: if the input data has already been retrieved
-- you might not get anything -- you might not get anything
require require
a_file_is_open_write: a_file.is_open_write a_medium_is_open_write: a_medium.is_open_write
local local
s: STRING s: STRING
l_input: WGI_INPUT_STREAM l_input: WGI_INPUT_STREAM
l_raw_data: detachable STRING_8 l_raw_data: detachable STRING_8
len: NATURAL_64
nb, l_step: INTEGER nb, l_step: INTEGER
l_size: NATURAL_64
do do
if raw_input_data_recorded and then attached raw_input_data as d then if raw_input_data_recorded and then attached raw_input_data as d then
a_file.put_string (d) a_medium.put_string (d)
else else
if raw_input_data_recorded then if raw_input_data_recorded then
create l_raw_data.make_empty create l_raw_data.make_empty
end end
l_input := input l_input := input
len := content_length_value
debug ("wsf")
io.error.put_string (generator + ".read_input_data_into_file (a_file) content_length=" + len.out + "%N")
end
from from
l_size := 0
l_step := 8_192 l_step := 8_192
create s.make (l_step) create s.make (l_step)
until until
l_step = 0 or l_input.end_of_input l_step = 0 or l_input.end_of_input
loop loop
if len < l_step.to_natural_64 then
l_step := len.to_integer_32
end
if l_step > 0 then
l_input.append_to_string (s, l_step) l_input.append_to_string (s, l_step)
nb := l_input.last_appended_count nb := l_input.last_appended_count
l_size := l_size + nb.to_natural_64
len := len - nb.to_natural_64
debug ("wsf") a_medium.put_string (s)
io.error.put_string (" append (s, " + l_step.out + ") -> " + nb.out + " (" + l_size.out + " / "+ content_length_value.out + ")%N")
end
a_file.put_string (s)
if l_raw_data /= Void then if l_raw_data /= Void then
l_raw_data.append (s) l_raw_data.append (s)
end end
@@ -347,12 +332,9 @@ feature -- Access: Input
l_step := 0 l_step := 0
end end
end end
if attached {FILE} a_medium as f then
f.flush
end end
a_file.flush
debug ("wsf")
io.error.put_string ("offset =" + len.out + "%N")
end
check got_all_data: len = 0 end
if l_raw_data /= Void then if l_raw_data /= Void then
set_raw_input_data (l_raw_data) set_raw_input_data (l_raw_data)
end end

View File

@@ -5,7 +5,7 @@
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/> <library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="encoders" location="..\..\encoder\encoder-safe.ecf"/> <library name="encoders" location="..\..\encoder\encoder-safe.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/> <library name="http" location="..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/> <library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="uuid" location="$ISE_LIBRARY\library\uuid\uuid-safe.ecf"/> <library name="uuid" location="$ISE_LIBRARY\library\uuid\uuid-safe.ecf"/>
<library name="xml_parser" location="$ISE_LIBRARY\library\text\parser\xml\parser\xml_parser-safe.ecf"/> <library name="xml_parser" location="$ISE_LIBRARY\library\text\parser\xml\parser\xml_parser-safe.ecf"/>

View File

@@ -7,7 +7,7 @@
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/> <library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
<library name="encoders" location="..\..\encoder\encoder.ecf"/> <library name="encoders" location="..\..\encoder\encoder.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf"/> <library name="http" location="..\..\..\network\protocol\http\http.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/> <library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="uuid" location="$ISE_LIBRARY\library\uuid\uuid.ecf"/> <library name="uuid" location="$ISE_LIBRARY\library\uuid\uuid.ecf"/>
<library name="xml_parser" location="$ISE_LIBRARY\library\text\parser\xml\parser\xml_parser.ecf"/> <library name="xml_parser" location="$ISE_LIBRARY\library\text\parser\xml\parser\xml_parser.ecf"/>

View File

@@ -72,6 +72,13 @@ feature -- Visitor
if attached a_entry.date as dt then if attached a_entry.date as dt then
append_content_tag_to ("updated", Void, date_to_string (dt), buffer) append_content_tag_to ("updated", Void, date_to_string (dt), buffer)
end end
if attached a_entry.categories as cats then
across
cats as ic
loop
append_content_tag_to ("category", <<["term", ic.item]>>, Void, buffer)
end
end
append_content_tag_to ("summary", Void, a_entry.description, buffer) append_content_tag_to ("summary", Void, a_entry.description, buffer)
if attached a_entry.content as l_content then if attached a_entry.content as l_content then

View File

@@ -81,6 +81,7 @@ feature -- Access
if attached x_entry.element_by_name ("content") as x_content then if attached x_entry.element_by_name ("content") as x_content then
e.set_content (xml_element_code (x_content), xml_attribute_text (x_content, "type")) e.set_content (xml_element_code (x_content), xml_attribute_text (x_content, "type"))
end end
if attached x_entry.element_by_name ("author") as x_author then if attached x_entry.element_by_name ("author") as x_author then
if attached x_author.element_by_name ("name") as x_name and then if attached x_author.element_by_name ("name") as x_name and then
attached x_name.text as l_author_name attached x_name.text as l_author_name
@@ -92,6 +93,17 @@ feature -- Access
e.set_author (l_author) e.set_author (l_author)
end end
end end
-- Optional "category"
if attached x_entry.elements_by_name ("category") as x_categories then
across
x_categories as cats_ic
loop
if attached xml_attribute_text (cats_ic.item, "term") as l_term then
e.set_category (l_term)
end
end
end
Result.extend (e) Result.extend (e)
end end
end end

View File

@@ -66,7 +66,7 @@ feature {NONE} -- Helpers
end end
end end
if a_content = Void then if a_content = Void then
a_output.append ("/>") a_output.append ("/>%N")
else else
a_output.append (">") a_output.append (">")
a_output.append (escaped_unicode_xml (a_content.as_string_32)) a_output.append (escaped_unicode_xml (a_content.as_string_32))

View File

@@ -65,6 +65,7 @@ feature {NONE} -- Data
<name>John Doe</name> <name>John Doe</name>
<email>johndoe@example.com</email> <email>johndoe@example.com</email>
</author> </author>
<category term="foo"/><category term="bar"/>
</entry> </entry>
</feed> </feed>

View File

@@ -6,7 +6,7 @@
<setting name="concurrency" value="none"/> <setting name="concurrency" value="none"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="feed" location="..\feed-safe.ecf" readonly="false"/> <library name="feed" location="..\feed-safe.ecf" readonly="false"/>
<library name="http_client" location="$ISE_LIBRARY\contrib\library\network\http_client\http_client-safe.ecf"/> <library name="http_client" location="..\..\..\..\network\http_client\http_client-safe.ecf"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/> <library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/>
<library name="xml_parser" location="$ISE_LIBRARY\library\text\parser\xml\parser\xml_parser-safe.ecf"/> <library name="xml_parser" location="$ISE_LIBRARY\library\text\parser\xml\parser\xml_parser-safe.ecf"/>
<tests name="src" location=".\" recursive="true"/> <tests name="src" location=".\" recursive="true"/>