Enable support for persistent connections.
(test: works fine with curl -k , but weird behavior with ab -k ...)
This commit is contained in:
@@ -174,7 +174,6 @@ feature -- Execution
|
|||||||
is_connected: is_connected
|
is_connected: is_connected
|
||||||
local
|
local
|
||||||
l_remote_info: detachable like remote_info
|
l_remote_info: detachable like remote_info
|
||||||
l_continue: BOOLEAN
|
|
||||||
l_socket: like client_socket
|
l_socket: like client_socket
|
||||||
l_ready_for_reading: BOOLEAN
|
l_ready_for_reading: BOOLEAN
|
||||||
do
|
do
|
||||||
@@ -192,11 +191,8 @@ feature -- Execution
|
|||||||
dbglog (generator + ".execute_request socket=" + l_socket.descriptor.out + " ENTER")
|
dbglog (generator + ".execute_request socket=" + l_socket.descriptor.out + " ENTER")
|
||||||
end
|
end
|
||||||
l_socket.set_timeout (5) -- 5 seconds!
|
l_socket.set_timeout (5) -- 5 seconds!
|
||||||
from until l_continue loop
|
|
||||||
-- Use timeout from l_socket!
|
|
||||||
l_ready_for_reading := l_socket.ready_for_reading
|
l_ready_for_reading := l_socket.ready_for_reading
|
||||||
if l_ready_for_reading then
|
if l_ready_for_reading then
|
||||||
l_continue := True
|
|
||||||
create l_remote_info
|
create l_remote_info
|
||||||
if attached l_socket.peer_address as l_addr then
|
if attached l_socket.peer_address as l_addr then
|
||||||
l_remote_info.addr := l_addr.host_address.host_address
|
l_remote_info.addr := l_addr.host_address.host_address
|
||||||
@@ -207,10 +203,8 @@ feature -- Execution
|
|||||||
analyze_request_message (l_socket)
|
analyze_request_message (l_socket)
|
||||||
else
|
else
|
||||||
has_error := True
|
has_error := True
|
||||||
l_continue := True
|
|
||||||
debug ("dbglog")
|
debug ("dbglog")
|
||||||
dbglog (generator + ".execute_request socket=" + l_socket.descriptor.out + "} WAITING")
|
dbglog (generator + ".execute_request socket=" + l_socket.descriptor.out + "} timeout!")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -310,11 +304,11 @@ feature -- Parsing
|
|||||||
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
|
if attached request_header_map.item ("Connection") as l_connection then
|
||||||
attached request_header_map.item ("Connection") as l_connection and then
|
print ("Connection -> " + l_connection + "%N")
|
||||||
l_connection.is_case_insensitive_equal_general ("close")
|
if l_connection.is_case_insensitive_equal_general ("close") then
|
||||||
then
|
|
||||||
keep_alive_enabled := False
|
keep_alive_enabled := False
|
||||||
|
end
|
||||||
else
|
else
|
||||||
keep_alive_enabled := True
|
keep_alive_enabled := True
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ feature -- Access
|
|||||||
|
|
||||||
factory: separate HTTPD_REQUEST_HANDLER_FACTORY
|
factory: separate HTTPD_REQUEST_HANDLER_FACTORY
|
||||||
|
|
||||||
is_persistent_connection_supported: BOOLEAN = False
|
is_persistent_connection_supported: BOOLEAN = True
|
||||||
-- Is persistent connection supported?
|
-- Is persistent connection supported?
|
||||||
--| For now, disabled during dev.
|
--| For now, disabled during dev.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="test_connector_standalone" uuid="BA1C9760-8ECD-4182-8354-5D880F2FC81B" library_target="test_connector_standalone">
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="test_connector_standalone" uuid="BA1C9760-8ECD-4182-8354-5D880F2FC81B" library_target="test_connector_standalone">
|
||||||
<target name="test_standalone_scoop">
|
<target name="test_standalone_scoop">
|
||||||
<root class="TEST_STANDALONE_CONNECTOR" feature="make"/>
|
<root class="TEST_STANDALONE_CONNECTOR" feature="make"/>
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
<library name="connector_standalone" location="standalone-safe.ecf" readonly="false"/>
|
<library name="connector_standalone" location="standalone-safe.ecf" readonly="false"/>
|
||||||
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
||||||
<library name="httpd" location="src\httpd\httpd-safe.ecf" readonly="false"/>
|
<library name="httpd_EDIT" location="src\httpd\httpd-safe.ecf" readonly="false"/>
|
||||||
|
<library name="net_ssl_EDIT" location="$ISE_LIBRARY\unstable\library\network\socket\netssl\net_ssl-safe.ecf" readonly="false"/>
|
||||||
<library name="wsf" location="..\..\..\wsf\wsf-safe.ecf" readonly="false"/>
|
<library name="wsf" location="..\..\..\wsf\wsf-safe.ecf" readonly="false"/>
|
||||||
<cluster name="tests" location="tests\" recursive="true"/>
|
<cluster name="tests" location="tests\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ feature -- Execution
|
|||||||
i64: INTEGER_64
|
i64: INTEGER_64
|
||||||
do
|
do
|
||||||
i64 := {INTEGER_64} 1_000_000_000
|
i64 := {INTEGER_64} 1_000_000_000
|
||||||
s := "Hello Concurrent EWF"
|
s := "Test Concurrent EWF ["
|
||||||
s.append (" (counter=")
|
s.append (request.percent_encoded_path_info)
|
||||||
|
s.append ("] (counter=")
|
||||||
s.append_integer (next_cell_counter_item (counter_cell))
|
s.append_integer (next_cell_counter_item (counter_cell))
|
||||||
s.append (")%N")
|
s.append (")%N")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user