Applied renaming from write_ to put_

This commit is contained in:
Jocelyn Fiat
2011-12-15 19:34:20 +01:00
parent 32373addfa
commit 7207a021be
7 changed files with 24 additions and 24 deletions

View File

@@ -158,8 +158,8 @@ feature -- Output
send (buf: WSF_RESPONSE)
do
buf.set_status_code (200)
buf.write_header_text (header_string)
buf.write_string (message_string)
buf.put_header_text (header_string)
buf.put_string (message_string)
end
feature {NONE} -- Implementation: output

View File

@@ -133,9 +133,9 @@ feature -- Output
do
compute
res.set_status_code (200)
res.write_header_text (headers_string)
res.put_header_text (headers_string)
if attached message as m then
res.write_string (m)
res.put_string (m)
end
end

View File

@@ -80,8 +80,8 @@ feature -- Execution
execute_unauthorized (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
res.set_status_code ({HTTP_STATUS_CODE}.unauthorized)
res.write_header ({HTTP_STATUS_CODE}.unauthorized, Void)
res.write_string ("Unauthorized")
res.put_header ({HTTP_STATUS_CODE}.unauthorized, Void)
res.put_string ("Unauthorized")
end
feature -- Auth

View File

@@ -53,12 +53,12 @@ feature -- Helper
end
end
res.set_status_code ({HTTP_STATUS_CODE}.unsupported_media_type)
res.write_header ({HTTP_STATUS_CODE}.unsupported_media_type, << ["Content-Type", "text/plain"], ["Accept", accept_s]>>)
res.put_header ({HTTP_STATUS_CODE}.unsupported_media_type, << ["Content-Type", "text/plain"], ["Accept", accept_s]>>)
if accept_s /= Void then
res.write_string ("Unsupported request content-type, Accept: " + accept_s + "%N")
res.put_string ("Unsupported request content-type, Accept: " + accept_s + "%N")
end
if uri_s /= Void then
res.write_string ("Unsupported request format from the URI: " + uri_s + "%N")
res.put_string ("Unsupported request format from the URI: " + uri_s + "%N")
end
end
@@ -78,11 +78,11 @@ feature -- Helper
s.append_string (c.item)
end
res.set_status_code ({HTTP_STATUS_CODE}.method_not_allowed)
res.write_header ({HTTP_STATUS_CODE}.method_not_allowed, <<
res.put_header ({HTTP_STATUS_CODE}.method_not_allowed, <<
["Content-Type", {HTTP_MIME_TYPES}.text_plain],
["Allow", s]
>>)
res.write_string ("Unsupported request method, Allow: " + s + "%N")
res.put_string ("Unsupported request method, Allow: " + s + "%N")
end
note

View File

@@ -63,8 +63,8 @@ feature -- Execution
h.put_content_length (s.count)
res.set_status_code ({HTTP_STATUS_CODE}.ok)
res.write_header_text (h.string)
res.write_string (s)
res.put_header_text (h.string)
res.put_string (s)
end
end
@@ -136,9 +136,9 @@ feature -- Execution
h.put_content_type_text_html
res.set_status_code ({HTTP_STATUS_CODE}.ok)
h.put_content_length (s.count)
res.write_header_text (h.string)
res.put_header_text (h.string)
if not req.request_method.same_string ({HTTP_REQUEST_METHODS}.method_head) then
res.write_string (s)
res.put_string (s)
end
res.flush
end
@@ -174,8 +174,8 @@ feature -- Execution
s.append ("Resource %"" + uri + "%" not found%N")
res.set_status_code ({HTTP_STATUS_CODE}.not_found)
h.put_content_length (s.count)
res.write_header_text (h.string)
res.write_string (s)
res.put_header_text (h.string)
res.put_string (s)
res.flush
end
@@ -190,8 +190,8 @@ feature -- Execution
s.append ("Resource %"" + uri + "%": Access denied%N")
res.set_status_code ({HTTP_STATUS_CODE}.forbidden)
h.put_content_length (s.count)
res.write_header_text (h.string)
res.write_string (s)
res.put_header_text (h.string)
res.put_string (s)
res.flush
end

View File

@@ -57,7 +57,7 @@ feature -- Execution
execute_rescue (req: WSF_REQUEST; res: WSF_RESPONSE)
do
if not res.header_committed then
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
res.put_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
res.flush
end

View File

@@ -149,17 +149,17 @@ feature -- Basic operations
s: detachable READABLE_STRING_8
do
res.set_status_code (status_code)
res.write_header_text (header.string)
res.put_header_text (header.string)
s := head
if s /= Void then
res.write_string (s)
res.put_string (s)
end
if not answer_head_request_method then
send_file_content_to (file_name, res)
end
s := bottom
if s /= Void then
res.write_string (s)
res.put_string (s)
end
end
@@ -224,7 +224,7 @@ feature {NONE} -- Implementation: output
f.exhausted
loop
f.read_stream (4_096)
res.write_string (f.last_string)
res.put_string (f.last_string)
end
f.close
end