Removed initial Thread for the HTTP_HANDLER, this is not needed here
Removed HTTP_SERVER_SHARED_CONFIGURATION from the library ... not needed by the library. Added HTTP_SERVER_SHARED_CONFIGURATION to the example to show how to share the configuration, if needed
This commit is contained in:
@@ -9,6 +9,8 @@ class
|
||||
inherit
|
||||
ARGUMENTS
|
||||
|
||||
HTTP_SERVER_SHARED_CONFIGURATION
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -24,6 +26,7 @@ feature {NONE} -- Initialization
|
||||
create l_cfg.make
|
||||
l_cfg.http_server_port := 9_000
|
||||
l_cfg.document_root := default_document_root
|
||||
set_server_configuration (l_cfg)
|
||||
debug ("nino")
|
||||
l_cfg.set_is_verbose (True)
|
||||
end
|
||||
|
||||
48
example/SimpleWebServer/http_server_shared_configuration.e
Normal file
48
example/SimpleWebServer/http_server_shared_configuration.e
Normal file
@@ -0,0 +1,48 @@
|
||||
note
|
||||
description: "Summary description for {HTTP_SERVER_SHARED_CONFIGURATION}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
HTTP_SERVER_SHARED_CONFIGURATION
|
||||
|
||||
feature -- Access
|
||||
|
||||
server_configuration: detachable HTTP_SERVER_CONFIGURATION
|
||||
-- Shared configuration
|
||||
do
|
||||
if attached server_configuration_cell.item as l_cfg then
|
||||
Result := l_cfg
|
||||
end
|
||||
end
|
||||
|
||||
document_root: STRING_8
|
||||
-- Shared document root
|
||||
do
|
||||
if attached server_configuration as l_cfg then
|
||||
Result := l_cfg.document_root
|
||||
else
|
||||
Result := ""
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_server_configuration (a_cfg: like server_configuration)
|
||||
-- Set `server_configuration' to `a_cfg'.
|
||||
do
|
||||
server_configuration_cell.replace (a_cfg)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
server_configuration_cell: CELL [detachable HTTP_SERVER_CONFIGURATION]
|
||||
once ("PROCESS")
|
||||
create Result.put (Void)
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2011, Javier Velilla and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
Reference in New Issue
Block a user