Made WGI_CHUNKED_INPUT_STREAM inherits from WGI_INPUT_STREAM

Merged REQUEST.input and REQUEST.chunked_input
  Now REQUEST.input handles directly the chunked transfer encoding, or the non chunked.
Kept REQUEST.is_chunked_input since it matters that Content-Length is 0 even if there are input (chunked) data.
This commit is contained in:
Jocelyn Fiat
2012-04-13 16:33:49 +02:00
parent e6a727ee42
commit 0bd2d16c12
5 changed files with 171 additions and 112 deletions

View File

@@ -27,9 +27,18 @@ feature {NONE} -- Initialization
input := a_input
set_meta_variables (a_vars)
update_path_info
if attached http_transfer_encoding as l_transfer_encoding and then l_transfer_encoding.same_string ("chunked") then
update_input
end
update_input
-- Update input, depending on Transfer-Encoding value.
do
if
attached http_transfer_encoding as l_transfer_encoding and then
l_transfer_encoding.same_string (once "chunked")
then
is_chunked_input := True
create chunked_input.make (a_input)
create {WGI_CHUNKED_INPUT_STREAM} input.make (input)
end
end
@@ -40,9 +49,7 @@ feature -- Access: Input
input: WGI_INPUT_STREAM
-- Server input channel
chunked_input: detachable WGI_CHUNKED_INPUT_STREAM
-- Chunked server input channel
--| Could be a chunked input as well
feature -- EWSGI access