A few change to make it more customizable

and prepare integration to EiffelWebReloaded (see on github)
This commit is contained in:
Jocelyn Fiat
2011-05-26 17:23:21 +02:00
parent 85cf39f3c6
commit 64cf2b6936
23 changed files with 590 additions and 298 deletions

44
io/http_input_stream.e Normal file
View File

@@ -0,0 +1,44 @@
note
description: "Summary description for {HTTP_INPUT_STREAM}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
HTTP_INPUT_STREAM
create
make
feature {NONE} -- Initialization
make (a_socket: like source)
do
source := a_socket
create last_string.make_empty
end
source: TCP_STREAM_SOCKET
feature -- Basic operation
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
do
last_string.wipe_out
if source.socket_ok then
source.read_stream_thread_aware (nb_char)
last_string.append_string (source.last_string)
end
end
feature -- Access
last_string: STRING
-- Last string read
end

31
io/http_output_stream.e Normal file
View File

@@ -0,0 +1,31 @@
note
description: "Summary description for {HTTP_OUTPUT_STREAM}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
HTTP_OUTPUT_STREAM
create
make
feature {NONE} -- Initialization
make (a_socket: like target)
do
target := a_socket
end
target: TCP_STREAM_SOCKET
feature -- Basic operation
put_string (s: STRING)
-- Write string `s' to `target'
do
target.put_string (s)
end
end