diff --git a/library/server/ewsgi/connectors/httpd/dev/httpd_connector_dev.e b/library/server/ewsgi/connectors/httpd/dev/httpd_connector_dev.e index 89bc7bea..80dfcd4e 100644 --- a/library/server/ewsgi/connectors/httpd/dev/httpd_connector_dev.e +++ b/library/server/ewsgi/connectors/httpd/dev/httpd_connector_dev.e @@ -23,6 +23,7 @@ feature {NONE} -- Initialization print ("Hello%N") create fac create server.make (fac) + server.configuration.set_max_concurrent_connections (100) server.configuration.set_http_server_port (9090) server.launch end diff --git a/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_connection_handler.e b/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_connection_handler.e index 79afe9f5..60141ef7 100644 --- a/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_connection_handler.e +++ b/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_connection_handler.e @@ -94,7 +94,9 @@ feature {HTTPD_SERVER_I} -- Execution dbglog (generator + ".ENTER process_request_handler_on_accept") end - hdl.accept_from_listening_socket (a_listening_socket) + hdl.set_listening_socket (a_listening_socket) + +-- hdl.accept_from_listening_socket (a_listening_socket) if hdl.has_error then log ("Internal error (accept_from_listening_socket failed)") else diff --git a/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_request_handler.e b/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_request_handler.e index 1f41852d..638d41fc 100644 --- a/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_request_handler.e +++ b/library/server/ewsgi/connectors/httpd/src/httpd/concurrency/scoop/httpd_request_handler.e @@ -22,6 +22,11 @@ inherit feature -- Change + set_listening_socket (a_listening_socket: separate HTTPD_STREAM_SOCKET) + do + listening_socket := a_listening_socket + end + accept_from_listening_socket (a_listening_socket: separate HTTPD_STREAM_SOCKET) local retried: BOOLEAN @@ -32,8 +37,21 @@ feature -- Change else create s.make_empty client_socket := s + debug ("dbglog") + dbglog ("before accept_to") + end + print ("[EWF/DBG] <#" + processor_id_from_object (Current).out + "> accept_to%N") a_listening_socket.accept_to (s) - if not s.is_created then + + if s.is_created then + debug ("dbglog") + dbglog ("after accept_to " + s.descriptor.out) + end + else + debug ("dbglog") + dbglog ("after accept_to ERROR") + end + has_error := True client_socket := Void end @@ -47,10 +65,16 @@ feature -- Execution separate_execution: BOOLEAN do - if attached client_socket as s then - execute (s) + Result := False + if attached listening_socket as l_listening_socket then + accept_from_listening_socket (l_listening_socket) + if not has_error then + if attached client_socket as s then + execute (s) + Result := True + end + end end - Result := True end feature {CONCURRENT_POOL, HTTPD_CONNECTION_HANDLER_I} -- Basic operation diff --git a/library/server/ewsgi/connectors/httpd/src/httpd/httpd_request_handler_i.e b/library/server/ewsgi/connectors/httpd/src/httpd/httpd_request_handler_i.e index dd3ce531..e1d376cd 100644 --- a/library/server/ewsgi/connectors/httpd/src/httpd/httpd_request_handler_i.e +++ b/library/server/ewsgi/connectors/httpd/src/httpd/httpd_request_handler_i.e @@ -28,6 +28,8 @@ feature {NONE} -- Initialization end client_socket := Void + listening_socket := Void + -- FIXME: optimize to just wipe_out if needed create method.make_empty create uri.make_empty @@ -40,6 +42,8 @@ feature -- Access client_socket: detachable HTTPD_STREAM_SOCKET + listening_socket: detachable separate HTTPD_STREAM_SOCKET + request_header: STRING -- Header' source