Renamed "ext" folder as "contrib" folder and reorganized a little bit
Renamed any *_APPLICATION as *_SERVICE mainly because those components such as WSF_APPLICATION, renamed as WSF_SERVICE are not always the main application entry, and "service" describe them better Minor implementation change in WSF_REQUEST Cosmetics
This commit is contained in:
@@ -5,7 +5,7 @@ note
|
||||
It includes CGI interface and a few extra values that are usually valuable
|
||||
In addition it provides
|
||||
query_parameter(s)
|
||||
form_data_parameter(s)
|
||||
form_parameter(s)
|
||||
...
|
||||
]"
|
||||
date: "$Date$"
|
||||
@@ -17,7 +17,7 @@ class
|
||||
inherit
|
||||
DEBUG_OUTPUT
|
||||
|
||||
create {WSF_APPLICATION}
|
||||
create {WSF_SERVICE}
|
||||
make_from_wgi
|
||||
|
||||
convert
|
||||
@@ -1001,7 +1001,7 @@ feature {NONE} -- Form fields and related
|
||||
-- Variables sent by POST request
|
||||
local
|
||||
vars: like internal_form_data_parameters_table
|
||||
s: STRING
|
||||
s: READABLE_STRING_8
|
||||
n: NATURAL_64
|
||||
l_type: like content_type
|
||||
do
|
||||
@@ -1017,10 +1017,10 @@ feature {NONE} -- Form fields and related
|
||||
create vars.make (5)
|
||||
vars.compare_objects
|
||||
--| FIXME: optimization ... fetch the input data progressively, otherwise we might run out of memory ...
|
||||
s := form_input_data (n.to_integer_32) --| FIXME truncated from NAT64 to INT32
|
||||
s := form_input_data (n)
|
||||
analyze_multipart_form (l_type, s, vars)
|
||||
else
|
||||
s := form_input_data (n.to_integer_32) --| FIXME truncated from NAT64 to INT32
|
||||
s := form_input_data (n)
|
||||
vars := urlencoded_parameters (s)
|
||||
end
|
||||
if raw_post_data_recorded then
|
||||
@@ -1480,15 +1480,19 @@ feature {NONE} -- Internal value
|
||||
default_content_type: STRING = "text/plain"
|
||||
-- Default content type
|
||||
|
||||
form_input_data (nb: INTEGER): STRING
|
||||
form_input_data (nb: NATURAL_64): READABLE_STRING_8
|
||||
-- data from input form
|
||||
local
|
||||
nb32: INTEGER
|
||||
n: INTEGER
|
||||
t: STRING
|
||||
s: STRING_8
|
||||
do
|
||||
from
|
||||
n := nb
|
||||
create Result.make (n)
|
||||
nb32 := nb.to_integer_32
|
||||
n := nb32
|
||||
create s.make (n)
|
||||
Result := s
|
||||
if n > 1_024 then
|
||||
n := 1_024
|
||||
end
|
||||
@@ -1497,11 +1501,11 @@ feature {NONE} -- Internal value
|
||||
loop
|
||||
input.read_string (n)
|
||||
t := input.last_string
|
||||
Result.append_string (t)
|
||||
s.append_string (t)
|
||||
if t.count < n then
|
||||
n := 0
|
||||
end
|
||||
n := nb - t.count
|
||||
n := nb32 - t.count
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
note
|
||||
description: "[
|
||||
Summary description for {WSF_RESPONSE}.
|
||||
Main interface to send message back to the client
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
@@ -8,7 +8,7 @@ note
|
||||
class
|
||||
WSF_RESPONSE
|
||||
|
||||
create {WSF_APPLICATION}
|
||||
create {WSF_SERVICE}
|
||||
make_from_wgi
|
||||
|
||||
convert
|
||||
@@ -23,18 +23,6 @@ feature {NONE} -- Initialization
|
||||
|
||||
wgi_response: WGI_RESPONSE_BUFFER
|
||||
|
||||
--feature {WSF_APPLICATION} -- Commit
|
||||
|
||||
-- commit
|
||||
-- -- Commit the current response
|
||||
-- do
|
||||
-- wgi_response.commit
|
||||
-- ensure
|
||||
-- status_is_set: status_is_set
|
||||
-- header_committed: header_committed
|
||||
-- message_committed: message_committed
|
||||
-- end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
header_committed: BOOLEAN
|
||||
@@ -55,15 +43,6 @@ feature -- Status report
|
||||
Result := wgi_response.message_writable
|
||||
end
|
||||
|
||||
--feature {WGI_RESPONSE_BUFFER} -- Core output operation
|
||||
|
||||
-- write (s: READABLE_STRING_8)
|
||||
-- -- Send the string `s'
|
||||
-- -- this can be used for header and body
|
||||
-- do
|
||||
-- wgi_response.write (s)
|
||||
-- end
|
||||
|
||||
feature -- Status setting
|
||||
|
||||
status_is_set: BOOLEAN
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
note
|
||||
description: "Objects that ..."
|
||||
description: "[
|
||||
Inherit from this class to implement the main entry of your web service
|
||||
You just need to implement `execute', get data from the request `req'
|
||||
and write the response in `res'
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_APPLICATION
|
||||
WSF_SERVICE
|
||||
|
||||
inherit
|
||||
WGI_APPLICATION
|
||||
WGI_SERVICE
|
||||
rename
|
||||
execute as wgi_execute
|
||||
end
|
||||
Reference in New Issue
Block a user