abstracted the HTTP_HANDLER

to let the user integrate at the level of its choice
(either very early so handle itself the header handling, or later to reuse existing code)
This commit is contained in:
Jocelyn Fiat
2011-05-27 13:07:06 +02:00
parent 64cf2b6936
commit c553bd1e1e
10 changed files with 249 additions and 277 deletions

View File

@@ -20,14 +20,34 @@ feature {NONE} -- Initialization
source: TCP_STREAM_SOCKET
feature -- Status Report
is_readable: BOOLEAN
-- Is readable?
do
Result := source.is_open_read
end
feature -- Basic operation
read_line
require
is_readable: is_readable
do
last_string.wipe_out
if source.socket_ok then
source.read_line_thread_aware
last_string.append_string (source.last_string)
end
end
read_stream (nb_char: INTEGER)
-- Read a string of at most `nb_char' bound characters
-- or until end of file.
-- Make result available in `last_string'.
require
nb_char_positive: nb_char > 0
is_readable: is_readable
do
last_string.wipe_out
if source.socket_ok then