Merge branch 'master' into handler

pull from upstream
This commit is contained in:
Colin Adams
2013-07-08 10:17:44 +01:00
286 changed files with 2211 additions and 19154 deletions

View File

@@ -88,14 +88,14 @@ feature -- Access: Input
feature -- Access: CGI meta variables
meta_variable (a_name: READABLE_STRING_8): detachable READABLE_STRING_8
meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8
-- Environment variable related to `a_name'
require
a_name_valid: a_name /= Void and then not a_name.is_empty
deferred
end
meta_string_variable (a_name: READABLE_STRING_8): detachable READABLE_STRING_8
meta_string_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8
-- Environment variable related to `a_name'
require
a_name_valid: a_name /= Void and then not a_name.is_empty
@@ -105,7 +105,7 @@ feature -- Access: CGI meta variables
end
end
meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]
meta_variables: STRING_TABLE [READABLE_STRING_8]
-- These variables are specific to requests made with HTTP.
-- Interpretation of these variables may depend on the value of
-- SERVER_PROTOCOL.
@@ -665,7 +665,7 @@ invariant
path_info_identical: path_info ~ meta_string_variable ({WGI_META_NAMES}.path_info)
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -25,9 +25,9 @@ feature {NONE} -- Initialization
make_with_response_and_output (res: WGI_RESPONSE; a_out: FILE; a_err: FILE)
do
make_with_response (res)
output := a_out
error := a_err
make_with_response (res)
end
output: FILE
@@ -104,7 +104,7 @@ feature -- Error reporting
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -123,6 +123,52 @@ feature -- Input
character_read: not end_of_input implies last_appended_count > 0
end
append_to_file (a_file: FILE; nb: INTEGER)
-- Append at most `nb' characters read from input stream
-- to `a_file'
-- Set `last_appended_count' to the number of characters actually read.
-- (Note that even if at least `nb' characters are available
-- in the input stream, there is no guarantee that they
-- will all be read.)
require
is_open_read: is_open_read
not_end_of_input: not end_of_input
a_file_attached: a_file /= Void
a_file_is_open_write: a_file.is_open_write
nb_large_enough: nb > 0
local
s: like last_string
n: INTEGER
l_remaining: INTEGER
do
from
n := nb.min (2_048)
l_remaining := nb - n
until
l_remaining = 0 or n = 0
loop
read_string (n)
s := last_string
a_file.put_string (s)
if end_of_input or s.count < n then
n := s.count
-- no more data
l_remaining := l_remaining - n
n := 0
else
n := s.count
l_remaining := l_remaining - n
end
end
last_appended_count := nb - l_remaining
-- Clean `last_string'
last_string.wipe_out
ensure
nb_char_read_large_enough: last_appended_count >= 0
nb_char_read_small_enough: last_appended_count <= nb
character_read: not end_of_input implies last_appended_count > 0
end
feature -- Access
last_string: STRING_8
@@ -166,7 +212,7 @@ feature -- Status report
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software