renamed keep_alive_requested as is_persistent_connection_requested.

This commit is contained in:
2015-04-01 22:51:20 +02:00
parent c42af5b2de
commit d8ea9ba63c
2 changed files with 9 additions and 9 deletions

View File

@@ -39,7 +39,7 @@ feature {NONE} -- Initialization
create request_header.make_empty create request_header.make_empty
create request_header_map.make (10) create request_header_map.make (10)
keep_alive_requested := False is_persistent_connection_requested := False
end end
feature -- Status report feature -- Status report
@@ -85,9 +85,9 @@ feature -- Access
remote_info: detachable TUPLE [addr: STRING; hostname: STRING; port: INTEGER] remote_info: detachable TUPLE [addr: STRING; hostname: STRING; port: INTEGER]
-- Information related to remote client -- Information related to remote client
keep_alive_requested: BOOLEAN is_persistent_connection_requested: BOOLEAN
-- Persistent connection requested? -- Persistent connection requested?
-- either has "Connection: Keep-Alive" header, -- either has "Connection: keep-alive" header,
-- or is HTTP/1.1 and no header "Connection: close". -- or is HTTP/1.1 and no header "Connection: close".
is_http_version_1_0: BOOLEAN is_http_version_1_0: BOOLEAN
@@ -167,7 +167,7 @@ feature -- Execution
execute_request execute_request
l_exit := not {HTTPD_SERVER}.is_persistent_connection_supported l_exit := not {HTTPD_SERVER}.is_persistent_connection_supported
or has_error or l_socket.is_closed or not l_socket.is_open_read or has_error or l_socket.is_closed or not l_socket.is_open_read
or not keep_alive_requested or not is_persistent_connection_requested
reset_request reset_request
end end
end end
@@ -301,18 +301,18 @@ feature -- Parsing
end end
end end
-- Except for HTTP/1.0, persistent connection is the default. -- Except for HTTP/1.0, persistent connection is the default.
keep_alive_requested := True is_persistent_connection_requested := True
if is_http_version_1_0 then if is_http_version_1_0 then
keep_alive_requested := attached request_header_map.item ("Connection") as l_connection and then is_persistent_connection_requested := attached request_header_map.item ("Connection") as l_connection and then
l_connection.is_case_insensitive_equal_general ("keep-alive") l_connection.is_case_insensitive_equal_general ("keep-alive")
else else
-- By default HTTP:1/1 support persistent connection. -- By default HTTP:1/1 support persistent connection.
if attached request_header_map.item ("Connection") as l_connection then if attached request_header_map.item ("Connection") as l_connection then
if l_connection.is_case_insensitive_equal_general ("close") then if l_connection.is_case_insensitive_equal_general ("close") then
keep_alive_requested := False is_persistent_connection_requested := False
end end
else else
keep_alive_requested := True is_persistent_connection_requested := True
end end
end end
end end

View File

@@ -82,7 +82,7 @@ feature -- Request processing
else else
l_output.set_http_version (version) l_output.set_http_version (version)
end end
res.set_is_persistent_connection_requested (keep_alive_requested) res.set_is_persistent_connection_requested (is_persistent_connection_requested)
req.set_meta_string_variable ("RAW_HEADER_DATA", request_header) req.set_meta_string_variable ("RAW_HEADER_DATA", request_header)