From MAILER-DAEMON Mon Sep 01 02:32:43 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ka2xv-00074V-Fb for mharc-myserver-commit@gnu.org; Mon, 01 Sep 2008 02:32:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ka2xu-00074I-53 for myserver-commit@gnu.org; Mon, 01 Sep 2008 02:32:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ka2xs-000746-BM for myserver-commit@gnu.org; Mon, 01 Sep 2008 02:32:40 -0400 Received: from [199.232.76.173] (port=56520 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ka2xs-000743-5W for myserver-commit@gnu.org; Mon, 01 Sep 2008 02:32:40 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51878 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ka2xr-000194-Ev for myserver-commit@gnu.org; Mon, 01 Sep 2008 02:32:39 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Ka2xq-0001Jw-92 for myserver-commit@gnu.org; Mon, 01 Sep 2008 06:32:38 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Ka2xp-0001IS-Ra for myserver-commit@gnu.org; Mon, 01 Sep 2008 06:32:38 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 01 Sep 2008 06:32:37 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2775] Fixed tests/Makefile.am and windows .dev project regenerated X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 06:32:42 -0000 Revision: 2775 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2775 Author: gscrivano Date: 2008-09-01 06:32:36 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Fixed tests/Makefile.am and windows .dev project regenerated Modified Paths: -------------- trunk/myserver/myserver.dev trunk/myserver/tests/Makefile.am Modified: trunk/myserver/myserver.dev =================================================================== --- trunk/myserver/myserver.dev 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/myserver.dev 2008-09-01 06:32:36 UTC (rev 2775) @@ -46,7 +46,6 @@ ProductName=MyServer ProductVersion=0.9.0 AutoIncBuildNr=0 - [Unit1] FileName=stdafx.cpp CompileCpp=1 @@ -58,7 +57,7 @@ BuildCmd= [Unit2] -FileName=src\dynamiclib.cpp +FileName=src\myserver.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -68,7 +67,7 @@ BuildCmd= [Unit3] -FileName=src\recursive_mutex.cpp +FileName=src\find_data\find_data.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -78,7 +77,7 @@ BuildCmd= [Unit4] -FileName=src\process_server_manager.cpp +FileName=src\connection\connection.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -88,7 +87,7 @@ BuildCmd= [Unit5] -FileName=src\gzip_decompress.cpp +FileName=src\env\env.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -98,7 +97,7 @@ BuildCmd= [Unit6] -FileName=src\cached_file_factory.cpp +FileName=src\log\log_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -108,7 +107,7 @@ BuildCmd= [Unit7] -FileName=src\thread.cpp +FileName=src\conf\mime\mime_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -118,7 +117,7 @@ BuildCmd= [Unit8] -FileName=src\dyn_http_manager_list.cpp +FileName=src\conf\security\security_cache.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -128,7 +127,7 @@ BuildCmd= [Unit9] -FileName=src\socket.cpp +FileName=src\conf\security\security.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -138,7 +137,7 @@ BuildCmd= [Unit10] -FileName=src\pipe.cpp +FileName=src\conf\vhost\vhost.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -148,7 +147,7 @@ BuildCmd= [Unit11] -FileName=src\dyn_http_command.cpp +FileName=src\conf\vhost\vhost_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -158,7 +157,7 @@ BuildCmd= [Unit12] -FileName=src\http_data_handler.cpp +FileName=src\connections_scheduler\connections_scheduler.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -168,7 +167,7 @@ BuildCmd= [Unit13] -FileName=src\dyn_executor_manager.cpp +FileName=src\connections_scheduler\listen_threads.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -178,7 +177,7 @@ BuildCmd= [Unit14] -FileName=src\mem_buff.cpp +FileName=src\http_handler\wincgi\wincgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -188,7 +187,7 @@ BuildCmd= [Unit15] -FileName=src\semaphore.cpp +FileName=src\http_handler\cgi\cgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -198,7 +197,7 @@ BuildCmd= [Unit16] -FileName=src\md5.cpp +FileName=src\http_handler\mscgi\mscgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -208,7 +207,7 @@ BuildCmd= [Unit17] -FileName=src\http_errors.cpp +FileName=src\http_handler\mscgi\mscgi_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -218,7 +217,7 @@ BuildCmd= [Unit18] -FileName=src\mutex.cpp +FileName=src\http_handler\fastcgi\fastcgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -228,7 +227,7 @@ BuildCmd= [Unit19] -FileName=src\memory_stream.cpp +FileName=src\http_handler\scgi\scgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -238,7 +237,7 @@ BuildCmd= [Unit20] -FileName=src\stringutils.cpp +FileName=src\http_handler\isapi\isapi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -248,7 +247,7 @@ BuildCmd= [Unit21] -FileName=src\filter.cpp +FileName=src\base\utility.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -258,7 +257,7 @@ BuildCmd= [Unit22] -FileName=src\dyn_http_command_manager.cpp +FileName=src\base\file\files_utility.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -268,7 +267,7 @@ BuildCmd= [Unit23] -FileName=src\generic_plugins_manager.cpp +FileName=src\base\file\file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -278,7 +277,7 @@ BuildCmd= [Unit24] -FileName=src\ftp_parser.cpp +FileName=src\base\pipe\pipe.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -288,7 +287,7 @@ BuildCmd= [Unit25] -FileName=src\dyn_filter.cpp +FileName=src\base\base64\mime_utils.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -298,7 +297,7 @@ BuildCmd= [Unit26] -FileName=src\myserver_regex.cpp +FileName=src\base\mem_buff\mem_buff.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -308,7 +307,7 @@ BuildCmd= [Unit27] -FileName=src\filters_chain.cpp +FileName=src\base\home_dir\home_dir.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -318,7 +317,7 @@ BuildCmd= [Unit28] -FileName=src\log_manager.cpp +FileName=src\base\multicast\multicast.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -328,7 +327,7 @@ BuildCmd= [Unit29] -FileName=src\isapi.cpp +FileName=src\base\sync\recursive_mutex.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -338,7 +337,7 @@ BuildCmd= [Unit30] -FileName=src\ftp_lexer.cpp +FileName=src\base\sync\semaphore.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -348,7 +347,7 @@ BuildCmd= [Unit31] -FileName=src\env.cpp +FileName=src\base\sync\mutex.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -358,7 +357,7 @@ BuildCmd= [Unit32] -FileName=src\securestr.cpp +FileName=src\base\sync\event.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -368,7 +367,7 @@ BuildCmd= [Unit33] -FileName=src\cgi.cpp +FileName=src\base\sync\read_write_lock.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -378,7 +377,7 @@ BuildCmd= [Unit34] -FileName=src\gzip.cpp +FileName=src\base\safetime\safetime.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -388,7 +387,7 @@ BuildCmd= [Unit35] -FileName=src\cached_file_buffer.cpp +FileName=src\base\socket\socket.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -398,7 +397,7 @@ BuildCmd= [Unit36] -FileName=src\plugins_namespace_manager.cpp +FileName=src\base\socket\ssl_socket.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -408,7 +407,7 @@ BuildCmd= [Unit37] -FileName=src\mime_manager.cpp +FileName=src\base\hash_map\hash_map.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -418,7 +417,7 @@ BuildCmd= [Unit38] -FileName=src\mscgi.cpp +FileName=src\base\dynamic_lib\dynamiclib.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -428,7 +427,7 @@ BuildCmd= [Unit39] -FileName=src\dynamic_protocol.cpp +FileName=src\base\process\process_server_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -438,7 +437,7 @@ BuildCmd= [Unit40] -FileName=src\process.cpp +FileName=src\base\process\process.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -448,7 +447,7 @@ BuildCmd= [Unit41] -FileName=src\protocol.cpp +FileName=src\base\md5\md5.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -458,7 +457,7 @@ BuildCmd= [Unit42] -FileName=src\files_utility.cpp +FileName=src\base\ssl\ssl.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -468,7 +467,7 @@ BuildCmd= [Unit43] -FileName=src\ssl.cpp +FileName=src\base\xml\xml_parser.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -478,7 +477,7 @@ BuildCmd= [Unit44] -FileName=src\fastcgi.cpp +FileName=src\base\string\stringutils.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -488,7 +487,7 @@ BuildCmd= [Unit45] -FileName=src\wincgi.cpp +FileName=src\base\string\securestr.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -498,7 +497,7 @@ BuildCmd= [Unit46] -FileName=src\plugins_namespace.cpp +FileName=src\base\regex\myserver_regex.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -508,7 +507,7 @@ BuildCmd= [Unit47] -FileName=src\clients_thread.cpp +FileName=src\base\thread\thread.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -518,7 +517,7 @@ BuildCmd= [Unit48] -FileName=src\vhost.cpp +FileName=src\protocol\protocol.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -528,7 +527,7 @@ BuildCmd= [Unit49] -FileName=src\http_response.cpp +FileName=src\protocol\protocol_buffer.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -538,7 +537,7 @@ BuildCmd= [Unit50] -FileName=src\protocol_buffer.cpp +FileName=src\protocol\ftp\ftp_parser.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -548,7 +547,7 @@ BuildCmd= [Unit51] -FileName=src\stream.cpp +FileName=src\protocol\ftp\ftp_lexer.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -558,7 +557,7 @@ BuildCmd= [Unit52] -FileName=src\home_dir.cpp +FileName=src\protocol\ftp\ftp.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -568,7 +567,7 @@ BuildCmd= [Unit53] -FileName=src\ftp.cpp +FileName=src\protocol\control\control_header.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -578,7 +577,7 @@ BuildCmd= [Unit54] -FileName=src\http_data_read.cpp +FileName=src\protocol\control\control_protocol.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -588,7 +587,7 @@ BuildCmd= [Unit55] -FileName=src\connection.cpp +FileName=src\protocol\https\https.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -598,7 +597,7 @@ BuildCmd= [Unit56] -FileName=src\scgi.cpp +FileName=src\protocol\http\http_data_handler.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -608,7 +607,7 @@ BuildCmd= [Unit57] -FileName=src\http.cpp +FileName=src\protocol\http\http_errors.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -618,7 +617,7 @@ BuildCmd= [Unit58] -FileName=src\http_headers.cpp +FileName=src\protocol\http\http_response.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -628,7 +627,7 @@ BuildCmd= [Unit59] -FileName=src\dyn_filter_file.cpp +FileName=src\protocol\http\http_data_read.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -638,7 +637,7 @@ BuildCmd= [Unit60] -FileName=src\https.cpp +FileName=src\protocol\http\http.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -648,7 +647,7 @@ BuildCmd= [Unit61] -FileName=src\security_cache.cpp +FileName=src\protocol\http\http_headers.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -658,7 +657,7 @@ BuildCmd= [Unit62] -FileName=src\find_data.cpp +FileName=src\protocol\http\http_dir.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -668,7 +667,7 @@ BuildCmd= [Unit63] -FileName=src\http_dir.cpp +FileName=src\protocol\http\http_thread_context.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -678,7 +677,7 @@ BuildCmd= [Unit64] -FileName=src\mime_utils.cpp +FileName=src\protocol\http\http_header_checker.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -688,7 +687,7 @@ BuildCmd= [Unit65] -FileName=src\control_header.cpp +FileName=src\protocol\http\http_request.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -698,7 +697,7 @@ BuildCmd= [Unit66] -FileName=src\dyn_filters_manager.cpp +FileName=src\protocol\http\http_file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -708,7 +707,7 @@ BuildCmd= [Unit67] -FileName=src\security.cpp +FileName=src\files_cache\cached_file_factory.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -718,7 +717,7 @@ BuildCmd= [Unit68] -FileName=src\http_thread_context.cpp +FileName=src\files_cache\cached_file_buffer.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -728,7 +727,7 @@ BuildCmd= [Unit69] -FileName=src\http_header_checker.cpp +FileName=src\files_cache\cached_file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -738,7 +737,7 @@ BuildCmd= [Unit70] -FileName=src\event.cpp +FileName=src\filter\memory_stream.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -748,7 +747,7 @@ BuildCmd= [Unit71] -FileName=src\xml_parser.cpp +FileName=src\filter\filter.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -758,7 +757,7 @@ BuildCmd= [Unit72] -FileName=src\utility.cpp +FileName=src\filter\filters_chain.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -768,7 +767,7 @@ BuildCmd= [Unit73] -FileName=src\multicast.cpp +FileName=src\filter\stream.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -778,7 +777,7 @@ BuildCmd= [Unit74] -FileName=src\plugin.cpp +FileName=src\filter\filters_factory.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -788,7 +787,7 @@ BuildCmd= [Unit75] -FileName=src\mscgi_manager.cpp +FileName=src\filter\gzip\gzip_decompress.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -798,7 +797,7 @@ BuildCmd= [Unit76] -FileName=src\read_write_lock.cpp +FileName=src\filter\gzip\gzip.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -808,7 +807,7 @@ BuildCmd= [Unit77] -FileName=src\server.cpp +FileName=src\plugin\generic_plugins_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -818,7 +817,7 @@ BuildCmd= [Unit78] -FileName=src\dynamic_executor.cpp +FileName=src\plugin\plugins_namespace_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -828,7 +827,7 @@ BuildCmd= [Unit79] -FileName=src\connections_scheduler.cpp +FileName=src\plugin\plugins_namespace.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -838,7 +837,7 @@ BuildCmd= [Unit80] -FileName=src\cached_file.cpp +FileName=src\plugin\plugin.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -848,7 +847,7 @@ BuildCmd= [Unit81] -FileName=src\http_request.cpp +FileName=src\plugin\plugins_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -858,7 +857,7 @@ BuildCmd= [Unit82] -FileName=src\filters_factory.cpp +FileName=src\plugin\executor\dyn_executor_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -868,7 +867,7 @@ BuildCmd= [Unit83] -FileName=src\ssl_socket.cpp +FileName=src\plugin\executor\dynamic_executor.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -878,7 +877,7 @@ BuildCmd= [Unit84] -FileName=src\file.cpp +FileName=src\plugin\http_manager\dyn_http_manager_list.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -888,7 +887,7 @@ BuildCmd= [Unit85] -FileName=src\control_protocol.cpp +FileName=src\plugin\http_manager\dyn_http_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -898,7 +897,7 @@ BuildCmd= [Unit86] -FileName=src\myserver.cpp +FileName=src\plugin\protocol\dynamic_protocol.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -908,7 +907,7 @@ BuildCmd= [Unit87] -FileName=src\vhost_manager.cpp +FileName=src\plugin\protocol\protocols_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -918,7 +917,7 @@ BuildCmd= [Unit88] -FileName=src\http_file.cpp +FileName=src\plugin\filter\dyn_filter.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -928,7 +927,7 @@ BuildCmd= [Unit89] -FileName=src\safetime.cpp +FileName=src\plugin\filter\dyn_filter_file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -938,7 +937,7 @@ BuildCmd= [Unit90] -FileName=src\listen_threads.cpp +FileName=src\plugin\filter\dyn_filters_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -948,7 +947,7 @@ BuildCmd= [Unit91] -FileName=src\hash_map.cpp +FileName=src\plugin\http_command\dyn_http_command.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -957,8 +956,8 @@ OverrideBuildCmd=0 BuildCmd= -[Unit93] -FileName=src\protocols_manager.cpp +[Unit92] +FileName=src\plugin\http_command\dyn_http_command_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -967,8 +966,8 @@ OverrideBuildCmd=0 BuildCmd= -[Unit94] -FileName=src\plugins_manager.cpp +[Unit93] +FileName=src\server\clients_thread.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -977,8 +976,8 @@ OverrideBuildCmd=0 BuildCmd= -[Unit95] -FileName=src\plugins_manager.cpp +[Unit94] +FileName=src\server\server.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -987,13 +986,3 @@ OverrideBuildCmd=0 BuildCmd= -[Unit92] -FileName=src\dyn_http_manager.cpp -CompileCpp=1 -Folder=myserver -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/tests/Makefile.am 2008-09-01 06:32:36 UTC (rev 2775) @@ -2,6 +2,6 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp ../src/cached_file_buffer.cpp ../src/cached_file.cpp ../src/cached_file_factory.cpp ../src/cgi.cpp ../src/clients_thread.cpp ../src/connection.cpp ../src/connections_scheduler.cpp ../src/control_header.cpp ../src/control_protocol.cpp ../src/Dev-C++.cpp ../src/dynamic_executor.cpp ../src/dynamiclib.cpp ../src/dynamic_protocol.cpp ../src/dyn_executor_manager.cpp ../src/dyn_filter.cpp ../src/dyn_filter_file.cpp ../src/dyn_filters_manager.cpp ../src/dyn_http_command.cpp ../src/dyn_http_command_manager.cpp ../src/dyn_http_manager.cpp ../src/dyn_http_manager_list.cpp ../src/event.cpp ../src/fastcgi.cpp ../src/file.cpp ../src/files_utility.cpp ../src/filter.cpp ../src/filters_chain.cpp ../src/filters_factory.cpp ../src/generic_plugins_manager.cpp ../src/gzip.cpp ../src/gzip_decompress.cpp ../src/hash_map.cpp ../src/home_dir.cpp ../src/http.cpp ../src/http_data_handler.cpp ../src/http_data_read.cpp ../src/http_dir.cpp ../src/http_errors.cpp ../src/http_file.cpp ../src/http_header_checker.cpp ../src/http_headers.cpp ../src/http_request.cpp ../src/http_response.cpp ../src/https.cpp ../src/http_thread_context.cpp ../src/isapi.cpp ../src/find_data.cpp ../src/listen_threads.cpp ../src/log_manager.cpp ../src/md5.cpp ../src/mem_buff.cpp ../src/memory_stream.cpp ../src/mime_manager.cpp ../src/mime_utils.cpp ../src/mscgi.cpp ../src/multicast.cpp ../src/mutex.cpp ../src/myserver_regex.cpp ../src/pipe.cpp ../src/plugin.cpp ../src/plugins_manager.cpp ../src/plugins_namespace.cpp ../src/plugins_namespace_manager.cpp ../src/process.cpp ../src/process_server_manager.cpp ../src/protocol_buffer.cpp ../src/protocol.cpp ../src/protocols_manager.cpp ../src/read_write_lock.cpp ../src/safetime.cpp ../src/scgi.cpp ../src/securestr.cpp ../src/security_cache.cpp ../src/security.cpp ../src/semaphore.cpp ../src/server.cpp ../src/socket.cpp ../src/ssl.cpp ../src/ssl_socket.cpp ../src/stream.cpp ../src/stringutils.cpp ../src/thread.cpp ../src/utility.cpp ../src/vhost_manager.cpp ../src/vhost.cpp ../src/wincgi.cpp ../src/xml_parser.cpp ../src/ftp_lexer.cpp ../src/ftp_parser.cpp ../src/ftp.cpp ../src/recursive_mutex.cpp ../src/env.cpp -tests_suite_LDADD = $(CPPUNIT_LIBS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) +tests_suite_SOURCES = main.cpp test_base64.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp +tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LIBS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) From MAILER-DAEMON Mon Sep 01 04:08:55 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ka4T0-0003gb-TZ for mharc-myserver-commit@gnu.org; Mon, 01 Sep 2008 04:08:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ka4T0-0003gT-6W for myserver-commit@gnu.org; Mon, 01 Sep 2008 04:08:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ka4Sz-0003gH-Ox for myserver-commit@gnu.org; Mon, 01 Sep 2008 04:08:53 -0400 Received: from [199.232.76.173] (port=53524 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ka4Sz-0003gE-LY for myserver-commit@gnu.org; Mon, 01 Sep 2008 04:08:53 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51609 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ka4Sz-0001qq-62 for myserver-commit@gnu.org; Mon, 01 Sep 2008 04:08:53 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Ka4Sy-0000m3-K0 for myserver-commit@gnu.org; Mon, 01 Sep 2008 08:08:52 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Ka4Sy-0000lM-8Z for myserver-commit@gnu.org; Mon, 01 Sep 2008 08:08:52 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 01 Sep 2008 08:08:52 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2776] Removed .deps files X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 08:08:54 -0000 Revision: 2776 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2776 Author: gscrivano Date: 2008-09-01 08:08:51 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Removed .deps files Modified Paths: -------------- trunk/myserver/src/Makefile.am trunk/myserver/tests/Makefile.am Removed Paths: ------------- trunk/myserver/src/.deps/ Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-01 06:32:36 UTC (rev 2775) +++ trunk/myserver/src/Makefile.am 2008-09-01 08:08:51 UTC (rev 2776) @@ -40,7 +40,7 @@ server/libserver.a libmyserver.a: rm -f libmyserver.a - ar cru libmyserver.a `find -iregex .*\\.o` + find -iregex .*\\.o | xargs ar cru libmyserver.a ranlib libmyserver.a #lib_LIBRARIES = libmyserver.a Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-01 06:32:36 UTC (rev 2775) +++ trunk/myserver/tests/Makefile.am 2008-09-01 08:08:51 UTC (rev 2776) @@ -4,4 +4,3 @@ bin_PROGRAMS = tests_suite tests_suite_SOURCES = main.cpp test_base64.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LIBS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) - From MAILER-DAEMON Mon Sep 01 05:28:56 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ka5iS-0005u7-IU for mharc-myserver-commit@gnu.org; Mon, 01 Sep 2008 05:28:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ka5iQ-0005tS-C3 for myserver-commit@gnu.org; Mon, 01 Sep 2008 05:28:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ka5iP-0005tC-O5 for myserver-commit@gnu.org; Mon, 01 Sep 2008 05:28:54 -0400 Received: from [199.232.76.173] (port=49339 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ka5iP-0005t1-Cr for myserver-commit@gnu.org; Mon, 01 Sep 2008 05:28:53 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43977 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ka5iO-0001A7-1n for myserver-commit@gnu.org; Mon, 01 Sep 2008 05:28:52 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Ka5iN-0002S4-3q for myserver-commit@gnu.org; Mon, 01 Sep 2008 09:28:51 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Ka5iM-0002RG-MZ for myserver-commit@gnu.org; Mon, 01 Sep 2008 09:28:50 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 01 Sep 2008 09:28:50 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2777] Fixed windows compiling problems X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 09:28:54 -0000 Revision: 2777 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2777 Author: gscrivano Date: 2008-09-01 09:28:50 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Fixed windows compiling problems Modified Paths: -------------- trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.dev trunk/myserver/binaries/web/cgi-src/post/post.cpp trunk/myserver/binaries/web/cgi-src/post/post.dev trunk/myserver/control/MyServer Configure.dev trunk/myserver/generate_myserver_dev.pl trunk/myserver/myserver.dev trunk/myserver/src/Makefile.am trunk/myserver/src/base/home_dir/home_dir.cpp Modified: trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp =================================================================== --- trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp 2008-09-01 09:28:50 UTC (rev 2777) @@ -1,8 +1,4 @@ -#ifdef WIN32 -#include "cgi_manager.h" -#else #include -#endif int isNumber(char* s) { Modified: trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.dev =================================================================== --- trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.dev 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.dev 2008-09-01 09:28:50 UTC (rev 2777) @@ -13,7 +13,7 @@ ProfilesCount=1 ProfileIndex=0 ObjFiles= -Includes=..\..\..\..\include +Includes=..\..\..\..\include;..\..\..\.. Libs= PrivateResource= ResourceIncludes= Modified: trunk/myserver/binaries/web/cgi-src/post/post.cpp =================================================================== --- trunk/myserver/binaries/web/cgi-src/post/post.cpp 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/binaries/web/cgi-src/post/post.cpp 2008-09-01 09:28:50 UTC (rev 2777) @@ -1,10 +1,5 @@ -#ifdef WIN32 -#include "cgi_manager.h" -#else #include -#endif - #ifdef WIN32 extern "C" int EXPORTABLE myserver_main (char *cmd,MsCgiData* data) #else Modified: trunk/myserver/binaries/web/cgi-src/post/post.dev =================================================================== --- trunk/myserver/binaries/web/cgi-src/post/post.dev 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/binaries/web/cgi-src/post/post.dev 2008-09-01 09:28:50 UTC (rev 2777) @@ -13,7 +13,7 @@ ProfilesCount=1 ProfileIndex=0 ObjFiles= -Includes=..\..\..\..\include +Includes=..\..\..\.. Libs= PrivateResource= ResourceIncludes= Modified: trunk/myserver/control/MyServer Configure.dev =================================================================== --- trunk/myserver/control/MyServer Configure.dev 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/control/MyServer Configure.dev 2008-09-01 09:28:50 UTC (rev 2777) @@ -5,7 +5,7 @@ Type=0 Ver=1 ObjFiles= -Includes= +Includes=..;. Libs= PrivateResource=MyServer_Configure_private.rc ResourceIncludes= Modified: trunk/myserver/generate_myserver_dev.pl =================================================================== --- trunk/myserver/generate_myserver_dev.pl 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/generate_myserver_dev.pl 2008-09-01 09:28:50 UTC (rev 2777) @@ -32,7 +32,7 @@ Type=1 Ver=1 ObjFiles= -Includes= +Includes=. Libs= PrivateResource=myserver_private.rc ResourceIncludes= @@ -52,7 +52,7 @@ IncludeVersionInfo=1 SupportXPThemes=0 CompilerSet=0 -CompilerSettings=0000001000000101000000 +CompilerSettings=0000001000000001000000 UseCustomMakefile=0 CustomMakefile= Modified: trunk/myserver/myserver.dev =================================================================== --- trunk/myserver/myserver.dev 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/myserver.dev 2008-09-01 09:28:50 UTC (rev 2777) @@ -5,14 +5,14 @@ Type=1 Ver=1 ObjFiles= -Includes= +Includes=. Libs= PrivateResource=myserver_private.rc ResourceIncludes= MakeIncludes= Compiler= CppCompiler= -Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@ +Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@_@@_ IsCpp=1 Icon= ExeOutput=binaries @@ -25,7 +25,7 @@ IncludeVersionInfo=1 SupportXPThemes=0 CompilerSet=0 -CompilerSettings=0000001000000101000000 +CompilerSettings=0000001000000001000000 UseCustomMakefile=0 CustomMakefile= @@ -46,6 +46,7 @@ ProductName=MyServer ProductVersion=0.9.0 AutoIncBuildNr=0 + [Unit1] FileName=stdafx.cpp CompileCpp=1 Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/src/Makefile.am 2008-09-01 09:28:50 UTC (rev 2777) @@ -38,7 +38,8 @@ plugin/filter/libfilter.a\ plugin/http_command/libhttp_command.a\ server/libserver.a -libmyserver.a: + +libmyserver.a: build_subdirs rm -f libmyserver.a find -iregex .*\\.o | xargs ar cru libmyserver.a ranlib libmyserver.a @@ -56,7 +57,7 @@ $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ $(XML_LIBS) -myserver_DEPENDENCIES = build_subdirs libmyserver.a +myserver_DEPENDENCIES = libmyserver.a build_subdirs: list='$(SUBDIRS)'; for subdir in $$list; do \ Modified: trunk/myserver/src/base/home_dir/home_dir.cpp =================================================================== --- trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-01 08:08:51 UTC (rev 2776) +++ trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-01 09:28:50 UTC (rev 2777) @@ -23,7 +23,7 @@ #include #ifdef WIN32 -#include +#include #endif extern "C" { #include From MAILER-DAEMON Mon Sep 01 06:08:56 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ka6LA-0005C1-71 for mharc-myserver-commit@gnu.org; Mon, 01 Sep 2008 06:08:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ka6L8-0005Ai-Cf for myserver-commit@gnu.org; Mon, 01 Sep 2008 06:08:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ka6L6-00058T-Qh for myserver-commit@gnu.org; Mon, 01 Sep 2008 06:08:53 -0400 Received: from [199.232.76.173] (port=44397 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ka6L6-000581-GW for myserver-commit@gnu.org; Mon, 01 Sep 2008 06:08:52 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53457 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ka6L5-0003Qy-Tz for myserver-commit@gnu.org; Mon, 01 Sep 2008 06:08:52 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Ka6L5-0002E4-99 for myserver-commit@gnu.org; Mon, 01 Sep 2008 10:08:51 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Ka6L4-0002DP-QC for myserver-commit@gnu.org; Mon, 01 Sep 2008 10:08:51 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 01 Sep 2008 10:08:50 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2778] Now make dist adds include files X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 10:08:54 -0000 Revision: 2778 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2778 Author: gscrivano Date: 2008-09-01 10:08:50 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Now make dist adds include files Modified Paths: -------------- trunk/myserver/Makefile.am trunk/myserver/binaries/Makefile.am trunk/myserver/configure.in trunk/myserver/control/Makefile.am Added Paths: ----------- trunk/myserver/include/Makefile.am trunk/myserver/include/base/Makefile.am trunk/myserver/include/base/base64/Makefile.am trunk/myserver/include/base/dynamic_lib/Makefile.am trunk/myserver/include/base/file/Makefile.am trunk/myserver/include/base/hash_map/Makefile.am trunk/myserver/include/base/home_dir/Makefile.am trunk/myserver/include/base/md5/Makefile.am trunk/myserver/include/base/mem_buff/Makefile.am trunk/myserver/include/base/multicast/Makefile.am trunk/myserver/include/base/pipe/Makefile.am trunk/myserver/include/base/process/Makefile.am trunk/myserver/include/base/regex/Makefile.am trunk/myserver/include/base/safetime/Makefile.am trunk/myserver/include/base/socket/Makefile.am trunk/myserver/include/base/ssl/Makefile.am trunk/myserver/include/base/string/Makefile.am trunk/myserver/include/base/sync/Makefile.am trunk/myserver/include/base/thread/Makefile.am trunk/myserver/include/base/xml/Makefile.am trunk/myserver/include/conf/Makefile.am trunk/myserver/include/conf/mime/Makefile.am trunk/myserver/include/conf/security/Makefile.am trunk/myserver/include/conf/vhost/Makefile.am trunk/myserver/include/connection/Makefile.am trunk/myserver/include/connections_scheduler/Makefile.am trunk/myserver/include/env/Makefile.am trunk/myserver/include/files_cache/Makefile.am trunk/myserver/include/filter/Makefile.am trunk/myserver/include/filter/gzip/Makefile.am trunk/myserver/include/find_data/Makefile.am trunk/myserver/include/http_handler/Makefile.am trunk/myserver/include/http_handler/cgi/Makefile.am trunk/myserver/include/http_handler/fastcgi/Makefile.am trunk/myserver/include/http_handler/isapi/Makefile.am trunk/myserver/include/http_handler/mscgi/Makefile.am trunk/myserver/include/http_handler/scgi/Makefile.am trunk/myserver/include/http_handler/wincgi/Makefile.am trunk/myserver/include/log/Makefile.am trunk/myserver/include/plugin/Makefile.am trunk/myserver/include/plugin/executor/Makefile.am trunk/myserver/include/plugin/filter/Makefile.am trunk/myserver/include/plugin/http_command/Makefile.am trunk/myserver/include/plugin/http_manager/Makefile.am trunk/myserver/include/plugin/protocol/Makefile.am trunk/myserver/include/protocol/Makefile.am trunk/myserver/include/protocol/control/Makefile.am trunk/myserver/include/protocol/ftp/Makefile.am trunk/myserver/include/protocol/http/Makefile.am trunk/myserver/include/protocol/https/Makefile.am trunk/myserver/include/server/Makefile.am Modified: trunk/myserver/Makefile.am =================================================================== --- trunk/myserver/Makefile.am 2008-09-01 09:28:50 UTC (rev 2777) +++ trunk/myserver/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -15,4 +15,6 @@ $(top_srcdir)/configure.in -SUBDIRS = src $(CONTROL) $(CGI_LIB) binaries documentation $(TESTS) +SUBDIRS = src include $(CONTROL) $(CGI_LIB) binaries documentation $(TESTS) + +EXTRA_DIST = stdafx.h stdafx.cpp doxygen SConstruct Modified: trunk/myserver/binaries/Makefile.am =================================================================== --- trunk/myserver/binaries/Makefile.am 2008-09-01 09:28:50 UTC (rev 2777) +++ trunk/myserver/binaries/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -1,4 +1,4 @@ -SUBDIRS = languages logs system web certificates +SUBDIRS = languages logs system web certificates plugins EXTRA_DIST = myserver-daemon myserver.ico license.txt MIMEtypes.xml.unix.default \ myserver.xml.unix.default readme.txt virtualhosts.xml.unix.default Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-01 09:28:50 UTC (rev 2777) +++ trunk/myserver/configure.in 2008-09-01 10:08:50 UTC (rev 2778) @@ -427,6 +427,57 @@ src/plugin/http_command/Makefile src/server/Makefile src/Makefile + include/find_data/Makefile + include/connection/Makefile + include/env/Makefile + include/log/Makefile + include/conf/Makefile + include/conf/mime/Makefile + include/conf/security/Makefile + include/conf/vhost/Makefile + include/connections_scheduler/Makefile + include/http_handler/Makefile + include/http_handler/wincgi/Makefile + include/http_handler/cgi/Makefile + include/http_handler/mscgi/Makefile + include/http_handler/fastcgi/Makefile + include/http_handler/scgi/Makefile + include/http_handler/isapi/Makefile + include/base/Makefile + include/base/file/Makefile + include/base/pipe/Makefile + include/base/base64/Makefile + include/base/mem_buff/Makefile + include/base/home_dir/Makefile + include/base/multicast/Makefile + include/base/sync/Makefile + include/base/safetime/Makefile + include/base/socket/Makefile + include/base/hash_map/Makefile + include/base/dynamic_lib/Makefile + include/base/process/Makefile + include/base/md5/Makefile + include/base/ssl/Makefile + include/base/xml/Makefile + include/base/string/Makefile + include/base/regex/Makefile + include/base/thread/Makefile + include/protocol/Makefile + include/protocol/ftp/Makefile + include/protocol/control/Makefile + include/protocol/https/Makefile + include/protocol/http/Makefile + include/files_cache/Makefile + include/filter/Makefile + include/filter/gzip/Makefile + include/plugin/Makefile + include/plugin/executor/Makefile + include/plugin/http_manager/Makefile + include/plugin/protocol/Makefile + include/plugin/filter/Makefile + include/plugin/http_command/Makefile + include/server/Makefile + include/Makefile tests/Makefile ]) AC_OUTPUT Modified: trunk/myserver/control/Makefile.am =================================================================== --- trunk/myserver/control/Makefile.am 2008-09-01 09:28:50 UTC (rev 2777) +++ trunk/myserver/control/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -7,5 +7,7 @@ myserver_configure_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) $(FLTK_CFLAGS) -DPREFIX=\"$(prefix)\" myserver_configure_LDADD = $(XML_LIBS) $(FLTK_LIBS) $(XNET_LIB) $(OPENSSL_LIB) +EXTRA_DIST = control_client.h fltkconfig.h language.h mimetype.h progress.h service.h vector.h vhost.h + all : all-am myserver-configure cp myserver-configure ../binaries/ Added: trunk/myserver/include/Makefile.am =================================================================== --- trunk/myserver/include/Makefile.am (rev 0) +++ trunk/myserver/include/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = +SUBDIRS = base conf connection connections_scheduler env files_cache filter find_data http_handler log plugin protocol server + Added: trunk/myserver/include/base/Makefile.am =================================================================== --- trunk/myserver/include/base/Makefile.am (rev 0) +++ trunk/myserver/include/base/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = utility.h +SUBDIRS = base64 dynamic_lib file hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml + Added: trunk/myserver/include/base/base64/Makefile.am =================================================================== --- trunk/myserver/include/base/base64/Makefile.am (rev 0) +++ trunk/myserver/include/base/base64/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = mime_utils.h +SUBDIRS = + Added: trunk/myserver/include/base/dynamic_lib/Makefile.am =================================================================== --- trunk/myserver/include/base/dynamic_lib/Makefile.am (rev 0) +++ trunk/myserver/include/base/dynamic_lib/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = dynamiclib.h +SUBDIRS = + Added: trunk/myserver/include/base/file/Makefile.am =================================================================== --- trunk/myserver/include/base/file/Makefile.am (rev 0) +++ trunk/myserver/include/base/file/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = file.h files_utility.h +SUBDIRS = + Added: trunk/myserver/include/base/hash_map/Makefile.am =================================================================== --- trunk/myserver/include/base/hash_map/Makefile.am (rev 0) +++ trunk/myserver/include/base/hash_map/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = hash_map.h +SUBDIRS = + Added: trunk/myserver/include/base/home_dir/Makefile.am =================================================================== --- trunk/myserver/include/base/home_dir/Makefile.am (rev 0) +++ trunk/myserver/include/base/home_dir/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = home_dir.h +SUBDIRS = + Added: trunk/myserver/include/base/md5/Makefile.am =================================================================== --- trunk/myserver/include/base/md5/Makefile.am (rev 0) +++ trunk/myserver/include/base/md5/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = md5.h +SUBDIRS = + Added: trunk/myserver/include/base/mem_buff/Makefile.am =================================================================== --- trunk/myserver/include/base/mem_buff/Makefile.am (rev 0) +++ trunk/myserver/include/base/mem_buff/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = mem_buff.h +SUBDIRS = + Added: trunk/myserver/include/base/multicast/Makefile.am =================================================================== --- trunk/myserver/include/base/multicast/Makefile.am (rev 0) +++ trunk/myserver/include/base/multicast/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = multicast.h +SUBDIRS = + Added: trunk/myserver/include/base/pipe/Makefile.am =================================================================== --- trunk/myserver/include/base/pipe/Makefile.am (rev 0) +++ trunk/myserver/include/base/pipe/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = pipe.h +SUBDIRS = + Added: trunk/myserver/include/base/process/Makefile.am =================================================================== --- trunk/myserver/include/base/process/Makefile.am (rev 0) +++ trunk/myserver/include/base/process/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = process.h process_server_manager.h +SUBDIRS = + Added: trunk/myserver/include/base/regex/Makefile.am =================================================================== --- trunk/myserver/include/base/regex/Makefile.am (rev 0) +++ trunk/myserver/include/base/regex/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = myserver_regex.h +SUBDIRS = + Added: trunk/myserver/include/base/safetime/Makefile.am =================================================================== --- trunk/myserver/include/base/safetime/Makefile.am (rev 0) +++ trunk/myserver/include/base/safetime/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = safetime.h +SUBDIRS = + Added: trunk/myserver/include/base/socket/Makefile.am =================================================================== --- trunk/myserver/include/base/socket/Makefile.am (rev 0) +++ trunk/myserver/include/base/socket/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = socket.h ssl_socket.h +SUBDIRS = + Added: trunk/myserver/include/base/ssl/Makefile.am =================================================================== --- trunk/myserver/include/base/ssl/Makefile.am (rev 0) +++ trunk/myserver/include/base/ssl/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = ssl.h +SUBDIRS = + Added: trunk/myserver/include/base/string/Makefile.am =================================================================== --- trunk/myserver/include/base/string/Makefile.am (rev 0) +++ trunk/myserver/include/base/string/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = securestr.h stringutils.h +SUBDIRS = + Added: trunk/myserver/include/base/sync/Makefile.am =================================================================== --- trunk/myserver/include/base/sync/Makefile.am (rev 0) +++ trunk/myserver/include/base/sync/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = event.h mutex.h read_write_lock.h recursive_mutex.h semaphore.h +SUBDIRS = + Added: trunk/myserver/include/base/thread/Makefile.am =================================================================== --- trunk/myserver/include/base/thread/Makefile.am (rev 0) +++ trunk/myserver/include/base/thread/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = thread.h +SUBDIRS = + Added: trunk/myserver/include/base/xml/Makefile.am =================================================================== --- trunk/myserver/include/base/xml/Makefile.am (rev 0) +++ trunk/myserver/include/base/xml/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = xml_parser.h +SUBDIRS = + Added: trunk/myserver/include/conf/Makefile.am =================================================================== --- trunk/myserver/include/conf/Makefile.am (rev 0) +++ trunk/myserver/include/conf/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = +SUBDIRS = mime security vhost + Added: trunk/myserver/include/conf/mime/Makefile.am =================================================================== --- trunk/myserver/include/conf/mime/Makefile.am (rev 0) +++ trunk/myserver/include/conf/mime/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = mime_manager.h +SUBDIRS = + Added: trunk/myserver/include/conf/security/Makefile.am =================================================================== --- trunk/myserver/include/conf/security/Makefile.am (rev 0) +++ trunk/myserver/include/conf/security/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = security_cache.h security.h +SUBDIRS = + Added: trunk/myserver/include/conf/vhost/Makefile.am =================================================================== --- trunk/myserver/include/conf/vhost/Makefile.am (rev 0) +++ trunk/myserver/include/conf/vhost/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = vhost.h vhost_manager.h +SUBDIRS = + Added: trunk/myserver/include/connection/Makefile.am =================================================================== --- trunk/myserver/include/connection/Makefile.am (rev 0) +++ trunk/myserver/include/connection/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = connection.h +SUBDIRS = + Added: trunk/myserver/include/connections_scheduler/Makefile.am =================================================================== --- trunk/myserver/include/connections_scheduler/Makefile.am (rev 0) +++ trunk/myserver/include/connections_scheduler/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = connections_scheduler.h listen_threads.h +SUBDIRS = + Added: trunk/myserver/include/env/Makefile.am =================================================================== --- trunk/myserver/include/env/Makefile.am (rev 0) +++ trunk/myserver/include/env/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = env.h +SUBDIRS = + Added: trunk/myserver/include/files_cache/Makefile.am =================================================================== --- trunk/myserver/include/files_cache/Makefile.am (rev 0) +++ trunk/myserver/include/files_cache/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = cached_file_buffer.h cached_file_factory.h cached_file.h +SUBDIRS = + Added: trunk/myserver/include/filter/Makefile.am =================================================================== --- trunk/myserver/include/filter/Makefile.am (rev 0) +++ trunk/myserver/include/filter/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = filter.h filters_chain.h filters_factory.h memory_stream.h stream.h +SUBDIRS = gzip + Added: trunk/myserver/include/filter/gzip/Makefile.am =================================================================== --- trunk/myserver/include/filter/gzip/Makefile.am (rev 0) +++ trunk/myserver/include/filter/gzip/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = gzip_decompress.h gzip.h +SUBDIRS = + Added: trunk/myserver/include/find_data/Makefile.am =================================================================== --- trunk/myserver/include/find_data/Makefile.am (rev 0) +++ trunk/myserver/include/find_data/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = find_data.h +SUBDIRS = + Added: trunk/myserver/include/http_handler/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = +SUBDIRS = cgi fastcgi isapi mscgi scgi wincgi + Added: trunk/myserver/include/http_handler/cgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/cgi/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/cgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = cgi.h +SUBDIRS = + Added: trunk/myserver/include/http_handler/fastcgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/fastcgi/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/fastcgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = fastcgi.h +SUBDIRS = + Added: trunk/myserver/include/http_handler/isapi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/isapi/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/isapi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = isapi.h +SUBDIRS = + Added: trunk/myserver/include/http_handler/mscgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/mscgi/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/mscgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = mscgi.h mscgi_manager.h +SUBDIRS = + Added: trunk/myserver/include/http_handler/scgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/scgi/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/scgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = scgi.h +SUBDIRS = + Added: trunk/myserver/include/http_handler/wincgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/wincgi/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/wincgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = wincgi.h +SUBDIRS = + Added: trunk/myserver/include/log/Makefile.am =================================================================== --- trunk/myserver/include/log/Makefile.am (rev 0) +++ trunk/myserver/include/log/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = log_manager.h +SUBDIRS = + Added: trunk/myserver/include/plugin/Makefile.am =================================================================== --- trunk/myserver/include/plugin/Makefile.am (rev 0) +++ trunk/myserver/include/plugin/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = generic_plugins_manager.h plugin.h plugins_manager.h plugins_namespace.h plugins_namespace_manager.h +SUBDIRS = executor filter http_command http_manager protocol + Added: trunk/myserver/include/plugin/executor/Makefile.am =================================================================== --- trunk/myserver/include/plugin/executor/Makefile.am (rev 0) +++ trunk/myserver/include/plugin/executor/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = dynamic_executor.h dyn_executor_manager.h +SUBDIRS = + Added: trunk/myserver/include/plugin/filter/Makefile.am =================================================================== --- trunk/myserver/include/plugin/filter/Makefile.am (rev 0) +++ trunk/myserver/include/plugin/filter/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = dyn_filter_file.h dyn_filter.h dyn_filters_manager.h +SUBDIRS = + Added: trunk/myserver/include/plugin/http_command/Makefile.am =================================================================== --- trunk/myserver/include/plugin/http_command/Makefile.am (rev 0) +++ trunk/myserver/include/plugin/http_command/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = dyn_http_command.h dyn_http_command_manager.h +SUBDIRS = + Added: trunk/myserver/include/plugin/http_manager/Makefile.am =================================================================== --- trunk/myserver/include/plugin/http_manager/Makefile.am (rev 0) +++ trunk/myserver/include/plugin/http_manager/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = dyn_http_manager.h dyn_http_manager_list.h +SUBDIRS = + Added: trunk/myserver/include/plugin/protocol/Makefile.am =================================================================== --- trunk/myserver/include/plugin/protocol/Makefile.am (rev 0) +++ trunk/myserver/include/plugin/protocol/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = dynamic_protocol.h protocols_manager.h +SUBDIRS = + Added: trunk/myserver/include/protocol/Makefile.am =================================================================== --- trunk/myserver/include/protocol/Makefile.am (rev 0) +++ trunk/myserver/include/protocol/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = protocol_buffer.h protocol.h +SUBDIRS = control ftp http https + Added: trunk/myserver/include/protocol/control/Makefile.am =================================================================== --- trunk/myserver/include/protocol/control/Makefile.am (rev 0) +++ trunk/myserver/include/protocol/control/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = control_errors.h control_header.h control_protocol.h +SUBDIRS = + Added: trunk/myserver/include/protocol/ftp/Makefile.am =================================================================== --- trunk/myserver/include/protocol/ftp/Makefile.am (rev 0) +++ trunk/myserver/include/protocol/ftp/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = ftp_common.h ftp.h ftp_lexer.h ftp_parser.h +SUBDIRS = + Added: trunk/myserver/include/protocol/http/Makefile.am =================================================================== --- trunk/myserver/include/protocol/http/Makefile.am (rev 0) +++ trunk/myserver/include/protocol/http/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = http_data_handler.h http_data_read.h http_dir.h http_errors.h http_file.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h +SUBDIRS = + Added: trunk/myserver/include/protocol/https/Makefile.am =================================================================== --- trunk/myserver/include/protocol/https/Makefile.am (rev 0) +++ trunk/myserver/include/protocol/https/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = https.h +SUBDIRS = + Added: trunk/myserver/include/server/Makefile.am =================================================================== --- trunk/myserver/include/server/Makefile.am (rev 0) +++ trunk/myserver/include/server/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) @@ -0,0 +1,3 @@ +EXTRA_DIST = clients_thread.h server.h +SUBDIRS = + From MAILER-DAEMON Mon Sep 01 15:56:51 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KaFW7-0003cm-1e for mharc-myserver-commit@gnu.org; Mon, 01 Sep 2008 15:56:51 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KaFW4-0003ag-Ip for myserver-commit@gnu.org; Mon, 01 Sep 2008 15:56:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaFW3-0003ZY-8V for myserver-commit@gnu.org; Mon, 01 Sep 2008 15:56:48 -0400 Received: from [199.232.76.173] (port=45023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaFW2-0003ZD-To for myserver-commit@gnu.org; Mon, 01 Sep 2008 15:56:46 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56707 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KaFW1-0002XY-At for myserver-commit@gnu.org; Mon, 01 Sep 2008 15:56:46 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KaFVx-0007PV-RB for myserver-commit@gnu.org; Mon, 01 Sep 2008 19:56:41 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KaFVw-0007Ov-Sn for myserver-commit@gnu.org; Mon, 01 Sep 2008 19:56:41 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 01 Sep 2008 19:56:40 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2779] use include_HEADERS instead of EXTRA_DIST for include files X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 19:56:49 -0000 Revision: 2779 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2779 Author: gscrivano Date: 2008-09-01 19:56:39 +0000 (Mon, 01 Sep 2008) Log Message: ----------- use include_HEADERS instead of EXTRA_DIST for include files Modified Paths: -------------- trunk/myserver/include/Makefile.am trunk/myserver/include/base/Makefile.am trunk/myserver/include/base/base64/Makefile.am trunk/myserver/include/base/dynamic_lib/Makefile.am trunk/myserver/include/base/file/Makefile.am trunk/myserver/include/base/hash_map/Makefile.am trunk/myserver/include/base/home_dir/Makefile.am trunk/myserver/include/base/md5/Makefile.am trunk/myserver/include/base/mem_buff/Makefile.am trunk/myserver/include/base/multicast/Makefile.am trunk/myserver/include/base/pipe/Makefile.am trunk/myserver/include/base/process/Makefile.am trunk/myserver/include/base/regex/Makefile.am trunk/myserver/include/base/safetime/Makefile.am trunk/myserver/include/base/socket/Makefile.am trunk/myserver/include/base/ssl/Makefile.am trunk/myserver/include/base/string/Makefile.am trunk/myserver/include/base/sync/Makefile.am trunk/myserver/include/base/thread/Makefile.am trunk/myserver/include/base/xml/Makefile.am trunk/myserver/include/conf/Makefile.am trunk/myserver/include/conf/mime/Makefile.am trunk/myserver/include/conf/security/Makefile.am trunk/myserver/include/conf/vhost/Makefile.am trunk/myserver/include/connection/Makefile.am trunk/myserver/include/connections_scheduler/Makefile.am trunk/myserver/include/env/Makefile.am trunk/myserver/include/files_cache/Makefile.am trunk/myserver/include/filter/Makefile.am trunk/myserver/include/filter/gzip/Makefile.am trunk/myserver/include/find_data/Makefile.am trunk/myserver/include/http_handler/Makefile.am trunk/myserver/include/http_handler/cgi/Makefile.am trunk/myserver/include/http_handler/fastcgi/Makefile.am trunk/myserver/include/http_handler/isapi/Makefile.am trunk/myserver/include/http_handler/mscgi/Makefile.am trunk/myserver/include/http_handler/scgi/Makefile.am trunk/myserver/include/http_handler/wincgi/Makefile.am trunk/myserver/include/log/Makefile.am trunk/myserver/include/plugin/Makefile.am trunk/myserver/include/plugin/executor/Makefile.am trunk/myserver/include/plugin/filter/Makefile.am trunk/myserver/include/plugin/http_command/Makefile.am trunk/myserver/include/plugin/http_manager/Makefile.am trunk/myserver/include/plugin/protocol/Makefile.am trunk/myserver/include/protocol/Makefile.am trunk/myserver/include/protocol/control/Makefile.am trunk/myserver/include/protocol/ftp/Makefile.am trunk/myserver/include/protocol/http/Makefile.am trunk/myserver/include/protocol/https/Makefile.am trunk/myserver/include/server/Makefile.am trunk/myserver/src/Makefile.am Modified: trunk/myserver/include/Makefile.am =================================================================== --- trunk/myserver/include/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,2 @@ -EXTRA_DIST = SUBDIRS = base conf connection connections_scheduler env files_cache filter find_data http_handler log plugin protocol server Modified: trunk/myserver/include/base/Makefile.am =================================================================== --- trunk/myserver/include/base/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = utility.h +include_HEADERS = utility.h SUBDIRS = base64 dynamic_lib file hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml Modified: trunk/myserver/include/base/base64/Makefile.am =================================================================== --- trunk/myserver/include/base/base64/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/base64/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = mime_utils.h +include_HEADERS = mime_utils.h SUBDIRS = Modified: trunk/myserver/include/base/dynamic_lib/Makefile.am =================================================================== --- trunk/myserver/include/base/dynamic_lib/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/dynamic_lib/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = dynamiclib.h +include_HEADERS = dynamiclib.h SUBDIRS = Modified: trunk/myserver/include/base/file/Makefile.am =================================================================== --- trunk/myserver/include/base/file/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/file/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = file.h files_utility.h +include_HEADERS = file.h files_utility.h SUBDIRS = Modified: trunk/myserver/include/base/hash_map/Makefile.am =================================================================== --- trunk/myserver/include/base/hash_map/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/hash_map/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = hash_map.h +include_HEADERS = hash_map.h SUBDIRS = Modified: trunk/myserver/include/base/home_dir/Makefile.am =================================================================== --- trunk/myserver/include/base/home_dir/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/home_dir/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = home_dir.h +include_HEADERS = home_dir.h SUBDIRS = Modified: trunk/myserver/include/base/md5/Makefile.am =================================================================== --- trunk/myserver/include/base/md5/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/md5/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = md5.h +include_HEADERS = md5.h SUBDIRS = Modified: trunk/myserver/include/base/mem_buff/Makefile.am =================================================================== --- trunk/myserver/include/base/mem_buff/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/mem_buff/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = mem_buff.h +include_HEADERS = mem_buff.h SUBDIRS = Modified: trunk/myserver/include/base/multicast/Makefile.am =================================================================== --- trunk/myserver/include/base/multicast/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/multicast/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = multicast.h +include_HEADERS = multicast.h SUBDIRS = Modified: trunk/myserver/include/base/pipe/Makefile.am =================================================================== --- trunk/myserver/include/base/pipe/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/pipe/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = pipe.h +include_HEADERS = pipe.h SUBDIRS = Modified: trunk/myserver/include/base/process/Makefile.am =================================================================== --- trunk/myserver/include/base/process/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/process/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = process.h process_server_manager.h +include_HEADERS = process.h process_server_manager.h SUBDIRS = Modified: trunk/myserver/include/base/regex/Makefile.am =================================================================== --- trunk/myserver/include/base/regex/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/regex/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = myserver_regex.h +include_HEADERS = myserver_regex.h SUBDIRS = Modified: trunk/myserver/include/base/safetime/Makefile.am =================================================================== --- trunk/myserver/include/base/safetime/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/safetime/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = safetime.h +include_HEADERS = safetime.h SUBDIRS = Modified: trunk/myserver/include/base/socket/Makefile.am =================================================================== --- trunk/myserver/include/base/socket/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/socket/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = socket.h ssl_socket.h +include_HEADERS = socket.h ssl_socket.h SUBDIRS = Modified: trunk/myserver/include/base/ssl/Makefile.am =================================================================== --- trunk/myserver/include/base/ssl/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/ssl/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = ssl.h +include_HEADERS = ssl.h SUBDIRS = Modified: trunk/myserver/include/base/string/Makefile.am =================================================================== --- trunk/myserver/include/base/string/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/string/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = securestr.h stringutils.h +include_HEADERS = securestr.h stringutils.h SUBDIRS = Modified: trunk/myserver/include/base/sync/Makefile.am =================================================================== --- trunk/myserver/include/base/sync/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/sync/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = event.h mutex.h read_write_lock.h recursive_mutex.h semaphore.h +include_HEADERS = event.h mutex.h read_write_lock.h recursive_mutex.h semaphore.h SUBDIRS = Modified: trunk/myserver/include/base/thread/Makefile.am =================================================================== --- trunk/myserver/include/base/thread/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/thread/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = thread.h +include_HEADERS = thread.h SUBDIRS = Modified: trunk/myserver/include/base/xml/Makefile.am =================================================================== --- trunk/myserver/include/base/xml/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/base/xml/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = xml_parser.h +include_HEADERS = xml_parser.h SUBDIRS = Modified: trunk/myserver/include/conf/Makefile.am =================================================================== --- trunk/myserver/include/conf/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/conf/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = +include_HEADERS = SUBDIRS = mime security vhost Modified: trunk/myserver/include/conf/mime/Makefile.am =================================================================== --- trunk/myserver/include/conf/mime/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/conf/mime/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = mime_manager.h +include_HEADERS = mime_manager.h SUBDIRS = Modified: trunk/myserver/include/conf/security/Makefile.am =================================================================== --- trunk/myserver/include/conf/security/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/conf/security/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = security_cache.h security.h +include_HEADERS = security_cache.h security.h SUBDIRS = Modified: trunk/myserver/include/conf/vhost/Makefile.am =================================================================== --- trunk/myserver/include/conf/vhost/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/conf/vhost/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = vhost.h vhost_manager.h +include_HEADERS = vhost.h vhost_manager.h SUBDIRS = Modified: trunk/myserver/include/connection/Makefile.am =================================================================== --- trunk/myserver/include/connection/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/connection/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = connection.h +include_HEADERS = connection.h SUBDIRS = Modified: trunk/myserver/include/connections_scheduler/Makefile.am =================================================================== --- trunk/myserver/include/connections_scheduler/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/connections_scheduler/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = connections_scheduler.h listen_threads.h +include_HEADERS = connections_scheduler.h listen_threads.h SUBDIRS = Modified: trunk/myserver/include/env/Makefile.am =================================================================== --- trunk/myserver/include/env/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/env/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = env.h +include_HEADERS = env.h SUBDIRS = Modified: trunk/myserver/include/files_cache/Makefile.am =================================================================== --- trunk/myserver/include/files_cache/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/files_cache/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = cached_file_buffer.h cached_file_factory.h cached_file.h +include_HEADERS = cached_file_buffer.h cached_file_factory.h cached_file.h SUBDIRS = Modified: trunk/myserver/include/filter/Makefile.am =================================================================== --- trunk/myserver/include/filter/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/filter/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = filter.h filters_chain.h filters_factory.h memory_stream.h stream.h +include_HEADERS = filter.h filters_chain.h filters_factory.h memory_stream.h stream.h SUBDIRS = gzip Modified: trunk/myserver/include/filter/gzip/Makefile.am =================================================================== --- trunk/myserver/include/filter/gzip/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/filter/gzip/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = gzip_decompress.h gzip.h +include_HEADERS = gzip_decompress.h gzip.h SUBDIRS = Modified: trunk/myserver/include/find_data/Makefile.am =================================================================== --- trunk/myserver/include/find_data/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/find_data/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = find_data.h +include_HEADERS = find_data.h SUBDIRS = Modified: trunk/myserver/include/http_handler/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = +include_HEADERS = SUBDIRS = cgi fastcgi isapi mscgi scgi wincgi Modified: trunk/myserver/include/http_handler/cgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/cgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/cgi/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = cgi.h +include_HEADERS = cgi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/fastcgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/fastcgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/fastcgi/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = fastcgi.h +include_HEADERS = fastcgi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/isapi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/isapi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/isapi/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = isapi.h +include_HEADERS = isapi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/mscgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/mscgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/mscgi/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = mscgi.h mscgi_manager.h +include_HEADERS = mscgi.h mscgi_manager.h SUBDIRS = Modified: trunk/myserver/include/http_handler/scgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/scgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/scgi/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = scgi.h +include_HEADERS = scgi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/wincgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/wincgi/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/http_handler/wincgi/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = wincgi.h +include_HEADERS = wincgi.h SUBDIRS = Modified: trunk/myserver/include/log/Makefile.am =================================================================== --- trunk/myserver/include/log/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/log/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = log_manager.h +include_HEADERS = log_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/Makefile.am =================================================================== --- trunk/myserver/include/plugin/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/plugin/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = generic_plugins_manager.h plugin.h plugins_manager.h plugins_namespace.h plugins_namespace_manager.h +include_HEADERS = generic_plugins_manager.h plugin.h plugins_manager.h plugins_namespace.h plugins_namespace_manager.h SUBDIRS = executor filter http_command http_manager protocol Modified: trunk/myserver/include/plugin/executor/Makefile.am =================================================================== --- trunk/myserver/include/plugin/executor/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/plugin/executor/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = dynamic_executor.h dyn_executor_manager.h +include_HEADERS = dynamic_executor.h dyn_executor_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/filter/Makefile.am =================================================================== --- trunk/myserver/include/plugin/filter/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/plugin/filter/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = dyn_filter_file.h dyn_filter.h dyn_filters_manager.h +include_HEADERS = dyn_filter_file.h dyn_filter.h dyn_filters_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/http_command/Makefile.am =================================================================== --- trunk/myserver/include/plugin/http_command/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/plugin/http_command/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = dyn_http_command.h dyn_http_command_manager.h +include_HEADERS = dyn_http_command.h dyn_http_command_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/http_manager/Makefile.am =================================================================== --- trunk/myserver/include/plugin/http_manager/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/plugin/http_manager/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = dyn_http_manager.h dyn_http_manager_list.h +include_HEADERS = dyn_http_manager.h dyn_http_manager_list.h SUBDIRS = Modified: trunk/myserver/include/plugin/protocol/Makefile.am =================================================================== --- trunk/myserver/include/plugin/protocol/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/plugin/protocol/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = dynamic_protocol.h protocols_manager.h +include_HEADERS = dynamic_protocol.h protocols_manager.h SUBDIRS = Modified: trunk/myserver/include/protocol/Makefile.am =================================================================== --- trunk/myserver/include/protocol/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/protocol/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = protocol_buffer.h protocol.h +include_HEADERS = protocol_buffer.h protocol.h SUBDIRS = control ftp http https Modified: trunk/myserver/include/protocol/control/Makefile.am =================================================================== --- trunk/myserver/include/protocol/control/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/protocol/control/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = control_errors.h control_header.h control_protocol.h +include_HEADERS = control_errors.h control_header.h control_protocol.h SUBDIRS = Modified: trunk/myserver/include/protocol/ftp/Makefile.am =================================================================== --- trunk/myserver/include/protocol/ftp/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/protocol/ftp/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = ftp_common.h ftp.h ftp_lexer.h ftp_parser.h +include_HEADERS = ftp_common.h ftp.h ftp_lexer.h ftp_parser.h SUBDIRS = Modified: trunk/myserver/include/protocol/http/Makefile.am =================================================================== --- trunk/myserver/include/protocol/http/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/protocol/http/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = http_data_handler.h http_data_read.h http_dir.h http_errors.h http_file.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h +include_HEADERS = http_data_handler.h http_data_read.h http_dir.h http_errors.h http_file.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h SUBDIRS = Modified: trunk/myserver/include/protocol/https/Makefile.am =================================================================== --- trunk/myserver/include/protocol/https/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/protocol/https/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = https.h +include_HEADERS = https.h SUBDIRS = Modified: trunk/myserver/include/server/Makefile.am =================================================================== --- trunk/myserver/include/server/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/include/server/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -1,3 +1,3 @@ -EXTRA_DIST = clients_thread.h server.h +include_HEADERS = clients_thread.h server.h SUBDIRS = Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-01 10:08:50 UTC (rev 2778) +++ trunk/myserver/src/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) @@ -3,51 +3,52 @@ filter find_data http_handler log plugin protocol server -STATIC_AR = find_data/libfind_data.a \ - connection/libconnection.a env/libenv.a\ - log/liblog.a conf/mime/libmime.a\ - conf/security/libsecurity.a conf/vhost/libvhost.a\ - conf/libconf.a\ - connections_scheduler/libconnections_scheduler.a\ - http_handler/wincgi/libwincgi.a\ - http_handler/cgi/libcgi.a\ - http_handler/mscgi/libmscgi.a\ - http_handler/fastcgi/libfastcgi.a\ - http_handler/scgi/libscgi.a\ - http_handler/isapi/libisapi.a\ - http_handler/libhttp_handler.a base/file/libfile.a\ - base/pipe/libpipe.a base/base64/libbase64.a\ - base/mem_buff/libmem_buff.a base/libbase.a\ - base/home_dir/libhome_dir.a\ - base/multicast/libmulticast.a base/sync/libsync.a\ - base/safetime/libsafetime.a\ - base/socket/libsocket.a\ - base/hash_map/libhash_map.a\ - base/dynamic_lib/libdynamic_lib.a\ - base/process/libprocess.a base/md5/libmd5.a\ - base/ssl/libssl.a base/xml/libxml.a\ - base/string/libstring.a base/regex/libregex.a\ - base/thread/libthread.a protocol/ftp/libftp.a\ - protocol/control/libcontrol.a\ - protocol/libprotocol.a protocol/https/libhttps.a\ - protocol/http/libhttp.a\ - files_cache/libfiles_cache.a filter/gzip/libgzip.a\ - filter/libfilter.a plugin/executor/libexecutor.a\ - plugin/http_manager/libhttp_manager.a\ - plugin/libplugin.a plugin/protocol/libprotocol.a\ - plugin/filter/libfilter.a\ - plugin/http_command/libhttp_command.a\ - server/libserver.a +# STATIC_AR = find_data/libfind_data.a \ +# connection/libconnection.a env/libenv.a\ +# log/liblog.a conf/mime/libmime.a\ +# conf/security/libsecurity.a conf/vhost/libvhost.a\ +# conf/libconf.a\ +# connections_scheduler/libconnections_scheduler.a\ +# http_handler/wincgi/libwincgi.a\ +# http_handler/cgi/libcgi.a\ +# http_handler/mscgi/libmscgi.a\ +# http_handler/fastcgi/libfastcgi.a\ +# http_handler/scgi/libscgi.a\ +# http_handler/isapi/libisapi.a\ +# http_handler/libhttp_handler.a base/file/libfile.a\ +# base/pipe/libpipe.a base/base64/libbase64.a\ +# base/mem_buff/libmem_buff.a base/libbase.a\ +# base/home_dir/libhome_dir.a\ +# base/multicast/libmulticast.a base/sync/libsync.a\ +# base/safetime/libsafetime.a\ +# base/socket/libsocket.a\ +# base/hash_map/libhash_map.a\ +# base/dynamic_lib/libdynamic_lib.a\ +# base/process/libprocess.a base/md5/libmd5.a\ +# base/ssl/libssl.a base/xml/libxml.a\ +# base/string/libstring.a base/regex/libregex.a\ +# base/thread/libthread.a protocol/ftp/libftp.a\ +# protocol/control/libcontrol.a\ +# protocol/libprotocol.a protocol/https/libhttps.a\ +# protocol/http/libhttp.a\ +# files_cache/libfiles_cache.a filter/gzip/libgzip.a\ +# filter/libfilter.a plugin/executor/libexecutor.a\ +# plugin/http_manager/libhttp_manager.a\ +# plugin/libplugin.a plugin/protocol/libprotocol.a\ +# plugin/filter/libfilter.a\ +# plugin/http_command/libhttp_command.a\ +# server/libserver.a +build_subdirs: + list='$(SUBDIRS)'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all) \ + done; + libmyserver.a: build_subdirs rm -f libmyserver.a find -iregex .*\\.o | xargs ar cru libmyserver.a ranlib libmyserver.a -#lib_LIBRARIES = libmyserver.a -#libmyserver_a_SOURCES = -#libmyserver_a_LIBADD = $(STATIC_AR) - bin_PROGRAMS = myserver myserver_SOURCES = myserver.cpp @@ -59,11 +60,6 @@ myserver_DEPENDENCIES = libmyserver.a -build_subdirs: - list='$(SUBDIRS)'; for subdir in $$list; do \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all) \ - done; - myserver_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\" myserver_LDFLAGS = -rdynamic libmyserver.a From MAILER-DAEMON Tue Sep 02 15:01:10 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kab7m-0003vF-8j for mharc-myserver-commit@gnu.org; Tue, 02 Sep 2008 15:01:10 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kab7h-0003rA-W6 for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:01:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kab7d-0003nf-1c for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:01:04 -0400 Received: from [199.232.76.173] (port=47046 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kab7c-0003nJ-PP for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:01:00 -0400 Received: from savannah.gnu.org ([199.232.41.3]:34062 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kab7b-0005Qw-41 for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:01:00 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kab7Z-0002NP-UG for myserver-commit@gnu.org; Tue, 02 Sep 2008 19:00:58 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kab7Y-0002Mn-4h for myserver-commit@gnu.org; Tue, 02 Sep 2008 19:00:57 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 02 Sep 2008 19:00:56 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2780] Files refactoring. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2008 19:01:06 -0000 Revision: 2780 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2780 Author: gscrivano Date: 2008-09-02 19:00:55 +0000 (Tue, 02 Sep 2008) Log Message: ----------- Files refactoring. Some files were moved in a different position. Modified Paths: -------------- trunk/myserver/configure.in trunk/myserver/control/myserver-configure.cpp trunk/myserver/include/Makefile.am trunk/myserver/include/base/Makefile.am trunk/myserver/include/base/files_cache/cached_file.h trunk/myserver/include/base/files_cache/cached_file_factory.h trunk/myserver/include/http_handler/Makefile.am trunk/myserver/include/protocol/http/Makefile.am trunk/myserver/include/server/server.h trunk/myserver/src/Makefile.am trunk/myserver/src/base/Makefile.am trunk/myserver/src/base/files_cache/cached_file.cpp trunk/myserver/src/base/files_cache/cached_file_buffer.cpp trunk/myserver/src/base/files_cache/cached_file_factory.cpp trunk/myserver/src/base/find_data/find_data.cpp trunk/myserver/src/filter/gzip/gzip_decompress.cpp trunk/myserver/src/http_handler/Makefile.am trunk/myserver/src/http_handler/cgi/cgi.cpp trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp trunk/myserver/src/http_handler/isapi/isapi.cpp trunk/myserver/src/http_handler/mscgi/mscgi.cpp trunk/myserver/src/http_handler/scgi/scgi.cpp trunk/myserver/src/plugin/executor/dynamic_executor.cpp trunk/myserver/src/plugin/filter/dyn_filter.cpp trunk/myserver/src/plugin/filter/dyn_filter_file.cpp trunk/myserver/src/plugin/filter/dyn_filters_manager.cpp trunk/myserver/src/plugin/generic_plugins_manager.cpp trunk/myserver/src/plugin/http_command/dyn_http_command.cpp trunk/myserver/src/plugin/http_manager/dyn_http_manager.cpp trunk/myserver/src/plugin/http_manager/dyn_http_manager_list.cpp trunk/myserver/src/plugin/plugins_namespace_manager.cpp trunk/myserver/src/plugin/protocol/dynamic_protocol.cpp trunk/myserver/src/plugin/protocol/protocols_manager.cpp trunk/myserver/src/protocol/control/control_header.cpp trunk/myserver/src/protocol/control/control_protocol.cpp trunk/myserver/src/protocol/ftp/ftp.cpp trunk/myserver/src/protocol/http/Makefile.am trunk/myserver/src/protocol/http/env/env.cpp trunk/myserver/src/protocol/http/http.cpp trunk/myserver/src/protocol/http/http_data_read.cpp trunk/myserver/src/protocol/http/http_headers.cpp Added Paths: ----------- trunk/myserver/include/base/files_cache/ trunk/myserver/include/base/files_cache/Makefile.am trunk/myserver/include/base/find_data/ trunk/myserver/include/base/find_data/Makefile.am trunk/myserver/include/http_handler/http_dir/ trunk/myserver/include/http_handler/http_dir/Makefile.am trunk/myserver/include/http_handler/http_dir/http_dir.h trunk/myserver/include/http_handler/http_file/ trunk/myserver/include/http_handler/http_file/http_file.h trunk/myserver/include/protocol/http/env/ trunk/myserver/include/protocol/http/env/Makefile.am trunk/myserver/src/base/files_cache/ trunk/myserver/src/base/find_data/ trunk/myserver/src/http_handler/http_dir/ trunk/myserver/src/http_handler/http_dir/http_dir.cpp trunk/myserver/src/http_handler/http_file/ trunk/myserver/src/http_handler/http_file/http_file.cpp trunk/myserver/src/protocol/http/env/ Removed Paths: ------------- trunk/myserver/include/env/Makefile.am trunk/myserver/include/env/env.h trunk/myserver/include/files_cache/Makefile.am trunk/myserver/include/files_cache/cached_file.h trunk/myserver/include/files_cache/cached_file_buffer.h trunk/myserver/include/files_cache/cached_file_factory.h trunk/myserver/include/find_data/Makefile.am trunk/myserver/include/find_data/find_data.h trunk/myserver/include/protocol/http/http_dir.h trunk/myserver/include/protocol/http/http_file.h trunk/myserver/src/env/ trunk/myserver/src/files_cache/ trunk/myserver/src/find_data/ trunk/myserver/src/protocol/http/http_dir.cpp trunk/myserver/src/protocol/http/http_file.cpp Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/configure.in 2008-09-02 19:00:55 UTC (rev 2780) @@ -376,108 +376,115 @@ documentation/english/images/Makefile documentation/english/style/Makefile documentation/english/texts/Makefile - src/find_data/Makefile - src/connection/Makefile - src/env/Makefile - src/log/Makefile - src/conf/Makefile - src/conf/mime/Makefile - src/conf/security/Makefile - src/conf/vhost/Makefile - src/connections_scheduler/Makefile - src/http_handler/Makefile - src/http_handler/wincgi/Makefile - src/http_handler/cgi/Makefile - src/http_handler/mscgi/Makefile - src/http_handler/fastcgi/Makefile - src/http_handler/scgi/Makefile - src/http_handler/isapi/Makefile - src/base/Makefile - src/base/file/Makefile - src/base/pipe/Makefile - src/base/base64/Makefile - src/base/mem_buff/Makefile - src/base/home_dir/Makefile - src/base/multicast/Makefile - src/base/sync/Makefile - src/base/safetime/Makefile - src/base/socket/Makefile - src/base/hash_map/Makefile - src/base/dynamic_lib/Makefile - src/base/process/Makefile - src/base/md5/Makefile - src/base/ssl/Makefile - src/base/xml/Makefile - src/base/string/Makefile - src/base/regex/Makefile - src/base/thread/Makefile - src/protocol/Makefile - src/protocol/ftp/Makefile - src/protocol/control/Makefile - src/protocol/https/Makefile - src/protocol/http/Makefile - src/files_cache/Makefile - src/filter/Makefile - src/filter/gzip/Makefile - src/plugin/Makefile - src/plugin/executor/Makefile - src/plugin/http_manager/Makefile - src/plugin/protocol/Makefile - src/plugin/filter/Makefile - src/plugin/http_command/Makefile - src/server/Makefile + include/Makefile + include/find_data/Makefile + include/connection/Makefile + include/log/Makefile + include/conf/Makefile + include/conf/mime/Makefile + include/conf/security/Makefile + include/conf/vhost/Makefile + include/connections_scheduler/Makefile + include/http_handler/Makefile + include/http_handler/wincgi/Makefile + include/http_handler/cgi/Makefile + include/http_handler/mscgi/Makefile + include/http_handler/fastcgi/Makefile + include/http_handler/http_file/Makefile + include/http_handler/scgi/Makefile + include/http_handler/isapi/Makefile + include/http_handler/http_dir/Makefile + include/base/Makefile + include/base/find_data/Makefile + include/base/file/Makefile + include/base/pipe/Makefile + include/base/base64/Makefile + include/base/mem_buff/Makefile + include/base/home_dir/Makefile + include/base/multicast/Makefile + include/base/sync/Makefile + include/base/safetime/Makefile + include/base/socket/Makefile + include/base/hash_map/Makefile + include/base/dynamic_lib/Makefile + include/base/process/Makefile + include/base/md5/Makefile + include/base/ssl/Makefile + include/base/xml/Makefile + include/base/files_cache/Makefile + include/base/string/Makefile + include/base/regex/Makefile + include/base/thread/Makefile + include/protocol/Makefile + include/protocol/ftp/Makefile + include/protocol/control/Makefile + include/protocol/https/Makefile + include/protocol/http/Makefile + include/protocol/http/env/Makefile + include/filter/Makefile + include/filter/gzip/Makefile + include/plugin/Makefile + include/plugin/executor/Makefile + include/plugin/http_manager/Makefile + include/plugin/protocol/Makefile + include/plugin/filter/Makefile + include/plugin/http_command/Makefile + include/server/Makefile src/Makefile - include/find_data/Makefile - include/connection/Makefile - include/env/Makefile - include/log/Makefile - include/conf/Makefile - include/conf/mime/Makefile - include/conf/security/Makefile - include/conf/vhost/Makefile - include/connections_scheduler/Makefile - include/http_handler/Makefile - include/http_handler/wincgi/Makefile - include/http_handler/cgi/Makefile - include/http_handler/mscgi/Makefile - include/http_handler/fastcgi/Makefile - include/http_handler/scgi/Makefile - include/http_handler/isapi/Makefile - include/base/Makefile - include/base/file/Makefile - include/base/pipe/Makefile - include/base/base64/Makefile - include/base/mem_buff/Makefile - include/base/home_dir/Makefile - include/base/multicast/Makefile - include/base/sync/Makefile - include/base/safetime/Makefile - include/base/socket/Makefile - include/base/hash_map/Makefile - include/base/dynamic_lib/Makefile - include/base/process/Makefile - include/base/md5/Makefile - include/base/ssl/Makefile - include/base/xml/Makefile - include/base/string/Makefile - include/base/regex/Makefile - include/base/thread/Makefile - include/protocol/Makefile - include/protocol/ftp/Makefile - include/protocol/control/Makefile - include/protocol/https/Makefile - include/protocol/http/Makefile - include/files_cache/Makefile - include/filter/Makefile - include/filter/gzip/Makefile - include/plugin/Makefile - include/plugin/executor/Makefile - include/plugin/http_manager/Makefile - include/plugin/protocol/Makefile - include/plugin/filter/Makefile - include/plugin/http_command/Makefile - include/server/Makefile - include/Makefile + src/find_data/Makefile + src/connection/Makefile + src/log/Makefile + src/conf/Makefile + src/conf/mime/Makefile + src/conf/security/Makefile + src/conf/vhost/Makefile + src/connections_scheduler/Makefile + src/http_handler/Makefile + src/http_handler/wincgi/Makefile + src/http_handler/cgi/Makefile + src/http_handler/mscgi/Makefile + src/http_handler/fastcgi/Makefile + src/http_handler/http_file/Makefile + src/http_handler/scgi/Makefile + src/http_handler/isapi/Makefile + src/http_handler/http_dir/Makefile + src/base/Makefile + src/base/find_data/Makefile + src/base/file/Makefile + src/base/pipe/Makefile + src/base/base64/Makefile + src/base/mem_buff/Makefile + src/base/home_dir/Makefile + src/base/multicast/Makefile + src/base/sync/Makefile + src/base/safetime/Makefile + src/base/socket/Makefile + src/base/hash_map/Makefile + src/base/dynamic_lib/Makefile + src/base/process/Makefile + src/base/md5/Makefile + src/base/ssl/Makefile + src/base/xml/Makefile + src/base/files_cache/Makefile + src/base/string/Makefile + src/base/regex/Makefile + src/base/thread/Makefile + src/protocol/Makefile + src/protocol/ftp/Makefile + src/protocol/control/Makefile + src/protocol/https/Makefile + src/protocol/http/Makefile + src/protocol/http/env/Makefile + src/filter/Makefile + src/filter/gzip/Makefile + src/plugin/Makefile + src/plugin/executor/Makefile + src/plugin/http_manager/Makefile + src/plugin/protocol/Makefile + src/plugin/filter/Makefile + src/plugin/http_command/Makefile + src/server/Makefile + tests/Makefile ]) AC_OUTPUT Modified: trunk/myserver/control/myserver-configure.cpp =================================================================== --- trunk/myserver/control/myserver-configure.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/control/myserver-configure.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -32,7 +32,7 @@ #include "fltkconfig.h" #include "language.h" -#include +#include extern "C" { Modified: trunk/myserver/include/Makefile.am =================================================================== --- trunk/myserver/include/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,2 +1,2 @@ -SUBDIRS = base conf connection connections_scheduler env files_cache filter find_data http_handler log plugin protocol server +SUBDIRS = base conf connection connections_scheduler filter find_data http_handler log plugin protocol server Modified: trunk/myserver/include/base/Makefile.am =================================================================== --- trunk/myserver/include/base/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/base/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,3 +1,3 @@ include_HEADERS = utility.h -SUBDIRS = base64 dynamic_lib file hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml +SUBDIRS = base64 dynamic_lib file files_cache find_data hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml Copied: trunk/myserver/include/base/files_cache (from rev 2774, trunk/myserver/include/files_cache) Property changes on: trunk/myserver/include/base/files_cache ___________________________________________________________________ Name: svn:mergeinfo + Copied: trunk/myserver/include/base/files_cache/Makefile.am (from rev 2779, trunk/myserver/include/files_cache/Makefile.am) =================================================================== --- trunk/myserver/include/base/files_cache/Makefile.am (rev 0) +++ trunk/myserver/include/base/files_cache/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,3 @@ +include_HEADERS = cached_file_buffer.h cached_file_factory.h cached_file.h +SUBDIRS = + Modified: trunk/myserver/include/base/files_cache/cached_file.h =================================================================== --- trunk/myserver/include/files_cache/cached_file.h 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/include/base/files_cache/cached_file.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -21,7 +21,7 @@ #include "stdafx.h" #include #include -#include +#include #include using namespace std; Modified: trunk/myserver/include/base/files_cache/cached_file_factory.h =================================================================== --- trunk/myserver/include/files_cache/cached_file_factory.h 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include #include Copied: trunk/myserver/include/base/find_data (from rev 2774, trunk/myserver/include/find_data) Property changes on: trunk/myserver/include/base/find_data ___________________________________________________________________ Name: svn:mergeinfo + Copied: trunk/myserver/include/base/find_data/Makefile.am (from rev 2779, trunk/myserver/include/find_data/Makefile.am) =================================================================== --- trunk/myserver/include/base/find_data/Makefile.am (rev 0) +++ trunk/myserver/include/base/find_data/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,3 @@ +include_HEADERS = find_data.h +SUBDIRS = + Deleted: trunk/myserver/include/env/Makefile.am =================================================================== --- trunk/myserver/include/env/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/env/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,3 +0,0 @@ -include_HEADERS = env.h -SUBDIRS = - Deleted: trunk/myserver/include/env/env.h =================================================================== --- trunk/myserver/include/env/env.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/env/env.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,37 +0,0 @@ -/* -MyServer -Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef ENV_H -#define ENV_H - -#include -#include -#include -#include - -extern const char *versionOfSoftware; - -class Env -{ -public: - static void buildEnvironmentString(HttpThreadContext*, char*, int = 1); -private: - static void buildProcessEnvString(MemBuf& memCgi); - static void buildHttpHeaderEnvString(MemBuf& memCgi, HttpRequestHeader & req); -}; - -#endif Deleted: trunk/myserver/include/files_cache/Makefile.am =================================================================== --- trunk/myserver/include/files_cache/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/files_cache/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,3 +0,0 @@ -include_HEADERS = cached_file_buffer.h cached_file_factory.h cached_file.h -SUBDIRS = - Deleted: trunk/myserver/include/files_cache/cached_file.h =================================================================== --- trunk/myserver/include/files_cache/cached_file.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/files_cache/cached_file.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,56 +0,0 @@ -/* -MyServer -Copyright (C) 2006 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CACHED_FILE_H -#define CACHED_FILE_H - -#include "stdafx.h" -#include -#include -#include -#include - -using namespace std; - -class CachedFile : public File -{ -protected: - u_long fseek; - CachedFileBuffer* buffer; -public: - CachedFile(CachedFileBuffer* buffer); - virtual FileHandle getHandle(); - virtual int setHandle(FileHandle); - virtual int readFromFile(char* ,u_long ,u_long* ); - virtual int writeToFile(const char* ,u_long ,u_long* ); - virtual int createTemporaryFile(const char* ); - - virtual int openFile(const char*, u_long ); - virtual int openFile(string const &file, u_long opt) - {return openFile(file.c_str(), opt);} - - virtual u_long getFileSize(); - virtual int setFilePointer(u_long); - - virtual int operator =(CachedFile); - virtual int closeFile(); - - /*! Inherithed from Stream. */ - virtual int write(const char* buffer, u_long len, u_long *nbw); - -}; -#endif Deleted: trunk/myserver/include/files_cache/cached_file_buffer.h =================================================================== --- trunk/myserver/include/files_cache/cached_file_buffer.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/files_cache/cached_file_buffer.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,52 +0,0 @@ -/* -MyServer -Copyright (C) 2006, 2007 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CACHED_FILE_BUFFER_H -#define CACHED_FILE_BUFFER_H - -#include "stdafx.h" -#include -#include -#include -#include - -using namespace std; - -class CachedFileFactory; - -class CachedFileBuffer -{ -public: - void addRef(); - void decRef(); - void setFactoryToNotify(CachedFileFactory *cff); - u_long getReferenceCounter(); - u_long getFileSize(){return fileSize;} - CachedFileBuffer(const char* filename); - CachedFileBuffer(File* file); - ~CachedFileBuffer(); - const char* getFilename(){return filename.c_str();} - const char* getBuffer(){return buffer;} -protected: - Mutex mutex; - char *buffer; - u_long refCounter; - u_long fileSize; - CachedFileFactory *factoryToNotify; - string filename; -}; -#endif Deleted: trunk/myserver/include/files_cache/cached_file_factory.h =================================================================== --- trunk/myserver/include/files_cache/cached_file_factory.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/files_cache/cached_file_factory.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,97 +0,0 @@ -/* -MyServer -Copyright (C) 2006, 2007 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CACHED_FILE_FACTORY_H -#define CACHED_FILE_FACTORY_H - -#include "stdafx.h" -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -class CachedFileFactory -{ -public: - CachedFileFactory(); - ~CachedFileFactory(); - CachedFileFactory(u_long m); - void initialize(u_long size); - void clean(); - void setSize(u_long m){size = m;} - File *open(const char* file); - void nullReferences(CachedFileBuffer* cfb); - - void setMaxSize(u_long maxSize); - void setMinSize(u_long minSize); - u_long getMaxSize(); - u_long getMinSize(); -protected: - - u_long purgeRecords(); - - - Mutex mutex; - - /*! Max elements count for this cache. */ - u_long size; - - /*! Size currently used. */ - u_long usedSize; - - /*! Number of times the cache was used. */ - u_long used; - - /*! Cache creation time. */ - u_long created; - - /*! Max size for single file. */ - u_long maxSize; - - /*! Min size for single file. */ - u_long minSize; - - struct CachedFileFactoryRecord - { - CachedFileBuffer* buffer; - /*! Number of times the cache record was used. */ - u_long used; - - /*! Cache record creation time. */ - u_long created; - - /*! Last mtime for this file. */ - time_t mtime; - - /*! Last time we checked for the mtime of the buffered file. */ - u_long lastModTimeCheck; - - /*! This entry is not valid and will be removed when refCount = 0. */ - bool invalidCache; - }; - - list buffersToRemove; - HashMap buffers; -}; - -#endif Deleted: trunk/myserver/include/find_data/Makefile.am =================================================================== --- trunk/myserver/include/find_data/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/find_data/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,3 +0,0 @@ -include_HEADERS = find_data.h -SUBDIRS = - Deleted: trunk/myserver/include/find_data/find_data.h =================================================================== --- trunk/myserver/include/find_data/find_data.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/find_data/find_data.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,86 +0,0 @@ -/* -MyServer -Copyright (C) 2002, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef FIND_DATA_H -#define FIND_DATA_H - -#include "stdafx.h" - -extern "C" -{ -#ifdef WIN32 -#include -#endif -#include -#include -#include -#include -#include -#ifdef NOT_WIN -#include -#endif -#include -} - -#include - -using namespace std; - -#ifndef EACCES -#define EACCES 1 -#endif -#define MAX_NAME NAME_MAX - -#ifndef FILE_ATTRIBUTE_DIRECTORY -#define FILE_ATTRIBUTE_DIRECTORY 1 -#endif - -#ifndef intptr_t -#define intptr_t int -#endif - -class FindData -{ - public: - char * name; - int attrib; - time_t time_write; - off_t size; - int findfirst(const char filename[]); - int findfirst(string &filename){return findfirst(filename.c_str());}; - int findnext(); - int findclose(); - FindData(); - ~FindData(); -#ifdef NOT_WIN - struct stat* getStatStruct(){return &stats;} -#endif - - private: -#ifdef WIN32 - _finddata_t fd; - intptr_t ff; -#endif - -#ifdef NOT_WIN - string DirName; - DIR *dh; - struct stat stats; -#endif -}; - -#endif Modified: trunk/myserver/include/http_handler/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/http_handler/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,3 +1,3 @@ include_HEADERS = -SUBDIRS = cgi fastcgi isapi mscgi scgi wincgi +SUBDIRS = cgi fastcgi http_dir http_file isapi mscgi scgi wincgi Added: trunk/myserver/include/http_handler/http_dir/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/http_dir/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/http_dir/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,3 @@ +include_HEADERS = http_dir.h +SUBDIRS = + Copied: trunk/myserver/include/http_handler/http_dir/http_dir.h (from rev 2774, trunk/myserver/include/protocol/http/http_dir.h) =================================================================== --- trunk/myserver/include/http_handler/http_dir/http_dir.h (rev 0) +++ trunk/myserver/include/http_handler/http_dir/http_dir.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,57 @@ +/* +MyServer +Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef HTTP_DIR_H +#define HTTP_DIR_H +#include "stdafx.h" +#include +#include +#include +#include + +using namespace std; + +class HttpDir : public HttpDataHandler +{ +public: + struct FileStruct + { + string name; + time_t time_write; + int attrib; + off_t size; + }; + + static int load(XmlParser*); + static int unLoad(); + virtual int send(HttpThreadContext*, ConnectionPtr s, + const char *filenamePath, const char* cgi, + int execute = 0, int OnlyHeader = 0); + HttpDir(); + virtual ~HttpDir(); +private: + double formatBytes(u_long bytes, u_int power); + void formatHtml(string & in, string& out); + static bool charIsLess(char i, char j); + static bool compareFileStructByName (HttpDir::FileStruct i, HttpDir::FileStruct j); + static bool compareFileStructByTime (HttpDir::FileStruct i, HttpDir::FileStruct j); + static bool compareFileStructBySize (HttpDir::FileStruct i, HttpDir::FileStruct j); + void getFormattedSize(u_long bytes, string& out); +}; + + +#endif Copied: trunk/myserver/include/http_handler/http_file/http_file.h (from rev 2774, trunk/myserver/include/protocol/http/http_file.h) =================================================================== --- trunk/myserver/include/http_handler/http_file/http_file.h (rev 0) +++ trunk/myserver/include/http_handler/http_file/http_file.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,50 @@ +/* +MyServer +Copyright (C) 2005, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef HTTP_FILE_H +#define HTTP_FILE_H +#include "stdafx.h" + +#include +#include +#include +#include + +class HttpFile : public HttpDataHandler +{ +public: + static int load(XmlParser*); + static int unLoad(); + virtual int send(HttpThreadContext*, ConnectionPtr s, + const char *filenamePath, const char* cgi, + int execute = 0, int OnlyHeader = 0); + HttpFile(); + virtual ~HttpFile(); +private: + static int appendDataToHTTPChannel(HttpThreadContext* td, + char* buffer, + u_long size, + File* appendFile, + FiltersChain* chain, + bool append, + bool useChunks, + u_long realBufferSize, + MemoryStream *tmpStream); +}; + + +#endif Modified: trunk/myserver/include/protocol/http/Makefile.am =================================================================== --- trunk/myserver/include/protocol/http/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/protocol/http/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,3 +1,3 @@ -include_HEADERS = http_data_handler.h http_data_read.h http_dir.h http_errors.h http_file.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h -SUBDIRS = +include_HEADERS = http_data_handler.h http_data_read.h http_errors.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h +SUBDIRS = env Copied: trunk/myserver/include/protocol/http/env (from rev 2774, trunk/myserver/include/env) Property changes on: trunk/myserver/include/protocol/http/env ___________________________________________________________________ Name: svn:mergeinfo + Copied: trunk/myserver/include/protocol/http/env/Makefile.am (from rev 2779, trunk/myserver/include/env/Makefile.am) =================================================================== --- trunk/myserver/include/protocol/http/env/Makefile.am (rev 0) +++ trunk/myserver/include/protocol/http/env/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,3 @@ +include_HEADERS = env.h +SUBDIRS = + Deleted: trunk/myserver/include/protocol/http/http_dir.h =================================================================== --- trunk/myserver/include/protocol/http/http_dir.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/protocol/http/http_dir.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,57 +0,0 @@ -/* -MyServer -Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef HTTP_DIR_H -#define HTTP_DIR_H -#include "stdafx.h" -#include -#include -#include -#include - -using namespace std; - -class HttpDir : public HttpDataHandler -{ -public: - struct FileStruct - { - string name; - time_t time_write; - int attrib; - off_t size; - }; - - static int load(XmlParser*); - static int unLoad(); - virtual int send(HttpThreadContext*, ConnectionPtr s, - const char *filenamePath, const char* cgi, - int execute = 0, int OnlyHeader = 0); - HttpDir(); - virtual ~HttpDir(); -private: - double formatBytes(u_long bytes, u_int power); - void formatHtml(string & in, string& out); - static bool charIsLess(char i, char j); - static bool compareFileStructByName (HttpDir::FileStruct i, HttpDir::FileStruct j); - static bool compareFileStructByTime (HttpDir::FileStruct i, HttpDir::FileStruct j); - static bool compareFileStructBySize (HttpDir::FileStruct i, HttpDir::FileStruct j); - void getFormattedSize(u_long bytes, string& out); -}; - - -#endif Deleted: trunk/myserver/include/protocol/http/http_file.h =================================================================== --- trunk/myserver/include/protocol/http/http_file.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/protocol/http/http_file.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,50 +0,0 @@ -/* -MyServer -Copyright (C) 2005, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef HTTP_FILE_H -#define HTTP_FILE_H -#include "stdafx.h" - -#include -#include -#include -#include - -class HttpFile : public HttpDataHandler -{ -public: - static int load(XmlParser*); - static int unLoad(); - virtual int send(HttpThreadContext*, ConnectionPtr s, - const char *filenamePath, const char* cgi, - int execute = 0, int OnlyHeader = 0); - HttpFile(); - virtual ~HttpFile(); -private: - static int appendDataToHTTPChannel(HttpThreadContext* td, - char* buffer, - u_long size, - File* appendFile, - FiltersChain* chain, - bool append, - bool useChunks, - u_long realBufferSize, - MemoryStream *tmpStream); -}; - - -#endif Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/include/server/server.h 2008-09-02 19:00:55 UTC (rev 2780) @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,50 +1,14 @@ # Makefile for MyServer (./src) -SUBDIRS = base conf connection connections_scheduler env files_cache \ - filter find_data http_handler log plugin protocol server +SUBDIRS = base conf connection connections_scheduler filter find_data \ + http_handler log plugin protocol server . -# STATIC_AR = find_data/libfind_data.a \ -# connection/libconnection.a env/libenv.a\ -# log/liblog.a conf/mime/libmime.a\ -# conf/security/libsecurity.a conf/vhost/libvhost.a\ -# conf/libconf.a\ -# connections_scheduler/libconnections_scheduler.a\ -# http_handler/wincgi/libwincgi.a\ -# http_handler/cgi/libcgi.a\ -# http_handler/mscgi/libmscgi.a\ -# http_handler/fastcgi/libfastcgi.a\ -# http_handler/scgi/libscgi.a\ -# http_handler/isapi/libisapi.a\ -# http_handler/libhttp_handler.a base/file/libfile.a\ -# base/pipe/libpipe.a base/base64/libbase64.a\ -# base/mem_buff/libmem_buff.a base/libbase.a\ -# base/home_dir/libhome_dir.a\ -# base/multicast/libmulticast.a base/sync/libsync.a\ -# base/safetime/libsafetime.a\ -# base/socket/libsocket.a\ -# base/hash_map/libhash_map.a\ -# base/dynamic_lib/libdynamic_lib.a\ -# base/process/libprocess.a base/md5/libmd5.a\ -# base/ssl/libssl.a base/xml/libxml.a\ -# base/string/libstring.a base/regex/libregex.a\ -# base/thread/libthread.a protocol/ftp/libftp.a\ -# protocol/control/libcontrol.a\ -# protocol/libprotocol.a protocol/https/libhttps.a\ -# protocol/http/libhttp.a\ -# files_cache/libfiles_cache.a filter/gzip/libgzip.a\ -# filter/libfilter.a plugin/executor/libexecutor.a\ -# plugin/http_manager/libhttp_manager.a\ -# plugin/libplugin.a plugin/protocol/libprotocol.a\ -# plugin/filter/libfilter.a\ -# plugin/http_command/libhttp_command.a\ -# server/libserver.a +#build_subdirs: +# list='$(SUBDIRS)'; for subdir in $$list; do \ +# (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all) \ +# done; -build_subdirs: - list='$(SUBDIRS)'; for subdir in $$list; do \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all) \ - done; - -libmyserver.a: build_subdirs +libmyserver.a: rm -f libmyserver.a find -iregex .*\\.o | xargs ar cru libmyserver.a ranlib libmyserver.a @@ -69,5 +33,5 @@ flex --header-file=../include/protocol/ftp/ftp_lexer.h protocol/ftp/ftp_lexer.lpp cp ./protocol/ftp/lex.yy.c ./protocol/ftp/ftp_lexer.cpp -all : myserver - cp myserver ../binaries +all : myserver${EXEEXT} + cp myserver${EXEEXT} ../binaries Modified: trunk/myserver/src/base/Makefile.am =================================================================== --- trunk/myserver/src/base/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/base/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,5 +1,5 @@ lib_LIBRARIES = libbase.a libbase_a_SOURCES = utility.cpp -SUBDIRS = base64 dynamic_lib file hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml +SUBDIRS = base64 dynamic_lib file files_cache find_data hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml INCLUDES = $(all_includes) Copied: trunk/myserver/src/base/files_cache (from rev 2774, trunk/myserver/src/files_cache) Property changes on: trunk/myserver/src/base/files_cache ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/myserver/src/base/files_cache/cached_file.cpp =================================================================== --- trunk/myserver/src/files_cache/cached_file.cpp 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -20,7 +20,7 @@ #include #include #include -#include +#include #ifdef NOT_WIN extern "C" { Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp =================================================================== --- trunk/myserver/src/files_cache/cached_file_buffer.cpp 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #ifdef NOT_WIN extern "C" { Modified: trunk/myserver/src/base/files_cache/cached_file_factory.cpp =================================================================== --- trunk/myserver/src/files_cache/cached_file_factory.cpp 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -20,7 +20,7 @@ #include #include #include -#include +#include #ifdef NOT_WIN extern "C" { Copied: trunk/myserver/src/base/find_data (from rev 2774, trunk/myserver/src/find_data) Property changes on: trunk/myserver/src/base/find_data ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/myserver/src/base/find_data/find_data.cpp =================================================================== --- trunk/myserver/src/find_data/find_data.cpp 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/src/base/find_data/find_data.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include +#include extern "C" { Modified: trunk/myserver/src/filter/gzip/gzip_decompress.cpp =================================================================== --- trunk/myserver/src/filter/gzip/gzip_decompress.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/filter/gzip/gzip_decompress.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -32,7 +32,6 @@ #ifdef WIN32 #include #endif -#include /*! *Initialize the gzip structure value. Modified: trunk/myserver/src/http_handler/Makefile.am =================================================================== --- trunk/myserver/src/http_handler/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/http_handler/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,5 +1,5 @@ lib_LIBRARIES = libhttp_handler.a libhttp_handler_a_SOURCES = -SUBDIRS = cgi fastcgi isapi mscgi scgi wincgi +SUBDIRS = cgi fastcgi http_dir http_file isapi mscgi scgi wincgi INCLUDES = $(all_includes) Modified: trunk/myserver/src/http_handler/cgi/cgi.cpp =================================================================== --- trunk/myserver/src/http_handler/cgi/cgi.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/http_handler/cgi/cgi.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include Modified: trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp =================================================================== --- trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -21,7 +21,7 @@ *On that site you can find samples and all the supported languages. */ #include -#include +#include #include #include #include Copied: trunk/myserver/src/http_handler/http_dir/http_dir.cpp (from rev 2774, trunk/myserver/src/protocol/http/http_dir.cpp) =================================================================== --- trunk/myserver/src/http_handler/http_dir/http_dir.cpp (rev 0) +++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,572 @@ +/* +MyServer +Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" +#include +#include +#include +#include +#include +#include + +extern "C" +{ +#ifdef WIN32 +#include +#include +#endif + +#ifdef NOT_WIN +#include +#include +#endif +} + +#include +#include +#ifdef NOT_WIN +#endif + +#include +#include +#include +#include +#include + +using namespace std; + +/*! + * Compare two HttpDir::FileStruct by their filename. + */ +bool HttpDir::compareFileStructByName (HttpDir::FileStruct i, HttpDir::FileStruct j) +{ + return stringcmpi (i.name, j.name) < 0 ? true : false; +} + +/*! + * Compare two HttpDir::FileStruct by their last modified file time. + */ + +bool HttpDir::compareFileStructByTime (HttpDir::FileStruct i, HttpDir::FileStruct j) +{ + return i.time_write < j.time_write; +} + +/*! + * Compare two HttpDir::FileStruct by their file size. + */ +bool HttpDir::compareFileStructBySize (HttpDir::FileStruct i, HttpDir::FileStruct j) +{ + return i.size < j.size; +} + +/*! + *Constructor for the class. + */ +HttpDir::HttpDir() +{ + +} + +/*! + *Destroy the object. + */ +HttpDir::~HttpDir() +{ + +} + +/*! + *Load the static elements. + */ +int HttpDir::load(XmlParser* /*confFile*/) +{ + return 0; +} + +/*! + *Unload the static elements. + */ +int HttpDir::unLoad() +{ + return 0; +} + +/*! + *Get a formatted dobule representation of BYTES right shifted by POWER. + *\param bytes Number of bytes. + *\param power Power of 2. + *\return the double representation for BYTES>>POWER. + */ +double HttpDir::formatBytes(u_long bytes, u_int power) +{ + const u_long quotient = bytes >> power; + if (quotient == 0) + return -1; + + const u_long unit = 1 << power; + const u_long remainder = bytes & (unit - 1); + const double result = quotient + static_cast(remainder) / unit; + return result; +} + + +/*! + *Fullfill the string out with a formatted representation for bytes. + *\param bytes Size to format. + *\param out Out string. + */ +void HttpDir::getFormattedSize(u_long bytes, string & out) +{ + const string symbols[] = {"TB", "GB", "MB", "KB", "bytes"}; + const u_int powers[] = {40, 30, 20, 10, 0}; + double result; + size_t i; + ostringstream osstr; + + if (bytes == 0) + { + out = "0"; + return; + } + + for (i = 0; i < sizeof (powers); i++) + { + result = formatBytes (bytes, powers[i]); + if (result != -1) + break; + } + + if((result - floor(result)) < 0.01) + osstr << std::fixed << setprecision(0) << result << " " << symbols[i]; + else + osstr << std::fixed << setprecision(2) << result << " " << symbols[i]; + + out = osstr.str(); +} + +/*! + *Browse a directory printing its contents in an HTML file. + *\param td The current thread context. + *\param s The current connection structure. + *\param directory Directory to show. + *\param cgi non used. + *\param onlyHeader Specify if send only the HTTP header. +*/ +int HttpDir::send(HttpThreadContext* td, ConnectionPtr s, + const char* directory, const char* /*cgi*/, + int /*execute*/, int onlyHeader) +{ + u_long nbw; + string filename; + int ret; + FindData fd; + FiltersChain chain; + int lastSlash = 0; + bool useChunks = false; + u_long sentData = 0; + int i; + char fileTime[32]; + char* bufferloop; + const char* browseDirCSSpath; + bool keepalive = false; + vector files; + size_t sortIndex; + char sortType; + bool sortReverse = false; + HttpRequestHeader::Entry *host = td->request.other.get("Host"); + + + chain.setProtocol(td->http); + chain.setProtocolData(td); + chain.setStream(td->connection->socket); + if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain, + td->mime->filters, + td->connection->socket, &nbw, 1)) + { + td->connection->host->warningsLogRequestAccess(td->id); + td->connection->host->warningsLogWrite("HttpDir: Error loading filters"); + td->connection->host->warningsLogTerminateAccess(td->id); + chain.clearAllFilters(); + return td->http->raiseHTTPError(500); + } + + lastSlash = td->request.uri.rfind('/') + 1; + + checkDataChunks(td, &keepalive, &useChunks); + + td->response.contentType.assign("text/html"); + + if(!td->appendOutputs) + { + + HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), + &(td->response)); + + if(s->socket->send(td->buffer->getBuffer(), + (u_long)strlen(td->buffer->getBuffer()), 0) + == SOCKET_ERROR) + { + /* Remove the connection. */ + return 0; + } + } + + if(onlyHeader) + return 1; + + + sortIndex = td->request.uriOpts.find("sort="); + + if(sortIndex != string::npos && sortIndex + 5 < td->request.uriOpts.length()) + { + sortType = td->request.uriOpts.at(sortIndex + 5); + } + + if(sortIndex != string::npos && sortIndex + 6 < td->request.uriOpts.length()) + { + sortReverse = td->request.uriOpts.at(sortIndex + 6) == 'I'; + } + + /* Make sortType always lowercase. */ + switch(sortType) + { + case 's': + case 'S': + sortType = 's'; + break; + case 't': + case 'T': + sortType = 't'; + break; + default: + sort (files.begin(), files.end(), compareFileStructByName); + } + + browseDirCSSpath = td->http->getBrowseDirCSSFile(); + + td->buffer2->setLength(0); + *td->buffer2 << "\r\n" + "\r\n" + "" + "\r\n\r\n" ; + *td->buffer2 << td->request.uri.c_str() ; + *td->buffer2 << "\r\n"; + + /* + *If it is defined a CSS file for the graphic layout of + *the browse directory insert it in the page. + */ + if(browseDirCSSpath != 0) + { + *td->buffer2 << "\r\n"; + } + + + *td->buffer2 << "\r\n"; + + ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), + td->buffer2->getLength(), + &(td->outputData), &chain, + td->appendOutputs, useChunks); + if(ret) + { + /* Return an internal server error. */ + td->outputData.closeFile(); + chain.clearAllFilters(); + return td->http->raiseHTTPError(500); + } + + sentData = td->buffer2->getLength(); + + browseDirCSSpath = td->http->getBrowseDirCSSFile(); + + filename = directory; + td->buffer2->setLength(0); + *td->buffer2 << "\r\n

Contents of directory "; + *td->buffer2 << &td->request.uri[lastSlash] ; + *td->buffer2 << "

\r\n
\r\n"; + + ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), + td->buffer2->getLength(), + &(td->outputData), &chain, + td->appendOutputs, useChunks); + + if(ret) + { + td->outputData.closeFile(); + /* Return an internal server error. */ + return td->http->raiseHTTPError(500); + } + sentData += td->buffer2->getLength(); + + ret = fd.findfirst(filename.c_str()); + + if(ret == -1) + { + chain.clearAllFilters(); + return td->http->raiseHTTPError(404); + } + + /* + *With the current code we build the HTML TABLE to indicize the + *files in the directory. + */ + td->buffer2->setLength(0); + *td->buffer2 << "\r\n\r\n" ; + + if(sortType == 'f' && !sortReverse) + *td->buffer2 << "\r\n"; + else + *td->buffer2 << "\r\n"; + + if(sortType == 't' && !sortReverse) + *td->buffer2 << "\r\n"; + else + *td->buffer2 << "\r\n"; + + if(sortType == 's' && !sortReverse) + *td->buffer2 << "\r\n\r\n"; + else + *td->buffer2 << "\r\n\r\n"; + + ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), + td->buffer2->getLength(), + &(td->outputData), &chain, + td->appendOutputs, useChunks); + + if(ret) + { + td->outputData.closeFile(); + chain.clearAllFilters(); + /* Return an internal server error. */ + return td->http->raiseHTTPError(500); + } + + sentData += td->buffer2->getLength(); + + td->buffer2->setLength(0); + + if(FilesUtility::getPathRecursionLevel(td->request.uri) >= 1) + { + string file; + file.assign(td->request.uri); + file.append("/../"); + + *td->buffer2 << "\r\n\n" + << "\r\n"; + + ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), + td->buffer2->getLength(), + &(td->outputData), &chain, + td->appendOutputs, useChunks); + if(ret) + { + fd.findclose(); + td->outputData.closeFile(); + chain.clearAllFilters(); + /* Return an internal server error. */ + return td->http->raiseHTTPError(500); + } + sentData += td->buffer2->getLength(); + } + + /* Put all files in a vector. */ + do + { + if(fd.name[0] == '.') + continue; + /* Do not show the security file. */ + if(!strcmp(fd.name, "security")) + continue; + + FileStruct file; + file.name.assign(fd.name); + file.time_write = fd.time_write; + file.attrib = fd.attrib; + file.size = fd.size; + files.push_back(file); + + } + while(!fd.findnext()); + + fd.findclose(); + + /* Sort the vector. */ + switch(sortType) + { + case 's': + sort (files.begin(), files.end(), compareFileStructBySize); + break; + case 't': + sort (files.begin(), files.end(), compareFileStructByTime); + break; + case 'f': + sort (files.begin(), files.end(), compareFileStructByName); + } + + if(sortReverse) + reverse (files.begin(), files.end()); + + /* Build the files table and send it. */ + for(vector::iterator it = files.begin(); + it != files.end(); it++) + { + string formattedName; + + FileStruct& file = *it; + + td->buffer2->setLength(0); + + *td->buffer2 << "\r\n\r\n\r\n\r\n\r\n"; + ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), + td->buffer2->getLength(), + &(td->outputData), &chain, + td->appendOutputs, useChunks); + if(ret) + { + td->outputData.closeFile(); + chain.clearAllFilters(); + /* Return an internal server error. */ + return td->http->raiseHTTPError(500); + } + + sentData += td->buffer2->getLength(); + + } + + td->buffer2->setLength(0); + *td->buffer2 << "
FileFileLast ModifiedLast ModifiedSize
Size
" + << "request.uriEndsWithSlash ? ".." : ".") + << "\">[ .. ][directory]
request.uriEndsWithSlash) + { + *td->buffer2 << &td->request.uri[lastSlash]; + *td->buffer2 << "/" ; + } + formattedName.assign(file.name); + + formatHtml(file.name, formattedName); + + *td->buffer2 << formattedName ; + *td->buffer2 << "\">" ; + *td->buffer2 << formattedName; + *td->buffer2 << ""; + + getRFC822GMTTime(file.time_write, fileTime, 32); + + *td->buffer2 << fileTime ; + *td->buffer2 << ""; + + if(file.attrib & FILE_ATTRIBUTE_DIRECTORY) + { + *td->buffer2 << "[directory]"; + } + else + { + string out; + getFormattedSize(file.size, out); + *td->buffer2 << out; + } + + *td->buffer2 << "
\r\n
\r\n
GNU MyServer " + << versionOfSoftware; + + if(host && host->value->length()) + { + ostringstream portBuff; + size_t portSeparator = host->value->find(':'); + *td->buffer2 << " on "; + if(portSeparator != string::npos) + *td->buffer2 << host->value->substr(0, portSeparator).c_str() ; + else + *td->buffer2 << host->value->c_str() ; + + *td->buffer2 << " Port "; + portBuff << td->connection->getLocalPort(); + *td->buffer2 << portBuff.str(); + } + *td->buffer2 << "
\r\n\r\n\r\n"; + ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), + td->buffer2->getLength(), + &(td->outputData), &chain, + td->appendOutputs, useChunks); + + if(ret) + { + td->outputData.closeFile(); + /* Return an internal server error. */ + return td->http->raiseHTTPError(500); + } + sentData += td->buffer2->getLength(); + + *td->buffer2 << end_str; + /* Changes the \ character in the / character. */ + bufferloop = td->buffer2->getBuffer(); + while(*bufferloop++) + if(*bufferloop == '\\') + *bufferloop = '/'; + + if(!td->appendOutputs && useChunks) + { + if(chain.write("0\r\n\r\n", 5, &nbw)) + return 1; + } + + /* For logging activity. */ + td->sentData += sentData; + + chain.clearAllFilters(); + return 1; + +} + +/*! + *Format a string to html. + *\param name String to convert. + *\param out HTML converted string. + */ +void HttpDir::formatHtml(string& in, string& out) +{ + string::size_type pos = 0; + out.assign(in); + /* + *Replace characters in the ranges 32-65 91-96 123-126 160-255 + *with "&#CODE;". + */ + for(pos = 0; out[pos] != '\0'; pos++) + { + if(((u_char)out[pos] >= 32 && + (u_char)out[pos] <= 65) || + ((u_char)out[pos] >= 91 && + (u_char)out[pos] <= 96) || + ((u_char)out[pos] >= 123 && + (u_char)out[pos] <= 126) || + ((u_char)out[pos] >= 160 && + (u_char)out[pos] < 255)) + { + ostringstream os; + os << "&#" << (int)((unsigned char)out[pos]) << ";"; + out.replace(pos, 1, os.str()); + pos += os.str().length() - 1; + } + } +} Copied: trunk/myserver/src/http_handler/http_file/http_file.cpp (from rev 2774, trunk/myserver/src/protocol/http/http_file.cpp) =================================================================== --- trunk/myserver/src/http_handler/http_file/http_file.cpp (rev 0) +++ trunk/myserver/src/http_handler/http_file/http_file.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -0,0 +1,627 @@ +/* +MyServer +Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include +#include +#include +#include +#include +#include + +#include +#include +using namespace std; + +extern "C" +{ +#ifdef WIN32 +#include +#include +#endif + +#ifdef NOT_WIN +#include +#include +#ifdef SENDFILE +#include +#include +#include +#include +#include +#include +#include +#endif +#endif +} + +/*! + *Send a file to the client using the HTTP protocol. + *\param td The current HTTP thread context. + *\param s A pointer to the connection. + *\param filenamePath The path of the static file to send. + *\param exec Not used. + *\param onlyHeader Specify if send only the HTTP header. + */ +int HttpFile::send(HttpThreadContext* td, ConnectionPtr s, + const char *filenamePath, const char* /*exec*/, + int /*execute*/, int onlyHeader) +{ + /* + *With this routine we send a file through the HTTP protocol. + *Open the file and save its handle. + */ + int ret; + + /* + *Will we use GZIP compression to send data? + */ + bool useGzip = false; + u_long filesize = 0; + File *file = 0; + u_long bytesToSend; + u_long firstByte = td->request.rangeByteBegin; + u_long lastByte = td->request.rangeByteEnd; + bool keepalive = false; + bool useChunks = false; + bool useModifiers = false; + MemoryStream memStream(td->buffer2); + FiltersChain chain; + u_long nbw; + u_long nbr; + + u_long dataSent = 0; + + try + { + file = Server::getInstance()->getCachedFiles()->open(filenamePath); + if(file == 0) + { + return td->http->raiseHTTPError(500); + } + /* + *Check how many bytes are ready to be send. + */ + filesize = file->getFileSize(); + bytesToSend = filesize; + if(lastByte == 0) + { + lastByte = bytesToSend; + } + else + { + /* + *If the client use ranges set the right value + *for the last byte number. + */ + lastByte = std::min(lastByte + 1, bytesToSend); + } + + /* + * bytesToSend is the interval between the first and the last byte. + */ + bytesToSend = lastByte - firstByte; + + /* + * If fail to set the file pointer returns an internal server error. + */ + ret = file->setFilePointer(firstByte); + if(ret) + { + file->closeFile(); + delete file; + return td->http->raiseHTTPError(500); + } + + + { + /* + *Use GZIP compression to send files bigger than GZIP threshold. + */ + const char* val = s->host->getHashedData("GZIP_THRESHOLD"); + useGzip = false; + if(val) + { + u_long gzipThreshold = atoi(val); + if(bytesToSend >= gzipThreshold) + useGzip = true; + } + + } + + keepalive = td->request.isKeepAlive(); + +#ifndef DO_NOT_USEGZIP + /* + *Be sure that the client accept GZIP compressed data. + */ + if(useGzip) + { + HttpRequestHeader::Entry* e = td->request.other.get("Accept-Encoding"); + if(e) + { + useGzip &= (e->value->find("gzip") != string::npos); + } + else + useGzip = false; + + } +#else + /* + * If compiled without GZIP support force the server to don't use it. + */ + useGzip = false; +#endif + if(td->appendOutputs) + useGzip = false; + + td->buffer->setLength(0); + + /* If a Range was requested send 206 and not 200 for success. */ + if( td->request.rangeByteBegin || td->request.rangeByteEnd ) + { + HttpResponseHeader::Entry *e; + ostringstream buffer; + td->response.httpStatus = 206; + buffer << "bytes "<< (u_long)firstByte << "-" + << (u_long)lastByte << "/" << (u_long)filesize ; + + e = td->response.other.get("Content-Range"); + if(e) + e->value->assign(buffer.str()); + else + { + e = new HttpResponseHeader::Entry(); + e->name->assign("Content-Range"); + e->value->assign(buffer.str()); + td->response.other.put(*(e->name), e); + } + + + e = td->response.other.get("Transfer-Encoding"); + if(e) + e->value->assign("chunked"); + else + { + e = new HttpResponseHeader::Entry(); + e->name->assign("Transfer-Encoding"); + e->value->assign("chunked"); + td->response.other.put(*(e->name), e); + } + + useGzip = false; + } + chain.setProtocol(td->http); + chain.setProtocolData(td); + chain.setStream(&memStream); + if(td->mime) + { + if(td->mime && + Server::getInstance()->getFiltersFactory()->chain(&chain, + td->mime->filters, + &memStream, + &nbw)) + { + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 0; + } + memStream.refresh(); + + dataSent += nbw; + } + + if(useGzip && !chain.isFilterPresent("gzip")) + { + Filter* gzipFilter = + Server::getInstance()->getFiltersFactory()->getFilter("gzip"); + u_long nbw; + if(!gzipFilter) + { + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 0; + } + if(chain.addFilter(gzipFilter, &nbw)) + { + delete gzipFilter; + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 0; + } + dataSent += nbw; + } + + useModifiers = chain.hasModifiersFilters(); + + if(keepalive && !useModifiers) + { + ostringstream buffer; + buffer << (u_int)bytesToSend; + td->response.contentLength.assign(buffer.str()); + } + + /* Specify the connection type. */ + if(keepalive) + { + td->response.connection.assign("keep-alive"); + } + else + { + td->response.connection.assign("close"); + } + + if(useModifiers) + { + string s; + HttpResponseHeader::Entry *e; + chain.getName(s); + e = td->response.other.get("Content-Encoding"); + if(e) + e->value->assign(s); + else + { + e = new HttpResponseHeader::Entry(); + e->name->assign("Content-Encoding"); + e->value->assign(s); + td->response.other.put(*(e->name), e); + } + /* Do not use chunked transfer with old HTTP/1.0 clients. */ + if(keepalive) + { + HttpResponseHeader::Entry *e; + e = td->response.other.get("Transfer-Encoding"); + if(e) + e->value->assign("chunked"); + else + { + e = new HttpResponseHeader::Entry(); + e->name->assign("Transfer-Encoding"); + e->value->assign("chunked"); + td->response.other.put(*(e->name), e); + } + + useChunks = true; + } + } + + HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), + &td->response); + td->buffer->setLength((u_long)strlen(td->buffer->getBuffer())); + if(!td->appendOutputs) + { + /* Send the HTTP header. */ + if(s->socket->send(td->buffer->getBuffer(), + (u_long)td->buffer->getLength(), 0) == SOCKET_ERROR) + { + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 1; + } + } + + /* + *If is requested only the header exit from the function; + *used by the HEAD request. + */ + if(onlyHeader) + { + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 0; + } + +#ifdef SENDFILE + /* + * Check if there are all the conditions to use a direct copy from the + * file to the socket. The sendfile syscall copy from a descriptor to + * another directly in the kernel space without performs an extra copy + * to an userspace buffer. + */ + if(!useChunks && chain.isEmpty() && + !td->appendOutputs && (file->getHandle() != -1) && + !(td->http->getProtocolOptions() & PROTOCOL_USES_SSL)) + { + off_t offset = firstByte; + ret = sendfile(s->socket->getHandle(), file->getHandle(), + &offset, bytesToSend); + file->closeFile(); + delete file; + chain.clearAllFilters(); + + /* For logging activity. */ + td->sentData += ret; + + return 0; + } +#endif + + if(td->appendOutputs) + chain.setStream(&(td->outputData)); + else + chain.setStream(s->socket); + + /* + *Flush initial data. This is data that filters could have added + *and we have to send before the file itself, for example the gzip + *filter add a header to file. + */ + if(memStream.availableToRead()) + { + ret = memStream.read(td->buffer->getBuffer(), + td->buffer->getRealLength(), + &nbr); + + if(ret) + { + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 0; + } + + memStream.refresh(); + + if(nbr) + { + if(HttpDataHandler::appendDataToHTTPChannel(td, + td->buffer->getBuffer(), + nbr, + &(td->outputData), + chain.getStream(), + td->appendOutputs, + useChunks)) + { + file->closeFile(); + delete file; + chain.clearAllFilters(); + return 1; + dataSent += nbw; + } + } /* nbr. */ + } /* memStream.availableToRead(). */ + + + /* Flush the rest of the file. */ + for(;;) + { + u_long nbr; + u_long nbw; + + /* Check if there are other bytes to send. */ + if(bytesToSend) + { + /* Read from the file the bytes to send. */ + ret = file->readFromFile(td->buffer->getBuffer(), + std::min(static_cast(bytesToSend), + static_cast(td->buffer->getRealLength()/2)), + &nbr); + if(ret) + break; + + if(nbr == 0) + { + bytesToSend = 0; + continue; + } + + bytesToSend -= nbr; + + + ret = appendDataToHTTPChannel(td, td->buffer->getBuffer(), + nbr, + &(td->outputData), + &chain, + td->appendOutputs, + useChunks, + td->buffer->getRealLength(), + &memStream); + if(ret) + break; + + dataSent += nbr; + } + else /* if(bytesToSend) */ + { + /* If we don't use chunks we can flush directly. */ + if(!useChunks) + { + ret = chain.flush(&nbw); + + break; + } + else + { + /* + *Replace the final stream before the flush and write to a + *memory buffer, after all the data is flushed from the + *chain we can replace the stream with the original one and + *write there the HTTP data chunk. + */ + Stream* tmpStream = chain.getStream(); + + chain.setStream(&memStream); + + memStream.refresh(); + + ret = chain.flush(&nbw); + + if(ret) + break; + + chain.setStream(tmpStream); + + ret = memStream.read(td->buffer->getBuffer(), + td->buffer->getRealLength(), + &nbr); + if(ret) + break; + + ret = HttpDataHandler::appendDataToHTTPChannel(td, + td->buffer->getBuffer(), + nbr, + &(td->outputData), + chain.getStream(), + td->appendOutputs, + useChunks); + if(ret) + break; + + ret = HttpDataHandler::appendDataToHTTPChannel(td, + 0, + 0, + &(td->outputData), + chain.getStream(), + td->appendOutputs, + useChunks); + + break; + } + } + + memStream.refresh(); + + }/* End for loop. */ + + file->closeFile(); + delete file; + } + catch(bad_alloc &ba) + { + file->closeFile(); + delete file; + s->host->warningsLogRequestAccess(td->id); + s->host->warningsLogWrite("HttpFile: Error allocating memory"); + s->host->warningsLogTerminateAccess(td->id); + chain.clearAllFilters(); + return td->http->raiseHTTPError(500); + } + catch(...) + { + file->closeFile(); + delete file; + s->host->warningsLogRequestAccess(td->id); + s->host->warningsLogWrite("HttpFile: Internal error"); + s->host->warningsLogTerminateAccess(td->id); + chain.clearAllFilters(); + return td->http->raiseHTTPError(500); + }; + + /* For logging activity. */ + td->sentData += dataSent; + + chain.clearAllFilters(); + return !ret; +} + +/*! + *Constructor for the class. + */ +HttpFile::HttpFile() +{ + +} + +/*! + *Destroy the object. + */ +HttpFile::~HttpFile() +{ + +} + +/*! + *Load the static elements. + *\param confFile Not used. + */ +int HttpFile::load(XmlParser* /*confFile*/) +{ + return 0; +} + +/*! + *Unload the static elements. + */ +int HttpFile::unLoad() +{ + return 0; +} + +/*! + *Custom version for the appendDataToHTTPChannel function, this is + *slower that the HttpDataHandler one but the internal buffer is + *needed by the filters chain. + *\param td The HTTP thread context. + *\param buffer Data to send. + *\param size Size of the buffer. + *\param appendFile The file where append if in append mode. + *\param chain Where send data if not append. + *\param append Append to the file? + *\param useChunks Can we use HTTP chunks to send data? + *\param realBufferSize The real dimension of the buffer that can be + *used by this method. + *\param tmpStream A support on memory read/write stream used + *internally by the function. + */ +int HttpFile::appendDataToHTTPChannel(HttpThreadContext* td, + char* buffer, + u_long size, + File* appendFile, + FiltersChain* chain, + bool append, + bool useChunks, + u_long realBufferSize, + MemoryStream *tmpStream) +{ + u_long nbr, nbw; + Stream *oldStream = chain->getStream(); + + /* + *This function can't append directly to the chain because we can't + *know in advance the data chunk size. Therefore we replace the + *final stream with a memory buffer and write there the final data + *chunk content, finally we read from it and send directly on the + *original stream. + */ + chain->setStream(tmpStream); + + if(chain->write(buffer, size, &nbw)) + return 1; + + if(tmpStream->read(buffer, realBufferSize, &nbr)) + return 1; + + chain->setStream(oldStream); + + /* + *Use of chain->getStream() is needed to write directly on the + *final stream. + */ + return HttpDataHandler::appendDataToHTTPChannel(td, + buffer, + nbr, + appendFile, + chain->getStream(), + append, + useChunks); + +} Modified: trunk/myserver/src/http_handler/isapi/isapi.cpp =================================================================== --- trunk/myserver/src/http_handler/isapi/isapi.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/http_handler/isapi/isapi.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include Modified: trunk/myserver/src/http_handler/mscgi/mscgi.cpp =================================================================== --- trunk/myserver/src/http_handler/mscgi/mscgi.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/http_handler/mscgi/mscgi.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include Modified: trunk/myserver/src/http_handler/scgi/scgi.cpp =================================================================== --- trunk/myserver/src/http_handler/scgi/scgi.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/http_handler/scgi/scgi.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -15,7 +15,7 @@ along with this program. If not, see . */ #include -#include +#include #include #include #include Modified: trunk/myserver/src/plugin/executor/dynamic_executor.cpp =================================================================== --- trunk/myserver/src/plugin/executor/dynamic_executor.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/executor/dynamic_executor.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,6 @@ #include #include #include -#include #include #include Modified: trunk/myserver/src/plugin/filter/dyn_filter.cpp =================================================================== --- trunk/myserver/src/plugin/filter/dyn_filter.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/filter/dyn_filter.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include Modified: trunk/myserver/src/plugin/filter/dyn_filter_file.cpp =================================================================== --- trunk/myserver/src/plugin/filter/dyn_filter_file.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/filter/dyn_filter_file.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include Modified: trunk/myserver/src/plugin/filter/dyn_filters_manager.cpp =================================================================== --- trunk/myserver/src/plugin/filter/dyn_filters_manager.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/filter/dyn_filters_manager.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include Modified: trunk/myserver/src/plugin/generic_plugins_manager.cpp =================================================================== --- trunk/myserver/src/plugin/generic_plugins_manager.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/generic_plugins_manager.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -17,7 +17,6 @@ #include "stdafx.h" #include -#include #include #include #include Modified: trunk/myserver/src/plugin/http_command/dyn_http_command.cpp =================================================================== --- trunk/myserver/src/plugin/http_command/dyn_http_command.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/http_command/dyn_http_command.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -15,11 +15,8 @@ along with this program. If not, see . */ - #include -#include #include -#include #include Modified: trunk/myserver/src/plugin/http_manager/dyn_http_manager.cpp =================================================================== --- trunk/myserver/src/plugin/http_manager/dyn_http_manager.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/http_manager/dyn_http_manager.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,6 @@ #include #include #include -#include #include Modified: trunk/myserver/src/plugin/http_manager/dyn_http_manager_list.cpp =================================================================== --- trunk/myserver/src/plugin/http_manager/dyn_http_manager_list.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/http_manager/dyn_http_manager_list.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -16,11 +16,9 @@ */ -#include #include -#include +#include #include -#include #include Modified: trunk/myserver/src/plugin/plugins_namespace_manager.cpp =================================================================== --- trunk/myserver/src/plugin/plugins_namespace_manager.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/plugins_namespace_manager.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -17,7 +17,7 @@ #include "stdafx.h" #include -#include +#include #include #include #include Modified: trunk/myserver/src/plugin/protocol/dynamic_protocol.cpp =================================================================== --- trunk/myserver/src/plugin/protocol/dynamic_protocol.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/protocol/dynamic_protocol.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,6 @@ #include #include #include -#include #include Modified: trunk/myserver/src/plugin/protocol/protocols_manager.cpp =================================================================== --- trunk/myserver/src/plugin/protocol/protocols_manager.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/plugin/protocol/protocols_manager.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include Modified: trunk/myserver/src/protocol/control/control_header.cpp =================================================================== --- trunk/myserver/src/protocol/control/control_header.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/control/control_header.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -32,10 +32,6 @@ #endif } -#ifdef NOT_WIN -#include -#endif - /*! *Return a string containing options specified by the client. */ Modified: trunk/myserver/src/protocol/control/control_protocol.cpp =================================================================== --- trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -45,9 +45,6 @@ extern const char *versionOfSoftware; -#include - - char ControlProtocol::adminLogin[64] = ""; char ControlProtocol::adminPassword[64] = ""; int ControlProtocol::controlEnabled = 0; Modified: trunk/myserver/src/protocol/ftp/ftp.cpp =================================================================== --- trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include Modified: trunk/myserver/src/protocol/http/Makefile.am =================================================================== --- trunk/myserver/src/protocol/http/Makefile.am 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/http/Makefile.am 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,5 +1,5 @@ lib_LIBRARIES = libhttp.a -libhttp_a_SOURCES = http.cpp http_data_handler.cpp http_data_read.cpp http_dir.cpp http_errors.cpp http_file.cpp http_header_checker.cpp http_headers.cpp http_request.cpp http_response.cpp http_thread_context.cpp -SUBDIRS = +libhttp_a_SOURCES = http.cpp http_data_handler.cpp http_data_read.cpp http_errors.cpp http_header_checker.cpp http_headers.cpp http_request.cpp http_response.cpp http_thread_context.cpp +SUBDIRS = env INCLUDES = $(all_includes) Copied: trunk/myserver/src/protocol/http/env (from rev 2774, trunk/myserver/src/env) Property changes on: trunk/myserver/src/protocol/http/env ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/myserver/src/protocol/http/env/env.cpp =================================================================== --- trunk/myserver/src/env/env.cpp 2008-08-31 23:22:09 UTC (rev 2774) +++ trunk/myserver/src/protocol/http/env/env.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -16,7 +16,7 @@ */ #include "stdafx.h" -#include +#include #include #include #include Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -58,10 +58,6 @@ #endif } -#ifdef NOT_WIN -#include -#endif - static HttpStaticData staticHttp; Modified: trunk/myserver/src/protocol/http/http_data_read.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_data_read.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/http/http_data_read.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -45,10 +45,6 @@ #endif } -#ifdef NOT_WIN -#include -#endif - /*! *Read primitive post data as it is sent by the client without apply any filter *in a contiguous manner, first read from the memory buffer and after from the Deleted: trunk/myserver/src/protocol/http/http_dir.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_dir.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/http/http_dir.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,572 +0,0 @@ -/* -MyServer -Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdafx.h" -#include -#include -#include -#include -#include -#include - -extern "C" -{ -#ifdef WIN32 -#include -#include -#endif - -#ifdef NOT_WIN -#include -#include -#endif -} - -#include -#include -#ifdef NOT_WIN -#endif - -#include -#include -#include -#include -#include - -using namespace std; - -/*! - * Compare two HttpDir::FileStruct by their filename. - */ -bool HttpDir::compareFileStructByName (HttpDir::FileStruct i, HttpDir::FileStruct j) -{ - return stringcmpi (i.name, j.name) < 0 ? true : false; -} - -/*! - * Compare two HttpDir::FileStruct by their last modified file time. - */ - -bool HttpDir::compareFileStructByTime (HttpDir::FileStruct i, HttpDir::FileStruct j) -{ - return i.time_write < j.time_write; -} - -/*! - * Compare two HttpDir::FileStruct by their file size. - */ -bool HttpDir::compareFileStructBySize (HttpDir::FileStruct i, HttpDir::FileStruct j) -{ - return i.size < j.size; -} - -/*! - *Constructor for the class. - */ -HttpDir::HttpDir() -{ - -} - -/*! - *Destroy the object. - */ -HttpDir::~HttpDir() -{ - -} - -/*! - *Load the static elements. - */ -int HttpDir::load(XmlParser* /*confFile*/) -{ - return 0; -} - -/*! - *Unload the static elements. - */ -int HttpDir::unLoad() -{ - return 0; -} - -/*! - *Get a formatted dobule representation of BYTES right shifted by POWER. - *\param bytes Number of bytes. - *\param power Power of 2. - *\return the double representation for BYTES>>POWER. - */ -double HttpDir::formatBytes(u_long bytes, u_int power) -{ - const u_long quotient = bytes >> power; - if (quotient == 0) - return -1; - - const u_long unit = 1 << power; - const u_long remainder = bytes & (unit - 1); - const double result = quotient + static_cast(remainder) / unit; - return result; -} - - -/*! - *Fullfill the string out with a formatted representation for bytes. - *\param bytes Size to format. - *\param out Out string. - */ -void HttpDir::getFormattedSize(u_long bytes, string & out) -{ - const string symbols[] = {"TB", "GB", "MB", "KB", "bytes"}; - const u_int powers[] = {40, 30, 20, 10, 0}; - double result; - size_t i; - ostringstream osstr; - - if (bytes == 0) - { - out = "0"; - return; - } - - for (i = 0; i < sizeof (powers); i++) - { - result = formatBytes (bytes, powers[i]); - if (result != -1) - break; - } - - if((result - floor(result)) < 0.01) - osstr << std::fixed << setprecision(0) << result << " " << symbols[i]; - else - osstr << std::fixed << setprecision(2) << result << " " << symbols[i]; - - out = osstr.str(); -} - -/*! - *Browse a directory printing its contents in an HTML file. - *\param td The current thread context. - *\param s The current connection structure. - *\param directory Directory to show. - *\param cgi non used. - *\param onlyHeader Specify if send only the HTTP header. -*/ -int HttpDir::send(HttpThreadContext* td, ConnectionPtr s, - const char* directory, const char* /*cgi*/, - int /*execute*/, int onlyHeader) -{ - u_long nbw; - string filename; - int ret; - FindData fd; - FiltersChain chain; - int lastSlash = 0; - bool useChunks = false; - u_long sentData = 0; - int i; - char fileTime[32]; - char* bufferloop; - const char* browseDirCSSpath; - bool keepalive = false; - vector files; - size_t sortIndex; - char sortType; - bool sortReverse = false; - HttpRequestHeader::Entry *host = td->request.other.get("Host"); - - - chain.setProtocol(td->http); - chain.setProtocolData(td); - chain.setStream(td->connection->socket); - if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain, - td->mime->filters, - td->connection->socket, &nbw, 1)) - { - td->connection->host->warningsLogRequestAccess(td->id); - td->connection->host->warningsLogWrite("HttpDir: Error loading filters"); - td->connection->host->warningsLogTerminateAccess(td->id); - chain.clearAllFilters(); - return td->http->raiseHTTPError(500); - } - - lastSlash = td->request.uri.rfind('/') + 1; - - checkDataChunks(td, &keepalive, &useChunks); - - td->response.contentType.assign("text/html"); - - if(!td->appendOutputs) - { - - HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), - &(td->response)); - - if(s->socket->send(td->buffer->getBuffer(), - (u_long)strlen(td->buffer->getBuffer()), 0) - == SOCKET_ERROR) - { - /* Remove the connection. */ - return 0; - } - } - - if(onlyHeader) - return 1; - - - sortIndex = td->request.uriOpts.find("sort="); - - if(sortIndex != string::npos && sortIndex + 5 < td->request.uriOpts.length()) - { - sortType = td->request.uriOpts.at(sortIndex + 5); - } - - if(sortIndex != string::npos && sortIndex + 6 < td->request.uriOpts.length()) - { - sortReverse = td->request.uriOpts.at(sortIndex + 6) == 'I'; - } - - /* Make sortType always lowercase. */ - switch(sortType) - { - case 's': - case 'S': - sortType = 's'; - break; - case 't': - case 'T': - sortType = 't'; - break; - default: - sort (files.begin(), files.end(), compareFileStructByName); - } - - browseDirCSSpath = td->http->getBrowseDirCSSFile(); - - td->buffer2->setLength(0); - *td->buffer2 << "\r\n" - "\r\n" - "" - "\r\n\r\n" ; - *td->buffer2 << td->request.uri.c_str() ; - *td->buffer2 << "\r\n"; - - /* - *If it is defined a CSS file for the graphic layout of - *the browse directory insert it in the page. - */ - if(browseDirCSSpath != 0) - { - *td->buffer2 << "\r\n"; - } - - - *td->buffer2 << "\r\n"; - - ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), - td->buffer2->getLength(), - &(td->outputData), &chain, - td->appendOutputs, useChunks); - if(ret) - { - /* Return an internal server error. */ - td->outputData.closeFile(); - chain.clearAllFilters(); - return td->http->raiseHTTPError(500); - } - - sentData = td->buffer2->getLength(); - - browseDirCSSpath = td->http->getBrowseDirCSSFile(); - - filename = directory; - td->buffer2->setLength(0); - *td->buffer2 << "\r\n

Contents of directory "; - *td->buffer2 << &td->request.uri[lastSlash] ; - *td->buffer2 << "

\r\n
\r\n"; - - ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), - td->buffer2->getLength(), - &(td->outputData), &chain, - td->appendOutputs, useChunks); - - if(ret) - { - td->outputData.closeFile(); - /* Return an internal server error. */ - return td->http->raiseHTTPError(500); - } - sentData += td->buffer2->getLength(); - - ret = fd.findfirst(filename.c_str()); - - if(ret == -1) - { - chain.clearAllFilters(); - return td->http->raiseHTTPError(404); - } - - /* - *With the current code we build the HTML TABLE to indicize the - *files in the directory. - */ - td->buffer2->setLength(0); - *td->buffer2 << "\r\n\r\n" ; - - if(sortType == 'f' && !sortReverse) - *td->buffer2 << "\r\n"; - else - *td->buffer2 << "\r\n"; - - if(sortType == 't' && !sortReverse) - *td->buffer2 << "\r\n"; - else - *td->buffer2 << "\r\n"; - - if(sortType == 's' && !sortReverse) - *td->buffer2 << "\r\n\r\n"; - else - *td->buffer2 << "\r\n\r\n"; - - ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), - td->buffer2->getLength(), - &(td->outputData), &chain, - td->appendOutputs, useChunks); - - if(ret) - { - td->outputData.closeFile(); - chain.clearAllFilters(); - /* Return an internal server error. */ - return td->http->raiseHTTPError(500); - } - - sentData += td->buffer2->getLength(); - - td->buffer2->setLength(0); - - if(FilesUtility::getPathRecursionLevel(td->request.uri) >= 1) - { - string file; - file.assign(td->request.uri); - file.append("/../"); - - *td->buffer2 << "\r\n\n" - << "\r\n"; - - ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), - td->buffer2->getLength(), - &(td->outputData), &chain, - td->appendOutputs, useChunks); - if(ret) - { - fd.findclose(); - td->outputData.closeFile(); - chain.clearAllFilters(); - /* Return an internal server error. */ - return td->http->raiseHTTPError(500); - } - sentData += td->buffer2->getLength(); - } - - /* Put all files in a vector. */ - do - { - if(fd.name[0] == '.') - continue; - /* Do not show the security file. */ - if(!strcmp(fd.name, "security")) - continue; - - FileStruct file; - file.name.assign(fd.name); - file.time_write = fd.time_write; - file.attrib = fd.attrib; - file.size = fd.size; - files.push_back(file); - - } - while(!fd.findnext()); - - fd.findclose(); - - /* Sort the vector. */ - switch(sortType) - { - case 's': - sort (files.begin(), files.end(), compareFileStructBySize); - break; - case 't': - sort (files.begin(), files.end(), compareFileStructByTime); - break; - case 'f': - sort (files.begin(), files.end(), compareFileStructByName); - } - - if(sortReverse) - reverse (files.begin(), files.end()); - - /* Build the files table and send it. */ - for(vector::iterator it = files.begin(); - it != files.end(); it++) - { - string formattedName; - - FileStruct& file = *it; - - td->buffer2->setLength(0); - - *td->buffer2 << "\r\n\r\n\r\n\r\n\r\n"; - ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), - td->buffer2->getLength(), - &(td->outputData), &chain, - td->appendOutputs, useChunks); - if(ret) - { - td->outputData.closeFile(); - chain.clearAllFilters(); - /* Return an internal server error. */ - return td->http->raiseHTTPError(500); - } - - sentData += td->buffer2->getLength(); - - } - - td->buffer2->setLength(0); - *td->buffer2 << "
FileFileLast ModifiedLast ModifiedSize
Size
" - << "request.uriEndsWithSlash ? ".." : ".") - << "\">[ .. ][directory]
request.uriEndsWithSlash) - { - *td->buffer2 << &td->request.uri[lastSlash]; - *td->buffer2 << "/" ; - } - formattedName.assign(file.name); - - formatHtml(file.name, formattedName); - - *td->buffer2 << formattedName ; - *td->buffer2 << "\">" ; - *td->buffer2 << formattedName; - *td->buffer2 << ""; - - getRFC822GMTTime(file.time_write, fileTime, 32); - - *td->buffer2 << fileTime ; - *td->buffer2 << ""; - - if(file.attrib & FILE_ATTRIBUTE_DIRECTORY) - { - *td->buffer2 << "[directory]"; - } - else - { - string out; - getFormattedSize(file.size, out); - *td->buffer2 << out; - } - - *td->buffer2 << "
\r\n
\r\n
GNU MyServer " - << versionOfSoftware; - - if(host && host->value->length()) - { - ostringstream portBuff; - size_t portSeparator = host->value->find(':'); - *td->buffer2 << " on "; - if(portSeparator != string::npos) - *td->buffer2 << host->value->substr(0, portSeparator).c_str() ; - else - *td->buffer2 << host->value->c_str() ; - - *td->buffer2 << " Port "; - portBuff << td->connection->getLocalPort(); - *td->buffer2 << portBuff.str(); - } - *td->buffer2 << "
\r\n\r\n\r\n"; - ret = appendDataToHTTPChannel(td, td->buffer2->getBuffer(), - td->buffer2->getLength(), - &(td->outputData), &chain, - td->appendOutputs, useChunks); - - if(ret) - { - td->outputData.closeFile(); - /* Return an internal server error. */ - return td->http->raiseHTTPError(500); - } - sentData += td->buffer2->getLength(); - - *td->buffer2 << end_str; - /* Changes the \ character in the / character. */ - bufferloop = td->buffer2->getBuffer(); - while(*bufferloop++) - if(*bufferloop == '\\') - *bufferloop = '/'; - - if(!td->appendOutputs && useChunks) - { - if(chain.write("0\r\n\r\n", 5, &nbw)) - return 1; - } - - /* For logging activity. */ - td->sentData += sentData; - - chain.clearAllFilters(); - return 1; - -} - -/*! - *Format a string to html. - *\param name String to convert. - *\param out HTML converted string. - */ -void HttpDir::formatHtml(string& in, string& out) -{ - string::size_type pos = 0; - out.assign(in); - /* - *Replace characters in the ranges 32-65 91-96 123-126 160-255 - *with "&#CODE;". - */ - for(pos = 0; out[pos] != '\0'; pos++) - { - if(((u_char)out[pos] >= 32 && - (u_char)out[pos] <= 65) || - ((u_char)out[pos] >= 91 && - (u_char)out[pos] <= 96) || - ((u_char)out[pos] >= 123 && - (u_char)out[pos] <= 126) || - ((u_char)out[pos] >= 160 && - (u_char)out[pos] < 255)) - { - ostringstream os; - os << "&#" << (int)((unsigned char)out[pos]) << ";"; - out.replace(pos, 1, os.str()); - pos += os.str().length() - 1; - } - } -} Deleted: trunk/myserver/src/protocol/http/http_file.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_file.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/http/http_file.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -1,627 +0,0 @@ -/* -MyServer -Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -#include -#include -#include -#include -#include -#include - -#include -#include -using namespace std; - -extern "C" -{ -#ifdef WIN32 -#include -#include -#endif - -#ifdef NOT_WIN -#include -#include -#ifdef SENDFILE -#include -#include -#include -#include -#include -#include -#include -#endif -#endif -} - -/*! - *Send a file to the client using the HTTP protocol. - *\param td The current HTTP thread context. - *\param s A pointer to the connection. - *\param filenamePath The path of the static file to send. - *\param exec Not used. - *\param onlyHeader Specify if send only the HTTP header. - */ -int HttpFile::send(HttpThreadContext* td, ConnectionPtr s, - const char *filenamePath, const char* /*exec*/, - int /*execute*/, int onlyHeader) -{ - /* - *With this routine we send a file through the HTTP protocol. - *Open the file and save its handle. - */ - int ret; - - /* - *Will we use GZIP compression to send data? - */ - bool useGzip = false; - u_long filesize = 0; - File *file = 0; - u_long bytesToSend; - u_long firstByte = td->request.rangeByteBegin; - u_long lastByte = td->request.rangeByteEnd; - bool keepalive = false; - bool useChunks = false; - bool useModifiers = false; - MemoryStream memStream(td->buffer2); - FiltersChain chain; - u_long nbw; - u_long nbr; - - u_long dataSent = 0; - - try - { - file = Server::getInstance()->getCachedFiles()->open(filenamePath); - if(file == 0) - { - return td->http->raiseHTTPError(500); - } - /* - *Check how many bytes are ready to be send. - */ - filesize = file->getFileSize(); - bytesToSend = filesize; - if(lastByte == 0) - { - lastByte = bytesToSend; - } - else - { - /* - *If the client use ranges set the right value - *for the last byte number. - */ - lastByte = std::min(lastByte + 1, bytesToSend); - } - - /* - * bytesToSend is the interval between the first and the last byte. - */ - bytesToSend = lastByte - firstByte; - - /* - * If fail to set the file pointer returns an internal server error. - */ - ret = file->setFilePointer(firstByte); - if(ret) - { - file->closeFile(); - delete file; - return td->http->raiseHTTPError(500); - } - - - { - /* - *Use GZIP compression to send files bigger than GZIP threshold. - */ - const char* val = s->host->getHashedData("GZIP_THRESHOLD"); - useGzip = false; - if(val) - { - u_long gzipThreshold = atoi(val); - if(bytesToSend >= gzipThreshold) - useGzip = true; - } - - } - - keepalive = td->request.isKeepAlive(); - -#ifndef DO_NOT_USEGZIP - /* - *Be sure that the client accept GZIP compressed data. - */ - if(useGzip) - { - HttpRequestHeader::Entry* e = td->request.other.get("Accept-Encoding"); - if(e) - { - useGzip &= (e->value->find("gzip") != string::npos); - } - else - useGzip = false; - - } -#else - /* - * If compiled without GZIP support force the server to don't use it. - */ - useGzip = false; -#endif - if(td->appendOutputs) - useGzip = false; - - td->buffer->setLength(0); - - /* If a Range was requested send 206 and not 200 for success. */ - if( td->request.rangeByteBegin || td->request.rangeByteEnd ) - { - HttpResponseHeader::Entry *e; - ostringstream buffer; - td->response.httpStatus = 206; - buffer << "bytes "<< (u_long)firstByte << "-" - << (u_long)lastByte << "/" << (u_long)filesize ; - - e = td->response.other.get("Content-Range"); - if(e) - e->value->assign(buffer.str()); - else - { - e = new HttpResponseHeader::Entry(); - e->name->assign("Content-Range"); - e->value->assign(buffer.str()); - td->response.other.put(*(e->name), e); - } - - - e = td->response.other.get("Transfer-Encoding"); - if(e) - e->value->assign("chunked"); - else - { - e = new HttpResponseHeader::Entry(); - e->name->assign("Transfer-Encoding"); - e->value->assign("chunked"); - td->response.other.put(*(e->name), e); - } - - useGzip = false; - } - chain.setProtocol(td->http); - chain.setProtocolData(td); - chain.setStream(&memStream); - if(td->mime) - { - if(td->mime && - Server::getInstance()->getFiltersFactory()->chain(&chain, - td->mime->filters, - &memStream, - &nbw)) - { - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 0; - } - memStream.refresh(); - - dataSent += nbw; - } - - if(useGzip && !chain.isFilterPresent("gzip")) - { - Filter* gzipFilter = - Server::getInstance()->getFiltersFactory()->getFilter("gzip"); - u_long nbw; - if(!gzipFilter) - { - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 0; - } - if(chain.addFilter(gzipFilter, &nbw)) - { - delete gzipFilter; - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 0; - } - dataSent += nbw; - } - - useModifiers = chain.hasModifiersFilters(); - - if(keepalive && !useModifiers) - { - ostringstream buffer; - buffer << (u_int)bytesToSend; - td->response.contentLength.assign(buffer.str()); - } - - /* Specify the connection type. */ - if(keepalive) - { - td->response.connection.assign("keep-alive"); - } - else - { - td->response.connection.assign("close"); - } - - if(useModifiers) - { - string s; - HttpResponseHeader::Entry *e; - chain.getName(s); - e = td->response.other.get("Content-Encoding"); - if(e) - e->value->assign(s); - else - { - e = new HttpResponseHeader::Entry(); - e->name->assign("Content-Encoding"); - e->value->assign(s); - td->response.other.put(*(e->name), e); - } - /* Do not use chunked transfer with old HTTP/1.0 clients. */ - if(keepalive) - { - HttpResponseHeader::Entry *e; - e = td->response.other.get("Transfer-Encoding"); - if(e) - e->value->assign("chunked"); - else - { - e = new HttpResponseHeader::Entry(); - e->name->assign("Transfer-Encoding"); - e->value->assign("chunked"); - td->response.other.put(*(e->name), e); - } - - useChunks = true; - } - } - - HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), - &td->response); - td->buffer->setLength((u_long)strlen(td->buffer->getBuffer())); - if(!td->appendOutputs) - { - /* Send the HTTP header. */ - if(s->socket->send(td->buffer->getBuffer(), - (u_long)td->buffer->getLength(), 0) == SOCKET_ERROR) - { - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 1; - } - } - - /* - *If is requested only the header exit from the function; - *used by the HEAD request. - */ - if(onlyHeader) - { - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 0; - } - -#ifdef SENDFILE - /* - * Check if there are all the conditions to use a direct copy from the - * file to the socket. The sendfile syscall copy from a descriptor to - * another directly in the kernel space without performs an extra copy - * to an userspace buffer. - */ - if(!useChunks && chain.isEmpty() && - !td->appendOutputs && (file->getHandle() != -1) && - !(td->http->getProtocolOptions() & PROTOCOL_USES_SSL)) - { - off_t offset = firstByte; - ret = sendfile(s->socket->getHandle(), file->getHandle(), - &offset, bytesToSend); - file->closeFile(); - delete file; - chain.clearAllFilters(); - - /* For logging activity. */ - td->sentData += ret; - - return 0; - } -#endif - - if(td->appendOutputs) - chain.setStream(&(td->outputData)); - else - chain.setStream(s->socket); - - /* - *Flush initial data. This is data that filters could have added - *and we have to send before the file itself, for example the gzip - *filter add a header to file. - */ - if(memStream.availableToRead()) - { - ret = memStream.read(td->buffer->getBuffer(), - td->buffer->getRealLength(), - &nbr); - - if(ret) - { - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 0; - } - - memStream.refresh(); - - if(nbr) - { - if(HttpDataHandler::appendDataToHTTPChannel(td, - td->buffer->getBuffer(), - nbr, - &(td->outputData), - chain.getStream(), - td->appendOutputs, - useChunks)) - { - file->closeFile(); - delete file; - chain.clearAllFilters(); - return 1; - dataSent += nbw; - } - } /* nbr. */ - } /* memStream.availableToRead(). */ - - - /* Flush the rest of the file. */ - for(;;) - { - u_long nbr; - u_long nbw; - - /* Check if there are other bytes to send. */ - if(bytesToSend) - { - /* Read from the file the bytes to send. */ - ret = file->readFromFile(td->buffer->getBuffer(), - std::min(static_cast(bytesToSend), - static_cast(td->buffer->getRealLength()/2)), - &nbr); - if(ret) - break; - - if(nbr == 0) - { - bytesToSend = 0; - continue; - } - - bytesToSend -= nbr; - - - ret = appendDataToHTTPChannel(td, td->buffer->getBuffer(), - nbr, - &(td->outputData), - &chain, - td->appendOutputs, - useChunks, - td->buffer->getRealLength(), - &memStream); - if(ret) - break; - - dataSent += nbr; - } - else /* if(bytesToSend) */ - { - /* If we don't use chunks we can flush directly. */ - if(!useChunks) - { - ret = chain.flush(&nbw); - - break; - } - else - { - /* - *Replace the final stream before the flush and write to a - *memory buffer, after all the data is flushed from the - *chain we can replace the stream with the original one and - *write there the HTTP data chunk. - */ - Stream* tmpStream = chain.getStream(); - - chain.setStream(&memStream); - - memStream.refresh(); - - ret = chain.flush(&nbw); - - if(ret) - break; - - chain.setStream(tmpStream); - - ret = memStream.read(td->buffer->getBuffer(), - td->buffer->getRealLength(), - &nbr); - if(ret) - break; - - ret = HttpDataHandler::appendDataToHTTPChannel(td, - td->buffer->getBuffer(), - nbr, - &(td->outputData), - chain.getStream(), - td->appendOutputs, - useChunks); - if(ret) - break; - - ret = HttpDataHandler::appendDataToHTTPChannel(td, - 0, - 0, - &(td->outputData), - chain.getStream(), - td->appendOutputs, - useChunks); - - break; - } - } - - memStream.refresh(); - - }/* End for loop. */ - - file->closeFile(); - delete file; - } - catch(bad_alloc &ba) - { - file->closeFile(); - delete file; - s->host->warningsLogRequestAccess(td->id); - s->host->warningsLogWrite("HttpFile: Error allocating memory"); - s->host->warningsLogTerminateAccess(td->id); - chain.clearAllFilters(); - return td->http->raiseHTTPError(500); - } - catch(...) - { - file->closeFile(); - delete file; - s->host->warningsLogRequestAccess(td->id); - s->host->warningsLogWrite("HttpFile: Internal error"); - s->host->warningsLogTerminateAccess(td->id); - chain.clearAllFilters(); - return td->http->raiseHTTPError(500); - }; - - /* For logging activity. */ - td->sentData += dataSent; - - chain.clearAllFilters(); - return !ret; -} - -/*! - *Constructor for the class. - */ -HttpFile::HttpFile() -{ - -} - -/*! - *Destroy the object. - */ -HttpFile::~HttpFile() -{ - -} - -/*! - *Load the static elements. - *\param confFile Not used. - */ -int HttpFile::load(XmlParser* /*confFile*/) -{ - return 0; -} - -/*! - *Unload the static elements. - */ -int HttpFile::unLoad() -{ - return 0; -} - -/*! - *Custom version for the appendDataToHTTPChannel function, this is - *slower that the HttpDataHandler one but the internal buffer is - *needed by the filters chain. - *\param td The HTTP thread context. - *\param buffer Data to send. - *\param size Size of the buffer. - *\param appendFile The file where append if in append mode. - *\param chain Where send data if not append. - *\param append Append to the file? - *\param useChunks Can we use HTTP chunks to send data? - *\param realBufferSize The real dimension of the buffer that can be - *used by this method. - *\param tmpStream A support on memory read/write stream used - *internally by the function. - */ -int HttpFile::appendDataToHTTPChannel(HttpThreadContext* td, - char* buffer, - u_long size, - File* appendFile, - FiltersChain* chain, - bool append, - bool useChunks, - u_long realBufferSize, - MemoryStream *tmpStream) -{ - u_long nbr, nbw; - Stream *oldStream = chain->getStream(); - - /* - *This function can't append directly to the chain because we can't - *know in advance the data chunk size. Therefore we replace the - *final stream with a memory buffer and write there the final data - *chunk content, finally we read from it and send directly on the - *original stream. - */ - chain->setStream(tmpStream); - - if(chain->write(buffer, size, &nbw)) - return 1; - - if(tmpStream->read(buffer, realBufferSize, &nbr)) - return 1; - - chain->setStream(oldStream); - - /* - *Use of chain->getStream() is needed to write directly on the - *final stream. - */ - return HttpDataHandler::appendDataToHTTPChannel(td, - buffer, - nbr, - appendFile, - chain->getStream(), - append, - useChunks); - -} Modified: trunk/myserver/src/protocol/http/http_headers.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_headers.cpp 2008-09-01 19:56:39 UTC (rev 2779) +++ trunk/myserver/src/protocol/http/http_headers.cpp 2008-09-02 19:00:55 UTC (rev 2780) @@ -39,10 +39,6 @@ #endif } -#ifdef NOT_WIN -#include -#endif - /*! *Builds an HTTP header string starting from an HttpResponseHeader structure. *\param str The buffer where write the HTTP header. From MAILER-DAEMON Tue Sep 02 15:03:02 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kab9a-0005L2-Bb for mharc-myserver-commit@gnu.org; Tue, 02 Sep 2008 15:03:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kab9Z-0005KU-BJ for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:03:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kab9Y-0005K2-UM for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:03:01 -0400 Received: from [199.232.76.173] (port=47196 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kab9Y-0005Ju-RK for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:03:00 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51123 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kab9Y-0005wW-Ga for myserver-commit@gnu.org; Tue, 02 Sep 2008 15:03:00 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kab9X-0002vo-Dt for myserver-commit@gnu.org; Tue, 02 Sep 2008 19:02:59 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kab9W-0002vV-II for myserver-commit@gnu.org; Tue, 02 Sep 2008 19:02:59 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 02 Sep 2008 19:02:58 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2781] Pruned empty directories X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2008 19:03:01 -0000 Revision: 2781 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2781 Author: gscrivano Date: 2008-09-02 19:02:58 +0000 (Tue, 02 Sep 2008) Log Message: ----------- Pruned empty directories Removed Paths: ------------- trunk/myserver/include/env/ trunk/myserver/include/files_cache/ From MAILER-DAEMON Wed Sep 03 14:00:31 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kawed-0006Z3-Dr for mharc-myserver-commit@gnu.org; Wed, 03 Sep 2008 14:00:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kaweb-0006YI-8Y for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:00:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaweZ-0006XU-0M for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:00:27 -0400 Received: from [199.232.76.173] (port=55299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaweY-0006XQ-PD for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:00:26 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51989 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KaweY-0005O6-0g for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:00:26 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KaweX-0005TE-Be for myserver-commit@gnu.org; Wed, 03 Sep 2008 18:00:25 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KaweX-0005TA-1v for myserver-commit@gnu.org; Wed, 03 Sep 2008 18:00:25 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 03 Sep 2008 18:00:25 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2782] Added missing Makefile.am X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 18:00:29 -0000 Revision: 2782 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2782 Author: gscrivano Date: 2008-09-03 18:00:24 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Added missing Makefile.am Added Paths: ----------- trunk/myserver/src/http_handler/http_dir/Makefile.am trunk/myserver/src/http_handler/http_file/Makefile.am Added: trunk/myserver/src/http_handler/http_dir/Makefile.am =================================================================== --- trunk/myserver/src/http_handler/http_dir/Makefile.am (rev 0) +++ trunk/myserver/src/http_handler/http_dir/Makefile.am 2008-09-03 18:00:24 UTC (rev 2782) @@ -0,0 +1,5 @@ +lib_LIBRARIES = libhttp_dir.a +libhttp_dir_a_SOURCES = http_dir.cpp +SUBDIRS = +INCLUDES = $(all_includes) + Added: trunk/myserver/src/http_handler/http_file/Makefile.am =================================================================== --- trunk/myserver/src/http_handler/http_file/Makefile.am (rev 0) +++ trunk/myserver/src/http_handler/http_file/Makefile.am 2008-09-03 18:00:24 UTC (rev 2782) @@ -0,0 +1,5 @@ +lib_LIBRARIES = libhttp_file.a +libhttp_file_a_SOURCES = http_file.cpp +SUBDIRS = +INCLUDES = $(all_includes) + From MAILER-DAEMON Wed Sep 03 14:07:34 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KawlS-0004pS-Ks for mharc-myserver-commit@gnu.org; Wed, 03 Sep 2008 14:07:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KawlR-0004o9-0f for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:07:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KawlQ-0004n9-AR for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:07:32 -0400 Received: from [199.232.76.173] (port=48506 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KawlQ-0004mr-4C for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:07:32 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44117 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KawlP-0006gG-VH for myserver-commit@gnu.org; Wed, 03 Sep 2008 14:07:32 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KawlP-0005cw-EZ for myserver-commit@gnu.org; Wed, 03 Sep 2008 18:07:31 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KawlP-0005cs-9m for myserver-commit@gnu.org; Wed, 03 Sep 2008 18:07:31 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 03 Sep 2008 18:07:31 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2783] Added missing Makefile.am X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 18:07:33 -0000 Revision: 2783 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2783 Author: gscrivano Date: 2008-09-03 18:07:31 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Added missing Makefile.am Added Paths: ----------- trunk/myserver/include/find_data/Makefile.am trunk/myserver/include/http_handler/http_file/Makefile.am Added: trunk/myserver/include/find_data/Makefile.am =================================================================== --- trunk/myserver/include/find_data/Makefile.am (rev 0) +++ trunk/myserver/include/find_data/Makefile.am 2008-09-03 18:07:31 UTC (rev 2783) @@ -0,0 +1,3 @@ +include_HEADERS = +SUBDIRS = + Added: trunk/myserver/include/http_handler/http_file/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/http_file/Makefile.am (rev 0) +++ trunk/myserver/include/http_handler/http_file/Makefile.am 2008-09-03 18:07:31 UTC (rev 2783) @@ -0,0 +1,3 @@ +include_HEADERS = http_file.h +SUBDIRS = + From MAILER-DAEMON Wed Sep 03 17:18:10 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kazju-0005MP-8s for mharc-myserver-commit@gnu.org; Wed, 03 Sep 2008 17:18:10 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kazjs-0005LI-7b for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:18:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kazjq-0005L2-CX for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:18:07 -0400 Received: from [199.232.76.173] (port=43387 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kazjq-0005Kz-72 for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:18:06 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60144 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kazjq-0003p9-3e for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:18:06 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kazjo-0003Qg-SC for myserver-commit@gnu.org; Wed, 03 Sep 2008 21:18:05 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kazjo-0003QG-0e for myserver-commit@gnu.org; Wed, 03 Sep 2008 21:18:04 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 03 Sep 2008 21:18:04 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2784] Pruned unused directories X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 21:18:08 -0000 Revision: 2784 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2784 Author: gscrivano Date: 2008-09-03 21:18:02 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Pruned unused directories Modified Paths: -------------- trunk/myserver/configure.in trunk/myserver/src/Makefile.am Removed Paths: ------------- trunk/myserver/include/find_data/ Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-03 18:07:31 UTC (rev 2783) +++ trunk/myserver/configure.in 2008-09-03 21:18:02 UTC (rev 2784) @@ -127,7 +127,7 @@ fi AC_SUBST(XNET_LIB) -AC_CHECK_LIB(event, accept, have_event=yes) +AC_CHECK_LIB(event, event_add, have_event=yes) if test x$have_event = xyes; then EVENT_LIB="-levent" else @@ -377,7 +377,6 @@ documentation/english/style/Makefile documentation/english/texts/Makefile include/Makefile - include/find_data/Makefile include/connection/Makefile include/log/Makefile include/conf/Makefile @@ -431,7 +430,6 @@ include/plugin/http_command/Makefile include/server/Makefile src/Makefile - src/find_data/Makefile src/connection/Makefile src/log/Makefile src/conf/Makefile Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-03 18:07:31 UTC (rev 2783) +++ trunk/myserver/src/Makefile.am 2008-09-03 21:18:02 UTC (rev 2784) @@ -1,5 +1,5 @@ # Makefile for MyServer (./src) -SUBDIRS = base conf connection connections_scheduler filter find_data \ +SUBDIRS = base conf connection connections_scheduler filter\ http_handler log plugin protocol server . From MAILER-DAEMON Wed Sep 03 17:24:09 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kazph-0001fy-Hg for mharc-myserver-commit@gnu.org; Wed, 03 Sep 2008 17:24:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kazpg-0001ed-FS for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:24:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kazpf-0001cn-Bz for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:24:07 -0400 Received: from [199.232.76.173] (port=52284 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kazpf-0001cd-7n for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:24:07 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42582 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kazpe-0004Yd-Nt for myserver-commit@gnu.org; Wed, 03 Sep 2008 17:24:07 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kazpa-0003cN-M4 for myserver-commit@gnu.org; Wed, 03 Sep 2008 21:24:02 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KazpZ-0003cA-NC for myserver-commit@gnu.org; Wed, 03 Sep 2008 21:24:01 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 03 Sep 2008 21:24:01 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2785] Removed include/find_data from SUBDIRS X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 21:24:08 -0000 Revision: 2785 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2785 Author: gscrivano Date: 2008-09-03 21:24:01 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Removed include/find_data from SUBDIRS Modified Paths: -------------- trunk/myserver/configure.in trunk/myserver/include/Makefile.am Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-03 21:18:02 UTC (rev 2784) +++ trunk/myserver/configure.in 2008-09-03 21:24:01 UTC (rev 2785) @@ -482,7 +482,6 @@ src/plugin/filter/Makefile src/plugin/http_command/Makefile src/server/Makefile - tests/Makefile ]) AC_OUTPUT Modified: trunk/myserver/include/Makefile.am =================================================================== --- trunk/myserver/include/Makefile.am 2008-09-03 21:18:02 UTC (rev 2784) +++ trunk/myserver/include/Makefile.am 2008-09-03 21:24:01 UTC (rev 2785) @@ -1,2 +1,2 @@ -SUBDIRS = base conf connection connections_scheduler filter find_data http_handler log plugin protocol server +SUBDIRS = base conf connection connections_scheduler filter http_handler log plugin protocol server From MAILER-DAEMON Thu Sep 04 17:56:30 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KbMoY-0004yt-Fj for mharc-myserver-commit@gnu.org; Thu, 04 Sep 2008 17:56:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbMoW-0004wO-8J for myserver-commit@gnu.org; Thu, 04 Sep 2008 17:56:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbMoV-0004vQ-DE for myserver-commit@gnu.org; Thu, 04 Sep 2008 17:56:27 -0400 Received: from [199.232.76.173] (port=50629 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbMoU-0004vD-Qh for myserver-commit@gnu.org; Thu, 04 Sep 2008 17:56:26 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60330 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KbMoU-0006n6-Dd for myserver-commit@gnu.org; Thu, 04 Sep 2008 17:56:26 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KbMoT-0003vc-La for myserver-commit@gnu.org; Thu, 04 Sep 2008 21:56:25 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KbMoT-0003vY-9z for myserver-commit@gnu.org; Thu, 04 Sep 2008 21:56:25 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 04 Sep 2008 21:56:25 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2786] Basic support for cygwin cross-compiling X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2008 21:56:28 -0000 Revision: 2786 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2786 Author: gscrivano Date: 2008-09-04 21:56:24 +0000 (Thu, 04 Sep 2008) Log Message: ----------- Basic support for cygwin cross-compiling Modified Paths: -------------- trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am trunk/myserver/binaries/web/cgi-src/post/Makefile.am trunk/myserver/configure.in trunk/myserver/control/Makefile.am trunk/myserver/include/base/socket/socket.h trunk/myserver/src/Makefile.am trunk/myserver/src/base/socket/socket.cpp trunk/myserver/src/base/socket/ssl_socket.cpp trunk/myserver/src/connections_scheduler/listen_threads.cpp trunk/myserver/src/server/server.cpp trunk/myserver/tests/Makefile.am trunk/myserver/tests/test_mutex.cpp Modified: trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am =================================================================== --- trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am 2008-09-04 21:56:24 UTC (rev 2786) @@ -12,7 +12,7 @@ math_sum.mscgi : $(libmath_sum_a_OBJECTS) $(libmath_sum_a_DEPENDENCIES) -rm -f math_sum.mscgi - $(CXX) $(libmath_sum_a_OBJECTS) $(libmath_sum_a_LIBADD) -o math_sum.mscgi -shared + $(CXX) $(libmath_sum_a_OBJECTS) ../../../../src/libmyserver.a $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) -o math_sum.mscgi -shared install : math_sum.mscgi $(INSTALL) 'math_sum.mscgi' '$(root_prefix)/var/web/cgi-bin/math_sum.mscgi' Modified: trunk/myserver/binaries/web/cgi-src/post/Makefile.am =================================================================== --- trunk/myserver/binaries/web/cgi-src/post/Makefile.am 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/binaries/web/cgi-src/post/Makefile.am 2008-09-04 21:56:24 UTC (rev 2786) @@ -12,7 +12,7 @@ post.mscgi : $(libpost_a_OBJECTS) $(libpost_a_DEPENDENCIES) -rm -f post.mscgi - $(CXX) $(libpost_a_OBJECTS) $(libpost_a_LIBADD) -o post.mscgi -shared + $(CXX) $(libpost_a_OBJECTS) ../../../../src/libmyserver.a $(libpost_a_LIBADD) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) -o post.mscgi -shared install : post.mscgi $(INSTALL) 'post.mscgi' '$(root_prefix)/var/web/cgi-bin/post.mscgi' Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/configure.in 2008-09-04 21:56:24 UTC (rev 2786) @@ -59,16 +59,15 @@ CXXFLAGS="$CXXFLAGS $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" LDFLAGS="$LDFLAGS $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" -AC_SUBST(CFLAGS) -AC_SUBST(CXFLAGS) -AC_SUBST(LDFLAGS) - AC_ARG_WITH([root-prefix], [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], root_prefix=$withval, root_prefix="") AC_ARG_ENABLE([control-gui], [ --disable-control-gui disable the myserver-configure GUI program], enable_control="no", enable_control="yes") AC_ARG_ENABLE([ipv6], [ --enable-ipv6 Build with IPv6 support], enable_ipv6="yes", enable_ipv6="") +AC_ARG_ENABLE([cygwin], [ --enable-cygwin Enable cygwin], enable_cygwin="yes", enable_cygwin="") + + root_bindir='${root_prefix}/bin' root_sbindir='${root_prefix}/sbin' root_sysconfdir='${root_prefix}/etc' @@ -110,14 +109,17 @@ dnl Looking for pthreads GNOME_PTHREAD_CHECK -if test x$PTHREAD_LIB = x; then +if test x$PTHREAD_LIB = x -a "x$enable_cygwin" != "xyes"; then AC_MSG_ERROR([ *** This system appears to have no posix threads *** Threads are required for MyServer ]) fi -AC_DEFINE(HAVE_PTHREAD, 1, [POSIX threads required for MyServer in a non-windows environment]) +if test x$PTHREAD_LIB != x; then + AC_DEFINE(HAVE_PTHREAD, 1, [POSIX threads required for MyServer in a non-windows environment]) +fi + dnl See if we need -lxnet for arpa AC_CHECK_LIB(xnet, accept, have_xnet=yes) if test x$have_xnet = xyes; then @@ -129,21 +131,23 @@ AC_CHECK_LIB(event, event_add, have_event=yes) if test x$have_event = xyes; then + AC_CHECK_HEADER(event.h,, + [ + AC_MSG_WARN([event.h not found which is part of libevent.]) + ]) EVENT_LIB="-levent" else EVENT_LIB="" - AC_MSG_ERROR([ + + if test "x$enable_cygwin" != "xyes"; then + AC_MSG_ERROR([ *** This system appears to have no libevent *** Libevent is required by MyServer -]) + ]) + fi fi AC_SUBST(EVENT_LIB) -AC_CHECK_HEADER(event.h,, -[ - AC_MSG_WARN([event.h not found which is part of libevent.]) -]) - AC_CHECK_FUNCS(event_loopbreak, AC_DEFINE(EVENT_LOOPBREAK, 1, [Define if the event_loopbreak function is present]) ) dnl check for Unix98 socklen_t @@ -160,10 +164,14 @@ AC_CHECK_LIB(c ,dlopen, have_dl=yes; no_dl_ld=yes) if test x$have_dl != xyes; then - AC_MSG_WARN([ + + if test "x$enable_cygwin" != "xyes"; then + AC_MSG_WARN([ *** dlLIB not found *** MSCGI support will not function -]) + ]) + fi + DL_LIB="" MAKE_MSCGI=no else @@ -174,10 +182,11 @@ if test x$no_dl_ld = xyes; then DL_LIB="" fi + + AC_SUBST(DL_LIB) - # Libidn checks # ------------- AC_CHECK_HEADER(idna.h,, @@ -222,9 +231,16 @@ CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" fi +OPENSSL_INC="" +AC_ARG_WITH(openssl-include, + [[ --with-openssl-include=FILE Use the given path to the openssl include files.]], + [ + OPENSSL_INC=$withval + ]) + dnl CHECKING FOR OPENSSL - for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do + for dir in $OPENSSL_INC /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do ssldir="$dir"; if test -f "$dir/include/openssl/ssl.h"; then found_ssl="yes"; @@ -246,7 +262,7 @@ else printf "OpenSSL found in $ssldir\n"; LDFLAGS="$LDFLAGS -L$ssldir/lib"; - OPENSSL_LIB="-lssl" # myserver + OPENSSL_LIB="-lssl -lcrypto" # myserver HAVE_SSL="yes" fi AC_SUBST(HAVE_SSL) @@ -279,10 +295,10 @@ AC_DEFINE(GZIP_CHECK_BOUNDS, 1, [Memory checking for Zlib, not defined in older vrs]) fi fi + AC_SUBST(ZLIB_LIB) if test x$enable_control == xyes; then - AC_CHECK_LIB(fltk, main, have_fltk=yes) dnl Looking for FLTK AM_PATH_FLTK(1.1.0, have_fltk=yes) @@ -340,10 +356,22 @@ *** tests driver program will not be built ]) MAKE_TESTS=no + CPPUNIT_LDFLAGS="" else MAKE_TESTS=yes + CPPUNIT_LDFLAGS="-lcppunit" fi +if test "x$enable_cygwin" = "xyes"; then + LDFLAGS="$LDFLAGS -levent_extra -levent_core -lws2_32 -lgdi32 -lrx -luserenv -lole32 -luuid" +fi + +AC_SUBST(CFLAGS) +AC_SUBST(CXFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(CPPUNIT_LDFLAGS) + + AM_CONDITIONAL(BUILD_TESTS, test "$MAKE_TESTS" = "yes") AM_CONDITIONAL(BUILD_MSCGI, test "$MAKE_MSCGI" = "yes") @@ -351,7 +379,7 @@ dnl AC_CONFIG_SUBDIRS() AC_CONFIG_FILES([ - version.h + version.h Makefile binaries/Makefile binaries/certificates/Makefile @@ -377,111 +405,111 @@ documentation/english/style/Makefile documentation/english/texts/Makefile include/Makefile - include/connection/Makefile - include/log/Makefile - include/conf/Makefile - include/conf/mime/Makefile - include/conf/security/Makefile - include/conf/vhost/Makefile - include/connections_scheduler/Makefile - include/http_handler/Makefile - include/http_handler/wincgi/Makefile - include/http_handler/cgi/Makefile - include/http_handler/mscgi/Makefile - include/http_handler/fastcgi/Makefile - include/http_handler/http_file/Makefile - include/http_handler/scgi/Makefile - include/http_handler/isapi/Makefile - include/http_handler/http_dir/Makefile - include/base/Makefile - include/base/find_data/Makefile - include/base/file/Makefile - include/base/pipe/Makefile - include/base/base64/Makefile - include/base/mem_buff/Makefile - include/base/home_dir/Makefile - include/base/multicast/Makefile - include/base/sync/Makefile - include/base/safetime/Makefile - include/base/socket/Makefile - include/base/hash_map/Makefile - include/base/dynamic_lib/Makefile - include/base/process/Makefile - include/base/md5/Makefile - include/base/ssl/Makefile - include/base/xml/Makefile - include/base/files_cache/Makefile - include/base/string/Makefile - include/base/regex/Makefile - include/base/thread/Makefile - include/protocol/Makefile - include/protocol/ftp/Makefile - include/protocol/control/Makefile - include/protocol/https/Makefile - include/protocol/http/Makefile - include/protocol/http/env/Makefile - include/filter/Makefile - include/filter/gzip/Makefile - include/plugin/Makefile - include/plugin/executor/Makefile - include/plugin/http_manager/Makefile - include/plugin/protocol/Makefile - include/plugin/filter/Makefile - include/plugin/http_command/Makefile - include/server/Makefile + include/connection/Makefile + include/log/Makefile + include/conf/Makefile + include/conf/mime/Makefile + include/conf/security/Makefile + include/conf/vhost/Makefile + include/connections_scheduler/Makefile + include/http_handler/Makefile + include/http_handler/wincgi/Makefile + include/http_handler/cgi/Makefile + include/http_handler/mscgi/Makefile + include/http_handler/fastcgi/Makefile + include/http_handler/http_file/Makefile + include/http_handler/scgi/Makefile + include/http_handler/isapi/Makefile + include/http_handler/http_dir/Makefile + include/base/Makefile + include/base/find_data/Makefile + include/base/file/Makefile + include/base/pipe/Makefile + include/base/base64/Makefile + include/base/mem_buff/Makefile + include/base/home_dir/Makefile + include/base/multicast/Makefile + include/base/sync/Makefile + include/base/safetime/Makefile + include/base/socket/Makefile + include/base/hash_map/Makefile + include/base/dynamic_lib/Makefile + include/base/process/Makefile + include/base/md5/Makefile + include/base/ssl/Makefile + include/base/xml/Makefile + include/base/files_cache/Makefile + include/base/string/Makefile + include/base/regex/Makefile + include/base/thread/Makefile + include/protocol/Makefile + include/protocol/ftp/Makefile + include/protocol/control/Makefile + include/protocol/https/Makefile + include/protocol/http/Makefile + include/protocol/http/env/Makefile + include/filter/Makefile + include/filter/gzip/Makefile + include/plugin/Makefile + include/plugin/executor/Makefile + include/plugin/http_manager/Makefile + include/plugin/protocol/Makefile + include/plugin/filter/Makefile + include/plugin/http_command/Makefile + include/server/Makefile src/Makefile - src/connection/Makefile - src/log/Makefile - src/conf/Makefile - src/conf/mime/Makefile - src/conf/security/Makefile - src/conf/vhost/Makefile - src/connections_scheduler/Makefile - src/http_handler/Makefile - src/http_handler/wincgi/Makefile - src/http_handler/cgi/Makefile - src/http_handler/mscgi/Makefile - src/http_handler/fastcgi/Makefile - src/http_handler/http_file/Makefile - src/http_handler/scgi/Makefile - src/http_handler/isapi/Makefile - src/http_handler/http_dir/Makefile - src/base/Makefile - src/base/find_data/Makefile - src/base/file/Makefile - src/base/pipe/Makefile - src/base/base64/Makefile - src/base/mem_buff/Makefile - src/base/home_dir/Makefile - src/base/multicast/Makefile - src/base/sync/Makefile - src/base/safetime/Makefile - src/base/socket/Makefile - src/base/hash_map/Makefile - src/base/dynamic_lib/Makefile - src/base/process/Makefile - src/base/md5/Makefile - src/base/ssl/Makefile - src/base/xml/Makefile - src/base/files_cache/Makefile - src/base/string/Makefile - src/base/regex/Makefile - src/base/thread/Makefile - src/protocol/Makefile - src/protocol/ftp/Makefile - src/protocol/control/Makefile - src/protocol/https/Makefile - src/protocol/http/Makefile - src/protocol/http/env/Makefile - src/filter/Makefile - src/filter/gzip/Makefile - src/plugin/Makefile - src/plugin/executor/Makefile - src/plugin/http_manager/Makefile - src/plugin/protocol/Makefile - src/plugin/filter/Makefile - src/plugin/http_command/Makefile - src/server/Makefile + src/connection/Makefile + src/log/Makefile + src/conf/Makefile + src/conf/mime/Makefile + src/conf/security/Makefile + src/conf/vhost/Makefile + src/connections_scheduler/Makefile + src/http_handler/Makefile + src/http_handler/wincgi/Makefile + src/http_handler/cgi/Makefile + src/http_handler/mscgi/Makefile + src/http_handler/fastcgi/Makefile + src/http_handler/http_file/Makefile + src/http_handler/scgi/Makefile + src/http_handler/isapi/Makefile + src/http_handler/http_dir/Makefile + src/base/Makefile + src/base/find_data/Makefile + src/base/file/Makefile + src/base/pipe/Makefile + src/base/base64/Makefile + src/base/mem_buff/Makefile + src/base/home_dir/Makefile + src/base/multicast/Makefile + src/base/sync/Makefile + src/base/safetime/Makefile + src/base/socket/Makefile + src/base/hash_map/Makefile + src/base/dynamic_lib/Makefile + src/base/process/Makefile + src/base/md5/Makefile + src/base/ssl/Makefile + src/base/xml/Makefile + src/base/files_cache/Makefile + src/base/string/Makefile + src/base/regex/Makefile + src/base/thread/Makefile + src/protocol/Makefile + src/protocol/ftp/Makefile + src/protocol/control/Makefile + src/protocol/https/Makefile + src/protocol/http/Makefile + src/protocol/http/env/Makefile + src/filter/Makefile + src/filter/gzip/Makefile + src/plugin/Makefile + src/plugin/executor/Makefile + src/plugin/http_manager/Makefile + src/plugin/protocol/Makefile + src/plugin/filter/Makefile + src/plugin/http_command/Makefile + src/server/Makefile tests/Makefile ]) AC_OUTPUT Modified: trunk/myserver/control/Makefile.am =================================================================== --- trunk/myserver/control/Makefile.am 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/control/Makefile.am 2008-09-04 21:56:24 UTC (rev 2786) @@ -1,13 +1,14 @@ bin_PROGRAMS = myserver-configure myserver_configure_SOURCES = control_client.cpp fltkconfig.cpp language.cpp mimetype.cpp\ - myserver-configure.cpp progress.cpp service.cpp vector.cpp vhost.cpp + myserver-configure.cpp progress.cpp service.cpp vector.cpp vhost.cpp + INCLUDES = $(all_includes) -myserver_configure_LDFLAGS = $(all_libraries) ../src/libmyserver.a +myserver_configure_LDFLAGS = $(all_libraries) myserver_configure_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) $(FLTK_CFLAGS) -DPREFIX=\"$(prefix)\" -myserver_configure_LDADD = $(XML_LIBS) $(FLTK_LIBS) $(XNET_LIB) $(OPENSSL_LIB) +myserver_configure_LDADD = ../src/libmyserver.a $(XML_LIBS) $(FLTK_LIBS) $(XNET_LIB) $(OPENSSL_LIB) $(LDFLAGS) EXTRA_DIST = control_client.h fltkconfig.h language.h mimetype.h progress.h service.h vector.h vhost.h -all : all-am myserver-configure - cp myserver-configure ../binaries/ +all : all-am myserver-configure$(EXEEXT) + cp myserver-configure$(EXEEXT) ../binaries/ Modified: trunk/myserver/include/base/socket/socket.h =================================================================== --- trunk/myserver/include/base/socket/socket.h 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/include/base/socket/socket.h 2008-09-04 21:56:24 UTC (rev 2786) @@ -39,7 +39,7 @@ #ifndef SOCKETLIBINCLUDED extern "C" { -#include + //#include #include } #define SOCKETLIBINCLUDED Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/src/Makefile.am 2008-09-04 21:56:24 UTC (rev 2786) @@ -10,22 +10,22 @@ libmyserver.a: rm -f libmyserver.a - find -iregex .*\\.o | xargs ar cru libmyserver.a - ranlib libmyserver.a + find -iregex .*\\.o | xargs $(AR) cru libmyserver.a + $(RANLIB) libmyserver.a bin_PROGRAMS = myserver myserver_SOURCES = myserver.cpp INCLUDES = $(all_includes) -myserver_LDADD = $(all_libraries) $(PTHREAD_LIB) $(IDN_LIB) \ - $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ - $(XML_LIBS) +myserver_LDADD = libmyserver.a $(all_libraries) $(PTHREAD_LIB) $(IDN_LIB) \ + $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ + $(XML_LIBS) $(LDFLAGS) myserver_DEPENDENCIES = libmyserver.a myserver_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\" -myserver_LDFLAGS = -rdynamic libmyserver.a +myserver_LDFLAGS = -rdynamic build_parser: protocol/ftp/ftp_lexer.lpp protocol/ftp/ftp_parser.ypp bison --defines=../include/protocol/ftp/ftp_parser.h protocol/ftp/ftp_parser.ypp Modified: trunk/myserver/src/base/socket/socket.cpp =================================================================== --- trunk/myserver/src/base/socket/socket.cpp 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/src/base/socket/socket.cpp 2008-09-04 21:56:24 UTC (rev 2786) @@ -23,7 +23,7 @@ #include #include #ifdef WIN32 -#include +//#include #endif #ifndef WIN32 #include @@ -162,8 +162,12 @@ { if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) ) return 1;//Andu: TODO our error code or what? - if ( (sa->ss_family == AF_INET && namelen != sizeof(sockaddr_in)) || - (sa->ss_family == AF_INET6 && namelen != sizeof(sockaddr_in6)) ) + if ( (sa->ss_family == AF_INET && namelen != sizeof(sockaddr_in)) +#if HAVE_IPV6 + || (sa->ss_family == AF_INET6 && namelen != sizeof(sockaddr_in6)) +#endif + ) + return 1;//Andu: TODO our error code or what? #ifdef WIN32 return ::bind((SOCKET)socketHandle,(const struct sockaddr*)sa,namelen); @@ -607,8 +611,11 @@ { if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) ) return 1;//Andu: TODO our error code or what? - if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) || - (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) ) + if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) +#if HAVE_IPV6 + || (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) +#endif + ) return 1;//Andu: TODO our error code or what? #ifdef WIN32 Modified: trunk/myserver/src/base/socket/ssl_socket.cpp =================================================================== --- trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-04 21:56:24 UTC (rev 2786) @@ -24,7 +24,7 @@ #include #include #ifdef WIN32 -#include + //#include #endif #ifndef WIN32 #include @@ -137,8 +137,11 @@ { if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) ) return 1;//Andu: TODO our error code or what? - if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) || - (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) ) + if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) +#if HAVE_IPV6 + || (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) +#endif +) return 1;//Andu: TODO our error code or what? #ifndef DO_NOT_USE_SSL sslMethod = SSLv23_client_method(); Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-04 21:56:24 UTC (rev 2786) @@ -23,7 +23,7 @@ extern "C" { #ifdef WIN32 -#include + //#include #include #endif #ifdef NOT_WIN Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/src/server/server.cpp 2008-09-04 21:56:24 UTC (rev 2786) @@ -38,7 +38,7 @@ extern "C" { #ifdef WIN32 -#include + //#include #include #endif #ifdef NOT_WIN @@ -66,7 +66,9 @@ #define MAKEWORD(a, b) ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) << 8)) #endif +#if HAVE_IPV6 const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +#endif /*! *At startup the server instance is null. @@ -1139,16 +1141,19 @@ /* Port used by the client. */ if ( asockIn->ss_family == AF_INET ) port = ntohs(((sockaddr_in *)(asockIn))->sin_port); +#if HAVE_IPV6 else port = ntohs(((sockaddr_in6 *)(asockIn))->sin6_port); +#endif /* Port used by the server. */ - if ( localSockIn.ss_family == AF_INET ) + if ( localSockIn.ss_family == AF_INET ) myPort = ntohs(((sockaddr_in *)(&localSockIn))->sin_port); +#if HAVE_IPV6 else myPort = ntohs(((sockaddr_in6 *)(&localSockIn))->sin6_port); +#endif - if(!addConnectionToList(&s, asockIn, &ip[0], &localIp[0], port, myPort, 1)) { /* If we report error to add the connection to the thread. */ Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/tests/Makefile.am 2008-09-04 21:56:24 UTC (rev 2786) @@ -3,4 +3,4 @@ bin_PROGRAMS = tests_suite tests_suite_SOURCES = main.cpp test_base64.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp -tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LIBS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) +tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Modified: trunk/myserver/tests/test_mutex.cpp =================================================================== --- trunk/myserver/tests/test_mutex.cpp 2008-09-03 21:24:01 UTC (rev 2785) +++ trunk/myserver/tests/test_mutex.cpp 2008-09-04 21:56:24 UTC (rev 2786) @@ -38,7 +38,7 @@ }; #ifdef WIN32 -unsigned int __stdcall test_mutex_incremented(void* pParam) +unsigned int __stdcall test_mutex_incrementer(void* pParam) #endif #ifdef HAVE_PTHREAD void* test_mutex_incrementer(void* pParam) From MAILER-DAEMON Thu Sep 04 18:24:58 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KbNG5-0002vK-St for mharc-myserver-commit@gnu.org; Thu, 04 Sep 2008 18:24:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbNG3-0002uz-VB for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:24:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbNG3-0002ui-Fu for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:24:55 -0400 Received: from [199.232.76.173] (port=60828 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbNG3-0002ub-8P for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:24:55 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49696 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KbNG3-0002j9-5U for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:24:55 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KbNG2-0006iJ-5q for myserver-commit@gnu.org; Thu, 04 Sep 2008 22:24:54 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KbNG1-0006iA-To for myserver-commit@gnu.org; Thu, 04 Sep 2008 22:24:54 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 04 Sep 2008 22:24:53 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2787] Updated source file path X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2008 22:24:56 -0000 Revision: 2787 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2787 Author: gscrivano Date: 2008-09-04 22:24:53 +0000 (Thu, 04 Sep 2008) Log Message: ----------- Updated source file path Modified Paths: -------------- trunk/myserver/SConstruct Modified: trunk/myserver/SConstruct =================================================================== --- trunk/myserver/SConstruct 2008-09-04 21:56:24 UTC (rev 2786) +++ trunk/myserver/SConstruct 2008-09-04 22:24:53 UTC (rev 2787) @@ -255,7 +255,7 @@ if buildControlGui: filesControl = glob.glob('control/*.cpp') filesControl.append(["src/base/file/file.cpp", "src/base/file/files_utility.cpp", "src/base/xml/xml_parser.cpp", - "src/base/utility.cpp", "src/find_data/find_data.cpp", "src/base/md5/md5.cpp", "src/base/mem_buff/mem_buff.cpp", + "src/base/utility.cpp", "src/base/find_data/find_data.cpp", "src/base/md5/md5.cpp", "src/base/mem_buff/mem_buff.cpp", "src/base/socket/ssl_socket.cpp", "src/base/socket/socket.cpp", "src/base/sync/mutex.cpp", "src/base/thread/thread.cpp", "src/filter/stream.cpp", "src/base/string/securestr.cpp"]) From MAILER-DAEMON Thu Sep 04 18:57:58 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KbNm2-00018m-5g for mharc-myserver-commit@gnu.org; Thu, 04 Sep 2008 18:57:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbNm0-00018P-Cn for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:57:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbNm0-00018D-0j for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:57:56 -0400 Received: from [199.232.76.173] (port=48832 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbNlz-00018A-Py for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:57:55 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40513 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KbNlz-0007MQ-NQ for myserver-commit@gnu.org; Thu, 04 Sep 2008 18:57:55 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KbNly-0001Rh-VN for myserver-commit@gnu.org; Thu, 04 Sep 2008 22:57:55 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KbNly-0001Rd-Nu for myserver-commit@gnu.org; Thu, 04 Sep 2008 22:57:54 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 04 Sep 2008 22:57:54 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2788] Use . X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2008 22:57:56 -0000 Revision: 2788 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2788 Author: gscrivano Date: 2008-09-04 22:57:54 +0000 (Thu, 04 Sep 2008) Log Message: ----------- Use . instead of .o Modified Paths: -------------- trunk/myserver/src/Makefile.am Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-04 22:24:53 UTC (rev 2787) +++ trunk/myserver/src/Makefile.am 2008-09-04 22:57:54 UTC (rev 2788) @@ -10,7 +10,7 @@ libmyserver.a: rm -f libmyserver.a - find -iregex .*\\.o | xargs $(AR) cru libmyserver.a + find -iregex .*\\.$(OBJEXT) | xargs $(AR) cru libmyserver.a $(RANLIB) libmyserver.a bin_PROGRAMS = myserver From MAILER-DAEMON Sat Sep 06 14:27:55 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kc2Vn-0008Lc-H8 for mharc-myserver-commit@gnu.org; Sat, 06 Sep 2008 14:27:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kc2Vl-0008Jf-G7 for myserver-commit@gnu.org; Sat, 06 Sep 2008 14:27:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kc2Vj-0008JG-RC for myserver-commit@gnu.org; Sat, 06 Sep 2008 14:27:52 -0400 Received: from [199.232.76.173] (port=59749 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kc2Vj-0008JD-Nx for myserver-commit@gnu.org; Sat, 06 Sep 2008 14:27:51 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51384 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kc2Vi-0003hX-Uy for myserver-commit@gnu.org; Sat, 06 Sep 2008 14:27:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kc2Vi-0008TV-Cn for myserver-commit@gnu.org; Sat, 06 Sep 2008 18:27:50 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kc2Vi-0008TR-3g for myserver-commit@gnu.org; Sat, 06 Sep 2008 18:27:50 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 06 Sep 2008 18:27:50 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2789] Updated NSIS installer script to install files generated by cygwin X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 18:27:54 -0000 Revision: 2789 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2789 Author: gscrivano Date: 2008-09-06 18:27:49 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Updated NSIS installer script to install files generated by cygwin Modified Paths: -------------- trunk/myserver/binaries/NSIS installer script.nsi trunk/myserver/control/MyServer Configure.dev Modified: trunk/myserver/binaries/NSIS installer script.nsi =================================================================== --- trunk/myserver/binaries/NSIS installer script.nsi 2008-09-04 22:57:54 UTC (rev 2788) +++ trunk/myserver/binaries/NSIS installer script.nsi 2008-09-06 18:27:49 UTC (rev 2789) @@ -1,4 +1,4 @@ -;NSIS Installation script for MyServer +;NSIS Installation script for GNU MyServer !include "MUI2.nsh" @@ -9,11 +9,11 @@ ; Versioning Information VIProductVersion "0.9.0.3" -VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "MyServer" -VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "www.myserverproject.net" -VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "MyServer Project" -VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "MyServer Project" -VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "MyServer webserver" +VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "GNU MyServer" +VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "www.gnu.org/software/myserver/" +VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Free Software Foundation Inc." +VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "GNU MyServer" +VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "GNU MyServer webserver" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "0.9.0.3" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "0.9.0.3" VIAddVersionKey /LANG=${LANG_ENGLISH} "InternalName" "" @@ -191,16 +191,9 @@ SetOutPath $INSTDIR WriteUninstaller "uninstall.exe" File "myserver.exe" - File "libxml2.dll" - File "iconv.dll" - File "libiconv-2.dll" - File "charset.dll" -; File "libpng13.dll" - File "zlib1.dll" - File "libssl32.dll" - File "intl.dll" - File "rx.dll" - File "libeay32.dll" + File "libiconv-2.dll" + File "libidn-11.dll" + File "libxml2-2.dll" File "MIMEtypes.xml.default" File "myserver.xml.default" File "virtualhosts.xml.default" @@ -268,7 +261,7 @@ Section "MyServer center" SecControl DetailPrint "Control Center Application" SetOutPath $INSTDIR - File "Myserver Configure.exe" + File "myserver-configure.exe" File "myserver.ico" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Control Center.lnk" "$INSTDIR\Myserver Configure.exe" SectionEnd @@ -316,7 +309,6 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Install the MyServer core application(this element is required)" !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "Install the MyServer documentation" !insertmacro MUI_DESCRIPTION_TEXT ${SecControl} "Install the Control Center application(the installation of this element is highly recommended)" - !insertmacro MUI_DESCRIPTION_TEXT ${SecMSCGI} "Copy the MyServer MSCGI library(premature status yet)" !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} "Copy all the languages files(by default only the english language is copied)" !insertmacro MUI_DESCRIPTION_TEXT ${SecWebEx} "Install some web examples" !insertmacro MUI_DESCRIPTION_TEXT ${SecService} "Install MyServer like a service (loaded automatically on startup)" Modified: trunk/myserver/control/MyServer Configure.dev =================================================================== --- trunk/myserver/control/MyServer Configure.dev 2008-09-04 22:57:54 UTC (rev 2788) +++ trunk/myserver/control/MyServer Configure.dev 2008-09-06 18:27:49 UTC (rev 2789) @@ -18,7 +18,7 @@ ExeOutput=..\binaries ObjectOutput=tmp OverrideOutput=0 -OverrideOutputName=MyServer Configure.exe +OverrideOutputName=myserver-configure.exe HostApplication= Folders= CommandLine= From MAILER-DAEMON Sat Sep 06 15:58:26 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kc3vO-0002Cn-Nt for mharc-myserver-commit@gnu.org; Sat, 06 Sep 2008 15:58:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kc3vM-0002An-65 for myserver-commit@gnu.org; Sat, 06 Sep 2008 15:58:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kc3vK-00029B-AX for myserver-commit@gnu.org; Sat, 06 Sep 2008 15:58:23 -0400 Received: from [199.232.76.173] (port=51578 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kc3vK-00028t-1f for myserver-commit@gnu.org; Sat, 06 Sep 2008 15:58:22 -0400 Received: from savannah.gnu.org ([199.232.41.3]:46816 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kc3vJ-0008BR-9S for myserver-commit@gnu.org; Sat, 06 Sep 2008 15:58:21 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kc3vI-000879-Uw for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:58:21 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kc3vI-00086x-HD for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:58:20 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 06 Sep 2008 19:58:20 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2790] Removed global variable versionOfSoftware. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 19:58:24 -0000 Revision: 2790 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2790 Author: gscrivano Date: 2008-09-06 19:58:19 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Removed global variable versionOfSoftware. It closes the task #8586 Ticket Links: :----------- http://savannah.gnu.org/task/?8586 Modified Paths: -------------- trunk/myserver/SConstruct trunk/myserver/configure.in trunk/myserver/generate_myserver_dev.pl trunk/myserver/include/http_handler/wincgi/wincgi.h trunk/myserver/include/protocol/http/env/env.h trunk/myserver/src/http_handler/http_dir/http_dir.cpp trunk/myserver/src/http_handler/isapi/isapi.cpp trunk/myserver/src/myserver.cpp trunk/myserver/src/protocol/control/control_protocol.cpp trunk/myserver/src/protocol/http/env/env.cpp trunk/myserver/src/protocol/http/http.cpp trunk/myserver/src/protocol/http/http_headers.cpp trunk/myserver/src/server/server.cpp trunk/myserver/stdafx.h Modified: trunk/myserver/SConstruct =================================================================== --- trunk/myserver/SConstruct 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/SConstruct 2008-09-06 19:58:19 UTC (rev 2790) @@ -26,9 +26,7 @@ import string -PKG_NAME = "MyServer" -MYSERVER_VERSION = "0.9.0" -PKG_VERSION = MYSERVER_VERSION + "-" + "rc2" +MYSERVER_VERSION = "GNU MyServer 0.9.0" SVN_TRUNK = "svn://svn.savannah.gnu.org/myserver/trunk" HOMEPAGE = "http://www.gnu.org/software/myserver/" @@ -39,7 +37,7 @@ ddir = ARGUMENTS.get('destdir', "#/release") plugin = ARGUMENTS.get('plugin', "") -destdir = ddir + "/" + PKG_NAME.lower() + "-" + PKG_VERSION +destdir = ddir listinc=[ '/usr/local/include', @@ -112,8 +110,6 @@ if not conf.__dict__.has_key('Define'): conf.Define = Define_helper - conf.Define("PACKAGE_NAME", '"' + PKG_NAME + '"') - conf.Define("PACKAGE_VERSION", '"' + PKG_VERSION + '"') conf.Define("MYSERVER_VERSION", '"' + MYSERVER_VERSION + '"') if not conf.CheckLib("libxml2"): @@ -311,7 +307,7 @@ #Prepare the package. if command == "package": - filename = PKG_NAME.lower() + "-" + PKG_VERSION + ".tar.gz" + filename = MYSERVER_VERSION.lower() + ".tar.gz" env = Environment(TARFLAGS = '-c -z') env.Tar(ddir + "/" + filename, destdir) Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/configure.in 2008-09-06 19:58:19 UTC (rev 2790) @@ -1,7 +1,6 @@ -dnl MySever configuration script +dnl GNU MySever configuration script dnl -dnl MyServer -dnl http://www.myserverproject.net/ +dnl GNU MyServer dnl dnl Copyright (C) 2002-2008 Free Software Foundation, Inc. dnl This program is free software; you can redistribute it and/or modify @@ -17,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -AC_INIT([MyServer], [0.9.0-rc2], [http://www.myserverproject.net/]) +AC_INIT([MyServer], [0.9.0-rc2], [bug-myserver@gnu.org]) AC_PREREQ([2.50]) AM_CONFIG_HEADER(config.h) CFLAGS="${CFLAGS=}" @@ -33,7 +32,7 @@ MYSERVER_MINOR_VERSION=9 MYSERVER_MICRO_VERSION=0 -MYSERVER_VERSION="${MYSERVER_MAJOR_VERSION}.${MYSERVER_MINOR_VERSION}.${MYSERVER_MICRO_VERSION}" +MYSERVER_VERSION="GNU MyServer ${MYSERVER_MAJOR_VERSION}.${MYSERVER_MINOR_VERSION}.${MYSERVER_MICRO_VERSION}" AC_SUBST(MYSERVER_MAJOR_VERSION) AC_SUBST(MYSERVER_MINOR_VERSION) Modified: trunk/myserver/generate_myserver_dev.pl =================================================================== --- trunk/myserver/generate_myserver_dev.pl 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/generate_myserver_dev.pl 2008-09-06 19:58:19 UTC (rev 2790) @@ -37,8 +37,8 @@ PrivateResource=myserver_private.rc ResourceIncludes= MakeIncludes= -Compiler= -CppCompiler= +Compiler=-DMYSERVER_VERSION=\"GNU MyServer 0.9\" +CppCompiler=-DMYSERVER_VERSION=\"GNU MyServer 0.9\" Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@@_ IsCpp=1 Icon= @@ -63,11 +63,11 @@ Build=3 LanguageID=1033 CharsetID=1252 -CompanyName=MyServer Project +CompanyName=Free Software Foundation Inc. FileVersion=0.9.0 -FileDescription=MyServer webserver +FileDescription=GNU MyServer webserver InternalName= -LegalCopyright=MyServer Team +LegalCopyright=Free Software Foundation Inc. LegalTrademarks= OriginalFilename=myserver.exe ProductName=MyServer Modified: trunk/myserver/include/http_handler/wincgi/wincgi.h =================================================================== --- trunk/myserver/include/http_handler/wincgi/wincgi.h 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/include/http_handler/wincgi/wincgi.h 2008-09-06 19:58:19 UTC (rev 2790) @@ -25,8 +25,6 @@ #include #include -extern const char *versionOfSoftware; - class WinCgi : public HttpDataHandler { private: Modified: trunk/myserver/include/protocol/http/env/env.h =================================================================== --- trunk/myserver/include/protocol/http/env/env.h 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/include/protocol/http/env/env.h 2008-09-06 19:58:19 UTC (rev 2790) @@ -23,8 +23,6 @@ #include #include -extern const char *versionOfSoftware; - class Env { public: Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp =================================================================== --- trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -487,8 +487,8 @@ } td->buffer2->setLength(0); - *td->buffer2 << "\r\n
\r\n
GNU MyServer " - << versionOfSoftware; + *td->buffer2 << "\r\n
\r\n
" + << MYSERVER_VERSION; if(host && host->value->length()) { Modified: trunk/myserver/src/http_handler/isapi/isapi.cpp =================================================================== --- trunk/myserver/src/http_handler/isapi/isapi.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/http_handler/isapi/isapi.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -713,7 +713,7 @@ if(valLen + 30 < maxLen) valLen += sprintf(&ValStr[valLen], "SERVER_SIGNATURE:
%s
\n", - versionOfSoftware); + MYSERVER_VERSION); else if(valLen + 30 < maxLen) return 0; Modified: trunk/myserver/src/myserver.cpp =================================================================== --- trunk/myserver/src/myserver.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/myserver.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -58,14 +58,6 @@ void RunAsService(); static char *path; -/* - *Change this to reflect the version of the software. - */ -#ifdef MYSERVER_VERSION -const char *versionOfSoftware = MYSERVER_VERSION; -#else -const char *versionOfSoftware = "0.9.0"; -#endif int argn; char **argv; void registerSignals(); @@ -276,7 +268,7 @@ /* If the version flag is up, show the version and exit. */ if(input.version) { - cout << "GNU MyServer "<< versionOfSoftware << endl; + cout << MYSERVER_VERSION << endl; cout #ifdef __DATE__ @@ -292,7 +284,7 @@ { if(!strcmpi(argv[1], "VERSION")) { - cout << "MyServer " << versionOfSoftware << endl; + cout << MYSERVER_VERSION << endl; return 0; } if(!strcmpi(argv[1], "CONSOLE")) Modified: trunk/myserver/src/protocol/control/control_protocol.cpp =================================================================== --- trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -43,8 +44,6 @@ using namespace std; -extern const char *versionOfSoftware; - char ControlProtocol::adminLogin[64] = ""; char ControlProtocol::adminPassword[64] = ""; int ControlProtocol::controlEnabled = 0; @@ -104,10 +103,10 @@ tmpPassword[0]='\0'; Md5 md5; - /*! Is the value in the config file still in MD5? */ + /* Is the value in the config file still in MD5? */ int adminNameMD5ized = 0; - /*! Is the value in the config file still in MD5? */ + /* Is the value in the config file still in MD5? */ int adminPasswordMD5ized = 0; char *data = 0; @@ -126,26 +125,26 @@ controlEnabled = 0; } - data=configurationFileManager.getValue("CONTROL_ADMIN"); + data = configurationFileManager.getValue("CONTROL_ADMIN"); if(data) { strncpy(tmpName, data, 64); } - data=configurationFileManager.getValue("CONTROL_PASSWORD"); + data = configurationFileManager.getValue("CONTROL_PASSWORD"); if(data) { strncpy(tmpPassword, data, 64); } - data=configurationFileManager.getAttr("CONTROL_ADMIN", "MD5"); + data = configurationFileManager.getAttr("CONTROL_ADMIN", "MD5"); if(data) { if(strcmpi(data, "YES") == 0) adminNameMD5ized = 1; } - data=configurationFileManager.getAttr("CONTROL_PASSWORD", "MD5"); + data = configurationFileManager.getAttr("CONTROL_PASSWORD", "MD5"); if(data) { if(strcmpi(data, "YES") == 0) @@ -174,7 +173,6 @@ md5.end(adminPassword); } - configurationFileManager.close(); return 0; } @@ -234,17 +232,16 @@ /* Output file. */ File *Ofile = 0; - /* Use control_header to parse the request. */ ControlHeader header; - /*! Is the specified command a know one? */ + /* Is the specified command a know one? */ int knownCommand; if(a->getToRemove()) { switch(a->getToRemove()) { - /*! Remove the connection from the list. */ + /* Remove the connection from the list. */ case CONNECTION_REMOVE_OVERLOAD: sendResponse(b2, bs2, a, CONTROL_SERVER_BUSY, header, 0); return 0; @@ -256,7 +253,7 @@ ret = header.parse_header(b1, nbtr, &realHeaderLength); - /*! + /* *On errors remove the connection from the connections list. *For return values look at protocol/control/control_errors.h. *Returning 0 from the controlConnection we will remove the connection @@ -264,7 +261,7 @@ */ if(ret != CONTROL_OK) { - /*! parse_header returns -1 on an incomplete header. */ + /* parse_header returns -1 on an incomplete header. */ if(ret == -1) { return 2; @@ -318,10 +315,10 @@ } } - /*! Check if there are other bytes waiting to be read. */ + /* Check if there are other bytes waiting to be read. */ if(specified_length && (specified_length != static_cast(nbtr - realHeaderLength) )) { - /*! Check if we can read all the specified data. */ + /* Check if we can read all the specified data. */ while(specified_length != static_cast(nbtr - realHeaderLength)) { if(a->socket->bytesToRead()) @@ -368,7 +365,7 @@ } else { - /*! Wait a bit. */ + /* Wait a bit. */ Thread::wait(2); } } @@ -395,10 +392,10 @@ authorized = checkAuth(header); - /*! + /* *If the client is not authorized remove the connection. */ - if(authorized ==0) + if(authorized == 0) { strcpy(b2,"Control: Bad authorization"); addToErrorLog(a,b2, strlen(b2), header); @@ -412,7 +409,7 @@ sendResponse(b2, bs2, a, CONTROL_AUTH, header, 0); return 0; } - /*! + /* *If the specified length is different from the length that the *server can read, remove the connection. */ @@ -436,7 +433,7 @@ knownCommand = 0; - /*! + /* *Create an out file. This can be used by commands that *needs it. */ @@ -556,7 +553,7 @@ FilesUtility::deleteFile(IfilePath.str().c_str()); FilesUtility::deleteFile(OfilePath.str().c_str()); connection = header.getConnection(); - /*! + /* *If the Keep-Alive was specified keep the connection in the *active connections list. */ @@ -598,7 +595,7 @@ string time; ostringstream out; ThreadID id = Thread::threadID(); - /*! + /* *Check that the verbosity is at least 1. */ if(Server::getInstance()->getVerbosity() < 1) @@ -660,7 +657,7 @@ } if(outFile) dataLength = outFile->getFileSize(); - /*! Build and send the first line. */ + /* Build and send the first line. */ #ifdef HAVE_SNPRINTF snprintf(buffer, buffersize, #else @@ -675,7 +672,7 @@ return -1; } - /*! Build and send the Length line. */ + /* Build and send the Length line. */ #ifdef HAVE_SNPRINTF snprintf(buffer, buffersize, #else @@ -691,7 +688,7 @@ return -1; } - /*! Send the end of the header. */ + /* Send the end of the header. */ err = conn->socket->send("\r\n", 2, 0); if(err == -1) { @@ -700,7 +697,7 @@ return -1; } - /*! Flush the content of the file if any. */ + /* Flush the content of the file if any. */ if(dataLength) { int dataToSend = dataLength; @@ -864,10 +861,10 @@ const char *filename = 0; File localfile; int ret = 0; - /*! # of bytes read. */ + /* # of bytes read. */ u_long nbr = 0; - /*! # of bytes written. */ + /* # of bytes written. */ u_long nbw = 0; if(!strcmpi(fn, "myserver.xml")) @@ -884,7 +881,7 @@ } else if(!FilesUtility::fileExists(fn)) { - /*! If we cannot find the file send the right error ID. */ + /* If we cannot find the file send the right error ID. */ string msg; msg.assign("Control: Requested file doesn't exist "); msg.append(fn); @@ -898,7 +895,7 @@ ret = localfile.openFile(filename, File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_IFEXISTS); - /*! An internal server error happens. */ + /* An internal server error happens. */ if(ret) { string msg; @@ -919,7 +916,7 @@ return CONTROL_INTERNAL; } - /*! Break the loop when we can't read no more data.*/ + /* Break the loop when we can't read no more data. */ if(!nbr) break; @@ -950,9 +947,9 @@ File localfile; int isAutoRebootToEnable = Server::getInstance()->isAutorebootEnabled(); int ret = 0; - /*! # of bytes read. */ + /*! # of bytes read. */ u_long nbr = 0; - /*! # of bytes written. */ + /*! # of bytes written. */ u_long nbw = 0; Server::getInstance()->disableAutoReboot(); if(!strcmpi(fn, "myserver.xml")) @@ -972,10 +969,10 @@ filename = fn; } - /*! Remove the file before create it. */ + /* Remove the file before create it. */ ret = FilesUtility::deleteFile(filename); - /*! An internal server error happens. */ + /* An internal server error happens. */ if(ret) { strcpy(b1,"Control: Error deleting the file"); @@ -989,7 +986,7 @@ ret = localfile.openFile(filename, File::MYSERVER_OPEN_WRITE | File::MYSERVER_OPEN_ALWAYS); - /*! An internal server error happens. */ + /* An internal server error happens. */ if(ret) { string msg; @@ -1016,7 +1013,7 @@ return CONTROL_INTERNAL; } - /*! Break the loop when we can't read no more data.*/ + /* Break the loop when we can't read no more data. */ if(!nbr) break; @@ -1075,7 +1072,7 @@ string filename; string ext; u_long nbw = 0; - /*! Do not show files starting with a dot. */ + /* Do not show files starting with a dot. */ if(fd.name[0]=='.') continue; @@ -1105,16 +1102,12 @@ /*! *Return the current MyServer version. */ -int ControlProtocol::getVersion(ConnectionPtr a, File* out, char *b1,int bs1, +int ControlProtocol::getVersion(ConnectionPtr a, File* out, char *b1, int bs1, ControlHeader& header) { u_long nbw; -#ifdef HAVE_SNPRINTF - snprintf(b1, bs1, -#else - sprintf(b1, -#endif - "MyServer %s", versionOfSoftware); + + myserver_strlcpy(b1, MYSERVER_VERSION, bs1); return out->writeToFile(b1, strlen(b1), &nbw); } Modified: trunk/myserver/src/protocol/http/env/env.cpp =================================================================== --- trunk/myserver/src/protocol/http/env/env.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/protocol/http/env/env.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -53,7 +53,7 @@ HttpRequestHeader::Entry* reqEntry = NULL; memCgi.setExternalBuffer(cgiEnv, td->buffer2->getRealLength()); - memCgi << "SERVER_SOFTWARE=GNU MyServer " << versionOfSoftware; + memCgi << "SERVER_SOFTWARE=" << MYSERVER_VERSION; #ifdef WIN32 memCgi << " (WIN32)"; @@ -71,9 +71,7 @@ memCgi << Server::getInstance()->getServerName(); memCgi << end_str << "SERVER_SIGNATURE="; - memCgi << "
GNU MyServer "; - memCgi << versionOfSoftware; - memCgi << "
"; + memCgi << "
" << MYSERVER_VERSION << "
"; memCgi << end_str << "SERVER_PROTOCOL="; memCgi << td->request.ver.c_str(); Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -94,20 +94,20 @@ td->buffer2->setLength(0); *td->buffer2 << "HTTP/1.1 200 OK\r\n"; *td->buffer2 << "Date: " << time ; - *td->buffer2 << "\r\nServer: MyServer " << versionOfSoftware ; + *td->buffer2 << "\r\nServer: "<< MYSERVER_VERSION; if(connection && connection->value->length()) - *td->buffer2 << "\r\nConnection:" << connection->value->c_str() ; - *td->buffer2 <<"\r\nContent-Length: 0\r\nAccept-Ranges: bytes\r\n"; - *td->buffer2 << "Allow: " << methods; + *td->buffer2 << "\r\nConnection:" << connection->value->c_str() << "\r\n"; + *td->buffer2 <<"Content-Length: 0\r\nAccept-Ranges: bytes\r\n"; + *td->buffer2 << "Allow: " << methods << "\r\n"; /*! *Check if the TRACE command is allowed on the virtual host. */ if(allowHTTPTRACE()) - *td->buffer2 << ", TRACE\r\n\r\n"; - else - *td->buffer2 << "\r\n\r\n"; + *td->buffer2 << ", TRACE\r\n"; + *td->buffer2 << "r\n"; + /*! Send the HTTP header. */ ret = td->connection->socket->send(td->buffer2->getBuffer(), (u_long)td->buffer2->getLength(), 0); @@ -143,14 +143,14 @@ return raiseHTTPError(401); td->buffer2->setLength(0); *td->buffer2 << "HTTP/1.1 200 OK\r\n"; - *td->buffer2 << "Date: " << time ; - *td->buffer2 << "\r\nServer: MyServer " << versionOfSoftware ; + *td->buffer2 << "Date: " << time << "\r\n"; + *td->buffer2 << "Server: " << MYSERVER_VERSION << "\r\n"; connection = td->request.other.get("Connection"); if(connection && connection->value->length()) - *td->buffer2 << "\r\nConnection:" << connection->value->c_str(); - *td->buffer2 <<"\r\nContent-Length:" << tmp - << "\r\nContent-Type: message/http\r\n" - << "Accept-Ranges: bytes\r\n\r\n"; + *td->buffer2 << "Connection:" << connection->value->c_str() << "\r\n"; + *td->buffer2 <<"Content-Length:" << tmp << "\r\n" + << "Content-Type: message/http\r\n" + << "Accept-Ranges: bytes\r\n\r\n"; /*! Send our HTTP header. */ ret = td->connection->socket->send(td->buffer2->getBuffer(), @@ -1856,11 +1856,13 @@ td->response.httpStatus = 401; td->buffer2->setLength(0); *td->buffer2 << "HTTP/1.1 401 Unauthorized\r\n" - << "Accept-Ranges: bytes\r\nServer: MyServer " ; - *td->buffer2 << versionOfSoftware ; - *td->buffer2 << "\r\nContent-Type: text/html\r\nConnection: "; + << "Accept-Ranges: bytes\r\n"; + *td->buffer2 << "Server: " << MYSERVER_VERSION << "\r\n"; + *td->buffer2 << "Content-Type: text/html\r\n" + << "Connection: "; *td->buffer2 << (connection ? connection->value->c_str() : ""); *td->buffer2 << "\r\nContent-Length: 0\r\n"; + if(td->authScheme == HTTP_AUTH_SCHEME_BASIC) { *td->buffer2 << "WWW-Authenticate: Basic realm=\"" @@ -2131,9 +2133,9 @@ *td->buffer << td->connection->getIpAddr() ; *td->buffer << "\r\n"; td->buffer2->setLength(0); - *td->buffer2 << "HTTP/1.1 500 System Error\r\nServer: MyServer "; - *td->buffer2 << versionOfSoftware; - *td->buffer2 <<" \r\nContent-Type: text/html\r\nContent-Length: "; + *td->buffer2 << "HTTP/1.1 500 System Error\r\n"; + *td->buffer2 << "Server: " << MYSERVER_VERSION << "\r\n"; + *td->buffer2 <<" Content-Type: text/html\r\nContent-Length: "; tmp.intToStr((int)strlen(hardHTML), tmpStr, 12); *td->buffer2 << tmp; *td->buffer2 << "\r\n"; @@ -2262,7 +2264,7 @@ td->response.httpStatus = 302; td->buffer2->setLength(0); *td->buffer2 << "HTTP/1.1 302 Moved\r\nAccept-Ranges: bytes\r\n" - << "Server: MyServer " << versionOfSoftware << "\r\n" + << "Server: " << MYSERVER_VERSION << "\r\n" << "Content-Type: text/html\r\n" << "Location: " << newURL << "\r\n" << "Content-Length: 0\r\n"; @@ -2294,7 +2296,7 @@ td->response.httpStatus = 304; td->buffer2->setLength(0); *td->buffer2 << "HTTP/1.1 304 Not Modified\r\nAccept-Ranges: bytes\r\n" - << "Server: MyServer " << versionOfSoftware << "\r\n"; + << "Server: " << MYSERVER_VERSION << "\r\n"; if(connection && !stringcmpi(connection->value->c_str(), "keep-alive")) *td->buffer2 << "Connection: keep-alive\r\n"; Modified: trunk/myserver/src/protocol/http/http_headers.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_headers.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/protocol/http/http_headers.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -75,8 +75,8 @@ } else { - pos += myserver_strlcpy(pos, "Server: GNU MyServer ", MAX-(long)(pos-str)); - pos += myserver_strlcpy(pos, versionOfSoftware, MAX-(long)(pos-str)); + pos += myserver_strlcpy(pos, "Server: ", MAX-(long)(pos-str)); + pos += myserver_strlcpy(pos, MYSERVER_VERSION, MAX-(long)(pos-str)); pos += myserver_strlcpy(pos, "\r\n", MAX-(long)(pos-str)); } @@ -292,7 +292,6 @@ void HttpHeaders::buildDefaultHTTPResponseHeader(HttpResponseHeader* response) { string date; - ostringstream stream; resetHTTPResponse(response); /*! *By default use: @@ -307,8 +306,7 @@ getRFC822GMTTime(date,HTTP_RESPONSE_DATE_DIM); response->date.assign(date); response->dateExp.assign(date); - stream << "MyServer " << versionOfSoftware; - response->serverName.assign(stream.str()); + response->serverName.assign(MYSERVER_VERSION); } /*! Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/src/server/server.cpp 2008-09-06 19:58:19 UTC (rev 2790) @@ -162,8 +162,8 @@ try { string softwareSignature; - softwareSignature.assign("************GNU MyServer "); - softwareSignature.append(versionOfSoftware); + softwareSignature.assign("************"); + softwareSignature.append(MYSERVER_VERSION); softwareSignature.append("************"); i = softwareSignature.length(); Modified: trunk/myserver/stdafx.h =================================================================== --- trunk/myserver/stdafx.h 2008-09-06 18:27:49 UTC (rev 2789) +++ trunk/myserver/stdafx.h 2008-09-06 19:58:19 UTC (rev 2790) @@ -80,7 +80,6 @@ typedef unsigned char u_char; typedef void* HANDLE; -extern const char *versionOfSoftware; #ifndef SOCKET_ERROR #define SOCKET_ERROR -1 From MAILER-DAEMON Sat Sep 06 19:12:09 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kc6wr-0008ON-Cg for mharc-myserver-commit@gnu.org; Sat, 06 Sep 2008 19:12:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kc6wq-0008O7-07 for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:12:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kc6wo-0008Nu-AK for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:12:06 -0400 Received: from [199.232.76.173] (port=52974 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kc6wo-0008Nr-4m for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:12:06 -0400 Received: from savannah.gnu.org ([199.232.41.3]:45734 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kc6wn-0005nx-N1 for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:12:06 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kc6wj-0002B3-8U for myserver-commit@gnu.org; Sat, 06 Sep 2008 23:12:01 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kc6wi-0002Ax-TQ for myserver-commit@gnu.org; Sat, 06 Sep 2008 23:12:01 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 06 Sep 2008 23:12:00 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2791] Define `MYSERVER_VERSION' in the config.h file X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 23:12:08 -0000 Revision: 2791 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2791 Author: gscrivano Date: 2008-09-06 23:12:00 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Define `MYSERVER_VERSION' in the config.h file Modified Paths: -------------- trunk/myserver/configure.in Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-06 19:58:19 UTC (rev 2790) +++ trunk/myserver/configure.in 2008-09-06 23:12:00 UTC (rev 2791) @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -AC_INIT([MyServer], [0.9.0-rc2], [bug-myserver@gnu.org]) +AC_INIT([GNU MyServer], [0.9.0-rc2], [bug-myserver@gnu.org]) AC_PREREQ([2.50]) AM_CONFIG_HEADER(config.h) CFLAGS="${CFLAGS=}" @@ -40,7 +40,9 @@ AC_SUBST(MYSERVER_VERSION) +AC_DEFINE_UNQUOTED([MYSERVER_VERSION], ["${MYSERVER_VERSION}"], [The software version]) + AC_PROG_CC AC_PROG_CPP AC_AIX From MAILER-DAEMON Sat Sep 06 19:55:29 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kc7cn-0006zj-2l for mharc-myserver-commit@gnu.org; Sat, 06 Sep 2008 19:55:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kc7cl-0006yc-7a for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:55:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kc7ck-0006xV-8s for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:55:26 -0400 Received: from [199.232.76.173] (port=54710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kc7ck-0006xS-3C for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:55:26 -0400 Received: from savannah.gnu.org ([199.232.41.3]:33967 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kc7cj-0002Y6-Rn for myserver-commit@gnu.org; Sat, 06 Sep 2008 19:55:26 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kc7cg-0005YK-8e for myserver-commit@gnu.org; Sat, 06 Sep 2008 23:55:22 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kc7cf-0005Y4-HJ for myserver-commit@gnu.org; Sat, 06 Sep 2008 23:55:21 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 06 Sep 2008 23:55:21 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2792] Cross-compile on cygwin linking against the bison library X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 23:55:27 -0000 Revision: 2792 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2792 Author: gscrivano Date: 2008-09-06 23:55:20 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Cross-compile on cygwin linking against the bison library Modified Paths: -------------- trunk/myserver/configure.in Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-06 23:12:00 UTC (rev 2791) +++ trunk/myserver/configure.in 2008-09-06 23:55:20 UTC (rev 2792) @@ -364,7 +364,7 @@ fi if test "x$enable_cygwin" = "xyes"; then - LDFLAGS="$LDFLAGS -levent_extra -levent_core -lws2_32 -lgdi32 -lrx -luserenv -lole32 -luuid" + LDFLAGS="$LDFLAGS -levent_extra -levent_core -lws2_32 -lgdi32 -lrx -luserenv -lole32 -luuid -ly" fi AC_SUBST(CFLAGS) From MAILER-DAEMON Mon Sep 08 18:42:02 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KcpQn-0008Ea-Uz for mharc-myserver-commit@gnu.org; Mon, 08 Sep 2008 18:42:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcpPq-0007TC-ML for myserver-commit@gnu.org; Mon, 08 Sep 2008 18:41:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcpPp-0007Ra-Il for myserver-commit@gnu.org; Mon, 08 Sep 2008 18:41:02 -0400 Received: from [199.232.76.173] (port=44866 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcpPp-0007RM-CX for myserver-commit@gnu.org; Mon, 08 Sep 2008 18:41:01 -0400 Received: from savannah.gnu.org ([199.232.41.3]:45384 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KcpPp-00026h-DY for myserver-commit@gnu.org; Mon, 08 Sep 2008 18:41:01 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KcpPo-0007K4-5Q for myserver-commit@gnu.org; Mon, 08 Sep 2008 22:41:00 +0000 Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KcpPn-0007K0-Sk for myserver-commit@gnu.org; Mon, 08 Sep 2008 22:41:00 +0000 MIME-Version: 1.0 Errors-To: dperrone To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniele Perrone Message-Id: Date: Mon, 08 Sep 2008 22:40:59 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-Mailman-Approved-At: Mon, 08 Sep 2008 18:42:00 -0400 Subject: [myserver-commit] [2793] corrected include paths X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 22:41:03 -0000 Revision: 2793 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2793 Author: dperrone Date: 2008-09-08 22:40:59 +0000 (Mon, 08 Sep 2008) Log Message: ----------- corrected include paths Modified Paths: -------------- trunk/plugins/executors/python/python.h Modified: trunk/plugins/executors/python/python.h =================================================================== --- trunk/plugins/executors/python/python.h 2008-09-06 23:55:20 UTC (rev 2792) +++ trunk/plugins/executors/python/python.h 2008-09-08 22:40:59 UTC (rev 2793) @@ -18,12 +18,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include struct PythonData From MAILER-DAEMON Tue Sep 09 12:40:23 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kd6GN-0001t7-7A for mharc-myserver-commit@gnu.org; Tue, 09 Sep 2008 12:40:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kd6GL-0001q0-MZ for myserver-commit@gnu.org; Tue, 09 Sep 2008 12:40:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kd6GL-0001pP-7O for myserver-commit@gnu.org; Tue, 09 Sep 2008 12:40:21 -0400 Received: from [199.232.76.173] (port=58972 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd6GL-0001pM-3r for myserver-commit@gnu.org; Tue, 09 Sep 2008 12:40:21 -0400 Received: from savannah.gnu.org ([199.232.41.3]:55568 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kd6GL-0003j1-69 for myserver-commit@gnu.org; Tue, 09 Sep 2008 12:40:21 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kd6GJ-0000zA-4K for myserver-commit@gnu.org; Tue, 09 Sep 2008 16:40:20 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kd6GG-0000z5-PP for myserver-commit@gnu.org; Tue, 09 Sep 2008 16:40:17 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 09 Sep 2008 16:40:17 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2794] Fixed problem with system files mapping X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2008 16:40:21 -0000 Revision: 2794 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2794 Author: gscrivano Date: 2008-09-09 16:40:10 +0000 (Tue, 09 Sep 2008) Log Message: ----------- Fixed problem with system files mapping Modified Paths: -------------- trunk/myserver/src/protocol/http/http.cpp Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-08 22:40:59 UTC (rev 2793) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-09 16:40:10 UTC (rev 2794) @@ -729,14 +729,20 @@ filename.assign(uri); td->buffer->setLength(0); - if(!systemrequest) + if(systemrequest) { + td->filenamePath.assign(uri); + + getFilePermissions(filename, directory, file, + td->filenamePath, 1, &permissions); + + } + else + { ret = Http::preprocessHttpRequest(filename, yetmapped, &permissions); if(ret != 200) - { return raiseHTTPError(ret); - } } /* The security file doesn't exist in any case. */ @@ -875,7 +881,20 @@ } if(!FilesUtility::fileExists(td->filenamePath.c_str())) + { + if(systemrequest) + { + string error; + error.assign("Http: cannot find system request file "); + error.append(td->filenamePath); + + td->connection->host->warningsLogRequestAccess(td->id); + td->connection->host->warningsLogWrite(error.c_str()); + td->connection->host->warningsLogTerminateAccess(td->id); + } + return raiseHTTPError(404); + } /*! *getMIME returns the type of command registered by the extension. @@ -1962,6 +1981,7 @@ HttpRequestHeader::Entry *connection = td->request.other.get("Connection"); const char *useMessagesVal = td->connection->host ? td->connection->host->getHashedData("USE_ERROR_FILE") : 0; + if(useMessagesVal) { if(!strcmpi(useMessagesVal, "YES")) @@ -1971,7 +1991,12 @@ } if(td->lastError) + { + td->connection->host->warningsLogRequestAccess(td->id); + td->connection->host->warningsLogWrite("Http: recursive error "); + td->connection->host->warningsLogTerminateAccess(td->id); return sendHTTPhardError500(); + } td->lastError = ID; @@ -1989,19 +2014,17 @@ *of the virtual host. */ if(td->connection->host) - ret = staticHttp.secCache.getErrorFileName(td->getVhostDir(), ID, - td->getVhostSys(), defFile); + ret = staticHttp.secCache.getErrorFileName(td->getVhostDir(), + ID, + td->getVhostSys(), + defFile); else ret = -1; staticHttp.secCacheMutex.unlock(); - if(ret == -1) + if(ret > 0) { - useMessagesFiles = 0; - } - else if(ret) - { ostringstream nURL; int isPortSpecified = 0; const char* hostStr = host ? host->value->c_str() : ""; @@ -2019,6 +2042,7 @@ } if(!isPortSpecified) nURL << ":" << td->connection->host->getPort(); + if(nURL.str()[nURL.str().length()-1] != '/') nURL << "/"; @@ -2036,21 +2060,29 @@ getRFC822GMTTime(time, HTTP_RESPONSE_DATE_EXPIRES_DIM); td->response.dateExp.assign(time); + if(useMessagesFiles) { string page; HttpErrors::getErrorMessage(ID, td->response.errorType); HttpErrors::getErrorPage(ID, page); errorFile << td->getVhostSys() << "/" << page; - } - if(useMessagesFiles && FilesUtility::fileExists(errorFile.str().c_str())) - { - string tmp; - HttpErrors::getErrorPage(ID, tmp); - return sendHTTPResource(tmp, 1, td->onlyHeader); + if(FilesUtility::fileExists(errorFile.str().c_str())) + { + string errorFileStr = errorFile.str(); + return sendHTTPResource(errorFileStr, 1, td->onlyHeader); + } + else + { + string error = "Http: The specified error page " + errorFile.str() + " does not exist"; + td->connection->host->warningsLogRequestAccess(td->id); + td->connection->host->warningsLogWrite(error.c_str()); + td->connection->host->warningsLogTerminateAccess(td->id); + } } HttpErrors::getErrorMessage(ID, errorMessage); + /*! Send only the header (and the body if specified). */ { const char* value = td->connection->host ? @@ -2063,15 +2095,10 @@ else { ostringstream size; - errorBodyMessage << ID << " - " << errorMessage << "\r\n"; - errorBodyLength = errorBodyMessage.str().length(); - size << errorBodyLength; - td->response.contentLength.assign(size.str()); - } } HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), From MAILER-DAEMON Tue Sep 09 16:57:46 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KdAHS-0006DW-6w for mharc-myserver-commit@gnu.org; Tue, 09 Sep 2008 16:57:46 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdAHP-0006DB-U9 for myserver-commit@gnu.org; Tue, 09 Sep 2008 16:57:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdAHP-0006Cj-IF for myserver-commit@gnu.org; Tue, 09 Sep 2008 16:57:43 -0400 Received: from [199.232.76.173] (port=50397 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdAHP-0006CV-4g for myserver-commit@gnu.org; Tue, 09 Sep 2008 16:57:43 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37041 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KdAHN-0004iY-R3 for myserver-commit@gnu.org; Tue, 09 Sep 2008 16:57:42 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KdAHK-0000Ey-OB for myserver-commit@gnu.org; Tue, 09 Sep 2008 20:57:38 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KdAHK-0000Eu-G0 for myserver-commit@gnu.org; Tue, 09 Sep 2008 20:57:38 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 09 Sep 2008 20:57:38 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2795] Don't reload HTTP static errors message if they were already loaded X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2008 20:57:44 -0000 Revision: 2795 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2795 Author: gscrivano Date: 2008-09-09 20:57:37 +0000 (Tue, 09 Sep 2008) Log Message: ----------- Don't reload HTTP static errors message if they were already loaded Modified Paths: -------------- trunk/myserver/include/protocol/http/http_errors.h trunk/myserver/src/protocol/http/http.cpp trunk/myserver/src/protocol/http/http_errors.cpp Modified: trunk/myserver/include/protocol/http/http_errors.h =================================================================== --- trunk/myserver/include/protocol/http/http_errors.h 2008-09-09 16:40:10 UTC (rev 2794) +++ trunk/myserver/include/protocol/http/http_errors.h 2008-09-09 20:57:37 UTC (rev 2795) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. +Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -33,6 +33,7 @@ static void load(); static void unLoad(); private: + static bool loaded; static void putMessage(int, const char*); static Mutex mutex; static HashMap messagesMap; Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-09 16:40:10 UTC (rev 2794) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-09 20:57:37 UTC (rev 2795) @@ -2378,6 +2378,7 @@ staticHttp.browseDirCSSpath.assign(""); Server::getInstance()->setGlobalData("http-static", getStaticData()); + /* Load the HTTP errors. */ HttpErrors::load(); Modified: trunk/myserver/src/protocol/http/http_errors.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_errors.cpp 2008-09-09 16:40:10 UTC (rev 2794) +++ trunk/myserver/src/protocol/http/http_errors.cpp 2008-09-09 20:57:37 UTC (rev 2795) @@ -25,6 +25,9 @@ Mutex HttpErrors::mutex; HashMap HttpErrors::messagesMap; +bool HttpErrors::loaded = false; + + /*! *Get an error page from its error code. *\param statusCode The HTTP error. @@ -79,7 +82,11 @@ */ void HttpErrors::load() { + if(loaded) + return; + loaded = true; + /* INFORMATIONAL. */ putMessage(100, "Continue"); putMessage(101, "Switching Protocols"); From MAILER-DAEMON Wed Sep 10 05:43:33 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KdMEX-0005yo-BD for mharc-myserver-commit@gnu.org; Wed, 10 Sep 2008 05:43:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdMDL-0005na-Iy for myserver-commit@gnu.org; Wed, 10 Sep 2008 05:42:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdMDK-0005n9-MC for myserver-commit@gnu.org; Wed, 10 Sep 2008 05:42:18 -0400 Received: from [199.232.76.173] (port=50888 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdMDJ-0005n2-Kv for myserver-commit@gnu.org; Wed, 10 Sep 2008 05:42:18 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49224 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KdMDJ-0005wD-Ar for myserver-commit@gnu.org; Wed, 10 Sep 2008 05:42:17 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KdMDH-0006zx-T4 for myserver-commit@gnu.org; Wed, 10 Sep 2008 09:42:15 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KdMDH-0006zt-JG for myserver-commit@gnu.org; Wed, 10 Sep 2008 09:42:15 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Wed, 10 Sep 2008 09:42:15 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-Mailman-Approved-At: Wed, 10 Sep 2008 05:43:32 -0400 Subject: [myserver-commit] [2796] Build process now behaves according to GNU standards X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2008 09:42:20 -0000 Revision: 2796 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2796 Author: francesco_pipita Date: 2008-09-10 09:42:14 +0000 (Wed, 10 Sep 2008) Log Message: ----------- Build process now behaves according to GNU standards Modified Paths: -------------- trunk/myserver/src/Makefile.am Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-09 20:57:37 UTC (rev 2795) +++ trunk/myserver/src/Makefile.am 2008-09-10 09:42:14 UTC (rev 2796) @@ -1,37 +1,29 @@ # Makefile for MyServer (./src) -SUBDIRS = base conf connection connections_scheduler filter\ - http_handler log plugin protocol server . - - -#build_subdirs: -# list='$(SUBDIRS)'; for subdir in $$list; do \ -# (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all) \ -# done; - -libmyserver.a: - rm -f libmyserver.a - find -iregex .*\\.$(OBJEXT) | xargs $(AR) cru libmyserver.a - $(RANLIB) libmyserver.a - +SUBDIRS = base conf connection connections_scheduler filter http_handler \ + log plugin protocol server +INCLUDES = $(all_includes) bin_PROGRAMS = myserver myserver_SOURCES = myserver.cpp - -INCLUDES = $(all_includes) - +myserver_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\" +myserver_LDFLAGS = -rdynamic myserver_LDADD = libmyserver.a $(all_libraries) $(PTHREAD_LIB) $(IDN_LIB) \ $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ $(XML_LIBS) $(LDFLAGS) -myserver_DEPENDENCIES = libmyserver.a +libmyserver.a: + rm -f libmyserver.a + find -iregex .*\\.$(OBJEXT) | xargs $(AR) cru libmyserver.a + $(RANLIB) libmyserver.a -myserver_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\" -myserver_LDFLAGS = -rdynamic - build_parser: protocol/ftp/ftp_lexer.lpp protocol/ftp/ftp_parser.ypp bison --defines=../include/protocol/ftp/ftp_parser.h protocol/ftp/ftp_parser.ypp cp protocol/ftp/ftp_parser.tab.cpp protocol/ftp/ftp_parser.cpp flex --header-file=../include/protocol/ftp/ftp_lexer.h protocol/ftp/ftp_lexer.lpp cp ./protocol/ftp/lex.yy.c ./protocol/ftp/ftp_lexer.cpp -all : myserver${EXEEXT} +all-local: libmyserver.a myserver${EXEEXT} cp myserver${EXEEXT} ../binaries + +clean-local: + rm -f libmyserver.a + find -iregex .*\\.$(OBJEXT) | xargs rm -f From MAILER-DAEMON Wed Sep 10 16:23:21 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KdWDg-00068b-AI for mharc-myserver-commit@gnu.org; Wed, 10 Sep 2008 16:23:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdWDd-00063x-GU for myserver-commit@gnu.org; Wed, 10 Sep 2008 16:23:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdWDb-0005ya-96 for myserver-commit@gnu.org; Wed, 10 Sep 2008 16:23:15 -0400 Received: from [199.232.76.173] (port=33675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdWDa-0005yM-NL for myserver-commit@gnu.org; Wed, 10 Sep 2008 16:23:14 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56080 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KdWDa-0002GJ-Ih for myserver-commit@gnu.org; Wed, 10 Sep 2008 16:23:14 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KdWDZ-0002ZZ-9j for myserver-commit@gnu.org; Wed, 10 Sep 2008 20:23:13 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KdWDY-0002ZV-V0 for myserver-commit@gnu.org; Wed, 10 Sep 2008 20:23:13 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 10 Sep 2008 20:23:13 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2797] LogManager objects are allocated dinamically X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2008 20:23:18 -0000 Revision: 2797 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2797 Author: gscrivano Date: 2008-09-10 20:23:12 +0000 (Wed, 10 Sep 2008) Log Message: ----------- LogManager objects are allocated dinamically Modified Paths: -------------- trunk/myserver/include/conf/vhost/vhost.h trunk/myserver/src/conf/vhost/vhost.cpp trunk/myserver/src/log/log_manager.cpp Modified: trunk/myserver/include/conf/vhost/vhost.h =================================================================== --- trunk/myserver/include/conf/vhost/vhost.h 2008-09-10 09:42:14 UTC (rev 2796) +++ trunk/myserver/include/conf/vhost/vhost.h 2008-09-10 20:23:12 UTC (rev 2797) @@ -220,8 +220,8 @@ HashMap hashedData; NULL_REFERENCECB nullReferenceCb; Mutex refMutex; - LogManager warningsLogFile; - LogManager accessesLogFile; + LogManager *warningsLogFile; + LogManager *accessesLogFile; MimeManager mimeManager; Modified: trunk/myserver/src/conf/vhost/vhost.cpp =================================================================== --- trunk/myserver/src/conf/vhost/vhost.cpp 2008-09-10 09:42:14 UTC (rev 2796) +++ trunk/myserver/src/conf/vhost/vhost.cpp 2008-09-10 20:23:12 UTC (rev 2797) @@ -73,8 +73,11 @@ warningsLogFileName.assign(""); - warningsLogFile.close(); - accessesLogFile.close(); + warningsLogFile->close(); + accessesLogFile->close(); + + delete warningsLogFile; + delete accessesLogFile; documentRoot.assign(""); systemRoot.assign(""); @@ -159,39 +162,43 @@ { const char* accessesLogFileName = getAccessesLogFileName(); const char* warningsLogFileName = getWarningsLogFileName(); + + accessesLogFile = new LogManager(); + warningsLogFile = new LogManager(); + if(accessesLogFileName) { - accessesLogFile.load(accessesLogFileName); + accessesLogFile->load(accessesLogFileName); if(strstr(getAccessLogOpt(), "cycle=yes")) { - accessesLogFile.setCycleLog(1); + accessesLogFile->setCycleLog(1); } if(strstr(getAccessLogOpt(), "cycle_gzip=no")) { - accessesLogFile.setGzip(0); + accessesLogFile->setGzip(0); } else { - accessesLogFile.setGzip(1); + accessesLogFile->setGzip(1); } } if(warningsLogFileName) { - warningsLogFile.load(warningsLogFileName); + warningsLogFile->load(warningsLogFileName); if(strstr(getWarningLogOpt(), "cycle=yes")) { - warningsLogFile.setCycleLog(1); + warningsLogFile->setCycleLog(1); } if(strstr(getWarningLogOpt(), "cycle_gzip=no")) { - warningsLogFile.setGzip(0); + warningsLogFile->setGzip(0); } else { - warningsLogFile.setGzip(1); + warningsLogFile->setGzip(1); } } @@ -399,7 +406,7 @@ */ u_long Vhost::accessesLogRequestAccess(int id) { - accessesLogFile.requestAccess(); + accessesLogFile->requestAccess(); return 0; } @@ -409,7 +416,7 @@ */ u_long Vhost::warningsLogRequestAccess(int id) { - warningsLogFile.requestAccess(); + warningsLogFile->requestAccess(); return 0; } @@ -419,7 +426,7 @@ */ u_long Vhost::accessesLogTerminateAccess(int id) { - accessesLogFile.terminateAccess(); + accessesLogFile->terminateAccess(); return 0; } @@ -429,7 +436,7 @@ */ u_long Vhost::warningsLogTerminateAccess(int id) { - warningsLogFile.terminateAccess(); + warningsLogFile->terminateAccess(); return 0; } @@ -439,7 +446,7 @@ */ int Vhost::accessesLogWrite(const char* str) { - return accessesLogFile.write(str); + return accessesLogFile->write(str); } /*! @@ -447,7 +454,7 @@ */ File* Vhost::getAccessesLogFile() { - return accessesLogFile.getFile(); + return accessesLogFile->getFile(); } /*! @@ -455,7 +462,7 @@ */ LogManager* Vhost::getWarningsLog() { - return &warningsLogFile; + return warningsLogFile; } /*! @@ -463,7 +470,7 @@ */ LogManager* Vhost::getAccessesLog() { - return &accessesLogFile; + return accessesLogFile; } /*! @@ -481,7 +488,7 @@ #else msg.append("\n"); #endif - return warningsLogFile.write(msg.c_str()); + return warningsLogFile->write(msg.c_str()); } /*! @@ -489,7 +496,7 @@ */ File* Vhost::getWarningsLogFile() { - return warningsLogFile.getFile(); + return warningsLogFile->getFile(); } /*! @@ -498,8 +505,8 @@ */ void Vhost::setMaxLogSize(int newSize) { - warningsLogFile.setMaxSize(newSize); - accessesLogFile.setMaxSize(newSize); + warningsLogFile->setMaxSize(newSize); + accessesLogFile->setMaxSize(newSize); } /*! @@ -511,7 +518,7 @@ *warningsLogFile max log size is equal to the *accessesLogFile one. */ - return warningsLogFile.getMaxSize( ); + return warningsLogFile->getMaxSize( ); } /*! Modified: trunk/myserver/src/log/log_manager.cpp =================================================================== --- trunk/myserver/src/log/log_manager.cpp 2008-09-10 09:42:14 UTC (rev 2796) +++ trunk/myserver/src/log/log_manager.cpp 2008-09-10 20:23:12 UTC (rev 2797) @@ -202,7 +202,7 @@ */ void LogManager::setGzip(bool useGzip) { - gzipLog=useGzip; + gzipLog = useGzip; } /*! From MAILER-DAEMON Thu Sep 11 11:25:55 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kdo3P-0000I9-Ch for mharc-myserver-commit@gnu.org; Thu, 11 Sep 2008 11:25:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kdo3N-0000Dy-Ap for myserver-commit@gnu.org; Thu, 11 Sep 2008 11:25:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kdo3M-0000CP-Po for myserver-commit@gnu.org; Thu, 11 Sep 2008 11:25:52 -0400 Received: from [199.232.76.173] (port=38943 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kdo3M-0000C2-93 for myserver-commit@gnu.org; Thu, 11 Sep 2008 11:25:52 -0400 Received: from savannah.gnu.org ([199.232.41.3]:39727 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kdo3L-0000lS-MK for myserver-commit@gnu.org; Thu, 11 Sep 2008 11:25:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kdo3K-00015Y-U1 for myserver-commit@gnu.org; Thu, 11 Sep 2008 15:25:51 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kdo3K-00015S-Mf for myserver-commit@gnu.org; Thu, 11 Sep 2008 15:25:50 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 11 Sep 2008 15:25:50 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2798] Define MyServer version in the `version' file. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 15:25:53 -0000 Revision: 2798 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2798 Author: gscrivano Date: 2008-09-11 15:25:50 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Define MyServer version in the `version' file. Modified Paths: -------------- trunk/myserver/SConstruct trunk/myserver/configure.in Added Paths: ----------- trunk/myserver/version Modified: trunk/myserver/SConstruct =================================================================== --- trunk/myserver/SConstruct 2008-09-10 20:23:12 UTC (rev 2797) +++ trunk/myserver/SConstruct 2008-09-11 15:25:50 UTC (rev 2798) @@ -2,7 +2,7 @@ # MySever configuration script for scons. # # MyServer -# http://www.myserverproject.net/ +# http://www.gnu.org/software/myserver/ # # Copyright (C) 2002-2008 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -25,9 +25,11 @@ from xml.dom.minidom import Node import string - -MYSERVER_VERSION = "GNU MyServer 0.9.0" +f = open('version','r') +MYSERVER_VERSION = f.readline() +f.close() + SVN_TRUNK = "svn://svn.savannah.gnu.org/myserver/trunk" HOMEPAGE = "http://www.gnu.org/software/myserver/" Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-10 20:23:12 UTC (rev 2797) +++ trunk/myserver/configure.in 2008-09-11 15:25:50 UTC (rev 2798) @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -AC_INIT([GNU MyServer], [0.9.0-rc2], [bug-myserver@gnu.org]) +AC_INIT([GNU MyServer], [ ], [bug-myserver@gnu.org]) AC_PREREQ([2.50]) AM_CONFIG_HEADER(config.h) CFLAGS="${CFLAGS=}" @@ -27,22 +27,13 @@ AM_INIT_AUTOMAKE -dnl Setting version -MYSERVER_MAJOR_VERSION=0 -MYSERVER_MINOR_VERSION=9 -MYSERVER_MICRO_VERSION=0 +PACKAGE_STRING=`cat version` +MYSERVER_VERSION="${PACKAGE_STRING}" -MYSERVER_VERSION="GNU MyServer ${MYSERVER_MAJOR_VERSION}.${MYSERVER_MINOR_VERSION}.${MYSERVER_MICRO_VERSION}" - -AC_SUBST(MYSERVER_MAJOR_VERSION) -AC_SUBST(MYSERVER_MINOR_VERSION) -AC_SUBST(MYSERVER_MICRO_VERSION) - AC_SUBST(MYSERVER_VERSION) AC_DEFINE_UNQUOTED([MYSERVER_VERSION], ["${MYSERVER_VERSION}"], [The software version]) - AC_PROG_CC AC_PROG_CPP AC_AIX @@ -66,7 +57,7 @@ AC_ARG_ENABLE([ipv6], [ --enable-ipv6 Build with IPv6 support], enable_ipv6="yes", enable_ipv6="") -AC_ARG_ENABLE([cygwin], [ --enable-cygwin Enable cygwin], enable_cygwin="yes", enable_cygwin="") +AC_ARG_ENABLE([mingw32], [ --enable-mingw32 Enable mingw32], enable_mingw32="yes", enable_mingw32="") root_bindir='${root_prefix}/bin' @@ -110,7 +101,7 @@ dnl Looking for pthreads GNOME_PTHREAD_CHECK -if test x$PTHREAD_LIB = x -a "x$enable_cygwin" != "xyes"; then +if test x$PTHREAD_LIB = x -a "x$enable_mingw32" != "xyes"; then AC_MSG_ERROR([ *** This system appears to have no posix threads *** Threads are required for MyServer @@ -140,7 +131,7 @@ else EVENT_LIB="" - if test "x$enable_cygwin" != "xyes"; then + if test "x$enable_mingw32" != "xyes"; then AC_MSG_ERROR([ *** This system appears to have no libevent *** Libevent is required by MyServer @@ -166,7 +157,7 @@ if test x$have_dl != xyes; then - if test "x$enable_cygwin" != "xyes"; then + if test "x$enable_mingw32" != "xyes"; then AC_MSG_WARN([ *** dlLIB not found *** MSCGI support will not function @@ -213,13 +204,8 @@ fi fi -#if test "x$have_idn" = "xyes"; then -# LDFLAGS="$LDFLAGS $IDN_LIB" -#fi - AC_SUBST(IDN_LIB) - dnl Looking for LibXL2 AM_PATH_XML2(2.6.0, have_xml2=yes) if test x$have_xml2 != xyes; then @@ -235,7 +221,7 @@ OPENSSL_INC="" AC_ARG_WITH(openssl-include, - [[ --with-openssl-include=FILE Use the given path to the openssl include files.]], + [[ --with-openssl-include=PATH Use the given path to the openssl include files.]], [ OPENSSL_INC=$withval ]) @@ -268,10 +254,7 @@ fi AC_SUBST(HAVE_SSL) AC_SUBST(OPENSSL_LIB) # myserver - - - dnl Looking for zlib AC_CHECK_LIB(z, uncompress, have_libz=yes) if test x$have_libz != xyes; then @@ -363,7 +346,7 @@ CPPUNIT_LDFLAGS="-lcppunit" fi -if test "x$enable_cygwin" = "xyes"; then +if test "x$enable_mingw32" = "xyes"; then LDFLAGS="$LDFLAGS -levent_extra -levent_core -lws2_32 -lgdi32 -lrx -luserenv -lole32 -luuid -ly" fi Added: trunk/myserver/version =================================================================== --- trunk/myserver/version (rev 0) +++ trunk/myserver/version 2008-09-11 15:25:50 UTC (rev 2798) @@ -0,0 +1 @@ +GNU MyServer 0.9.0-rc2 \ No newline at end of file From MAILER-DAEMON Thu Sep 11 15:28:54 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KdrqY-0005SD-Gu for mharc-myserver-commit@gnu.org; Thu, 11 Sep 2008 15:28:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdrqW-0005R0-FC for myserver-commit@gnu.org; Thu, 11 Sep 2008 15:28:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdrqU-0005Pj-WE for myserver-commit@gnu.org; Thu, 11 Sep 2008 15:28:51 -0400 Received: from [199.232.76.173] (port=33174 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdrqU-0005Pg-QL for myserver-commit@gnu.org; Thu, 11 Sep 2008 15:28:50 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40755 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KdrqU-00085c-HI for myserver-commit@gnu.org; Thu, 11 Sep 2008 15:28:50 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KdrqR-0001Qp-FZ for myserver-commit@gnu.org; Thu, 11 Sep 2008 19:28:47 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KdrqR-0001Ql-6o for myserver-commit@gnu.org; Thu, 11 Sep 2008 19:28:47 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 11 Sep 2008 19:28:47 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2799] Fixed some problems under windows. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 19:28:53 -0000 Revision: 2799 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2799 Author: gscrivano Date: 2008-09-11 19:28:46 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Fixed some problems under windows. Now all tests are completed successfully. Modified Paths: -------------- trunk/myserver/src/base/home_dir/home_dir.cpp trunk/myserver/src/base/thread/thread.cpp Modified: trunk/myserver/src/base/home_dir/home_dir.cpp =================================================================== --- trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-11 15:25:50 UTC (rev 2798) +++ trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-11 19:28:46 UTC (rev 2799) @@ -90,8 +90,8 @@ } data.clear(); timestamp = 0; +#endif loaded = 0; -#endif } /*! @@ -117,18 +117,18 @@ DWORD len = 64; char *buf; buf = new char[len]; - if(!GetProfilesDirectory(buf, &len)) + + if(GetProfilesDirectory(buf, &len) == FALSE) { - delete buf; + delete [] buf; buf = new char[len]; - if(!GetProfilesDirectory(buf, &len)) + if(GetProfilesDirectory(buf, &len) == FALSE) { - delete buf; + delete [] buf; return 1; } } data.assign(buf); - return 0; #else File usersFile; u_long size; @@ -200,12 +200,12 @@ while(buffer[counter++] != '\0'); /* Next tuple. */ } - loaded = 1; delete [] buffer; usersFile.closeFile(); #endif + + loaded = 1; return 0; - } /*! Modified: trunk/myserver/src/base/thread/thread.cpp =================================================================== --- trunk/myserver/src/base/thread/thread.cpp 2008-09-11 15:25:50 UTC (rev 2798) +++ trunk/myserver/src/base/thread/thread.cpp 2008-09-11 19:28:46 UTC (rev 2799) @@ -74,7 +74,9 @@ #endif { #ifdef WIN32 - return !_beginthreadex(NULL, 0, startRoutine, arg, 0, (unsigned int*)ID); + *ID = _beginthreadex(NULL, 0, startRoutine, arg, 0, NULL); + + return !(*ID); #endif #ifdef HAVE_PTHREAD return pthread_create((pthread_t*)ID, NULL, startRoutine, (void *)(arg)); From MAILER-DAEMON Fri Sep 12 16:19:20 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeF6u-0006y6-2Y for mharc-myserver-commit@gnu.org; Fri, 12 Sep 2008 16:19:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeF6t-0006xS-5U for myserver-commit@gnu.org; Fri, 12 Sep 2008 16:19:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeF6s-0006wV-4D for myserver-commit@gnu.org; Fri, 12 Sep 2008 16:19:18 -0400 Received: from [199.232.76.173] (port=38715 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeF6r-0006wQ-O5 for myserver-commit@gnu.org; Fri, 12 Sep 2008 16:19:17 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37520 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeF6r-00041Q-9y for myserver-commit@gnu.org; Fri, 12 Sep 2008 16:19:17 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeF6q-0001Tf-Hn for myserver-commit@gnu.org; Fri, 12 Sep 2008 20:19:16 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeF6q-0001Tb-5E for myserver-commit@gnu.org; Fri, 12 Sep 2008 20:19:16 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 12 Sep 2008 20:19:16 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2800] Changed code to detect the config files location. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 20:19:19 -0000 Revision: 2800 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2800 Author: gscrivano Date: 2008-09-12 20:19:15 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Changed code to detect the config files location. Need additional refactoring. Modified Paths: -------------- trunk/myserver/include/server/server.h trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-11 19:28:46 UTC (rev 2799) +++ trunk/myserver/include/server/server.h 2008-09-12 20:19:15 UTC (rev 2800) @@ -218,7 +218,7 @@ int freeHashedData(); u_long connectionTimeout; u_long maxLogFileSize; - int loadSettings(); + int loadConfFilesLocation(); Mutex* connectionsMutex; u_long nStaticThreads; u_long nMaxThreads; Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-11 19:28:46 UTC (rev 2799) +++ trunk/myserver/src/server/server.cpp 2008-09-12 20:19:15 UTC (rev 2800) @@ -123,6 +123,11 @@ string buffer; int err = 0; int osVer = getOSVersion(); + int ret; + ostringstream nCPU; + string strCPU; + u_long nbr, nbw; + char* data; #ifdef WIN32 DWORD eventsCount, cNumRead; INPUT_RECORD irInBuf[128]; @@ -193,9 +198,6 @@ try { - /* - *Set the current working directory. - */ setcwdBuffer(); XmlParser::startXML(); @@ -269,8 +271,137 @@ logWriteln(msg.c_str()); } - loadSettings(); + if(filtersFactory.insert("gzip", Gzip::factory)) + { + ostringstream stream; + stream << languageParser.getValue("ERR_ERROR") << ": Gzip Filter"; + logPreparePrintError(); + logWriteln(stream.str().c_str()); + logEndPrintError(); + } + /* Load the MIME types. */ + logWriteln(languageParser.getValue("MSG_LOADMIME")); + if(mimeManager) + delete mimeManager; + mimeManager = new MimeManager(); + + if(int nMIMEtypes = mimeManager->loadXML(mimeConfigurationFile->c_str())) + { + ostringstream stream; + stream << languageParser.getValue("MSG_MIMERUN") << ": " << nMIMEtypes; + logWriteln(stream.str().c_str()); + } + else + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADMIME")); + logEndPrintError(); + } + + nCPU << (u_int)getCPUCount(); + + strCPU.assign(languageParser.getValue("MSG_NUM_CPU")); + strCPU.append(" "); + strCPU.append(nCPU.str()); + logWriteln(strCPU.c_str()); + + connectionsScheduler.restart(); + + listenThreads.initialize(&languageParser); + if(vhostList) + { + delete vhostList; + vhostList = 0; + } + + vhostList = new VhostManager(&listenThreads); + if(vhostList == 0) + { + return; + } + + getProcessServerManager()->load(); + + /* Load the home directories configuration. */ + homeDir.load(); + + + { + Protocol *protocolsSet[] = {new HttpProtocol(), + new HttpsProtocol(), + new FtpProtocol(), + new ControlProtocol(), + 0}; + + for (int j = 0; protocolsSet[j]; j++) + { + char protocolName[32]; + Protocol *protocol = protocolsSet[j]; + protocol->loadProtocol(&languageParser); + protocol->registerName(protocolName, 32); + + getProtocolsManager()->addProtocol(protocolName, protocol); + } + } + + getPluginsManager()->addNamespace(&executors); + getPluginsManager()->addNamespace(&protocols); + getPluginsManager()->addNamespace(&filters); + getPluginsManager()->addNamespace(&genericPluginsManager); + + + { + string res("plugins"); + getPluginsManager()->preLoad(this, &languageParser, res); + getPluginsManager()->load(this, &languageParser, res); + getPluginsManager()->postLoad(this, &languageParser); + } + + + /* Load the virtual hosts configuration from the xml file. */ + vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), + getMaxLogFileSize()); + + + if(path == 0) + path = new string(); + + if(getdefaultwd(*path)) + return; + + setProcessPermissions(); + + if(getGid()) + { + ostringstream out; + out << "gid: " << gid; + logWriteln(out.str().c_str()); + } + + if(getUid()) + { + ostringstream out; + out << "uid: " << uid; + logWriteln(out.str().c_str()); + } + + for(i = 0; i < nStaticThreads; i++) + { + logWriteln(languageParser.getValue("MSG_CREATET")); + ret = addThread(1); + + if(ret) + return; + + logWriteln(languageParser.getValue("MSG_THREADR")); + } + + logWriteln(languageParser.getValue("MSG_READY")); + + if(logManager.getType() == LogManager::TYPE_CONSOLE) + logWriteln(languageParser.getValue("MSG_BREAK")); + mainConfTime = FilesUtility::getLastModTime(mainConfigurationFile->c_str()); hostsConfTime = @@ -278,6 +409,9 @@ mimeConf = FilesUtility::getLastModTime(mimeConfigurationFile->c_str()); + + serverReady = 1; + /* *Keep thread alive. *When the endServer flag is set to True exit @@ -649,7 +783,9 @@ ipAddresses = 0; vhostList = 0; languageParser.close(); - mimeManager->clean(); + + if(mimeManager) + mimeManager->clean(); delete mimeManager; mimeManager = 0; #ifdef WIN32 @@ -733,115 +869,13 @@ delete serverAdmin; serverAdmin = 0; autoRebootEnabled = 1; - languagesPath = new string(); -#ifndef WIN32 - /* - *Do not use the files in the directory /usr/share/myserver/languages - *if exists a local directory. - */ - if(FilesUtility::fileExists("languages")) - { - languagesPath->assign(getdefaultwd(0, 0) ); - languagesPath->append("/languages/"); + if(loadConfFilesLocation()) + return -1; - } - else - { -#ifdef PREFIX - languagesPath->assign(PREFIX); - languagesPath->append("/share/myserver/languages/"); -#else - /* Default PREFIX is /usr/. */ - languagesPath->assign("/usr/share/myserver/languages/"); -#endif - } -#endif + if(configurationFileManager.open(mainConfigurationFile->c_str())) + return -1; - if(mainConfigurationFile) - delete mainConfigurationFile; - mainConfigurationFile = new string(); - -#ifdef WIN32 - languagesPath->assign( "languages/" ); -#endif - -#ifndef WIN32 - - /* - *Under an *nix environment look for .xml files in the following order. - *1) myserver executable working directory - *2) ~/.myserver/ - *3) /etc/myserver/ - *4) default files will be copied in myserver executable working - */ - if(FilesUtility::fileExists("myserver.xml")) - { - mainConfigurationFile->assign("myserver.xml"); - } - else if(FilesUtility::fileExists("~/.myserver/myserver.xml")) - { - mainConfigurationFile->assign("~/.myserver/myserver.xml"); - } - else if(FilesUtility::fileExists("/etc/myserver/myserver.xml")) - { - mainConfigurationFile->assign("/etc/myserver/myserver.xml"); - } - else -#endif - /* If the myserver.xml files doesn't exist copy it from the default one. */ - if(!FilesUtility::fileExists("myserver.xml")) - { - mainConfigurationFile->assign("myserver.xml"); - File inputF; - File outputF; - ret = inputF.openFile("myserver.xml.default", - File::MYSERVER_OPEN_READ | - File::MYSERVER_OPEN_IFEXISTS); - if(ret) - { - logPreparePrintError(); - logWriteln("Error loading configuration file\n"); - logEndPrintError(); - return -1; - } - ret = outputF.openFile("myserver.xml", File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_ALWAYS); - if(ret) - { - logPreparePrintError(); - logWriteln("Error loading configuration file\n"); - logEndPrintError(); - return -1; - } - for(;;) - { - ret = inputF.readFromFile(buffer, 512, &nbr ); - if(ret) - return -1; - - if(!nbr) - break; - - ret = outputF.writeToFile(buffer, nbr, &nbw); - if(ret) - return -1; - } - inputF.closeFile(); - outputF.closeFile(); - } - else - { - mainConfigurationFile->assign("myserver.xml"); - } - configurationFileManager.open(mainConfigurationFile->c_str()); - - - data = configurationFileManager.getValue("VERBOSITY"); - if(data) - { - verbosity = (u_long)atoi(data); - } data = configurationFileManager.getValue("LANGUAGE"); if(languageFile) delete languageFile; @@ -856,7 +890,26 @@ { languageFile->assign("languages/english.xml"); } + + if(languageParser.open(languageFile->c_str())) + { + string err; + logPreparePrintError(); + err.assign("Error loading: "); + err.append( *languageFile ); + logWriteln( err.c_str() ); + logEndPrintError(); + return -1; + } + logWriteln(languageParser.getValue("MSG_LANGUAGE")); + data = configurationFileManager.getValue("VERBOSITY"); + if(data) + { + verbosity = (u_long)atoi(data); + } + + data = configurationFileManager.getValue("BUFFER_SIZE"); if(data) { @@ -1001,19 +1054,7 @@ } } - if(languageParser.open(languageFile->c_str())) - { - string err; - logPreparePrintError(); - err.assign("Error loading: "); - err.append( *languageFile ); - logWriteln( err.c_str() ); - logEndPrintError(); - return -1; - } - logWriteln(languageParser.getValue("MSG_LANGUAGE")); return 0; - } /*! @@ -1466,23 +1507,25 @@ } /*! - *Load the main server settings. + *Load the configuration files locations. *Return nonzero on errors. */ -int Server::loadSettings() +int Server::loadConfFilesLocation() { - u_long i; - int ret; - ostringstream nCPU; string strCPU; char buffer[512]; u_long nbr, nbw; + char* data; + int ret; + try { - if(mimeConfigurationFile) - delete mimeConfigurationFile; - mimeConfigurationFile = new string(); + if(mainConfigurationFile) + delete mainConfigurationFile; + mainConfigurationFile = new string(); + #ifndef WIN32 + /* *Under an *nix environment look for .xml files in the following order. *1) myserver executable working directory @@ -1490,96 +1533,96 @@ *3) /etc/myserver/ *4) default files will be copied in myserver executable working */ - if(FilesUtility::fileExists("MIMEtypes.xml")) + if(FilesUtility::fileExists("myserver.xml")) { - mimeConfigurationFile->assign("MIMEtypes.xml"); + mainConfigurationFile->assign("myserver.xml"); } - else if(FilesUtility::fileExists("~/.myserver/MIMEtypes.xml")) + else if(FilesUtility::fileExists("~/.myserver/myserver.xml")) { - mimeConfigurationFile->assign("~/.myserver/MIMEtypes.xml"); + mainConfigurationFile->assign("~/.myserver/myserver.xml"); } - else if(FilesUtility::fileExists("/etc/myserver/MIMEtypes.xml")) + else if(FilesUtility::fileExists("/etc/myserver/myserver.xml")) { - mimeConfigurationFile->assign("/etc/myserver/MIMEtypes.xml"); + mainConfigurationFile->assign("/etc/myserver/myserver.xml"); } else #endif - /* - *If the MIMEtypes.xml files doesn't exist copy it - *from the default one. - */ - if(!FilesUtility::fileExists("MIMEtypes.xml")) + /* If the myserver.xml files doesn't exist copy it from the default one. */ + if(mainConfigurationFile->length() == 0) + { + mainConfigurationFile->assign("myserver.xml"); + File inputF; + File outputF; + ret = inputF.openFile("myserver.xml.default", + File::MYSERVER_OPEN_READ | + File::MYSERVER_OPEN_IFEXISTS); + if(ret) { - File inputF; - File outputF; - mimeConfigurationFile->assign("MIMEtypes.xml"); - ret = inputF.openFile("MIMEtypes.xml.default", - File::MYSERVER_OPEN_READ | - File::MYSERVER_OPEN_IFEXISTS); + logPreparePrintError(); + logWriteln("Error loading configuration file\n"); + logEndPrintError(); + return -1; + } + ret = outputF.openFile("myserver.xml", File::MYSERVER_OPEN_WRITE | + File::MYSERVER_OPEN_ALWAYS); + if(ret) + { + logPreparePrintError(); + logWriteln("Error loading configuration file\n"); + logEndPrintError(); + return -1; + } + + for(;;) + { + ret = inputF.readFromFile(buffer, 512, &nbr ); if(ret) - { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADMIME")); - logEndPrintError(); return -1; - } - ret = outputF.openFile("MIMEtypes.xml", File::MYSERVER_OPEN_WRITE| - File::MYSERVER_OPEN_ALWAYS); + + if(!nbr) + break; + + ret = outputF.writeToFile(buffer, nbr, &nbw); if(ret) return -1; - - for(;;) - { - ret = inputF.readFromFile(buffer, 512, &nbr ); - if(ret) - return -1; - if(nbr==0) - break; - ret = outputF.writeToFile(buffer, nbr, &nbw); - if(ret) - return -1; - } - inputF.closeFile(); - outputF.closeFile(); } - else - { - mimeConfigurationFile->assign("MIMEtypes.xml"); - } - - if(filtersFactory.insert("gzip", Gzip::factory)) + inputF.closeFile(); + outputF.closeFile(); + } + else { - ostringstream stream; - stream << languageParser.getValue("ERR_ERROR") << ": Gzip Filter"; - logPreparePrintError(); - logWriteln(stream.str().c_str()); - logEndPrintError(); + mainConfigurationFile->assign("myserver.xml"); } - /* Load the MIME types. */ - logWriteln(languageParser.getValue("MSG_LOADMIME")); - if(mimeManager) - delete mimeManager; - mimeManager = new MimeManager(); - if(int nMIMEtypes = mimeManager->loadXML(mimeConfigurationFile->c_str())) + if(mimeConfigurationFile) + delete mimeConfigurationFile; + + mimeConfigurationFile = new string(); + +#ifndef WIN32 + /* + *Under an *nix environment look for .xml files in the following order. + *1) myserver executable working directory + *2) ~/.myserver/ + *3) /etc/myserver/ + *4) default files will be copied in myserver executable working + */ + if(FilesUtility::fileExists("MIMEtypes.xml")) { - ostringstream stream; - stream << languageParser.getValue("MSG_MIMERUN") << ": " << nMIMEtypes; - logWriteln(stream.str().c_str()); + mimeConfigurationFile->assign("MIMEtypes.xml"); } - else + else if(FilesUtility::fileExists("~/.myserver/MIMEtypes.xml")) { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADMIME")); - logEndPrintError(); - return -1; + mimeConfigurationFile->assign("~/.myserver/MIMEtypes.xml"); } - nCPU << (u_int)getCPUCount(); + else if(FilesUtility::fileExists("/etc/myserver/MIMEtypes.xml")) + { + mimeConfigurationFile->assign("/etc/myserver/MIMEtypes.xml"); + } +#endif - strCPU.assign(languageParser.getValue("MSG_NUM_CPU")); - strCPU.append(" "); - strCPU.append(nCPU.str()); - logWriteln(strCPU.c_str()); + if(vhostConfigurationFile) + delete vhostConfigurationFile; vhostConfigurationFile = new string(); @@ -1603,16 +1646,80 @@ { vhostConfigurationFile->assign("/etc/myserver/virtualhosts.xml"); } +#endif + + if(externalPath) + delete externalPath; + externalPath = new string(); + +#ifdef NOT_WIN + if(FilesUtility::fileExists("plugins")) + externalPath->assign("plugins"); else + { +#ifdef PREFIX + externalPath->assign(PREFIX); + externalPath->append("/lib/myserver/plugins"); + #else + externalPath->assign("/usr/lib/myserver/plugins"); #endif - /* - *If the virtualhosts.xml file doesn't exist copy it - *from the default one. - */ - if(!FilesUtility::fileExists("virtualhosts.xml")) + } + +#endif + +#ifdef WIN32 + externalPath->assign("plugins/protocols"); +#endif + + + /* + *If the MIMEtypes.xml files doesn't exist copy it + *from the default one. + */ + if(mimeConfigurationFile->length() == 0) { File inputF; File outputF; + mimeConfigurationFile->assign("MIMEtypes.xml"); + ret = inputF.openFile("MIMEtypes.xml.default", + File::MYSERVER_OPEN_READ | + File::MYSERVER_OPEN_IFEXISTS); + if(ret) + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADMIME")); + logEndPrintError(); + return -1; + } + ret = outputF.openFile("MIMEtypes.xml", File::MYSERVER_OPEN_WRITE| + File::MYSERVER_OPEN_ALWAYS); + if(ret) + return -1; + + for(;;) + { + ret = inputF.readFromFile(buffer, 512, &nbr ); + if(ret) + return -1; + if(nbr == 0) + break; + ret = outputF.writeToFile(buffer, nbr, &nbw); + if(ret) + return -1; + } + inputF.closeFile(); + outputF.closeFile(); + } + + + /* + *If the virtualhosts.xml file doesn't exist copy it + *from the default one. + */ + if(vhostConfigurationFile->length() == 0) + { + File inputF; + File outputF; vhostConfigurationFile->assign("virtualhosts.xml"); ret = inputF.openFile("virtualhosts.xml.default", File::MYSERVER_OPEN_READ | @@ -1620,7 +1727,7 @@ if(ret) { logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADMIME")); + logWriteln(languageParser.getValue("ERR_LOADVHOSTS")); logEndPrintError(); return -1; } @@ -1644,158 +1751,45 @@ inputF.closeFile(); outputF.closeFile(); } - else - { - vhostConfigurationFile->assign("virtualhosts.xml"); - } - connectionsScheduler.restart(); - listenThreads.initialize(&languageParser); - if(vhostList) - { - delete vhostList; - vhostList = 0; - } + if(languagesPath) + delete languagesPath; - vhostList = new VhostManager(&listenThreads); - if(vhostList == 0) - { - return -1; - } - if(externalPath) - delete externalPath; - externalPath = new string(); -#ifdef NOT_WIN - if(FilesUtility::fileExists("plugins")) - externalPath->assign("plugins"); - else - { + languagesPath = new string(); + +#ifndef WIN32 + /* + *Do not use the files in the directory /usr/share/myserver/languages + *if exists a local directory. + */ + if(FilesUtility::fileExists("languages")) + { + languagesPath->assign(getdefaultwd(0, 0) ); + languagesPath->append("/languages/"); + } + else + { #ifdef PREFIX - externalPath->assign(PREFIX); - externalPath->append("/lib/myserver/plugins"); - #else - externalPath->assign("/usr/lib/myserver/plugins"); + languagesPath->assign(PREFIX); + languagesPath->append("/share/myserver/languages/"); +#else + /* Default PREFIX is /usr/. */ + languagesPath->assign("/usr/share/myserver/languages/"); #endif } - #endif #ifdef WIN32 - externalPath->assign("plugins/protocols"); - + languagesPath->assign( "languages/" ); #endif - getProcessServerManager()->load(); - /* Load the home directories configuration. */ - homeDir.load(); - - - { - Protocol *protocolsSet[] = {new HttpProtocol(), - new HttpsProtocol(), - new FtpProtocol(), - new ControlProtocol(), - 0}; - - for (int j = 0; protocolsSet[j]; j++) - { - char protocolName[32]; - Protocol *protocol = protocolsSet[j]; - protocol->loadProtocol(&languageParser); - protocol->registerName(protocolName, 32); - - getProtocolsManager()->addProtocol(protocolName, protocol); - } - } - - getPluginsManager()->addNamespace(&executors); - getPluginsManager()->addNamespace(&protocols); - getPluginsManager()->addNamespace(&filters); - getPluginsManager()->addNamespace(&genericPluginsManager); - - - { - string res("plugins"); - getPluginsManager()->preLoad(this, &languageParser, res); - getPluginsManager()->load(this, &languageParser, res); - getPluginsManager()->postLoad(this, &languageParser); - } - - - /* Load the virtual hosts configuration from the xml file. */ - vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), - getMaxLogFileSize()); - - - if(path == 0) - path = new string(); - - /* Return 1 if we had an allocation problem. */ - if(getdefaultwd(*path)) - return -1; - - setProcessPermissions(); - - if(getGid()) - { - ostringstream out; - out << "gid: " << gid; - logWriteln(out.str().c_str()); - } - - if(getUid()) - { - ostringstream out; - out << "uid: " << uid; - logWriteln(out.str().c_str()); - } - - for(i = 0; i < nStaticThreads; i++) - { - logWriteln(languageParser.getValue("MSG_CREATET")); - ret = addThread(1); - if(ret) - return -1; - logWriteln(languageParser.getValue("MSG_THREADR")); - } - - logWriteln(languageParser.getValue("MSG_READY")); - - /* - *Print this message only if the log outputs to the console screen. - */ - if(logManager.getType() == LogManager::TYPE_CONSOLE) - logWriteln(languageParser.getValue("MSG_BREAK")); - - /* - *Server initialization is now completed. - */ - serverReady = 1; } - catch(bad_alloc& ba) - { - logPreparePrintError(); - logWriteln("Error allocating memory"); - logEndPrintError(); - return 1; - } - catch(exception& e) - { - ostringstream out; - out << "Error: " << e.what(); - logPreparePrintError(); - logWriteln(out.str().c_str()); - logEndPrintError(); - return 1; - } - catch(...) - { - return 1; - } + catch(...){} return 0; } + /*! *If specified set the uid/gid for the process. */ @@ -1916,14 +1910,14 @@ rebooting = 0; ret = initialize(0); + if(ret) return ret; - ret = loadSettings(); + logWriteln("Rebooted"); - return ret; - + return 0; } /*! From MAILER-DAEMON Fri Sep 12 18:43:28 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeHMO-0005fb-Pq for mharc-myserver-commit@gnu.org; Fri, 12 Sep 2008 18:43:28 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeHMN-0005fH-Bf for myserver-commit@gnu.org; Fri, 12 Sep 2008 18:43:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeHMM-0005ey-OX for myserver-commit@gnu.org; Fri, 12 Sep 2008 18:43:27 -0400 Received: from [199.232.76.173] (port=36771 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeHMM-0005ep-IF for myserver-commit@gnu.org; Fri, 12 Sep 2008 18:43:26 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44796 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeHMM-00008y-8Y for myserver-commit@gnu.org; Fri, 12 Sep 2008 18:43:26 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeHML-00052F-Li for myserver-commit@gnu.org; Fri, 12 Sep 2008 22:43:25 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeHML-00052B-9S for myserver-commit@gnu.org; Fri, 12 Sep 2008 22:43:25 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 12 Sep 2008 22:43:25 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2801] Removed mutex. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 22:43:27 -0000 Revision: 2801 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2801 Author: gscrivano Date: 2008-09-12 22:43:24 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Removed mutex. HashMap::get is reentrant. Modified Paths: -------------- trunk/myserver/include/protocol/http/http_errors.h trunk/myserver/src/protocol/http/http_errors.cpp Modified: trunk/myserver/include/protocol/http/http_errors.h =================================================================== --- trunk/myserver/include/protocol/http/http_errors.h 2008-09-12 20:19:15 UTC (rev 2800) +++ trunk/myserver/include/protocol/http/http_errors.h 2008-09-12 22:43:24 UTC (rev 2801) @@ -20,7 +20,6 @@ #define HTTP_ERRORS_H #include -#include #include using namespace std; @@ -35,7 +34,6 @@ private: static bool loaded; static void putMessage(int, const char*); - static Mutex mutex; static HashMap messagesMap; }; #endif Modified: trunk/myserver/src/protocol/http/http_errors.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_errors.cpp 2008-09-12 20:19:15 UTC (rev 2800) +++ trunk/myserver/src/protocol/http/http_errors.cpp 2008-09-12 22:43:24 UTC (rev 2801) @@ -22,7 +22,6 @@ #include -Mutex HttpErrors::mutex; HashMap HttpErrors::messagesMap; bool HttpErrors::loaded = false; @@ -48,15 +47,12 @@ void HttpErrors::getErrorMessage(int statusCode, string& out) { const char* msg; - mutex.lock(); msg = messagesMap.get(statusCode); if(msg) out.assign(msg); else out.assign(""); - - mutex.unlock(); } /*! From MAILER-DAEMON Fri Sep 12 19:09:53 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeHlx-0005Xw-K3 for mharc-myserver-commit@gnu.org; Fri, 12 Sep 2008 19:09:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeHlw-0005Xp-E3 for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:09:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeHlv-0005XV-VJ for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:09:52 -0400 Received: from [199.232.76.173] (port=54750 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeHlv-0005XJ-Na for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:09:51 -0400 Received: from savannah.gnu.org ([199.232.41.3]:59286 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeHlv-0002hK-7P for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:09:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeHlu-0005mY-P6 for myserver-commit@gnu.org; Fri, 12 Sep 2008 23:09:50 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeHlu-0005mU-Hq for myserver-commit@gnu.org; Fri, 12 Sep 2008 23:09:50 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 12 Sep 2008 23:09:50 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2802] Fixed right shift problem in HttpDir::formatBytes. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 23:09:52 -0000 Revision: 2802 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2802 Author: gscrivano Date: 2008-09-12 23:09:50 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Fixed right shift problem in HttpDir::formatBytes. Modified Paths: -------------- trunk/myserver/src/http_handler/http_dir/http_dir.cpp Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp =================================================================== --- trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-12 22:43:24 UTC (rev 2801) +++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-12 23:09:50 UTC (rev 2802) @@ -114,7 +114,10 @@ */ double HttpDir::formatBytes(u_long bytes, u_int power) { - const u_long quotient = bytes >> power; + /* u_long can be 32 bits. Don't do a right shift that is bigger than + * its size. */ + const u_long quotient = (bytes >> (power / 2)) >> (power / 2); + if (quotient == 0) return -1; From MAILER-DAEMON Fri Sep 12 19:36:08 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeIBM-0003KX-3V for mharc-myserver-commit@gnu.org; Fri, 12 Sep 2008 19:36:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeIBJ-0003JV-NO for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:36:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeIBH-0003Hg-38 for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:36:05 -0400 Received: from [199.232.76.173] (port=60691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeIBG-0003HM-Rt for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:36:02 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49112 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeIBG-0005CD-Bl for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:36:02 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeIBF-0006Hs-LH for myserver-commit@gnu.org; Fri, 12 Sep 2008 23:36:01 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeIBF-0006HE-7m for myserver-commit@gnu.org; Fri, 12 Sep 2008 23:36:01 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 12 Sep 2008 23:36:01 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2803] Updated Dev-C++ project generation script X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 23:36:05 -0000 Revision: 2803 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2803 Author: gscrivano Date: 2008-09-12 23:36:00 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Updated Dev-C++ project generation script Modified Paths: -------------- trunk/myserver/generate_myserver_dev.pl trunk/myserver/myserver.dev Modified: trunk/myserver/generate_myserver_dev.pl =================================================================== --- trunk/myserver/generate_myserver_dev.pl 2008-09-12 23:09:50 UTC (rev 2802) +++ trunk/myserver/generate_myserver_dev.pl 2008-09-12 23:36:00 UTC (rev 2803) @@ -2,8 +2,6 @@ ## MyServer ## -## http://www.myserverproject.net -## ## Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -25,6 +23,10 @@ my @files = ('stdafx.cpp'); my @directories = ('src'); +open(DAT, "version") || die("Could not open file!"); +$version=; + + $head = "[Project] FileName=myserver.dev Name=myserver @@ -37,8 +39,8 @@ PrivateResource=myserver_private.rc ResourceIncludes= MakeIncludes= -Compiler=-DMYSERVER_VERSION=\"GNU MyServer 0.9\" -CppCompiler=-DMYSERVER_VERSION=\"GNU MyServer 0.9\" +Compiler=-DMYSERVER_VERSION=\"$version\" +CppCompiler=-DMYSERVER_VERSION=\"$version\" Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@@_ IsCpp=1 Icon= Modified: trunk/myserver/myserver.dev =================================================================== --- trunk/myserver/myserver.dev 2008-09-12 23:09:50 UTC (rev 2802) +++ trunk/myserver/myserver.dev 2008-09-12 23:36:00 UTC (rev 2803) @@ -10,9 +10,9 @@ PrivateResource=myserver_private.rc ResourceIncludes= MakeIncludes= -Compiler= -CppCompiler= -Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@_@@_ +Compiler=-DMYSERVER_VERSION="GNU MyServer 0.9.0-rc2" +CppCompiler=-DMYSERVER_VERSION="GNU MyServer 0.9.0-rc2" +Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@ IsCpp=1 Icon= ExeOutput=binaries @@ -36,17 +36,16 @@ Build=3 LanguageID=1033 CharsetID=1252 -CompanyName=MyServer Project +CompanyName=Free Software Foundation Inc. FileVersion=0.9.0 -FileDescription=MyServer webserver +FileDescription=GNU MyServer webserver InternalName= -LegalCopyright=MyServer Team +LegalCopyright=Free Software Foundation Inc. LegalTrademarks= OriginalFilename=myserver.exe ProductName=MyServer ProductVersion=0.9.0 AutoIncBuildNr=0 - [Unit1] FileName=stdafx.cpp CompileCpp=1 @@ -68,7 +67,7 @@ BuildCmd= [Unit3] -FileName=src\find_data\find_data.cpp +FileName=src\connection\connection.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -78,7 +77,7 @@ BuildCmd= [Unit4] -FileName=src\connection\connection.cpp +FileName=src\log\log_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -88,7 +87,7 @@ BuildCmd= [Unit5] -FileName=src\env\env.cpp +FileName=src\conf\mime\mime_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -98,7 +97,7 @@ BuildCmd= [Unit6] -FileName=src\log\log_manager.cpp +FileName=src\conf\security\security_cache.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -108,7 +107,7 @@ BuildCmd= [Unit7] -FileName=src\conf\mime\mime_manager.cpp +FileName=src\conf\security\security.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -118,7 +117,7 @@ BuildCmd= [Unit8] -FileName=src\conf\security\security_cache.cpp +FileName=src\conf\vhost\vhost.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -128,7 +127,7 @@ BuildCmd= [Unit9] -FileName=src\conf\security\security.cpp +FileName=src\conf\vhost\vhost_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -138,7 +137,7 @@ BuildCmd= [Unit10] -FileName=src\conf\vhost\vhost.cpp +FileName=src\connections_scheduler\connections_scheduler.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -148,7 +147,7 @@ BuildCmd= [Unit11] -FileName=src\conf\vhost\vhost_manager.cpp +FileName=src\connections_scheduler\listen_threads.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -158,7 +157,7 @@ BuildCmd= [Unit12] -FileName=src\connections_scheduler\connections_scheduler.cpp +FileName=src\http_handler\wincgi\wincgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -168,7 +167,7 @@ BuildCmd= [Unit13] -FileName=src\connections_scheduler\listen_threads.cpp +FileName=src\http_handler\cgi\cgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -178,7 +177,7 @@ BuildCmd= [Unit14] -FileName=src\http_handler\wincgi\wincgi.cpp +FileName=src\http_handler\mscgi\mscgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -188,7 +187,7 @@ BuildCmd= [Unit15] -FileName=src\http_handler\cgi\cgi.cpp +FileName=src\http_handler\mscgi\mscgi_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -198,7 +197,7 @@ BuildCmd= [Unit16] -FileName=src\http_handler\mscgi\mscgi.cpp +FileName=src\http_handler\fastcgi\fastcgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -208,7 +207,7 @@ BuildCmd= [Unit17] -FileName=src\http_handler\mscgi\mscgi_manager.cpp +FileName=src\http_handler\http_file\http_file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -218,7 +217,7 @@ BuildCmd= [Unit18] -FileName=src\http_handler\fastcgi\fastcgi.cpp +FileName=src\http_handler\scgi\scgi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -228,7 +227,7 @@ BuildCmd= [Unit19] -FileName=src\http_handler\scgi\scgi.cpp +FileName=src\http_handler\isapi\isapi.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -238,7 +237,7 @@ BuildCmd= [Unit20] -FileName=src\http_handler\isapi\isapi.cpp +FileName=src\http_handler\http_dir\http_dir.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -258,7 +257,7 @@ BuildCmd= [Unit22] -FileName=src\base\file\files_utility.cpp +FileName=src\base\find_data\find_data.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -268,7 +267,7 @@ BuildCmd= [Unit23] -FileName=src\base\file\file.cpp +FileName=src\base\file\files_utility.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -278,7 +277,7 @@ BuildCmd= [Unit24] -FileName=src\base\pipe\pipe.cpp +FileName=src\base\file\file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -288,7 +287,7 @@ BuildCmd= [Unit25] -FileName=src\base\base64\mime_utils.cpp +FileName=src\base\pipe\pipe.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -298,7 +297,7 @@ BuildCmd= [Unit26] -FileName=src\base\mem_buff\mem_buff.cpp +FileName=src\base\base64\mime_utils.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -308,7 +307,7 @@ BuildCmd= [Unit27] -FileName=src\base\home_dir\home_dir.cpp +FileName=src\base\mem_buff\mem_buff.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -318,7 +317,7 @@ BuildCmd= [Unit28] -FileName=src\base\multicast\multicast.cpp +FileName=src\base\home_dir\home_dir.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -328,7 +327,7 @@ BuildCmd= [Unit29] -FileName=src\base\sync\recursive_mutex.cpp +FileName=src\base\multicast\multicast.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -338,7 +337,7 @@ BuildCmd= [Unit30] -FileName=src\base\sync\semaphore.cpp +FileName=src\base\sync\recursive_mutex.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -348,7 +347,7 @@ BuildCmd= [Unit31] -FileName=src\base\sync\mutex.cpp +FileName=src\base\sync\semaphore.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -358,7 +357,7 @@ BuildCmd= [Unit32] -FileName=src\base\sync\event.cpp +FileName=src\base\sync\mutex.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -368,7 +367,7 @@ BuildCmd= [Unit33] -FileName=src\base\sync\read_write_lock.cpp +FileName=src\base\sync\event.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -378,7 +377,7 @@ BuildCmd= [Unit34] -FileName=src\base\safetime\safetime.cpp +FileName=src\base\sync\read_write_lock.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -388,7 +387,7 @@ BuildCmd= [Unit35] -FileName=src\base\socket\socket.cpp +FileName=src\base\safetime\safetime.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -398,7 +397,7 @@ BuildCmd= [Unit36] -FileName=src\base\socket\ssl_socket.cpp +FileName=src\base\socket\socket.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -408,7 +407,7 @@ BuildCmd= [Unit37] -FileName=src\base\hash_map\hash_map.cpp +FileName=src\base\socket\ssl_socket.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -418,7 +417,7 @@ BuildCmd= [Unit38] -FileName=src\base\dynamic_lib\dynamiclib.cpp +FileName=src\base\hash_map\hash_map.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -428,7 +427,7 @@ BuildCmd= [Unit39] -FileName=src\base\process\process_server_manager.cpp +FileName=src\base\dynamic_lib\dynamiclib.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -438,7 +437,7 @@ BuildCmd= [Unit40] -FileName=src\base\process\process.cpp +FileName=src\base\process\process_server_manager.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -448,7 +447,7 @@ BuildCmd= [Unit41] -FileName=src\base\md5\md5.cpp +FileName=src\base\process\process.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -458,7 +457,7 @@ BuildCmd= [Unit42] -FileName=src\base\ssl\ssl.cpp +FileName=src\base\md5\md5.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -468,7 +467,7 @@ BuildCmd= [Unit43] -FileName=src\base\xml\xml_parser.cpp +FileName=src\base\ssl\ssl.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -478,7 +477,7 @@ BuildCmd= [Unit44] -FileName=src\base\string\stringutils.cpp +FileName=src\base\xml\xml_parser.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -488,7 +487,7 @@ BuildCmd= [Unit45] -FileName=src\base\string\securestr.cpp +FileName=src\base\files_cache\cached_file_factory.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -498,7 +497,7 @@ BuildCmd= [Unit46] -FileName=src\base\regex\myserver_regex.cpp +FileName=src\base\files_cache\cached_file_buffer.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -508,7 +507,7 @@ BuildCmd= [Unit47] -FileName=src\base\thread\thread.cpp +FileName=src\base\files_cache\cached_file.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -518,7 +517,7 @@ BuildCmd= [Unit48] -FileName=src\protocol\protocol.cpp +FileName=src\base\string\stringutils.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -528,7 +527,7 @@ BuildCmd= [Unit49] -FileName=src\protocol\protocol_buffer.cpp +FileName=src\base\string\securestr.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -538,7 +537,7 @@ BuildCmd= [Unit50] -FileName=src\protocol\ftp\ftp_parser.cpp +FileName=src\base\regex\myserver_regex.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -548,7 +547,7 @@ BuildCmd= [Unit51] -FileName=src\protocol\ftp\ftp_lexer.cpp +FileName=src\base\thread\thread.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -558,7 +557,7 @@ BuildCmd= [Unit52] -FileName=src\protocol\ftp\ftp.cpp +FileName=src\protocol\protocol.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -568,7 +567,7 @@ BuildCmd= [Unit53] -FileName=src\protocol\control\control_header.cpp +FileName=src\protocol\protocol_buffer.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -578,7 +577,7 @@ BuildCmd= [Unit54] -FileName=src\protocol\control\control_protocol.cpp +FileName=src\protocol\ftp\ftp_parser.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -588,7 +587,7 @@ BuildCmd= [Unit55] -FileName=src\protocol\https\https.cpp +FileName=src\protocol\ftp\ftp_lexer.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -598,7 +597,7 @@ BuildCmd= [Unit56] -FileName=src\protocol\http\http_data_handler.cpp +FileName=src\protocol\ftp\ftp.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -608,7 +607,7 @@ BuildCmd= [Unit57] -FileName=src\protocol\http\http_errors.cpp +FileName=src\protocol\control\control_header.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -618,7 +617,7 @@ BuildCmd= [Unit58] -FileName=src\protocol\http\http_response.cpp +FileName=src\protocol\control\control_protocol.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -628,7 +627,7 @@ BuildCmd= [Unit59] -FileName=src\protocol\http\http_data_read.cpp +FileName=src\protocol\https\https.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -638,7 +637,7 @@ BuildCmd= [Unit60] -FileName=src\protocol\http\http.cpp +FileName=src\protocol\http\http_data_handler.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -648,7 +647,7 @@ BuildCmd= [Unit61] -FileName=src\protocol\http\http_headers.cpp +FileName=src\protocol\http\http_errors.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -658,7 +657,7 @@ BuildCmd= [Unit62] -FileName=src\protocol\http\http_dir.cpp +FileName=src\protocol\http\http_response.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -668,7 +667,7 @@ BuildCmd= [Unit63] -FileName=src\protocol\http\http_thread_context.cpp +FileName=src\protocol\http\http_data_read.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -678,7 +677,7 @@ BuildCmd= [Unit64] -FileName=src\protocol\http\http_header_checker.cpp +FileName=src\protocol\http\http.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -688,7 +687,7 @@ BuildCmd= [Unit65] -FileName=src\protocol\http\http_request.cpp +FileName=src\protocol\http\http_headers.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -698,7 +697,7 @@ BuildCmd= [Unit66] -FileName=src\protocol\http\http_file.cpp +FileName=src\protocol\http\http_thread_context.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -708,7 +707,7 @@ BuildCmd= [Unit67] -FileName=src\files_cache\cached_file_factory.cpp +FileName=src\protocol\http\http_header_checker.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -718,7 +717,7 @@ BuildCmd= [Unit68] -FileName=src\files_cache\cached_file_buffer.cpp +FileName=src\protocol\http\http_request.cpp CompileCpp=1 Folder=myserver Compile=1 @@ -728,7 +727,7 @@ BuildCmd= [Unit69] -FileName=src\files_cache\cached_file.cpp +FileName=src\protocol\http\env\env.cpp CompileCpp=1 Folder=myserver Compile=1 From MAILER-DAEMON Fri Sep 12 19:38:45 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeIDt-00060o-5g for mharc-myserver-commit@gnu.org; Fri, 12 Sep 2008 19:38:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeIDr-0005zA-5W for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:38:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeIDp-0005xJ-AH for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:38:42 -0400 Received: from [199.232.76.173] (port=43261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeIDp-0005wy-3j for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:38:41 -0400 Received: from savannah.gnu.org ([199.232.41.3]:41917 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeIDo-0005VP-Ip for myserver-commit@gnu.org; Fri, 12 Sep 2008 19:38:40 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeIDo-0006Kf-2q for myserver-commit@gnu.org; Fri, 12 Sep 2008 23:38:40 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeIDn-0006Kb-Si for myserver-commit@gnu.org; Fri, 12 Sep 2008 23:38:39 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 12 Sep 2008 23:38:39 +0000 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [myserver-commit] [2804] Code refactoring. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 23:38:43 -0000 Revision: 2804 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2804 Author: gscrivano Date: 2008-09-12 23:38:39 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Code refactoring. Extracted new methods from Server::start. Modified Paths: -------------- trunk/myserver/include/server/server.h trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-12 23:36:00 UTC (rev 2803) +++ trunk/myserver/include/server/server.h 2008-09-12 23:38:39 UTC (rev 2804) @@ -172,6 +172,10 @@ /*! Do not allow to create directly objects. */ Server(); + void mainLoop(); + void loadPlugins(); + void displayBoot(); + CachedFileFactory cachedFiles; void *envString; @@ -207,7 +211,7 @@ string* path; string* externalPath; string* serverAdmin; - int initialize(int); + int initialize(); int addThread(int staticThread = 0); ConnectionPtr addConnectionToList(Socket* s, MYSERVER_SOCKADDRIN *asock_in, char *ipAddr, char *localIpAddr, Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-12 23:36:00 UTC (rev 2803) +++ trunk/myserver/src/server/server.cpp 2008-09-12 23:38:39 UTC (rev 2804) @@ -115,14 +115,8 @@ void Server::start() { u_long i; - u_long configsCheck = 0; - u_long purgeThreadsCounter = 0; - time_t mainConfTime; - time_t hostsConfTime; - time_t mimeConf; string buffer; int err = 0; - int osVer = getOSVersion(); int ret; ostringstream nCPU; string strCPU; @@ -133,69 +127,8 @@ INPUT_RECORD irInBuf[128]; #endif -#ifdef CLEAR_BOOT_SCREEN + displayBoot(); - if(logManager.getType() == LogManager::TYPE_CONSOLE ) - { -#ifdef WIN32 - - /* - *Under the windows platform use the cls operating-system - *command to clear the screen. - */ - _flushall(); - system("cls"); -#endif -#ifdef NOT_WIN - - /* - *Under an UNIX environment, clearing the screen - *can be done in a similar method - */ - sync(); - system("clear"); -#endif - } - -#endif /* CLEAR_BOOT_SCREEN. */ - - /* - *Print the MyServer signature only if the log writes to the console. - */ - if(logManager.getType() == LogManager::TYPE_CONSOLE ) - { - try - { - string softwareSignature; - softwareSignature.assign("************"); - softwareSignature.append(MYSERVER_VERSION); - softwareSignature.append("************"); - - i = softwareSignature.length(); - while(i--) - logManager.write("*"); - logManager.writeln(""); - logManager.write(softwareSignature.c_str()); - logManager.write("\n"); - i = softwareSignature.length(); - while(i--) - logManager.write("*"); - logManager.writeln(""); - } - catch(exception& e) - { - ostringstream err; - err << "Error: " << e.what(); - logManager.write(err.str().c_str()); - logManager.write("\n"); - return; - } - catch(...) - { - return; - }; - } - try { setcwdBuffer(); @@ -209,9 +142,8 @@ */ logWriteln("Initializing server configuration..."); err = 0; - osVer = getOSVersion(); - err = initialize(osVer); + err = initialize(); if(err) return; @@ -271,15 +203,6 @@ logWriteln(msg.c_str()); } - if(filtersFactory.insert("gzip", Gzip::factory)) - { - ostringstream stream; - stream << languageParser.getValue("ERR_ERROR") << ": Gzip Filter"; - logPreparePrintError(); - logWriteln(stream.str().c_str()); - logEndPrintError(); - } - /* Load the MIME types. */ logWriteln(languageParser.getValue("MSG_LOADMIME")); if(mimeManager) @@ -325,40 +248,9 @@ /* Load the home directories configuration. */ homeDir.load(); + + loadPlugins(); - - { - Protocol *protocolsSet[] = {new HttpProtocol(), - new HttpsProtocol(), - new FtpProtocol(), - new ControlProtocol(), - 0}; - - for (int j = 0; protocolsSet[j]; j++) - { - char protocolName[32]; - Protocol *protocol = protocolsSet[j]; - protocol->loadProtocol(&languageParser); - protocol->registerName(protocolName, 32); - - getProtocolsManager()->addProtocol(protocolName, protocol); - } - } - - getPluginsManager()->addNamespace(&executors); - getPluginsManager()->addNamespace(&protocols); - getPluginsManager()->addNamespace(&filters); - getPluginsManager()->addNamespace(&genericPluginsManager); - - - { - string res("plugins"); - getPluginsManager()->preLoad(this, &languageParser, res); - getPluginsManager()->load(this, &languageParser, res); - getPluginsManager()->postLoad(this, &languageParser); - } - - /* Load the virtual hosts configuration from the xml file. */ vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), getMaxLogFileSize()); @@ -401,168 +293,292 @@ if(logManager.getType() == LogManager::TYPE_CONSOLE) logWriteln(languageParser.getValue("MSG_BREAK")); + + serverReady = 1; - mainConfTime = - FilesUtility::getLastModTime(mainConfigurationFile->c_str()); - hostsConfTime = - FilesUtility::getLastModTime(vhostConfigurationFile->c_str()); - mimeConf = - FilesUtility::getLastModTime(mimeConfigurationFile->c_str()); + /* Finally we can give control to the main loop. */ + mainLoop(); - - serverReady = 1; - - /* - *Keep thread alive. - *When the endServer flag is set to True exit - *from the loop and terminate the server execution. - */ - while(!endServer) + } + catch(bad_alloc &ba) + { + ostringstream s; + s << "Bad alloc: " << ba.what(); + logWriteln(s.str().c_str()); + } + catch(exception &e) + { + ostringstream s; + s << "Error: " << e.what(); + logWriteln(s.str().c_str()); + }; + this->terminate(); + finalCleanup(); +#ifdef WIN32 + WSACleanup(); +#endif// WIN32 +} + +/*! + *Load the plugins. + */ +void Server::loadPlugins() +{ + if(filtersFactory.insert("gzip", Gzip::factory)) + { + ostringstream stream; + stream << languageParser.getValue("ERR_ERROR") << ": Gzip Filter"; + logPreparePrintError(); + logWriteln(stream.str().c_str()); + logEndPrintError(); + } + + Protocol *protocolsSet[] = {new HttpProtocol(), + new HttpsProtocol(), + new FtpProtocol(), + new ControlProtocol(), + 0}; + + for (int j = 0; protocolsSet[j]; j++) + { + char protocolName[32]; + Protocol *protocol = protocolsSet[j]; + protocol->loadProtocol(&languageParser); + protocol->registerName(protocolName, 32); + getProtocolsManager()->addProtocol(protocolName, protocol); + } + + + getPluginsManager()->addNamespace(&executors); + getPluginsManager()->addNamespace(&protocols); + getPluginsManager()->addNamespace(&filters); + getPluginsManager()->addNamespace(&genericPluginsManager); + + getPluginsManager()->preLoad(this, &languageParser, *externalPath); + getPluginsManager()->load(this, &languageParser, *externalPath); + getPluginsManager()->postLoad(this, &languageParser); +} + +/*! + *Server main loop. + */ +void Server::mainLoop() +{ + time_t mainConfTime; + time_t hostsConfTime; + time_t mimeConfTime; + + u_long configsCheck = 0; + u_long purgeThreadsCounter = 0; + + mainConfTime = + FilesUtility::getLastModTime(mainConfigurationFile->c_str()); + hostsConfTime = + FilesUtility::getLastModTime(vhostConfigurationFile->c_str()); + mimeConfTime = + FilesUtility::getLastModTime(mimeConfigurationFile->c_str()); + + /* + *Keep thread alive. + *When the endServer flag is set to True exit + *from the loop and terminate the server execution. + */ + while(!endServer) + { + Thread::wait(100000); + + /* Check threads. */ + if(purgeThreadsCounter++ >= 100) { - Thread::wait(100000); + purgeThreadsCounter = 0; + purgeThreads(); + } - /* Check threads. */ - if(purgeThreadsCounter++ >= 100) + if(autoRebootEnabled) + { + configsCheck++; + /* Do not check for modified configuration files every cycle. */ + if(configsCheck > 10) { - purgeThreadsCounter = 0; - purgeThreads(); - } + time_t mainConfTimeNow = + FilesUtility::getLastModTime(mainConfigurationFile->c_str()); + time_t hostsConfTimeNow = + FilesUtility::getLastModTime(vhostConfigurationFile->c_str()); + time_t mimeConfNow = + FilesUtility::getLastModTime(mimeConfigurationFile->c_str()); - if(autoRebootEnabled) - { - configsCheck++; - /* Do not check for modified configuration files every cycle. */ - if(configsCheck > 10) + /* If a configuration file was modified reboot the server. */ + if(((mainConfTimeNow!=-1) && (hostsConfTimeNow!=-1) && + (mimeConfNow!=-1)) || toReboot) { - time_t mainConfTimeNow = - FilesUtility::getLastModTime(mainConfigurationFile->c_str()); - time_t hostsConfTimeNow = - FilesUtility::getLastModTime(vhostConfigurationFile->c_str()); - time_t mimeConfNow = - FilesUtility::getLastModTime(mimeConfigurationFile->c_str()); - - /* If a configuration file was modified reboot the server. */ - if(((mainConfTimeNow!=-1) && (hostsConfTimeNow!=-1) && - (mimeConfNow!=-1)) || toReboot) + if( (mainConfTimeNow != mainConfTime) || toReboot) { - if( (mainConfTimeNow != mainConfTime) || toReboot) + string msg("main-conf-changed"); + notifyMulticast(msg, 0); + + reboot(); + /* Store new mtime values. */ + mainConfTime = mainConfTimeNow; + mimeConfTime = mimeConfNow; + } + else if(mimeConfNow != mimeConfTime) + { + string msg("mime-conf-changed"); + notifyMulticast(msg, 0); + + if(logManager.getType() == LogManager::TYPE_CONSOLE) { - string msg("main-conf-changed"); - notifyMulticast(msg, 0); - - reboot(); - /* Store new mtime values. */ - mainConfTime = mainConfTimeNow; - mimeConf = mimeConfNow; + char beep[]={static_cast(0x7), '\0'}; + logManager.write(beep); } - else if(mimeConfNow != mimeConf) - { - string msg("mime-conf-changed"); - notifyMulticast(msg, 0); - if(logManager.getType() == LogManager::TYPE_CONSOLE) - { - char beep[]={static_cast(0x7), '\0'}; - logManager.write(beep); - } + logWriteln("Reloading MIMEtypes.xml"); - logWriteln("Reloading MIMEtypes.xml"); - - getMimeManager()->loadXML(getMIMEConfFile()); + getMimeManager()->loadXML(getMIMEConfFile()); + + logWriteln("Reloaded"); + + mimeConfTime = mimeConfNow; + } + else if(hostsConfTimeNow != hostsConfTime) + { + VhostManager* oldvhost = vhostList; + string msg("vhosts-conf-changed"); + notifyMulticast(msg, 0); - logWriteln("Reloaded"); - - mimeConf = mimeConfNow; + /* Do a beep if outputting to console. */ + if(logManager.getType() == LogManager::TYPE_CONSOLE) + { + char beep[]={static_cast(0x7), '\0'}; + logManager.write(beep); } - else if(hostsConfTimeNow != hostsConfTime) - { - VhostManager* oldvhost = vhostList; - string msg("vhosts-conf-changed"); - notifyMulticast(msg, 0); + + logWriteln("Rebooting..."); + + connectionsScheduler.release(); - /* Do a beep if outputting to console. */ - if(logManager.getType() == LogManager::TYPE_CONSOLE) - { - char beep[]={static_cast(0x7), '\0'}; - logManager.write(beep); - } + Socket::stopBlockingOperations(true); + + listenThreads.beginFastReboot(); - logWriteln("Rebooting..."); + listenThreads.terminate(); + + connectionsScheduler.terminateConnections(); + clearAllConnections(); - connectionsScheduler.release(); - - Socket::stopBlockingOperations(true); - - listenThreads.beginFastReboot(); - - listenThreads.terminate(); - connectionsScheduler.terminateConnections(); - clearAllConnections(); + Socket::stopBlockingOperations(false); + connectionsScheduler.restart(); + listenThreads.initialize(&languageParser); - Socket::stopBlockingOperations(false); + vhostList = new VhostManager(&listenThreads); + + if(vhostList == 0) + continue; + + delete oldvhost; - connectionsScheduler.restart(); - listenThreads.initialize(&languageParser); + /* Load the virtual hosts configuration from the xml file. */ + if(vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), + getMaxLogFileSize())) + { + listenThreads.rollbackFastReboot(); + } + else + { + listenThreads.commitFastReboot(); + } + + hostsConfTime = hostsConfTimeNow; + logWriteln("Reloaded"); + } - vhostList = new VhostManager(&listenThreads); + configsCheck = 0; + } + else + { + /* + *If there are problems in loading mtimes + *check again after a bit. + */ + configsCheck = 7; + } + } + }//end if(autoRebootEnabled) + } +} - if(vhostList == 0) - { - continue; - } +/*! + *Display the MyServer boot. + */ +void Server::displayBoot() +{ + u_long i; - delete oldvhost; +#ifdef CLEAR_BOOT_SCREEN - /* Load the virtual hosts configuration from the xml file. */ - if(vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), - getMaxLogFileSize())) - { - listenThreads.rollbackFastReboot(); + if(logManager.getType() == LogManager::TYPE_CONSOLE ) + { +#ifdef WIN32 - } - else - { - listenThreads.commitFastReboot(); - } + /* + *Under the windows platform use the cls operating-system + *command to clear the screen. + */ + _flushall(); + system("cls"); +#endif +#ifdef NOT_WIN - hostsConfTime = hostsConfTimeNow; - logWriteln("Reloaded"); + /* + *Under an UNIX environment, clearing the screen + *can be done in a similar method + */ + sync(); + system("clear"); +#endif + } - } +#endif /* CLEAR_BOOT_SCREEN. */ - configsCheck = 0; - } - else - { - /* - *If there are problems in loading mtimes - *check again after a bit. - */ - configsCheck = 7; - } - } - }//end if(autoRebootEnabled) + /* + *Print the MyServer signature only if the log writes to the console. + */ + if(logManager.getType() == LogManager::TYPE_CONSOLE ) + { + try + { + string softwareSignature; + softwareSignature.assign("************"); + softwareSignature.append(MYSERVER_VERSION); + softwareSignature.append("************"); + + i = softwareSignature.length(); + while(i--) + logManager.write("*"); + logManager.writeln(""); + logManager.write(softwareSignature.c_str()); + logManager.write("\n"); + i = softwareSignature.length(); + while(i--) + logManager.write("*"); + logManager.writeln(""); } + catch(exception& e) + { + ostringstream err; + err << "Error: " << e.what(); + logManager.write(err.str().c_str()); + logManager.write("\n"); + return; + } + catch(...) + { + return; + }; } - catch(bad_alloc &ba) - { - ostringstream s; - s << "Bad alloc: " << ba.what(); - logWriteln(s.str().c_str()); - } - catch(exception &e) - { - ostringstream s; - s << "Error: " << e.what(); - logWriteln(s.str().c_str()); - }; - this->terminate(); - finalCleanup(); -#ifdef WIN32 - WSACleanup(); -#endif// WIN32 + } /*! @@ -838,7 +854,7 @@ *The configuration file is a XML file. *Return nonzero on errors. */ -int Server::initialize(int /*!osVer*/) +int Server::initialize() { char *data; int ret; @@ -1668,7 +1684,7 @@ #endif #ifdef WIN32 - externalPath->assign("plugins/protocols"); + externalPath->assign("plugins"); #endif @@ -1909,7 +1925,7 @@ rebooting = 0; - ret = initialize(0); + ret = initialize(); if(ret) return ret; From MAILER-DAEMON Sat Sep 13 05:19:53 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeRIG-000349-WE for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 05:19:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeRIF-00033y-Fe for myserver-commit@gnu.org; Sat, 13 Sep 2008 05:19:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeRIE-00033g-SJ for myserver-commit@gnu.org; Sat, 13 Sep 2008 05:19:51 -0400 Received: from [199.232.76.173] (port=35542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeRIE-00033V-HT for myserver-commit@gnu.org; Sat, 13 Sep 2008 05:19:50 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43684 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeRID-00031E-VI for myserver-commit@gnu.org; Sat, 13 Sep 2008 05:19:50 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeRID-0000r6-5C for myserver-commit@gnu.org; Sat, 13 Sep 2008 09:19:49 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeRIC-0000qy-PD for myserver-commit@gnu.org; Sat, 13 Sep 2008 09:19:48 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 13 Sep 2008 09:19:48 +0000 X-detected-kernel: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2805] Libraries loading code isolated into Server::loadLibraries. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 09:19:51 -0000 Revision: 2805 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2805 Author: gscrivano Date: 2008-09-13 09:19:48 +0000 (Sat, 13 Sep 2008) Log Message: ----------- Libraries loading code isolated into Server::loadLibraries. Modified Paths: -------------- trunk/myserver/include/server/server.h trunk/myserver/src/myserver.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-12 23:38:39 UTC (rev 2804) +++ trunk/myserver/include/server/server.h 2008-09-13 09:19:48 UTC (rev 2805) @@ -77,6 +77,8 @@ return instance; } + int loadLibraries(); + CachedFileFactory* getCachedFiles(); const char* getHashedData(const char* name); Modified: trunk/myserver/src/myserver.cpp =================================================================== --- trunk/myserver/src/myserver.cpp 2008-09-12 23:38:39 UTC (rev 2804) +++ trunk/myserver/src/myserver.cpp 2008-09-13 09:19:48 UTC (rev 2805) @@ -204,7 +204,6 @@ try { Server::createInstance(); - Process::initialize(); } catch(...) { @@ -553,7 +552,7 @@ char path [MAX_PATH]; GetCurrentDirectory(MAX_PATH,path); strcat(path,"\\"); - strcat(path,"myServer.exe SERVICE"); + strcat(path,"myserver.exe SERVICE"); manager = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); if (manager) Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-12 23:38:39 UTC (rev 2804) +++ trunk/myserver/src/server/server.cpp 2008-09-13 09:19:48 UTC (rev 2805) @@ -102,6 +102,34 @@ } /*! + *Load here all the libraries. + */ +int Server::loadLibraries() +{ + Process::initialize(); + + setcwdBuffer(); + XmlParser::startXML(); + myserver_safetime_init(); + + /* Startup the socket library. */ + logWriteln(languageParser.getValue("MSG_ISOCK") ); + + if(startupSocketLib(MAKEWORD( 1, 1)) != 0) + { + logPreparePrintError(); + logWriteln( languageParser.getValue("MSG_SERVER_CONF") ); + logEndPrintError(); + return 1; + } + + logWriteln(languageParser.getValue("MSG_SOCKSTART") ); + + return 0; +} + + +/*! *Destroy the object. */ Server::~Server() @@ -131,12 +159,9 @@ try { - setcwdBuffer(); + if(loadLibraries()) + return; - XmlParser::startXML(); - - myserver_safetime_init(); - /* *Setup the server configuration. */ @@ -152,18 +177,6 @@ logWriteln( languageParser.getValue("MSG_SERVER_CONF") ); - /* Startup the socket library. */ - logWriteln( languageParser.getValue("MSG_ISOCK") ); - err = startupSocketLib(/* MAKEWORD( 2, 2 ) */MAKEWORD( 1, 1)); - if (err != 0) - { - logPreparePrintError(); - logWriteln( languageParser.getValue("MSG_SERVER_CONF") ); - logEndPrintError(); - return; - } - logWriteln( languageParser.getValue("MSG_SOCKSTART") ); - /* *Get the name of the local machine. */ @@ -232,17 +245,14 @@ connectionsScheduler.restart(); listenThreads.initialize(&languageParser); + if(vhostList) - { delete vhostList; - vhostList = 0; - } vhostList = new VhostManager(&listenThreads); - if(vhostList == 0) - { + + if(vhostList == NULL) return; - } getProcessServerManager()->load(); @@ -314,6 +324,7 @@ }; this->terminate(); finalCleanup(); + #ifdef WIN32 WSACleanup(); #endif// WIN32 From MAILER-DAEMON Sat Sep 13 06:54:34 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeSlu-00057c-81 for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 06:54:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeSls-00056D-5P for myserver-commit@gnu.org; Sat, 13 Sep 2008 06:54:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeSlq-00055x-PP for myserver-commit@gnu.org; Sat, 13 Sep 2008 06:54:30 -0400 Received: from [199.232.76.173] (port=35301 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeSlq-00055r-J9 for myserver-commit@gnu.org; Sat, 13 Sep 2008 06:54:30 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44889 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeSlq-000892-7p for myserver-commit@gnu.org; Sat, 13 Sep 2008 06:54:30 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeSlp-0007zE-JU for myserver-commit@gnu.org; Sat, 13 Sep 2008 10:54:29 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeSlp-0007zA-As for myserver-commit@gnu.org; Sat, 13 Sep 2008 10:54:29 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 13 Sep 2008 10:54:29 +0000 X-detected-kernel: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2806] Removed pragma directives from the source code. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 10:54:32 -0000 Revision: 2806 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2806 Author: gscrivano Date: 2008-09-13 10:54:28 +0000 (Sat, 13 Sep 2008) Log Message: ----------- Removed pragma directives from the source code. Modified Paths: -------------- trunk/myserver/src/base/socket/socket.cpp trunk/myserver/src/base/socket/ssl_socket.cpp trunk/myserver/src/filter/gzip/gzip.cpp trunk/myserver/src/filter/gzip/gzip_decompress.cpp trunk/myserver/src/myserver.cpp Modified: trunk/myserver/src/base/socket/socket.cpp =================================================================== --- trunk/myserver/src/base/socket/socket.cpp 2008-09-13 09:19:48 UTC (rev 2805) +++ trunk/myserver/src/base/socket/socket.cpp 2008-09-13 10:54:28 UTC (rev 2806) @@ -22,9 +22,6 @@ extern "C" { #include #include -#ifdef WIN32 -//#include -#endif #ifndef WIN32 #include #include @@ -40,14 +37,8 @@ using namespace std; -#ifdef WIN32 -#pragma comment(lib,"wsock32.lib") -#pragma comment(lib,"ws2_32.lib") -#endif - bool Socket::denyBlockingOperations = false; - /*! *Source code to wrap the socket library to MyServer project. */ Modified: trunk/myserver/src/base/socket/ssl_socket.cpp =================================================================== --- trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-13 09:19:48 UTC (rev 2805) +++ trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-13 10:54:28 UTC (rev 2806) @@ -23,9 +23,6 @@ extern "C" { #include #include -#ifdef WIN32 - //#include -#endif #ifndef WIN32 #include #include @@ -41,19 +38,6 @@ using namespace std; -#ifdef WIN32 - -#pragma comment(lib,"wsock32.lib") -#pragma comment(lib,"ws2_32.lib") - -#ifndef DO_NOT_USE_SSL - #pragma comment(lib,"libssl.lib")/*! Import the OpenSSL library. */ - #pragma comment(lib,"libcrypto.lib")/*! Import the OpenSSL library. */ -#endif - -#endif - - /*! *Constructor of the class. */ Modified: trunk/myserver/src/filter/gzip/gzip.cpp =================================================================== --- trunk/myserver/src/filter/gzip/gzip.cpp 2008-09-13 09:19:48 UTC (rev 2805) +++ trunk/myserver/src/filter/gzip/gzip.cpp 2008-09-13 10:54:28 UTC (rev 2806) @@ -23,7 +23,6 @@ #ifdef WIN32 #include #include -#pragma comment (lib,"libz.lib") #endif #ifdef NOT_WIN #include Modified: trunk/myserver/src/filter/gzip/gzip_decompress.cpp =================================================================== --- trunk/myserver/src/filter/gzip/gzip_decompress.cpp 2008-09-13 09:19:48 UTC (rev 2805) +++ trunk/myserver/src/filter/gzip/gzip_decompress.cpp 2008-09-13 10:54:28 UTC (rev 2806) @@ -22,7 +22,6 @@ #ifdef WIN32 #include #include -#pragma comment (lib,"libz.lib") #endif #ifdef NOT_WIN #include Modified: trunk/myserver/src/myserver.cpp =================================================================== --- trunk/myserver/src/myserver.cpp 2008-09-13 09:19:48 UTC (rev 2805) +++ trunk/myserver/src/myserver.cpp 2008-09-13 10:54:28 UTC (rev 2806) @@ -35,11 +35,6 @@ #endif } -/* External libraries to be included in the project. */ -#ifdef WIN32 -#pragma comment(lib,"winmm.lib") -#endif - #define MYSERVER_RUNAS_CONSOLE 1 #define MYSERVER_RUNAS_SERVICE 2 From MAILER-DAEMON Sat Sep 13 12:18:22 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeXpG-0002Ka-DW for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 12:18:22 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeXoJ-0001ZM-RO for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:17:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeXoJ-0001Z8-AX for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:17:23 -0400 Received: from [199.232.76.173] (port=41758 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeXoJ-0001Z3-5U for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:17:23 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44350 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeXoI-000086-U7 for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:17:23 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeXoH-0001w6-Ef for myserver-commit@gnu.org; Sat, 13 Sep 2008 16:17:22 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeXoG-0001w2-Qd for myserver-commit@gnu.org; Sat, 13 Sep 2008 16:17:21 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Sat, 13 Sep 2008 16:17:20 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 13 Sep 2008 12:18:21 -0400 Subject: [myserver-commit] [2807] Build libmyserver.a after any change made to the library source tree X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 16:17:24 -0000 Revision: 2807 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2807 Author: francesco_pipita Date: 2008-09-13 16:17:19 +0000 (Sat, 13 Sep 2008) Log Message: ----------- Build libmyserver.a after any change made to the library source tree Modified Paths: -------------- trunk/myserver/src/Makefile.am Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-13 10:54:28 UTC (rev 2806) +++ trunk/myserver/src/Makefile.am 2008-09-13 16:17:19 UTC (rev 2807) @@ -10,16 +10,18 @@ $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ $(XML_LIBS) $(LDFLAGS) -libmyserver.a: +clean-libmyserver.a: rm -f libmyserver.a + +libmyserver.a: clean-libmyserver.a find -iregex .*\\.$(OBJEXT) | xargs $(AR) cru libmyserver.a $(RANLIB) libmyserver.a -build_parser: protocol/ftp/ftp_lexer.lpp protocol/ftp/ftp_parser.ypp - bison --defines=../include/protocol/ftp/ftp_parser.h protocol/ftp/ftp_parser.ypp - cp protocol/ftp/ftp_parser.tab.cpp protocol/ftp/ftp_parser.cpp - flex --header-file=../include/protocol/ftp/ftp_lexer.h protocol/ftp/ftp_lexer.lpp - cp ./protocol/ftp/lex.yy.c ./protocol/ftp/ftp_lexer.cpp +# build_parser: protocol/ftp/ftp_lexer.lpp protocol/ftp/ftp_parser.ypp +# bison --defines=../include/protocol/ftp/ftp_parser.h protocol/ftp/ftp_parser.ypp +# cp protocol/ftp/ftp_parser.tab.cpp protocol/ftp/ftp_parser.cpp +# flex --header-file=../include/protocol/ftp/ftp_lexer.h protocol/ftp/ftp_lexer.lpp +# cp ./protocol/ftp/lex.yy.c ./protocol/ftp/ftp_lexer.cpp all-local: libmyserver.a myserver${EXEEXT} cp myserver${EXEEXT} ../binaries From MAILER-DAEMON Sat Sep 13 12:31:35 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeY23-0005gu-7b for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 12:31:35 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeY20-0005gP-G8 for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:31:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeY1z-0005fk-S1 for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:31:32 -0400 Received: from [199.232.76.173] (port=43779 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeY1z-0005ff-JL for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:31:31 -0400 Received: from savannah.gnu.org ([199.232.41.3]:45331 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeY1z-0002KT-BM for myserver-commit@gnu.org; Sat, 13 Sep 2008 12:31:31 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeY1y-0002LH-KJ for myserver-commit@gnu.org; Sat, 13 Sep 2008 16:31:30 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeY1y-0002LC-8J for myserver-commit@gnu.org; Sat, 13 Sep 2008 16:31:30 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 13 Sep 2008 16:31:30 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2808] Read AC_INIT version from the file `version'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 16:31:33 -0000 Revision: 2808 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2808 Author: gscrivano Date: 2008-09-13 16:31:29 +0000 (Sat, 13 Sep 2008) Log Message: ----------- Read AC_INIT version from the file `version'. Dirty hack. Modified Paths: -------------- trunk/myserver/configure.in Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-13 16:17:19 UTC (rev 2807) +++ trunk/myserver/configure.in 2008-09-13 16:31:29 UTC (rev 2808) @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -AC_INIT([GNU MyServer], [ ], [bug-myserver@gnu.org]) +AC_INIT([GNU MyServer], [`cat version | awk'{print $NF}'`], [bug-myserver@gnu.org]) AC_PREREQ([2.50]) AM_CONFIG_HEADER(config.h) CFLAGS="${CFLAGS=}" From MAILER-DAEMON Sat Sep 13 13:51:50 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeZHi-0005s3-5p for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 13:51:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeZH7-0005mO-0p for myserver-commit@gnu.org; Sat, 13 Sep 2008 13:51:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeZH6-0005l8-3f for myserver-commit@gnu.org; Sat, 13 Sep 2008 13:51:12 -0400 Received: from [199.232.76.173] (port=59058 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeZH6-0005l1-1E for myserver-commit@gnu.org; Sat, 13 Sep 2008 13:51:12 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54446 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeZH5-0007dd-G1 for myserver-commit@gnu.org; Sat, 13 Sep 2008 13:51:11 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeZH4-0004fA-Qs for myserver-commit@gnu.org; Sat, 13 Sep 2008 17:51:10 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeZH4-0004f6-Hl for myserver-commit@gnu.org; Sat, 13 Sep 2008 17:51:10 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Sat, 13 Sep 2008 17:51:10 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 13 Sep 2008 13:51:48 -0400 Subject: [myserver-commit] [2809] Moved ftp parser generation rule to 'src/protocol/ftp/Makefile.am' X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 17:51:13 -0000 Revision: 2809 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2809 Author: francesco_pipita Date: 2008-09-13 17:51:10 +0000 (Sat, 13 Sep 2008) Log Message: ----------- Moved ftp parser generation rule to 'src/protocol/ftp/Makefile.am' Modified Paths: -------------- trunk/myserver/src/Makefile.am trunk/myserver/src/protocol/ftp/Makefile.am trunk/myserver/src/protocol/ftp/ftp_lexer.lpp Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-13 16:31:29 UTC (rev 2808) +++ trunk/myserver/src/Makefile.am 2008-09-13 17:51:10 UTC (rev 2809) @@ -17,12 +17,6 @@ find -iregex .*\\.$(OBJEXT) | xargs $(AR) cru libmyserver.a $(RANLIB) libmyserver.a -# build_parser: protocol/ftp/ftp_lexer.lpp protocol/ftp/ftp_parser.ypp -# bison --defines=../include/protocol/ftp/ftp_parser.h protocol/ftp/ftp_parser.ypp -# cp protocol/ftp/ftp_parser.tab.cpp protocol/ftp/ftp_parser.cpp -# flex --header-file=../include/protocol/ftp/ftp_lexer.h protocol/ftp/ftp_lexer.lpp -# cp ./protocol/ftp/lex.yy.c ./protocol/ftp/ftp_lexer.cpp - all-local: libmyserver.a myserver${EXEEXT} cp myserver${EXEEXT} ../binaries Modified: trunk/myserver/src/protocol/ftp/Makefile.am =================================================================== --- trunk/myserver/src/protocol/ftp/Makefile.am 2008-09-13 16:31:29 UTC (rev 2808) +++ trunk/myserver/src/protocol/ftp/Makefile.am 2008-09-13 17:51:10 UTC (rev 2809) @@ -3,3 +3,8 @@ SUBDIRS = INCLUDES = $(all_includes) +build_parser: ftp_lexer.lpp ftp_parser.ypp + bison --defines=../../../include/protocol/ftp/ftp_parser.h \ + --output=ftp_parser.cpp ftp_parser.ypp + flex --header-file=../../../include/protocol/ftp/ftp_lexer.h \ + --outfile=ftp_lexer.cpp ftp_lexer.lpp Modified: trunk/myserver/src/protocol/ftp/ftp_lexer.lpp =================================================================== --- trunk/myserver/src/protocol/ftp/ftp_lexer.lpp 2008-09-13 16:31:29 UTC (rev 2808) +++ trunk/myserver/src/protocol/ftp/ftp_lexer.lpp 2008-09-13 17:51:10 UTC (rev 2809) @@ -1,14 +1,14 @@ %{ -#include "../include/ftp_common.h" +#include "../../../include/protocol/ftp/ftp_common.h" #include -#include "../include/ftp_parser.h" +#include "../../../include/protocol/ftp/ftp_parser.h" #include %} %option reentrant %option bison-bridge %option noyywrap -/* %option header-file= "../include/ftp_lexer.h" */ +/* %option header-file= "../../../include/protocol/ftp/ftp_lexer.h" */ %option case-insensitive %option bison-locations From MAILER-DAEMON Sat Sep 13 14:44:21 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kea6X-00013Y-0E for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 14:44:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kea6T-0000y7-KS for myserver-commit@gnu.org; Sat, 13 Sep 2008 14:44:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kea6S-0000vy-5h for myserver-commit@gnu.org; Sat, 13 Sep 2008 14:44:16 -0400 Received: from [199.232.76.173] (port=52966 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kea6R-0000vu-T8 for myserver-commit@gnu.org; Sat, 13 Sep 2008 14:44:15 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49740 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kea6R-0001YU-Kt for myserver-commit@gnu.org; Sat, 13 Sep 2008 14:44:15 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kea6Q-0002C5-QK for myserver-commit@gnu.org; Sat, 13 Sep 2008 18:44:14 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kea6Q-0002C1-Fs for myserver-commit@gnu.org; Sat, 13 Sep 2008 18:44:14 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 13 Sep 2008 18:44:14 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2810] Added tests for `src/base/files_cache/*.cpp' X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 18:44:17 -0000 Revision: 2810 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2810 Author: gscrivano Date: 2008-09-13 18:44:13 +0000 (Sat, 13 Sep 2008) Log Message: ----------- Added tests for `src/base/files_cache/*.cpp' Modified Paths: -------------- trunk/myserver/include/base/files_cache/cached_file.h trunk/myserver/include/base/files_cache/cached_file_buffer.h trunk/myserver/include/base/files_cache/cached_file_factory.h trunk/myserver/src/base/files_cache/cached_file.cpp trunk/myserver/src/base/files_cache/cached_file_buffer.cpp trunk/myserver/tests/Makefile.am Added Paths: ----------- trunk/myserver/tests/test_cached_file.cpp trunk/myserver/tests/test_cached_file_buffer.cpp trunk/myserver/tests/test_cached_file_factory.cpp Modified: trunk/myserver/include/base/files_cache/cached_file.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file.h 2008-09-13 17:51:10 UTC (rev 2809) +++ trunk/myserver/include/base/files_cache/cached_file.h 2008-09-13 18:44:13 UTC (rev 2810) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -28,9 +28,6 @@ class CachedFile : public File { -protected: - u_long fseek; - CachedFileBuffer* buffer; public: CachedFile(CachedFileBuffer* buffer); virtual FileHandle getHandle(); @@ -51,6 +48,8 @@ /*! Inherithed from Stream. */ virtual int write(const char* buffer, u_long len, u_long *nbw); - +protected: + u_long fseek; + CachedFileBuffer* buffer; }; #endif Modified: trunk/myserver/include/base/files_cache/cached_file_buffer.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file_buffer.h 2008-09-13 17:51:10 UTC (rev 2809) +++ trunk/myserver/include/base/files_cache/cached_file_buffer.h 2008-09-13 18:44:13 UTC (rev 2810) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2006, 2007 Free Software Foundation, Inc. +Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -31,22 +31,27 @@ class CachedFileBuffer { public: - void addRef(); - void decRef(); - void setFactoryToNotify(CachedFileFactory *cff); - u_long getReferenceCounter(); - u_long getFileSize(){return fileSize;} - CachedFileBuffer(const char* filename); - CachedFileBuffer(File* file); - ~CachedFileBuffer(); - const char* getFilename(){return filename.c_str();} - const char* getBuffer(){return buffer;} + void addRef(); + void decRef(); + u_long getReferenceCounter(); + + void setFactoryToNotify(CachedFileFactory *cff); + CachedFileFactory* getFactoryToNotify(){return factoryToNotify;} + + u_long getFileSize(){return fileSize;} + CachedFileBuffer(const char* filename); + CachedFileBuffer(File* file); + CachedFileBuffer(const char* buffer, u_long size); + ~CachedFileBuffer(); + + const char* getFilename(){return filename.c_str();} + const char* getBuffer(){return buffer;} protected: - Mutex mutex; - char *buffer; - u_long refCounter; - u_long fileSize; - CachedFileFactory *factoryToNotify; - string filename; + Mutex mutex; + char *buffer; + u_long refCounter; + u_long fileSize; + CachedFileFactory *factoryToNotify; + string filename; }; #endif Modified: trunk/myserver/include/base/files_cache/cached_file_factory.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-13 17:51:10 UTC (rev 2809) +++ trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-13 18:44:13 UTC (rev 2810) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2006, 2007 Free Software Foundation, Inc. +Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -33,65 +33,69 @@ class CachedFileFactory { public: - CachedFileFactory(); - ~CachedFileFactory(); - CachedFileFactory(u_long m); - void initialize(u_long size); - void clean(); - void setSize(u_long m){size = m;} - File *open(const char* file); - void nullReferences(CachedFileBuffer* cfb); + CachedFileFactory(); + ~CachedFileFactory(); + CachedFileFactory(u_long m); + void initialize(u_long size); + void clean(); + void setSize(u_long m){size = m;} + u_long getSize(){return size;} + u_long getUsedSize(){return usedSize;} + u_long getUsed(){return used;} - void setMaxSize(u_long maxSize); - void setMinSize(u_long minSize); - u_long getMaxSize(); - u_long getMinSize(); + File *open(const char* file); + void nullReferences(CachedFileBuffer* cfb); + + void setMaxSize(u_long maxSize); + void setMinSize(u_long minSize); + u_long getMaxSize(); + u_long getMinSize(); protected: - u_long purgeRecords(); + u_long purgeRecords(); - Mutex mutex; + Mutex mutex; - /*! Max elements count for this cache. */ - u_long size; + /*! Max elements count for this cache. */ + u_long size; - /*! Size currently used. */ - u_long usedSize; + /*! Size currently used. */ + u_long usedSize; - /*! Number of times the cache was used. */ - u_long used; + /*! Number of times the cache was used. */ + u_long used; - /*! Cache creation time. */ - u_long created; + /*! Cache creation time. */ + u_long created; - /*! Max size for single file. */ - u_long maxSize; + /*! Max size for single file. */ + u_long maxSize; - /*! Min size for single file. */ - u_long minSize; + /*! Min size for single file. */ + u_long minSize; - struct CachedFileFactoryRecord - { - CachedFileBuffer* buffer; - /*! Number of times the cache record was used. */ - u_long used; + struct CachedFileFactoryRecord + { + CachedFileBuffer* buffer; + /*! Number of times the cache record was used. */ + u_long used; - /*! Cache record creation time. */ - u_long created; + /*! Cache record creation time. */ + u_long created; - /*! Last mtime for this file. */ - time_t mtime; + /*! Last mtime for this file. */ + time_t mtime; - /*! Last time we checked for the mtime of the buffered file. */ - u_long lastModTimeCheck; + /*! Last time we checked for the mtime of the buffered file. */ + u_long lastModTimeCheck; - /*! This entry is not valid and will be removed when refCount = 0. */ - bool invalidCache; - }; + /*! This entry is not valid and will be removed when refCount = 0. */ + bool invalidCache; + }; - list buffersToRemove; - HashMap buffers; + list buffersToRemove; + HashMap buffers; }; #endif Modified: trunk/myserver/src/base/files_cache/cached_file.cpp =================================================================== --- trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-13 17:51:10 UTC (rev 2809) +++ trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-13 18:44:13 UTC (rev 2810) @@ -179,7 +179,7 @@ if(initialByte <= buffer->getFileSize()) fseek = initialByte; else - return 1; + return -1; return 0; } Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp =================================================================== --- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-13 17:51:10 UTC (rev 2809) +++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-13 18:44:13 UTC (rev 2810) @@ -117,6 +117,23 @@ } /*! + *Load a file in the buffer from a memory location. + *\param buffer The buffer to copy. + *\param size The memory buffer size. + */ +CachedFileBuffer::CachedFileBuffer(const char* buffer, u_long size) +{ + u_long nbr; + factoryToNotify = 0; + refCounter = 0; + + fileSize = size; + this->buffer = new char[size]; + + memcpy(this->buffer, buffer, size); +} + +/*! *Load a file in the buffer. *\param file The file object. */ Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-13 17:51:10 UTC (rev 2809) +++ trunk/myserver/tests/Makefile.am 2008-09-13 18:44:13 UTC (rev 2810) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp +tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Added: trunk/myserver/tests/test_cached_file.cpp =================================================================== --- trunk/myserver/tests/test_cached_file.cpp (rev 0) +++ trunk/myserver/tests/test_cached_file.cpp 2008-09-13 18:44:13 UTC (rev 2810) @@ -0,0 +1,111 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#include + +using namespace std; + +class TestCachedFile : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestCachedFile ); + + CPPUNIT_TEST(testFilePointer); + CPPUNIT_TEST(testGetHandle); + CPPUNIT_TEST(testOpenFile); + CPPUNIT_TEST(testCreateTemporaryFile); + CPPUNIT_TEST(testWrite); + CPPUNIT_TEST(testRead); + + CPPUNIT_TEST_SUITE_END(); + + CachedFileBuffer *cfb; + CachedFile *cf; + +public: + void setUp() + { + const char* buffer = "hello world!!!"; + + cfb = new CachedFileBuffer(buffer, strlen(buffer)); + + cf = new CachedFile(cfb); + } + + void tearDown() + { + delete cf; + delete cfb; + } + + + void testFilePointer() + { + CPPUNIT_ASSERT_EQUAL(cf->setFilePointer(3), 0); + CPPUNIT_ASSERT(cf->setFilePointer(100000)); + } + + + void testGetHandle() + { + CPPUNIT_ASSERT_EQUAL(cf->getHandle(), (FileHandle)-1); + } + + void testOpenFile() + { + string filename; + CPPUNIT_ASSERT(cf->openFile(NULL, 0)); + CPPUNIT_ASSERT(cf->openFile(filename, 0)); + } + + void testCreateTemporaryFile() + { + CPPUNIT_ASSERT(cf->createTemporaryFile(NULL)); + } + + void testWrite() + { + CPPUNIT_ASSERT(cf->writeToFile(NULL, 0, NULL)); + } + + void testRead() + { + u_long nbr = 0; + u_long size = cf->getFileSize(); + + CPPUNIT_ASSERT(size > 0); + + char *buffer =new char[size]; + + int ret = cf->readFromFile(buffer, size, &nbr); + + CPPUNIT_ASSERT_EQUAL(ret, 0); + CPPUNIT_ASSERT(nbr > 0); + + delete [] buffer; + } + + + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( TestCachedFile ); Added: trunk/myserver/tests/test_cached_file_buffer.cpp =================================================================== --- trunk/myserver/tests/test_cached_file_buffer.cpp (rev 0) +++ trunk/myserver/tests/test_cached_file_buffer.cpp 2008-09-13 18:44:13 UTC (rev 2810) @@ -0,0 +1,86 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#include + +using namespace std; + +class TestCachedFileBuffer : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestCachedFileBuffer ); + + CPPUNIT_TEST(testGetFileSize); + CPPUNIT_TEST(testFactoryToNotify); + CPPUNIT_TEST(testRefCounter); + CPPUNIT_TEST_SUITE_END(); + + CachedFileBuffer *cfb; +public: + void setUp() + { + const char* buffer = "hello world!!!"; + + cfb = new CachedFileBuffer(buffer, strlen(buffer)); + } + + void tearDown() + { + delete cfb; + } + + void testGetFileSize() + { + CPPUNIT_ASSERT(cfb->getFileSize()); + } + + + void testFactoryToNotify() + { + CachedFileFactory cff; + + cfb->setFactoryToNotify(&cff); + CPPUNIT_ASSERT_EQUAL(cfb->getFactoryToNotify(), &cff); + + cfb->setFactoryToNotify(NULL); + CPPUNIT_ASSERT_EQUAL(cfb->getFactoryToNotify(), (CachedFileFactory*)NULL); + } + + void testRefCounter() + { + for(u_long i = 1; i <= 20; i++) + { + cfb->addRef(); + CPPUNIT_ASSERT_EQUAL(cfb->getReferenceCounter(), i); + } + + for(u_long i = 1; i <= 20; i++) + { + cfb->decRef(); + CPPUNIT_ASSERT_EQUAL(cfb->getReferenceCounter(), 20 - i); + } + + } +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( TestCachedFileBuffer ); Added: trunk/myserver/tests/test_cached_file_factory.cpp =================================================================== --- trunk/myserver/tests/test_cached_file_factory.cpp (rev 0) +++ trunk/myserver/tests/test_cached_file_factory.cpp 2008-09-13 18:44:13 UTC (rev 2810) @@ -0,0 +1,93 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#include + +using namespace std; + +class TestCachedFileFactory : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestCachedFileFactory ); + + CPPUNIT_TEST(testInitialize); + CPPUNIT_TEST(testSize); + CPPUNIT_TEST(testMaxSize); + CPPUNIT_TEST(testMinSize); + + CPPUNIT_TEST_SUITE_END(); + CachedFileFactory *cff; + +public: + void setUp() + { + cff = new CachedFileFactory(); + } + + void tearDown() + { + delete cff; + } + + void testInitialize() + { + cff->initialize(20); + + CPPUNIT_ASSERT_EQUAL(cff->getSize(), 20ul); + CPPUNIT_ASSERT_EQUAL(cff->getUsed(), 0ul); + CPPUNIT_ASSERT_EQUAL(cff->getUsedSize(), 0ul); + CPPUNIT_ASSERT_EQUAL(cff->getMaxSize(), 0ul); + CPPUNIT_ASSERT_EQUAL(cff->getMinSize(), 0ul); + CPPUNIT_ASSERT_EQUAL(cff->getMaxSize(), 0ul); + } + + + void testSize() + { + for(u_long i = 0; i < 100; i += 10) + { + cff->setSize(i); + CPPUNIT_ASSERT_EQUAL(cff->getSize(), i); + } + } + + void testMaxSize() + { + for(u_long i = 0; i < 100; i += 10) + { + cff->setMaxSize(i); + CPPUNIT_ASSERT_EQUAL(cff->getMaxSize(), i); + } + } + + void testMinSize() + { + for(u_long i = 0; i < 100; i += 10) + { + cff->setMinSize(i); + CPPUNIT_ASSERT_EQUAL(cff->getMinSize(), i); + } + } +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( TestCachedFileFactory ); From MAILER-DAEMON Sat Sep 13 17:17:58 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KecVC-0005qm-BF for mharc-myserver-commit@gnu.org; Sat, 13 Sep 2008 17:17:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KecUN-0005bW-25 for myserver-commit@gnu.org; Sat, 13 Sep 2008 17:17:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KecUK-0005bA-Q4 for myserver-commit@gnu.org; Sat, 13 Sep 2008 17:17:05 -0400 Received: from [199.232.76.173] (port=40040 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KecUK-0005b7-KK for myserver-commit@gnu.org; Sat, 13 Sep 2008 17:17:04 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40431 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KecUK-0007S7-Q5 for myserver-commit@gnu.org; Sat, 13 Sep 2008 17:17:05 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KecUI-0006B9-KT for myserver-commit@gnu.org; Sat, 13 Sep 2008 21:17:02 +0000 Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KecUG-0006Ad-Tl for myserver-commit@gnu.org; Sat, 13 Sep 2008 21:17:01 +0000 MIME-Version: 1.0 Errors-To: dperrone To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniele Perrone Message-Id: Date: Sat, 13 Sep 2008 21:17:00 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 13 Sep 2008 17:17:57 -0400 Subject: [myserver-commit] [2811] corrected include path X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2008 21:17:07 -0000 Revision: 2811 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2811 Author: dperrone Date: 2008-09-13 21:16:59 +0000 (Sat, 13 Sep 2008) Log Message: ----------- corrected include path Modified Paths: -------------- trunk/plugins/generics/http_checker/http_checker.cpp trunk/plugins/generics/python_http_handler/python_http_handler.cpp trunk/plugins/generics/rules_checker/functions.cpp trunk/plugins/generics/rules_checker/rules_checker.cpp trunk/plugins/generics/rules_checker/string_alloc.cpp trunk/plugins/http_managers/php/php.cpp trunk/plugins/http_managers/php/php.h Modified: trunk/plugins/generics/http_checker/http_checker.cpp =================================================================== --- trunk/plugins/generics/http_checker/http_checker.cpp 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/generics/http_checker/http_checker.cpp 2008-09-13 21:16:59 UTC (rev 2811) @@ -16,10 +16,10 @@ */ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #ifdef WIN32 @@ -87,11 +87,11 @@ string value; if (!PyArg_ParseTuple(args, (char*)"s", &header)) return NULL; - + HttpThreadContext* context = getThreadContext(); - + context->request.getValue(header, &value); - + return Py_BuildValue((char*)"s", value.c_str()); } @@ -102,11 +102,11 @@ const char* ret; if (!PyArg_ParseTuple(args, (char*)"ss", &header, &value)) return NULL; - + HttpThreadContext* context = getThreadContext(); - + ret = context->request.setValue(header, value)->c_str(); - + return Py_BuildValue((char*)"s", ret); } @@ -120,11 +120,11 @@ if(data->ret) return NULL; - + data->td->http->raiseHTTPError(error); - + data->ret = 1; - + return Py_BuildValue((char*)"s", ""); } @@ -138,11 +138,11 @@ if(data->ret) return NULL; - + data->td->http->sendHTTPRedirect(dest); - + data->ret = 1; - + return Py_BuildValue((char*)"s", dest); } @@ -167,7 +167,7 @@ bool file; }; public: - + virtual int updateMulticast(MulticastRegistry* reg, string& msg, void* arg) { HttpThreadContext *td = (HttpThreadContext*)arg; @@ -297,7 +297,7 @@ observer.addRule(data, file); } - + } mutex.init(); Modified: trunk/plugins/generics/python_http_handler/python_http_handler.cpp =================================================================== --- trunk/plugins/generics/python_http_handler/python_http_handler.cpp 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/generics/python_http_handler/python_http_handler.cpp 2008-09-13 21:16:59 UTC (rev 2811) @@ -16,11 +16,11 @@ */ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -54,8 +54,8 @@ void setHttpThreadContext(HttpThreadContext* td){this->td = td;} void setRet(int r){ret = r;} - + virtual int send(HttpThreadContext*, ConnectionPtr s, const char* exec, const char* cmdLine, int execute, int onlyHeader) @@ -67,7 +67,7 @@ { return appendDataToHTTPChannel(td, buffer, size, 0, &chain, 0, useChunks); } - + void check() { checkDataChunks(td, &keepalive, &useChunks); @@ -131,11 +131,11 @@ string value; if (!PyArg_ParseTuple(args, (char*)"s", &header)) return NULL; - + HttpThreadContext* context = getThreadContext(); - + context->response.getValue(header, &value); - + return Py_BuildValue((char*)"s", value.c_str()); } @@ -145,11 +145,11 @@ string value; if (!PyArg_ParseTuple(args, (char*)"s", &header)) return NULL; - + HttpThreadContext* context = getThreadContext(); - + context->request.getValue(header, &value); - + return Py_BuildValue((char*)"s", value.c_str()); } @@ -159,13 +159,13 @@ if (!PyArg_ParseTuple(args, (char*)"s", &msg)) return NULL; - + serverInstance->logLockAccess(); serverInstance->logPreparePrintError(); serverInstance->logWriteln(msg); serverInstance->logEndPrintError(); serverInstance->logUnlockAccess(); - + return NULL; } @@ -176,9 +176,9 @@ const char* ret; if (!PyArg_ParseTuple(args, (char*)"ss", &header, &value)) return NULL; - + HttpThreadContext* context = getThreadContext(); - + string *retS = context->response.setValue(header, value); if(retS) @@ -196,9 +196,9 @@ const char* ret; if (!PyArg_ParseTuple(args, (char*)"ss", &header, &value)) return NULL; - + HttpThreadContext* context = getThreadContext(); - + string *retS = context->request.setValue(header, value); if(retS) @@ -216,18 +216,18 @@ tdata->check(); - HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), + HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), &(td->response)); - if(td->connection->socket->send(td->buffer->getBuffer(), - (u_long)strlen(td->buffer->getBuffer()), 0) + if(td->connection->socket->send(td->buffer->getBuffer(), + (u_long)strlen(td->buffer->getBuffer()), 0) == SOCKET_ERROR) { return Py_BuildValue((char*)"i", 1); - } + } tdata->setRet(1); - + return Py_BuildValue((char*)"i", 0); } @@ -257,7 +257,7 @@ return Py_BuildValue((char*)"i", 0); tdata->setRet(1); - + return Py_BuildValue((char*)"i", size); } @@ -280,11 +280,11 @@ if(data->getRet()) return NULL; - + data->getHttpThreadContext()->http->raiseHTTPError(error); - + data->setRet(1); - + return Py_BuildValue((char*)"s", ""); } @@ -308,11 +308,11 @@ if(data->getRet()) return NULL; - + data->getHttpThreadContext()->http->sendHTTPRedirect(dest); - + data->setRet(1); - + return Py_BuildValue((char*)"s", dest); } @@ -345,7 +345,7 @@ bool file; }; public: - + virtual int updateMulticast(MulticastRegistry* reg, string& msg, void* arg) { HttpThreadContext *td = (HttpThreadContext*)arg; @@ -476,7 +476,7 @@ observer.addRule(data, file); } - + } mutex.init(); Modified: trunk/plugins/generics/rules_checker/functions.cpp =================================================================== --- trunk/plugins/generics/rules_checker/functions.cpp 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/generics/rules_checker/functions.cpp 2008-09-13 21:16:59 UTC (rev 2811) @@ -1,8 +1,8 @@ using namespace std; #include "heading.h" -#include -#include +#include +#include string* call_function(void* context, string* func) { Modified: trunk/plugins/generics/rules_checker/rules_checker.cpp =================================================================== --- trunk/plugins/generics/rules_checker/rules_checker.cpp 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/generics/rules_checker/rules_checker.cpp 2008-09-13 21:16:59 UTC (rev 2811) @@ -17,7 +17,7 @@ #include #include -#include +#include #include "heading.h" #ifdef WIN32 @@ -56,7 +56,7 @@ return 1; } - + } free_strings(&context); return 0; @@ -71,12 +71,12 @@ if(pos == string::npos) return; //TODO: error. - + it.condition.assign(ruleStr.substr(0, pos)); it.event.assign(ruleStr.substr(pos+2, string::npos)); rules.push_back(it); } - + private: list rules; }; @@ -108,22 +108,22 @@ serverInstance->logUnlockAccess(); return -1; } - - + + staticData->addMulticast(msg, &observer); - + configuration = serverInstance->getConfiguration(); xmlDoc = configuration->getDoc(); - + for(xmlNodePtr ptr = xmlDoc->children->next->children; ptr; ptr = ptr->next) { char* data; if(!xmlStrcmp(ptr->name, (const xmlChar *)"RULES_CHECKER_RULE")) { - + if(ptr->children && ptr->children->next && ptr->children->next->content) data = (char*)ptr->children->next->content; - + if(!data) { serverInstance->logLockAccess(); @@ -133,10 +133,10 @@ serverInstance->logUnlockAccess(); return -1; } - + observer.addRule(data); } - + } return 0; Modified: trunk/plugins/generics/rules_checker/string_alloc.cpp =================================================================== --- trunk/plugins/generics/rules_checker/string_alloc.cpp 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/generics/rules_checker/string_alloc.cpp 2008-09-13 21:16:59 UTC (rev 2811) @@ -17,7 +17,7 @@ #include "heading.h" #include -#include +#include static list strings; @@ -37,7 +37,7 @@ void free_strings(ThreadContext* context) { - + list::iterator it = context->strings.begin(); while(it != context->strings.end()) { Modified: trunk/plugins/http_managers/php/php.cpp =================================================================== --- trunk/plugins/http_managers/php/php.cpp 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/http_managers/php/php.cpp 2008-09-13 21:16:59 UTC (rev 2811) @@ -15,13 +15,12 @@ along with this program. If not, see . */ #include "php.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include
#include
@@ -66,7 +65,7 @@ int modifyHeader(HttpResponseHeader *response, char* name, char* value) { string* val = response->getValue(name, NULL); - + if(val) val->assign(value); else @@ -100,12 +99,12 @@ &data->td->response); - + location = data->td->response.getValue("Location", 0); /* - *If it is present Location: xxx in the header - *send a redirect to xxx. + *If it is present Location: xxx in the header + *send a redirect to xxx. */ if(location && location->length()) { @@ -120,7 +119,7 @@ - + } int myphp_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) @@ -140,7 +139,7 @@ modifyHeader(&(data->td->response), sapi_header->header, valInit); - sapi_header->header[sep] = ':'; + sapi_header->header[sep] = ':'; return 0; } @@ -155,7 +154,7 @@ nbr = 0; return nbr; - + } int myphp_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) @@ -183,8 +182,8 @@ } -int myphp_ub_write(const char *str, unsigned int str_length TSRMLS_DC) -{ +int myphp_ub_write(const char *str, unsigned int str_length TSRMLS_DC) +{ PhpData* data = getPhpData(); if(!data->headerSent) @@ -197,9 +196,9 @@ return HttpDataHandler::appendDataToHTTPChannel(data->td, (char*)str, (u_long)str_length, - &(data->td->outputData), + &(data->td->outputData), &(data->chain), - (bool)data->td->appendOutputs, + (bool)data->td->appendOutputs, data->useChunks); @@ -251,8 +250,8 @@ } int myphp_startup(struct _sapi_module_struct *sapi_module) -{ - if(php_module_startup(sapi_module, entries, loadedEntries) == FAILURE) +{ + if(php_module_startup(sapi_module, entries, loadedEntries) == FAILURE) { return FAILURE; } @@ -260,7 +259,7 @@ return 0; } -static sapi_module_struct myphp_module = +static sapi_module_struct myphp_module = { "myphp", "MyServer PHP Module", @@ -274,20 +273,20 @@ myphp_flush, /* flush */ NULL, //myphp_get_stat, /* get uid */ NULL, //myphp_getenv, /* getenv */ - + php_error, /* error handler */ - + myphp_header_handler, /* header handler */ myphp_send_headers, /* send headers handler */ NULL, /* send header handler */ - + myphp_read_post, /* read POST data */ myphp_read_cookies, /* read Cookies */ - + myphp_register_variables, myphp_log_message, /* Log message */ NULL,//myphp_sapi_get_request_time, /* Request Time */ - + STANDARD_SAPI_MODULE_PROPERTIES }; @@ -305,7 +304,7 @@ singleRequest = 1; else singleRequest = 0; - + loadedEntries = 0; if(singleRequest) @@ -348,7 +347,7 @@ if(singleRequest) requestMutex.destroy(); - + #ifdef ZTS tsrm_shutdown(); #endif @@ -385,7 +384,7 @@ if(!req->ver.compare("HTTP/1.1") || !req->ver.compare("HTTPS/1.1")) SG(request_info).proto_num = 1001; - else + else SG(request_info).proto_num = 1000; SG(server_context) = data = new PhpData(); @@ -423,7 +422,7 @@ name = "html_errors"; zend_alter_ini_entry(name, strlen(name), "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - } + } SG(request_info).post_data_length = SG(request_info).content_length; @@ -432,23 +431,23 @@ script.opened_path = NULL; script.free_filename = 0; - zend_first_try + zend_first_try { - if (php_request_startup(TSRMLS_C) == FAILURE) + if (php_request_startup(TSRMLS_C) == FAILURE) { return FAILURE; } php_execute_script(&script TSRMLS_CC); - + if(data->useChunks) HttpDataHandler::appendDataToHTTPChannel(data->td, 0, 0, - &(data->td->outputData), + &(data->td->outputData), &(data->chain), - (bool)data->td->appendOutputs, + (bool)data->td->appendOutputs, data->useChunks); php_request_shutdown(NULL); Modified: trunk/plugins/http_managers/php/php.h =================================================================== --- trunk/plugins/http_managers/php/php.h 2008-09-13 18:44:13 UTC (rev 2810) +++ trunk/plugins/http_managers/php/php.h 2008-09-13 21:16:59 UTC (rev 2811) @@ -17,14 +17,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef WIN32 #define EXPORTABLE(x) x _declspec(dllexport); From MAILER-DAEMON Sun Sep 14 11:55:24 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ketwa-0001MG-8B for mharc-myserver-commit@gnu.org; Sun, 14 Sep 2008 11:55:24 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KetwX-0001JG-Vt for myserver-commit@gnu.org; Sun, 14 Sep 2008 11:55:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KetwV-0001En-LJ for myserver-commit@gnu.org; Sun, 14 Sep 2008 11:55:21 -0400 Received: from [199.232.76.173] (port=37602 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KetwV-0001EV-Gt for myserver-commit@gnu.org; Sun, 14 Sep 2008 11:55:19 -0400 Received: from savannah.gnu.org ([199.232.41.3]:52216 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KetwU-0005km-QT for myserver-commit@gnu.org; Sun, 14 Sep 2008 11:55:19 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KetwU-0004bZ-AF for myserver-commit@gnu.org; Sun, 14 Sep 2008 15:55:18 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KetwT-0004bV-Tg for myserver-commit@gnu.org; Sun, 14 Sep 2008 15:55:18 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 14 Sep 2008 15:55:17 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2812] Removed dependencies from the Server singleton instance. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 15:55:22 -0000 Revision: 2812 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2812 Author: gscrivano Date: 2008-09-14 15:55:15 +0000 (Sun, 14 Sep 2008) Log Message: ----------- Removed dependencies from the Server singleton instance. Modified Paths: -------------- trunk/myserver/include/connections_scheduler/connections_scheduler.h trunk/myserver/include/connections_scheduler/listen_threads.h trunk/myserver/src/connections_scheduler/connections_scheduler.cpp trunk/myserver/src/connections_scheduler/listen_threads.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/connections_scheduler/connections_scheduler.h =================================================================== --- trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-13 21:16:59 UTC (rev 2811) +++ trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-14 15:55:15 UTC (rev 2812) @@ -36,6 +36,9 @@ #define PRIORITY_CLASSES 3 + +class Server; + class ConnectionsSchedulerVisitor { public: @@ -53,10 +56,11 @@ bool *terminate; Mutex* eventsMutex; ConnectionsScheduler *scheduler; - void reset(Socket* sock, u_short p){serverSocket = sock; port = p;} - ListenerArg(Socket* sock, u_short p){reset(sock, p);} - ListenerArg(){reset(0, 0);} - ListenerArg(ListenerArg* l){serverSocket = l->serverSocket; port = l->port;} + Server* server; + void reset(Socket* sock, u_short p, Server* ser){serverSocket = sock; port = p; server = ser;} + ListenerArg(Socket* sock, u_short p, Server* server){reset(sock, p, server);} + ListenerArg(){reset(NULL, NULL, NULL);} + ListenerArg(ListenerArg* l){serverSocket = l->serverSocket; port = l->port; server = l->server;} }; struct DispatcherArg @@ -66,9 +70,11 @@ Mutex* mutex; int fd[2]; event loopEvent; + Server* server; + ConnectionsScheduler* scheduler; }; - ConnectionsScheduler(); + ConnectionsScheduler(Server* server = NULL); ~ConnectionsScheduler(); void addNewReadyConnection(ConnectionPtr); @@ -83,7 +89,7 @@ void initialize(); void listener(struct ListenerArg* ); void removeListener(struct ListenerArg*); - int getConnectionsNumber(); + u_long getConnectionsNumber(); void removeConnection(ConnectionPtr connection); void terminateConnections(); void getConnections(list &out); @@ -94,7 +100,10 @@ u_long getNumTotalConnections(); + void newData(short event, SocketHandle handle); + private: + Server* server; void addWaitingConnectionImpl(ConnectionPtr, int lock); void addReadyConnectionImpl(ConnectionPtr); u_long nTotalConnections; Modified: trunk/myserver/include/connections_scheduler/listen_threads.h =================================================================== --- trunk/myserver/include/connections_scheduler/listen_threads.h 2008-09-13 21:16:59 UTC (rev 2811) +++ trunk/myserver/include/connections_scheduler/listen_threads.h 2008-09-14 15:55:15 UTC (rev 2812) @@ -16,6 +16,7 @@ */ #ifndef LISTEN_THREADS_H #define LISTEN_THREADS_H + #include "stdafx.h" #include #include @@ -35,7 +36,8 @@ void commitFastReboot(); void beginFastReboot(); void rollbackFastReboot(); - ListenThreads(); + ListenThreads(ConnectionsScheduler*, Server*); + private: struct SocketInformation { @@ -56,6 +58,9 @@ XmlParser *languageParser; int createServerAndListener(u_short port); void registerListener(SocketInformation*); + + Server* server; + ConnectionsScheduler* scheduler; }; #endif Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-13 21:16:59 UTC (rev 2811) +++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-14 15:55:15 UTC (rev 2812) @@ -114,6 +114,9 @@ { ConnectionsScheduler::DispatcherArg *da = (ConnectionsScheduler::DispatcherArg*)p; + if(da == NULL) + return NULL; + da->mutex->lock(); if(!da->terminated) { @@ -143,24 +146,35 @@ da->terminated = true; da->mutex->unlock(); - return 0; + return NULL; } static void newDataHandler(int fd, short event, void *arg) { - ConnectionPtr connection = static_cast(arg); + ConnectionsScheduler* scheduler = (ConnectionsScheduler*) arg; + if(scheduler) + scheduler->newData(event, (SocketHandle)fd); +} + + +void ConnectionsScheduler::newData(short event, SocketHandle handle) +{ + ConnectionPtr connection = connections.get(handle); + + if(connection == NULL || server == NULL) + return; + if(event == EV_TIMEOUT) { - Server::getInstance()->deleteConnection(connection, 0); + server->deleteConnection(connection, 0); } else if(event == EV_READ) { - Server::getInstance()->getConnectionsScheduler()->addReadyConnection(connection); + server->getConnectionsScheduler()->addReadyConnection(connection); } } - static void eventLoopHandler(int fd, short event, void *arg) { ConnectionsScheduler::DispatcherArg *da = (ConnectionsScheduler::DispatcherArg*)arg; @@ -190,7 +204,7 @@ sock.recv((char*)&c, sizeof(ConnectionPtr), 0); sock.recv((char*)&tv, sizeof(timeval), 0); - event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, c, &tv); + event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, da->scheduler, &tv); } /* Handle other cmd without do anything else. */ } @@ -216,10 +230,12 @@ asockInLen = sizeof(sockaddr_in); asock = s->serverSocket->accept(&asockIn, &asockInLen); - if(asock.getHandle() != 0 && + + if(s->server && + asock.getHandle() != 0 && asock.getHandle() != (SocketHandle)INVALID_SOCKET) { - Server::getInstance()->addConnection(asock, &asockIn); + s->server->addConnection(asock, &asockIn); } event_add (&(s->ev), &tv); @@ -243,6 +259,7 @@ arg->terminate = &dispatcherArg.terminate; arg->scheduler = this; + arg->server = server; arg->eventsMutex = &eventsMutex; la->serverSocket->setNonBlocking(1); @@ -272,7 +289,7 @@ /*! *C'tor. */ -ConnectionsScheduler::ConnectionsScheduler() +ConnectionsScheduler::ConnectionsScheduler(Server* server) { readyMutex.init(); eventsMutex.init(); @@ -283,6 +300,7 @@ currentPriorityDone = 0; nTotalConnections = 0; ready = new queue[PRIORITY_CLASSES]; + this->server = server; } /*! @@ -334,6 +352,8 @@ dispatcherArg.terminated = true; dispatcherArg.mutex = &eventsMutex; + dispatcherArg.server = server; + dispatcherArg.scheduler = this; #ifdef WIN32 #define LOCAL_SOCKETPAIR_AF AF_INET @@ -344,11 +364,14 @@ dispatcherArg.fd); if (err == -1) { - Server::getInstance()->logLockAccess(); - Server::getInstance()->logPreparePrintError(); - Server::getInstance()->logWriteln("Error initializing socket pair."); - Server::getInstance()->logEndPrintError(); - Server::getInstance()->logUnlockAccess(); + if(server) + { + server->logLockAccess(); + server->logPreparePrintError(); + server->logWriteln("Error initializing socket pair."); + server->logEndPrintError(); + server->logUnlockAccess(); + } return; } @@ -361,15 +384,18 @@ event_add(&(dispatcherArg.loopEvent), NULL); if(Thread::create(&dispatchedThreadId, dispatcher, &dispatcherArg)) - { - Server::getInstance()->logLockAccess(); - Server::getInstance()->logPreparePrintError(); - Server::getInstance()->logWriteln("Error initializing dispatcher thread."); - Server::getInstance()->logEndPrintError(); - Server::getInstance()->logUnlockAccess(); - dispatchedThreadId = 0; - } - + { + if(server) + { + server->logLockAccess(); + server->logPreparePrintError(); + server->logWriteln("Error initializing dispatcher thread."); + server->logEndPrintError(); + server->logUnlockAccess(); + } + dispatchedThreadId = 0; + } + releasing = false; } @@ -423,7 +449,8 @@ ready[priority].push(c); readyMutex.unlock(); - Server::getInstance()->checkThreadsNumber(); + if(server) + server->checkThreadsNumber(); readySemaphore->unlock(); } @@ -450,9 +477,13 @@ void ConnectionsScheduler::addWaitingConnectionImpl(ConnectionPtr c, int lock) { static timeval tv = {10, 0}; - SocketHandle handle = c->socket->getHandle(); + SocketHandle handle = c->socket ? c->socket->getHandle() : NULL; - tv.tv_sec = Server::getInstance()->getTimeout() / 1000; + if(server) + tv.tv_sec = server->getTimeout() / 1000; + else + tv.tv_sec = 30000; + c->setScheduled(0); connectionsMutex.lock(); @@ -479,7 +510,7 @@ } else { - event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, c, &tv); + event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, this, &tv); } } @@ -531,10 +562,14 @@ */ void ConnectionsScheduler::release() { + u_long max = 100; releasing = true; dispatcherArg.terminate = true; - for(u_long i = 0; i < Server::getInstance()->getNumThreads()*10; i++) + if(server) + max = server->getNumThreads() * 10; + + for(u_long i = 0; i < max; i++) { readySemaphore->unlock(); } @@ -597,7 +632,7 @@ /*! *Get the alive connections number. */ -int ConnectionsScheduler::getConnectionsNumber() +u_long ConnectionsScheduler::getConnectionsNumber() { return connections.size(); } @@ -608,7 +643,8 @@ void ConnectionsScheduler::removeConnection(ConnectionPtr connection) { connectionsMutex.lock(); - connections.remove(connection->socket->getHandle()); + if(connection->socket) + connections.remove(connection->socket->getHandle()); connectionsMutex.unlock(); } Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-13 21:16:59 UTC (rev 2811) +++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-14 15:55:15 UTC (rev 2812) @@ -49,12 +49,14 @@ using namespace std; /*! - *Default c'tor. + *c'tor. */ -ListenThreads::ListenThreads() +ListenThreads::ListenThreads(ConnectionsScheduler* scheduler, Server* server) { fastRebooting = false; committingFastReboot = false; + this->scheduler = scheduler; + this->server = server; } /*! @@ -66,7 +68,6 @@ int optvalReuseAddr = 1; ostringstream portBuff; string listenPortMsg; - Server* server = Server::getInstance(); if(fastRebooting) { @@ -302,14 +303,14 @@ if(si->ipv4) { - si->laIpv4.reset(si->ipv4, si->port); - Server::getInstance()->getConnectionsScheduler()->listener(&(si->laIpv4)); + si->laIpv4.reset(si->ipv4, si->port, server); + scheduler->listener(&(si->laIpv4)); } if(si->ipv6) { - si->laIpv6.reset(si->ipv6, si->port); - Server::getInstance()->getConnectionsScheduler()->listener(&(si->laIpv6)); + si->laIpv6.reset(si->ipv6, si->port, server); + scheduler->listener(&(si->laIpv6)); } } Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-13 21:16:59 UTC (rev 2811) +++ trunk/myserver/src/server/server.cpp 2008-09-14 15:55:15 UTC (rev 2812) @@ -75,7 +75,8 @@ */ Server* Server::instance = 0; -Server::Server() +Server::Server() : connectionsScheduler(this), + listenThreads(&connectionsScheduler, this) { toReboot = 0; autoRebootEnabled = 1; From MAILER-DAEMON Sun Sep 14 14:19:23 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KewBv-0006fk-Oy for mharc-myserver-commit@gnu.org; Sun, 14 Sep 2008 14:19:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KewBu-0006ff-Gy for myserver-commit@gnu.org; Sun, 14 Sep 2008 14:19:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KewBt-0006fS-KT for myserver-commit@gnu.org; Sun, 14 Sep 2008 14:19:21 -0400 Received: from [199.232.76.173] (port=44902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KewBt-0006fP-Ea for myserver-commit@gnu.org; Sun, 14 Sep 2008 14:19:21 -0400 Received: from savannah.gnu.org ([199.232.41.3]:38483 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KewBt-0005lv-24 for myserver-commit@gnu.org; Sun, 14 Sep 2008 14:19:21 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KewBs-0000eG-Gh for myserver-commit@gnu.org; Sun, 14 Sep 2008 18:19:20 +0000 Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KewBs-0000eC-2K for myserver-commit@gnu.org; Sun, 14 Sep 2008 18:19:20 +0000 MIME-Version: 1.0 Errors-To: dperrone To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniele Perrone Message-Id: Date: Sun, 14 Sep 2008 18:19:20 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2813] refactoring copying files in server X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 18:19:22 -0000 Revision: 2813 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2813 Author: dperrone Date: 2008-09-14 18:19:19 +0000 (Sun, 14 Sep 2008) Log Message: ----------- refactoring copying files in server Modified Paths: -------------- trunk/myserver/include/base/file/files_utility.h trunk/myserver/src/base/file/files_utility.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/base/file/files_utility.h =================================================================== --- trunk/myserver/include/base/file/files_utility.h 2008-09-14 15:55:15 UTC (rev 2812) +++ trunk/myserver/include/base/file/files_utility.h 2008-09-14 18:19:19 UTC (rev 2813) @@ -25,11 +25,11 @@ using namespace std; -class FilesUtility +class FilesUtility { FileHandle handle; string filename; - + private: /*! Don't allow instances for this class. */ FilesUtility(); @@ -73,11 +73,12 @@ static int deleteFile(string const &file) {return deleteFile(file.c_str());} - static int renameFile(const char*, const char*); + static int renameFile(const char*, const char*); static int renameFile(string const &before, string const &after) {return renameFile(before.c_str(), after.c_str());} static int copyFile(const char*, const char*, int overwrite); + static int copyFile(File, File); static int copyFile(string const &src, string const &dest, int overwrite) {return copyFile(src.c_str(), dest.c_str(), overwrite);} Modified: trunk/myserver/src/base/file/files_utility.cpp =================================================================== --- trunk/myserver/src/base/file/files_utility.cpp 2008-09-14 15:55:15 UTC (rev 2812) +++ trunk/myserver/src/base/file/files_utility.cpp 2008-09-14 18:19:19 UTC (rev 2813) @@ -81,7 +81,7 @@ lpath++; continue; } - + if(*lpath=='.') { lpath++; @@ -170,7 +170,7 @@ destFile = open(dest, O_WRONLY); else destFile = open(dest, O_WRONLY | O_CREAT); - + if(destFile == -1) { close(srcFile); @@ -193,7 +193,7 @@ close(srcFile); close(destFile); return -1; - } + } }while(dim); @@ -204,7 +204,34 @@ #endif } +/*! + *Copy the file from [SRC] to [DEST]. Returns 0 on success. + *\param src The source File. + *\param dest The destination File. + *\param overwrite Overwrite the dest file if already exists? + */ +int FilesUtility::copyFile(File src, File dest) +{ + char buffer[512]; + u_long nbr, nbw; + int ret; + + for (;;) { + ret = src.readFromFile(buffer, 512, &nbr); + if (ret) + return -1; + + if (!nbr) + break; + + ret = dest.writeToFile(buffer, nbr, &nbw); + if (ret) + return -1; + } + return 0; +} + /*! *Delete an existing file passing the path. *Return a non-null value on errors. @@ -264,7 +291,7 @@ return (S_ISLNK(F_Stats.st_mode))? 1 : 0; #endif - + } /*! @@ -278,9 +305,9 @@ OFSTRUCT of; int ret = OpenFile(filename, &of, OF_EXIST); return (ret != HFILE_ERROR)?1:0;*/ - HANDLE hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, + HANDLE hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); int nRet = hFile != INVALID_HANDLE_VALUE ? 1 : 0; CloseHandle(hFile); @@ -373,7 +400,7 @@ { #ifdef NOT_WIN return ::chown(filename, uid, gid) ? 1 : 0; -#endif +#endif return 0; } @@ -575,7 +602,7 @@ { ext.assign(""); } - + } /*! @@ -595,7 +622,7 @@ #endif #ifdef NOT_WIN strncpy(out, filePath, buffersize); - return 0; + return 0; #endif } Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-14 15:55:15 UTC (rev 2812) +++ trunk/myserver/src/server/server.cpp 2008-09-14 18:19:19 UTC (rev 2813) @@ -35,7 +35,7 @@ #include #include -extern "C" +extern "C" { #ifdef WIN32 //#include @@ -75,7 +75,7 @@ */ Server* Server::instance = 0; -Server::Server() : connectionsScheduler(this), +Server::Server() : connectionsScheduler(this), listenThreads(&connectionsScheduler, this) { toReboot = 0; @@ -112,7 +112,7 @@ setcwdBuffer(); XmlParser::startXML(); myserver_safetime_init(); - + /* Startup the socket library. */ logWriteln(languageParser.getValue("MSG_ISOCK") ); @@ -259,7 +259,7 @@ /* Load the home directories configuration. */ homeDir.load(); - + loadPlugins(); /* Load the virtual hosts configuration from the xml file. */ @@ -304,7 +304,7 @@ if(logManager.getType() == LogManager::TYPE_CONSOLE) logWriteln(languageParser.getValue("MSG_BREAK")); - + serverReady = 1; /* Finally we can give control to the main loop. */ @@ -350,7 +350,7 @@ new FtpProtocol(), new ControlProtocol(), 0}; - + for (int j = 0; protocolsSet[j]; j++) { char protocolName[32]; @@ -359,13 +359,13 @@ protocol->registerName(protocolName, 32); getProtocolsManager()->addProtocol(protocolName, protocol); } - + getPluginsManager()->addNamespace(&executors); getPluginsManager()->addNamespace(&protocols); getPluginsManager()->addNamespace(&filters); getPluginsManager()->addNamespace(&genericPluginsManager); - + getPluginsManager()->preLoad(this, &languageParser, *externalPath); getPluginsManager()->load(this, &languageParser, *externalPath); getPluginsManager()->postLoad(this, &languageParser); @@ -383,13 +383,13 @@ u_long configsCheck = 0; u_long purgeThreadsCounter = 0; - mainConfTime = + mainConfTime = FilesUtility::getLastModTime(mainConfigurationFile->c_str()); - hostsConfTime = + hostsConfTime = FilesUtility::getLastModTime(vhostConfigurationFile->c_str()); - mimeConfTime = + mimeConfTime = FilesUtility::getLastModTime(mimeConfigurationFile->c_str()); - + /* *Keep thread alive. *When the endServer flag is set to True exit @@ -427,7 +427,7 @@ { string msg("main-conf-changed"); notifyMulticast(msg, 0); - + reboot(); /* Store new mtime values. */ mainConfTime = mainConfTimeNow; @@ -437,7 +437,7 @@ { string msg("mime-conf-changed"); notifyMulticast(msg, 0); - + if(logManager.getType() == LogManager::TYPE_CONSOLE) { char beep[]={static_cast(0x7), '\0'}; @@ -447,9 +447,9 @@ logWriteln("Reloading MIMEtypes.xml"); getMimeManager()->loadXML(getMIMEConfFile()); - + logWriteln("Reloaded"); - + mimeConfTime = mimeConfNow; } else if(hostsConfTimeNow != hostsConfTime) @@ -464,31 +464,31 @@ char beep[]={static_cast(0x7), '\0'}; logManager.write(beep); } - + logWriteln("Rebooting..."); - + connectionsScheduler.release(); Socket::stopBlockingOperations(true); - + listenThreads.beginFastReboot(); listenThreads.terminate(); - + connectionsScheduler.terminateConnections(); clearAllConnections(); - + Socket::stopBlockingOperations(false); connectionsScheduler.restart(); listenThreads.initialize(&languageParser); - + vhostList = new VhostManager(&listenThreads); - + if(vhostList == 0) continue; - + delete oldvhost; /* Load the virtual hosts configuration from the xml file. */ @@ -501,7 +501,7 @@ { listenThreads.commitFastReboot(); } - + hostsConfTime = hostsConfTimeNow; logWriteln("Reloaded"); } @@ -918,7 +918,7 @@ { languageFile->assign("languages/english.xml"); } - + if(languageParser.open(languageFile->c_str())) { string err; @@ -1059,7 +1059,7 @@ { int serversProcessesInitialPort = atoi(data); getProcessServerManager()->setInitialPort(serversProcessesInitialPort); - } + } { xmlNodePtr node = @@ -1146,7 +1146,7 @@ /* *We can use MAX_IP_STRING_LEN only because we use NI_NUMERICHOST *in getnameinfo call; Otherwise we should have used NI_MAXHOST. - *ip is the string containing the address of the remote host connecting + *ip is the string containing the address of the remote host connecting *to the server. *localIp is the local address used by the connection. *port is the remote port used by the client to open the connection. @@ -1163,21 +1163,21 @@ return 0; /* - *Do not accept this connection if a MAX_CONNECTIONS_TO_ACCEPT limit is + *Do not accept this connection if a MAX_CONNECTIONS_TO_ACCEPT limit is *defined. */ - if(maxConnectionsToAccept && + if(maxConnectionsToAccept && ((u_long)connectionsScheduler.getConnectionsNumber() >= maxConnectionsToAccept)) return 0; #if ( HAVE_IPV6 ) if ( asockIn->ss_family == AF_INET ) - ret = getnameinfo(reinterpret_cast(asockIn), + ret = getnameinfo(reinterpret_cast(asockIn), sizeof(sockaddr_in), ip, MAX_IP_STRING_LEN, NULL, 0, NI_NUMERICHOST); else - ret = getnameinfo(reinterpret_cast(asockIn), - sizeof(sockaddr_in6), ip, MAX_IP_STRING_LEN, + ret = getnameinfo(reinterpret_cast(asockIn), + sizeof(sockaddr_in6), ip, MAX_IP_STRING_LEN, NULL, 0, NI_NUMERICHOST); if(ret) return 0; @@ -1189,19 +1189,19 @@ s.getsockname((MYSERVER_SOCKADDR*)&localSockIn, &dim); if ( asockIn->ss_family == AF_INET ) - ret = getnameinfo(reinterpret_cast(&localSockIn), - sizeof(sockaddr_in), localIp, MAX_IP_STRING_LEN, + ret = getnameinfo(reinterpret_cast(&localSockIn), + sizeof(sockaddr_in), localIp, MAX_IP_STRING_LEN, NULL, 0, NI_NUMERICHOST); else// AF_INET6 - ret = getnameinfo(reinterpret_cast(&localSockIn), - sizeof(sockaddr_in6), localIp, MAX_IP_STRING_LEN, + ret = getnameinfo(reinterpret_cast(&localSockIn), + sizeof(sockaddr_in6), localIp, MAX_IP_STRING_LEN, NULL, 0, NI_NUMERICHOST); if(ret) return 0; #else// !HAVE_IPV6 dim = sizeof(localSockIn); s.getsockname((MYSERVER_SOCKADDR*)&localSockIn, &dim); - strncpy(ip, inet_ntoa(((sockaddr_in *)asockIn)->sin_addr), + strncpy(ip, inet_ntoa(((sockaddr_in *)asockIn)->sin_addr), MAX_IP_STRING_LEN); strncpy(localIp, inet_ntoa(((sockaddr_in *)&localSockIn)->sin_addr), MAX_IP_STRING_LEN); @@ -1252,7 +1252,7 @@ ConnectionPtr Server::addConnectionToList(Socket* s, MYSERVER_SOCKADDRIN* /*asockIn*/, char *ipAddr, char *localIpAddr, - u_short port, u_short localPort, + u_short port, u_short localPort, int /*id*/) { int doSSLhandshake = 0; @@ -1284,22 +1284,22 @@ } protocol = Server::getInstance()->getProtocol(newConnection->host->getProtocolName()); - + if(protocol) opts = protocol->getProtocolOptions(); - + if(opts & PROTOCOL_USES_SSL) doSSLhandshake = 1; - + if(opts & PROTOCOL_FAST_CHECK) doFastCheck = 1; - + { string msg("new-connection"); - + handlers = getHandlers(msg); - + if(handlers) { for(size_t i = 0; i < handlers->size(); i++) @@ -1349,7 +1349,7 @@ *is bigger than it say to the protocol that will parse the connection *to remove it from the active connections list. */ - if(maxConnections && + if(maxConnections && ((u_long)connectionsScheduler.getConnectionsNumber() > maxConnections)) newConnection->setToRemove(CONNECTION_REMOVE_OVERLOAD); @@ -1474,7 +1474,7 @@ u_long ret; threadsMutex->lock(); ret = threads.size(); - threadsMutex->unlock(); + threadsMutex->unlock(); return ret; } @@ -1582,7 +1582,7 @@ File inputF; File outputF; ret = inputF.openFile("myserver.xml.default", - File::MYSERVER_OPEN_READ | + File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_IFEXISTS); if(ret) { @@ -1601,19 +1601,8 @@ return -1; } - for(;;) - { - ret = inputF.readFromFile(buffer, 512, &nbr ); - if(ret) - return -1; + FilesUtility::copyFile(inputF,outputF); - if(!nbr) - break; - - ret = outputF.writeToFile(buffer, nbr, &nbw); - if(ret) - return -1; - } inputF.closeFile(); outputF.closeFile(); } @@ -1624,7 +1613,7 @@ if(mimeConfigurationFile) delete mimeConfigurationFile; - + mimeConfigurationFile = new string(); #ifndef WIN32 @@ -1709,7 +1698,7 @@ File inputF; File outputF; mimeConfigurationFile->assign("MIMEtypes.xml"); - ret = inputF.openFile("MIMEtypes.xml.default", + ret = inputF.openFile("MIMEtypes.xml.default", File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_IFEXISTS); if(ret) @@ -1738,8 +1727,8 @@ inputF.closeFile(); outputF.closeFile(); } - + /* *If the virtualhosts.xml file doesn't exist copy it *from the default one. @@ -1749,7 +1738,7 @@ File inputF; File outputF; vhostConfigurationFile->assign("virtualhosts.xml"); - ret = inputF.openFile("virtualhosts.xml.default", + ret = inputF.openFile("virtualhosts.xml.default", File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_IFEXISTS ); if(ret) @@ -1760,7 +1749,7 @@ return -1; } ret = outputF.openFile("virtualhosts.xml", - File::MYSERVER_OPEN_WRITE | + File::MYSERVER_OPEN_WRITE | File::MYSERVER_OPEN_ALWAYS); if(ret) return -1; @@ -1775,7 +1764,7 @@ if(ret) return -1; } - + inputF.closeFile(); outputF.closeFile(); } @@ -1833,7 +1822,7 @@ if(Process::setAdditionalGroups(0, 0)) { - out << languageParser.getValue("ERR_ERROR") + out << languageParser.getValue("ERR_ERROR") << ": setAdditionalGroups"; logPreparePrintError(); logWriteln(out.str().c_str()); @@ -2067,7 +2056,7 @@ vector*>* handlers; purgeThreadsThreshold = 1; - + if(isRebooting()) return -1; From MAILER-DAEMON Sun Sep 14 17:09:24 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KeyqR-0003eW-TN for mharc-myserver-commit@gnu.org; Sun, 14 Sep 2008 17:09:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeyqQ-0003b9-04 for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:09:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeyqO-0003Yv-N9 for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:09:21 -0400 Received: from [199.232.76.173] (port=47629 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeyqO-0003Yc-GF for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:09:20 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53017 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeyqO-0005Kj-7Z for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:09:20 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KeyqN-0005zw-Ke for myserver-commit@gnu.org; Sun, 14 Sep 2008 21:09:19 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KeyqN-0005zs-AC for myserver-commit@gnu.org; Sun, 14 Sep 2008 21:09:19 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 14 Sep 2008 21:09:19 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2814] Added getHandle to the Stream class. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 21:09:22 -0000 Revision: 2814 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2814 Author: gscrivano Date: 2008-09-14 21:09:18 +0000 (Sun, 14 Sep 2008) Log Message: ----------- Added getHandle to the Stream class. Now the same getHandle method signature is shared between Socket and File. Modified Paths: -------------- trunk/myserver/include/base/file/file.h trunk/myserver/include/base/socket/socket.h trunk/myserver/include/connections_scheduler/connections_scheduler.h trunk/myserver/include/filter/stream.h trunk/myserver/src/base/process/process_server_manager.cpp trunk/myserver/src/base/socket/socket.cpp trunk/myserver/src/connections_scheduler/connections_scheduler.cpp trunk/myserver/src/connections_scheduler/listen_threads.cpp trunk/myserver/src/filter/stream.cpp trunk/myserver/src/protocol/ftp/ftp.cpp Modified: trunk/myserver/include/base/file/file.h =================================================================== --- trunk/myserver/include/base/file/file.h 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/include/base/file/file.h 2008-09-14 21:09:18 UTC (rev 2814) @@ -22,13 +22,6 @@ #include #include -#ifdef WIN32 -typedef void* FileHandle; -#endif -#ifdef NOT_WIN -typedef long FileHandle; -#endif - using namespace std; class File : public Stream Modified: trunk/myserver/include/base/socket/socket.h =================================================================== --- trunk/myserver/include/base/socket/socket.h 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/include/base/socket/socket.h 2008-09-14 21:09:18 UTC (rev 2814) @@ -39,7 +39,6 @@ #ifndef SOCKETLIBINCLUDED extern "C" { - //#include #include } #define SOCKETLIBINCLUDED @@ -68,11 +67,8 @@ #define MAX_IP_STRING_LEN 32 #endif -typedef unsigned int SocketHandle; typedef struct sockaddr_storage MYSERVER_SOCKADDR_STORAGE; typedef struct sockaddr_storage MYSERVER_SOCKADDRIN; -//typedef struct sockaddr_in MYSERVER_SOCKADDRIN; -//typedef struct sockaddr MYSERVER_SOCKADDR; typedef struct sockaddr_storage MYSERVER_SOCKADDR; typedef struct hostent MYSERVER_HOSTENT; int startupSocketLib(u_short); @@ -84,8 +80,8 @@ Socket* getServerSocket(); static void stopBlockingOperations(bool); - SocketHandle getHandle(); - int setHandle(SocketHandle); + virtual FileHandle getHandle(); + int setHandle(FileHandle); static MYSERVER_HOSTENT *gethostbyaddr(char* addr, int len, int type); static MYSERVER_HOSTENT *gethostbyname(const char*); static int gethostname(char*, int); @@ -94,7 +90,7 @@ int listen(int); Socket(); Socket(Socket*); - Socket(SocketHandle); + Socket(FileHandle); Socket accept(MYSERVER_SOCKADDR*, int*); int setsockopt(int,int, const char*,int); @@ -112,11 +108,8 @@ int operator=(Socket); int getsockname(MYSERVER_SOCKADDR*,int*); int setNonBlocking(int); -#ifdef __HURD__ - virtual int dataOnRead(int sec = 1, int usec = 500); -#else virtual int dataOnRead(int sec = 0, int usec = 500); -#endif + u_long getThrottling(); void setThrottling(u_long); static int getLocalIPsList(string&); @@ -125,7 +118,7 @@ virtual int write(const char* buffer, u_long len, u_long *nbw); protected: - SocketHandle socketHandle; + FileHandle socketHandle; /*! Pointer to the socket that has accepted this connection. */ Socket *serverSocket; Modified: trunk/myserver/include/connections_scheduler/connections_scheduler.h =================================================================== --- trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-14 21:09:18 UTC (rev 2814) @@ -100,7 +100,7 @@ u_long getNumTotalConnections(); - void newData(short event, SocketHandle handle); + void newData(short event, FileHandle handle); private: Server* server; @@ -114,7 +114,7 @@ Mutex eventsMutex; Mutex eventsSocketMutex; queue *ready; - HashMap connections; + HashMap connections; list listeners; u_long currentPriority; u_long currentPriorityDone; Modified: trunk/myserver/include/filter/stream.h =================================================================== --- trunk/myserver/include/filter/stream.h 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/include/filter/stream.h 2008-09-14 21:09:18 UTC (rev 2814) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -20,6 +20,13 @@ #include "stdafx.h" +#ifdef WIN32 +typedef void* FileHandle; +#endif +#ifdef NOT_WIN +typedef long FileHandle; +#endif + /*! *Abstract class to handle virtual data streams. */ @@ -29,6 +36,7 @@ virtual int read(char* buffer, u_long len, u_long*); virtual int write(const char* buffer, u_long len, u_long*); virtual int flush(u_long*); + virtual FileHandle getHandle(); Stream(); /*! Avoid direct instances of this class. */ virtual ~Stream() = 0; Modified: trunk/myserver/src/base/process/process_server_manager.cpp =================================================================== --- trunk/myserver/src/base/process/process_server_manager.cpp 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/src/base/process/process_server_manager.cpp 2008-09-14 21:09:18 UTC (rev 2814) @@ -405,7 +405,7 @@ server->port = (initialPort + nServers++); server->socket.socket(AF_INET,SOCK_STREAM,0); - if(server->socket.getHandle() != (SocketHandle)INVALID_SOCKET) + if(server->socket.getHandle() != (FileHandle)INVALID_SOCKET) { ((sockaddr_in *)(&serverSockAddrIn))->sin_family = AF_INET; @@ -480,7 +480,7 @@ { #if HAVE_IPV6 && 0 server->socket.socket(AF_INET6, SOCK_STREAM, 0); - if(server->socket.getHandle() != (SocketHandle)INVALID_SOCKET) + if(server->socket.getHandle() != (FileHandle)INVALID_SOCKET) { ((sockaddr_in6 *)(&serverSockAddrIn))->sin6_family = AF_INET6; Modified: trunk/myserver/src/base/socket/socket.cpp =================================================================== --- trunk/myserver/src/base/socket/socket.cpp 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/src/base/socket/socket.cpp 2008-09-14 21:09:18 UTC (rev 2814) @@ -56,9 +56,9 @@ } /*! - *Returns the base/socket/socket.handle + *Returns the socket handle */ -SocketHandle Socket::getHandle() +FileHandle Socket::getHandle() { return socketHandle; } @@ -66,7 +66,7 @@ /*! *Set the handle for the socket */ -int Socket::setHandle(SocketHandle h) +int Socket::setHandle(FileHandle h) { socketHandle = h; return 1; @@ -94,14 +94,14 @@ */ int Socket::socket(int af, int type, int protocol) { - socketHandle = (SocketHandle)::socket(af, type, protocol); + socketHandle = (FileHandle)::socket(af, type, protocol); return (int)socketHandle; } /*! *Set the base/socket/socket.handle. */ -Socket::Socket(SocketHandle handle) +Socket::Socket(FileHandle handle) { throttlingRate = 0; setHandle(handle); @@ -196,7 +196,7 @@ Socket s; #ifdef WIN32 - SocketHandle h = (SocketHandle)::accept(socketHandle,(struct sockaddr*)sa, + FileHandle h = (FileHandle)::accept(socketHandle,(struct sockaddr*)sa, sockaddrlen); s.setHandle(h); #endif Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-14 21:09:18 UTC (rev 2814) @@ -68,18 +68,17 @@ do { - if (listen(listener, 1) == SOCKET_ERROR) - break; - if ((socks[0] = socket(AF_INET, type, 0)) == INVALID_SOCKET) - break; - if (connect(socks[0], (const struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR) - break; - if ((socks[1] = accept(listener, NULL, NULL)) == INVALID_SOCKET) - break; - - closesocket(listener); - return 0; - + if (listen(listener, 1) == SOCKET_ERROR) + break; + if ((socks[0] = socket(AF_INET, type, 0)) == INVALID_SOCKET) + break; + if (connect(socks[0], (const struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR) + break; + if ((socks[1] = accept(listener, NULL, NULL)) == INVALID_SOCKET) + break; + + closesocket(listener); + return 0; } while (0); closesocket(listener); @@ -123,8 +122,9 @@ da->mutex->unlock(); return 0; } + da->terminated = false; - da->terminate = false; + da->mutex->unlock(); while(!da->terminate) @@ -149,16 +149,16 @@ return NULL; } -static void newDataHandler(int fd, short event, void *arg) +static void newDataHandler(int fd, short event, void *param) { - ConnectionsScheduler* scheduler = (ConnectionsScheduler*) arg; + ConnectionsScheduler::DispatcherArg* arg = (ConnectionsScheduler::DispatcherArg*) param; - if(scheduler) - scheduler->newData(event, (SocketHandle)fd); + if(!arg->terminate && arg->scheduler) + arg->scheduler->newData(event, (FileHandle)fd); } -void ConnectionsScheduler::newData(short event, SocketHandle handle) +void ConnectionsScheduler::newData(short event, FileHandle handle) { ConnectionPtr connection = connections.get(handle); @@ -192,20 +192,22 @@ /* *Schedule a new connection. *The 'c' command is followed by: - *SocketHandle -> Socket to monitor for new data. + *FileHandle -> Socket to monitor for new data. *ConnectionPtr -> Related Connection. *timeval -> Timeout. */ - SocketHandle handle; + FileHandle handle; ConnectionPtr c; timeval tv = {10, 0}; - sock.recv((char*)&handle, sizeof(SocketHandle), 0); + sock.recv((char*)&handle, sizeof(FileHandle), 0); sock.recv((char*)&c, sizeof(ConnectionPtr), 0); sock.recv((char*)&tv, sizeof(timeval), 0); - event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, da->scheduler, &tv); + event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, da, &tv); } + if(cmd == 'r') + break; /* Handle other cmd without do anything else. */ } @@ -232,8 +234,7 @@ asock = s->serverSocket->accept(&asockIn, &asockInLen); if(s->server && - asock.getHandle() != 0 && - asock.getHandle() != (SocketHandle)INVALID_SOCKET) + asock.getHandle() != (FileHandle)INVALID_SOCKET) { s->server->addConnection(asock, &asockIn); } @@ -348,9 +349,10 @@ { static timeval tv = {1, 0}; - event_init(); + event_init(); dispatcherArg.terminated = true; + dispatcherArg.terminate = false; dispatcherArg.mutex = &eventsMutex; dispatcherArg.server = server; dispatcherArg.scheduler = this; @@ -361,7 +363,8 @@ #define LOCAL_SOCKETPAIR_AF AF_UNIX #endif int err = create_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, - dispatcherArg.fd); + dispatcherArg.fd); + if (err == -1) { if(server) @@ -477,12 +480,12 @@ void ConnectionsScheduler::addWaitingConnectionImpl(ConnectionPtr c, int lock) { static timeval tv = {10, 0}; - SocketHandle handle = c->socket ? c->socket->getHandle() : NULL; + FileHandle handle = c->socket ? c->socket->getHandle() : NULL; if(server) tv.tv_sec = server->getTimeout() / 1000; else - tv.tv_sec = 30000; + tv.tv_sec = 30; c->setScheduled(0); @@ -503,14 +506,14 @@ eventsSocketMutex.lock(); sock.write("c", 1, &nbw); - sock.write((char*)&handle, sizeof(SocketHandle), &nbw); + sock.write((char*)&handle, sizeof(FileHandle), &nbw); sock.write((char*)&c, sizeof(ConnectionPtr), &nbw); sock.write((char*)&tv, sizeof(timeval), &nbw); eventsSocketMutex.unlock(); } else { - event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, this, &tv); + event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, &dispatcherArg, &tv); } } @@ -542,7 +545,7 @@ if(ready[currentPriority].size()) { - SocketHandle handle; + FileHandle handle; ret = ready[currentPriority].front(); ret->setScheduled(0); @@ -562,7 +565,8 @@ */ void ConnectionsScheduler::release() { - u_long max = 100; + u_long nbw; + u_long max = 0; releasing = true; dispatcherArg.terminate = true; @@ -574,17 +578,12 @@ readySemaphore->unlock(); } - event_loopexit(NULL); -#if EVENT_LOOPBREAK | WIN32 - event_loopbreak(); -#endif - u_long nbw; - Socket sock(dispatcherArg.fd[1]); + Socket sock(dispatcherArg.fd[1]); - eventsSocketMutex.lock(); - sock.write("r", 1, &nbw); - eventsSocketMutex.unlock(); - + eventsSocketMutex.lock(); + sock.write("r", 1, &nbw); + eventsSocketMutex.unlock(); + if(dispatchedThreadId) Thread::join(dispatchedThreadId); @@ -622,7 +621,7 @@ connectionsMutex.lock(); - HashMap::Iterator it = connections.begin(); + HashMap::Iterator it = connections.begin(); for(; it != connections.end(); it++) out.push_back(*it); @@ -654,15 +653,17 @@ void ConnectionsScheduler::terminateConnections() { int i; + try { connectionsMutex.lock(); - HashMap::Iterator it = connections.begin(); + HashMap::Iterator it = connections.begin(); for(; it != connections.end(); it++) { - if ( (*it)->allowDelete(true) ) - (*it)->socket->closesocket(); + ConnectionPtr c = *it; + if ( c->allowDelete(true) && c->socket) + c->socket->closesocket(); } } catch(...) @@ -695,7 +696,7 @@ try { - for(HashMap::Iterator it = connections.begin(); + for(HashMap::Iterator it = connections.begin(); it != connections.end() && !ret; it++) { Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-14 21:09:18 UTC (rev 2814) @@ -94,7 +94,7 @@ { server->logWriteln(languageParser->getValue("MSG_SSOCKCREATE")); serverSocketIPv4->socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (serverSocketIPv4->getHandle() == (SocketHandle)INVALID_SOCKET) + if (serverSocketIPv4->getHandle() == (FileHandle)INVALID_SOCKET) { server->logPreparePrintError(); server->logWriteln(languageParser->getValue("ERR_OPENP")); @@ -159,7 +159,7 @@ { server->logWriteln(languageParser->getValue("MSG_SSOCKCREATE")); serverSocketIPv6->socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); - if ( serverSocketIPv6->getHandle() == (SocketHandle)INVALID_SOCKET ) + if ( serverSocketIPv6->getHandle() == (FileHandle)INVALID_SOCKET ) { server->logPreparePrintError(); server->logWriteln(languageParser->getValue("ERR_OPENP")); Modified: trunk/myserver/src/filter/stream.cpp =================================================================== --- trunk/myserver/src/filter/stream.cpp 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/src/filter/stream.cpp 2008-09-14 21:09:18 UTC (rev 2814) @@ -57,3 +57,11 @@ { } + +/*! + *Get the file handle. + */ +FileHandle Stream::getHandle() +{ + return 0; +} Modified: trunk/myserver/src/protocol/ftp/ftp.cpp =================================================================== --- trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-14 18:19:19 UTC (rev 2813) +++ trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-14 21:09:18 UTC (rev 2814) @@ -581,7 +581,7 @@ { asockInLen = sizeof(sockaddr_in); asock = pFtpUserData->m_pDataConnection->socket->accept(&asockIn, &asockInLen); - if ( asock.getHandle() == (SocketHandle)INVALID_SOCKET ) + if ( asock.getHandle() == (FileHandle)INVALID_SOCKET ) return; pFtpUserData->m_pDataConnection->socket->shutdown(SD_BOTH); @@ -1575,7 +1575,7 @@ Socket *pSocket = new Socket(); pSocket->socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if ( pSocket->getHandle() == (SocketHandle)INVALID_SOCKET ) + if ( pSocket->getHandle() == (FileHandle)INVALID_SOCKET ) return 0; int nReuseAddr = 1; MYSERVER_SOCKADDR_STORAGE storage = { 0 }; From MAILER-DAEMON Sun Sep 14 17:14:56 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Keyvn-0007sK-V1 for mharc-myserver-commit@gnu.org; Sun, 14 Sep 2008 17:14:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Keyvl-0007qG-SA for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:14:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Keyvk-0007oz-GI for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:14:53 -0400 Received: from [199.232.76.173] (port=38963 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Keyvk-0007ob-9Q for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:14:52 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42208 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Keyvi-0006Hl-Rx for myserver-commit@gnu.org; Sun, 14 Sep 2008 17:14:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Keyvd-00067I-Gb for myserver-commit@gnu.org; Sun, 14 Sep 2008 21:14:45 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Keyvd-00067E-6v for myserver-commit@gnu.org; Sun, 14 Sep 2008 21:14:45 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 14 Sep 2008 21:14:45 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2815] Added basic tests for the ConnectionsScheduler class. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 21:14:54 -0000 Revision: 2815 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2815 Author: gscrivano Date: 2008-09-14 21:14:44 +0000 (Sun, 14 Sep 2008) Log Message: ----------- Added basic tests for the ConnectionsScheduler class. Modified Paths: -------------- trunk/myserver/tests/Makefile.am Added Paths: ----------- trunk/myserver/tests/test_connections_scheduler.cpp Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-14 21:09:18 UTC (rev 2814) +++ trunk/myserver/tests/Makefile.am 2008-09-14 21:14:44 UTC (rev 2815) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp +tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Added: trunk/myserver/tests/test_connections_scheduler.cpp =================================================================== --- trunk/myserver/tests/test_connections_scheduler.cpp (rev 0) +++ trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-14 21:14:44 UTC (rev 2815) @@ -0,0 +1,233 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include + +#include +#include +#include +#include +#include + + +class MockSocket : public Socket +{ + FileHandle handle; +public: + + /* + * BE SURE TO USE VALID HANDLES. + * 0, 1, 2 are valid ones. + */ + MockSocket(FileHandle handle) + { + this->handle = handle; + } + + virtual int connect(MYSERVER_SOCKADDR*, int) + { + return 0; + } + virtual int closesocket() + { + return 0; + } + + virtual int shutdown(int how) + { + return 0; + } + virtual int recv(char*, int, int, u_long) + { + return 0; + } + virtual int recv(char*, int, int) + { + return 0; + } + virtual u_long bytesToRead() + { + return 0; + } + + virtual FileHandle getHandle() + { + return (FileHandle) handle; + } + +}; + + +class TestSchedulerVisitor : public ConnectionsSchedulerVisitor +{ +public: + TestSchedulerVisitor() + { + arg = NULL; + } + + void *getArg() + { + return arg; + } + + virtual int visitConnection(ConnectionPtr conn, void* param) + { + arg = param; + } +private: + void *arg; +}; + + +class TestConnectionsScheduler : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestConnectionsScheduler ); + CPPUNIT_TEST( testAddNewConnection ); + CPPUNIT_TEST( testGetNumTotalConnections ); + CPPUNIT_TEST( testAddNewReadyConnection ); + CPPUNIT_TEST( testGetConnections ); + CPPUNIT_TEST( testVisitor ); + + CPPUNIT_TEST_SUITE_END(); + + ConnectionsScheduler* scheduler; +public: + + void setUp() + { + scheduler = new ConnectionsScheduler(NULL); + scheduler->initialize(); + } + + void tearDown() + { + scheduler->release(); + delete scheduler; + } + + void testVisitor() + { + TestSchedulerVisitor visitor; + + void* arg = this; + u_long max = 3; + u_long sum = 0; + + for(u_long i = 0; i < max; i++) + { + ConnectionPtr conn = new Connection; + conn->socket = new MockSocket(i); + scheduler->addWaitingConnection(conn); + } + + scheduler->accept(&visitor, arg); + + CPPUNIT_ASSERT_EQUAL(arg, visitor.getArg()); + + } + + void testGetConnections() + { + ConnectionPtr conn = new Connection; + conn->socket = new MockSocket(1); + + list out; + + scheduler->getConnections(out); + + CPPUNIT_ASSERT_EQUAL(out.size(), (size_t)0); + + conn = new Connection; + conn->socket = new MockSocket(2); + + scheduler->addWaitingConnection(conn); + + scheduler->getConnections(out); + + CPPUNIT_ASSERT_EQUAL(out.size(), (size_t)1); + } + + void testGetNumTotalConnections() + { + ConnectionPtr conn = new Connection; + conn->socket = new MockSocket(1); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); + + scheduler->registerConnectionID(conn); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 1ul); + + scheduler->registerConnectionID(conn); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 2ul); + + scheduler->registerConnectionID(conn); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 3ul); + + delete conn; + } + + void testAddNewReadyConnection() + { + ConnectionPtr gotConn; + + ConnectionPtr conn = new Connection; + conn->socket = new MockSocket(1); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); + + + scheduler->addReadyConnection(conn); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); + + gotConn = scheduler->getConnection(); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); + CPPUNIT_ASSERT_EQUAL(conn, gotConn); + + delete conn; + } + + void testAddNewConnection() + { + ConnectionPtr conn = new Connection; + conn->socket = new MockSocket(1); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); + + scheduler->addWaitingConnection(conn); + + CPPUNIT_ASSERT_EQUAL(scheduler->getConnectionsNumber(), 1ul); + + scheduler->removeConnection(conn); + + CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); + + delete conn; + } + + + + +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestConnectionsScheduler ); From MAILER-DAEMON Sun Sep 14 18:00:27 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kezdq-0000Zr-Ta for mharc-myserver-commit@gnu.org; Sun, 14 Sep 2008 18:00:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kezdo-0000Yo-NF for myserver-commit@gnu.org; Sun, 14 Sep 2008 18:00:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kezdn-0000YQ-6I for myserver-commit@gnu.org; Sun, 14 Sep 2008 18:00:23 -0400 Received: from [199.232.76.173] (port=35490 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kezdm-0000YN-R1 for myserver-commit@gnu.org; Sun, 14 Sep 2008 18:00:22 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56440 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kezdm-0005oe-Cy for myserver-commit@gnu.org; Sun, 14 Sep 2008 18:00:22 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kezdl-0007TB-61 for myserver-commit@gnu.org; Sun, 14 Sep 2008 22:00:21 +0000 Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kezdk-0007T4-JE for myserver-commit@gnu.org; Sun, 14 Sep 2008 22:00:20 +0000 MIME-Version: 1.0 Errors-To: dperrone To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniele Perrone Message-Id: Date: Sun, 14 Sep 2008 22:00:20 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2816] refactored configuration file loading methods X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 22:00:25 -0000 Revision: 2816 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2816 Author: dperrone Date: 2008-09-14 22:00:18 +0000 (Sun, 14 Sep 2008) Log Message: ----------- refactored configuration file loading methods Modified Paths: -------------- trunk/myserver/include/server/server.h trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-14 21:14:44 UTC (rev 2815) +++ trunk/myserver/include/server/server.h 2008-09-14 22:00:18 UTC (rev 2816) @@ -224,6 +224,11 @@ int freeHashedData(); u_long connectionTimeout; u_long maxLogFileSize; + int loadMainConfFilesLocation(); + int loadVHostConfFilesLocation(); + int loadMimeConfFilesLocation(); + int loadExternalPath(); + int loadLanguagesPath(); int loadConfFilesLocation(); Mutex* connectionsMutex; u_long nStaticThreads; Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-14 21:14:44 UTC (rev 2815) +++ trunk/myserver/src/server/server.cpp 2008-09-14 22:00:18 UTC (rev 2816) @@ -1535,20 +1535,15 @@ } /*! - *Load the configuration files locations. + *Load the main configuration files locations. *Return nonzero on errors. */ -int Server::loadConfFilesLocation() +int Server::loadMainConfFilesLocation() { - string strCPU; - char buffer[512]; - u_long nbr, nbw; - char* data; int ret; - try { - if(mainConfigurationFile) + if (mainConfigurationFile) delete mainConfigurationFile; mainConfigurationFile = new string(); @@ -1561,39 +1556,38 @@ *3) /etc/myserver/ *4) default files will be copied in myserver executable working */ - if(FilesUtility::fileExists("myserver.xml")) + if (FilesUtility::fileExists("myserver.xml")) { mainConfigurationFile->assign("myserver.xml"); } - else if(FilesUtility::fileExists("~/.myserver/myserver.xml")) + else if (FilesUtility::fileExists("~/.myserver/myserver.xml")) { mainConfigurationFile->assign("~/.myserver/myserver.xml"); } - else if(FilesUtility::fileExists("/etc/myserver/myserver.xml")) + else if (FilesUtility::fileExists("/etc/myserver/myserver.xml")) { mainConfigurationFile->assign("/etc/myserver/myserver.xml"); } else #endif /* If the myserver.xml files doesn't exist copy it from the default one. */ - if(mainConfigurationFile->length() == 0) + if (mainConfigurationFile->length() == 0) { mainConfigurationFile->assign("myserver.xml"); File inputF; File outputF; - ret = inputF.openFile("myserver.xml.default", - File::MYSERVER_OPEN_READ | - File::MYSERVER_OPEN_IFEXISTS); - if(ret) + ret = inputF.openFile("myserver.xml.default", File::MYSERVER_OPEN_READ + | File::MYSERVER_OPEN_IFEXISTS); + if (ret) { logPreparePrintError(); logWriteln("Error loading configuration file\n"); logEndPrintError(); return -1; } - ret = outputF.openFile("myserver.xml", File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_ALWAYS); - if(ret) + ret = outputF.openFile("myserver.xml", File::MYSERVER_OPEN_WRITE + | File::MYSERVER_OPEN_ALWAYS); + if (ret) { logPreparePrintError(); logWriteln("Error loading configuration file\n"); @@ -1601,7 +1595,7 @@ return -1; } - FilesUtility::copyFile(inputF,outputF); + FilesUtility::copyFile(inputF, outputF); inputF.closeFile(); outputF.closeFile(); @@ -1610,8 +1604,24 @@ { mainConfigurationFile->assign("myserver.xml"); } + } + catch (...) + { + } + return 0; +} - if(mimeConfigurationFile) + +/*! + *Load the mime configuration files locations. + *Return nonzero on errors. + */ +int Server::loadMimeConfFilesLocation() +{ + int ret; + try + { + if (mimeConfigurationFile) delete mimeConfigurationFile; mimeConfigurationFile = new string(); @@ -1624,21 +1634,67 @@ *3) /etc/myserver/ *4) default files will be copied in myserver executable working */ - if(FilesUtility::fileExists("MIMEtypes.xml")) + if (FilesUtility::fileExists("MIMEtypes.xml")) { mimeConfigurationFile->assign("MIMEtypes.xml"); } - else if(FilesUtility::fileExists("~/.myserver/MIMEtypes.xml")) + else if (FilesUtility::fileExists("~/.myserver/MIMEtypes.xml")) { mimeConfigurationFile->assign("~/.myserver/MIMEtypes.xml"); } - else if(FilesUtility::fileExists("/etc/myserver/MIMEtypes.xml")) + else if (FilesUtility::fileExists("/etc/myserver/MIMEtypes.xml")) { mimeConfigurationFile->assign("/etc/myserver/MIMEtypes.xml"); } + else #endif + /* + *If the MIMEtypes.xml files doesn't exist copy it + *from the default one. + */ + if (mimeConfigurationFile->length() == 0) + { + File inputF; + File outputF; + mimeConfigurationFile->assign("MIMEtypes.xml"); + ret = inputF.openFile("MIMEtypes.xml.default", File::MYSERVER_OPEN_READ + | File::MYSERVER_OPEN_IFEXISTS); + if (ret) + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADMIME")); + logEndPrintError(); + return -1; + } + ret = outputF.openFile("MIMEtypes.xml", File::MYSERVER_OPEN_WRITE + | File::MYSERVER_OPEN_ALWAYS); + if (ret) + return -1; - if(vhostConfigurationFile) + FilesUtility::copyFile(inputF, outputF); + + inputF.closeFile(); + outputF.closeFile(); + } + + } + catch (...) + { + } + return 0; +} + + +/*! + *Load the vhost configuration files locations. + *Return nonzero on errors. + */ +int Server::loadVHostConfFilesLocation() +{ + int ret; + try + { + if (vhostConfigurationFile) delete vhostConfigurationFile; vhostConfigurationFile = new string(); @@ -1651,33 +1707,77 @@ *3) /etc/myserver/ *4) default files will be copied in myserver executable working */ - if(FilesUtility::fileExists("virtualhosts.xml")) + if (FilesUtility::fileExists("virtualhosts.xml")) { vhostConfigurationFile->assign("virtualhosts.xml"); } - else if(FilesUtility::fileExists("~/.myserver/virtualhosts.xml")) + else if (FilesUtility::fileExists("~/.myserver/virtualhosts.xml")) { vhostConfigurationFile->assign("~/.myserver/virtualhosts.xml"); } - else if(FilesUtility::fileExists("/etc/myserver/virtualhosts.xml")) + else if (FilesUtility::fileExists("/etc/myserver/virtualhosts.xml")) { vhostConfigurationFile->assign("/etc/myserver/virtualhosts.xml"); } + else #endif + /* + *If the virtualhosts.xml file doesn't exist copy it + *from the default one. + */ + if (vhostConfigurationFile->length() == 0) + { + File inputF; + File outputF; - if(externalPath) + vhostConfigurationFile->assign("virtualhosts.xml"); + ret = inputF.openFile("virtualhosts.xml.default", + File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_IFEXISTS); + if (ret) + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADVHOSTS")); + logEndPrintError(); + return -1; + } + ret = outputF.openFile("virtualhosts.xml", File::MYSERVER_OPEN_WRITE + | File::MYSERVER_OPEN_ALWAYS); + if (ret) + return -1; + + FilesUtility::copyFile(inputF, outputF); + + inputF.closeFile(); + outputF.closeFile(); + } + } + catch (...) + { + } + return 0; +} + +/*! + *Load the external path. + *Return nonzero on errors. + */ +int Server::loadExternalPath() +{ + try + { + if (externalPath) delete externalPath; externalPath = new string(); #ifdef NOT_WIN if(FilesUtility::fileExists("plugins")) - externalPath->assign("plugins"); + externalPath->assign("plugins"); else { #ifdef PREFIX externalPath->assign(PREFIX); externalPath->append("/lib/myserver/plugins"); - #else +#else externalPath->assign("/usr/lib/myserver/plugins"); #endif } @@ -1687,127 +1787,88 @@ #ifdef WIN32 externalPath->assign("plugins"); #endif + } + catch (...) + { + } + return 0; +} - /* - *If the MIMEtypes.xml files doesn't exist copy it - *from the default one. - */ - if(mimeConfigurationFile->length() == 0) - { - File inputF; - File outputF; - mimeConfigurationFile->assign("MIMEtypes.xml"); - ret = inputF.openFile("MIMEtypes.xml.default", - File::MYSERVER_OPEN_READ | - File::MYSERVER_OPEN_IFEXISTS); - if(ret) - { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADMIME")); - logEndPrintError(); - return -1; - } - ret = outputF.openFile("MIMEtypes.xml", File::MYSERVER_OPEN_WRITE| - File::MYSERVER_OPEN_ALWAYS); - if(ret) - return -1; - for(;;) - { - ret = inputF.readFromFile(buffer, 512, &nbr ); - if(ret) - return -1; - if(nbr == 0) - break; - ret = outputF.writeToFile(buffer, nbr, &nbw); - if(ret) - return -1; - } - inputF.closeFile(); - outputF.closeFile(); - } +/*! + *Load the languages path. + *Return nonzero on errors. + */ +int Server::loadLanguagesPath() +{ + try + { + if (languagesPath) + delete languagesPath; + languagesPath = new string(); + +#ifndef WIN32 /* - *If the virtualhosts.xml file doesn't exist copy it - *from the default one. + *Do not use the files in the directory /usr/share/myserver/languages + *if exists a local directory. */ - if(vhostConfigurationFile->length() == 0) + if (FilesUtility::fileExists("languages")) { - File inputF; - File outputF; - vhostConfigurationFile->assign("virtualhosts.xml"); - ret = inputF.openFile("virtualhosts.xml.default", - File::MYSERVER_OPEN_READ | - File::MYSERVER_OPEN_IFEXISTS ); - if(ret) - { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADVHOSTS")); - logEndPrintError(); - return -1; - } - ret = outputF.openFile("virtualhosts.xml", - File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_ALWAYS); - if(ret) - return -1; - for(;;) - { - ret = inputF.readFromFile(buffer, 512, &nbr ); - if(ret) - return -1; - if(!nbr) - break; - ret = outputF.writeToFile(buffer, nbr, &nbw); - if(ret) - return -1; - } - - inputF.closeFile(); - outputF.closeFile(); + languagesPath->assign(getdefaultwd(0, 0)); + languagesPath->append("/languages/"); } - - - if(languagesPath) - delete languagesPath; - - languagesPath = new string(); - -#ifndef WIN32 - /* - *Do not use the files in the directory /usr/share/myserver/languages - *if exists a local directory. - */ - if(FilesUtility::fileExists("languages")) - { - languagesPath->assign(getdefaultwd(0, 0) ); - languagesPath->append("/languages/"); - } - else - { + else + { #ifdef PREFIX - languagesPath->assign(PREFIX); - languagesPath->append("/share/myserver/languages/"); + languagesPath->assign(PREFIX); + languagesPath->append("/share/myserver/languages/"); #else /* Default PREFIX is /usr/. */ - languagesPath->assign("/usr/share/myserver/languages/"); + languagesPath->assign("/usr/share/myserver/languages/"); #endif } #endif #ifdef WIN32 - languagesPath->assign( "languages/" ); + languagesPath->assign( "languages/" ); #endif - } - catch(...){} + catch (...) + { + } return 0; } /*! + *Load the configuration files locations. + *Return nonzero on errors. + */ +int Server::loadConfFilesLocation() +{ + if (loadMainConfFilesLocation()) + return -1; + + if (loadMimeConfFilesLocation()) + return -1; + + if (loadVHostConfFilesLocation()) + return -1; + + if (loadExternalPath()) + return -1; + + if (loadLanguagesPath()) + return -1; + + return 0; +} + + +/*! *If specified set the uid/gid for the process. */ void Server::setProcessPermissions() From MAILER-DAEMON Mon Sep 15 06:16:35 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KfB8E-0000gu-TU for mharc-myserver-commit@gnu.org; Mon, 15 Sep 2008 06:16:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KfB86-0000dT-SX for myserver-commit@gnu.org; Mon, 15 Sep 2008 06:16:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KfB83-0000ca-QI for myserver-commit@gnu.org; Mon, 15 Sep 2008 06:16:25 -0400 Received: from [199.232.76.173] (port=33719 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KfB80-0000bc-G4 for myserver-commit@gnu.org; Mon, 15 Sep 2008 06:16:20 -0400 Received: from savannah.gnu.org ([199.232.41.3]:45925 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KfB80-0008JF-5j for myserver-commit@gnu.org; Mon, 15 Sep 2008 06:16:20 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KfB7z-0007VK-KG for myserver-commit@gnu.org; Mon, 15 Sep 2008 10:16:19 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KfB7z-0007VG-Cr for myserver-commit@gnu.org; Mon, 15 Sep 2008 10:16:19 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Mon, 15 Sep 2008 10:16:19 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2817] Fixed indentation. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 10:16:27 -0000 Revision: 2817 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2817 Author: francesco_pipita Date: 2008-09-15 10:16:19 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Fixed indentation. Modified Paths: -------------- trunk/myserver/src/base/file/files_utility.cpp Modified: trunk/myserver/src/base/file/files_utility.cpp =================================================================== --- trunk/myserver/src/base/file/files_utility.cpp 2008-09-14 22:00:18 UTC (rev 2816) +++ trunk/myserver/src/base/file/files_utility.cpp 2008-09-15 10:16:19 UTC (rev 2817) @@ -217,7 +217,8 @@ int ret; - for (;;) { + for (;;) + { ret = src.readFromFile(buffer, 512, &nbr); if (ret) return -1; @@ -228,7 +229,7 @@ ret = dest.writeToFile(buffer, nbr, &nbw); if (ret) return -1; - } + } return 0; } From MAILER-DAEMON Mon Sep 15 17:26:07 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KfLaB-0007Pz-IR for mharc-myserver-commit@gnu.org; Mon, 15 Sep 2008 17:26:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KfLaA-0007OB-1I for myserver-commit@gnu.org; Mon, 15 Sep 2008 17:26:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KfLa4-0007E6-FO for myserver-commit@gnu.org; Mon, 15 Sep 2008 17:26:05 -0400 Received: from [199.232.76.173] (port=37136 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KfLa4-0007Dz-BP for myserver-commit@gnu.org; Mon, 15 Sep 2008 17:26:00 -0400 Received: from savannah.gnu.org ([199.232.41.3]:57218 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KfLa3-0004oI-Ll for myserver-commit@gnu.org; Mon, 15 Sep 2008 17:26:00 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KfLa3-0006mE-3G for myserver-commit@gnu.org; Mon, 15 Sep 2008 21:25:59 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KfLa2-0006mA-7z for myserver-commit@gnu.org; Mon, 15 Sep 2008 21:25:59 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 15 Sep 2008 21:25:58 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2818] Specify Emacs c++-mode for .h files. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 21:26:06 -0000 Revision: 2818 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2818 Author: gscrivano Date: 2008-09-15 21:25:57 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Specify Emacs c++-mode for .h files. Modified Paths: -------------- trunk/myserver/include/base/base64/mime_utils.h trunk/myserver/include/base/dynamic_lib/dynamiclib.h trunk/myserver/include/base/file/file.h trunk/myserver/include/base/file/files_utility.h trunk/myserver/include/base/files_cache/cached_file.h trunk/myserver/include/base/files_cache/cached_file_buffer.h trunk/myserver/include/base/files_cache/cached_file_factory.h trunk/myserver/include/base/find_data/find_data.h trunk/myserver/include/base/hash_map/hash_map.h trunk/myserver/include/base/home_dir/home_dir.h trunk/myserver/include/base/md5/md5.h trunk/myserver/include/base/mem_buff/mem_buff.h trunk/myserver/include/base/multicast/multicast.h trunk/myserver/include/base/pipe/pipe.h trunk/myserver/include/base/process/process.h trunk/myserver/include/base/process/process_server_manager.h trunk/myserver/include/base/regex/myserver_regex.h trunk/myserver/include/base/safetime/safetime.h trunk/myserver/include/base/socket/socket.h trunk/myserver/include/base/socket/ssl_socket.h trunk/myserver/include/base/ssl/ssl.h trunk/myserver/include/base/string/securestr.h trunk/myserver/include/base/string/stringutils.h trunk/myserver/include/base/sync/event.h trunk/myserver/include/base/sync/mutex.h trunk/myserver/include/base/sync/read_write_lock.h trunk/myserver/include/base/sync/recursive_mutex.h trunk/myserver/include/base/sync/semaphore.h trunk/myserver/include/base/thread/thread.h trunk/myserver/include/base/utility.h trunk/myserver/include/base/xml/xml_parser.h trunk/myserver/include/conf/mime/mime_manager.h trunk/myserver/include/conf/security/security.h trunk/myserver/include/conf/security/security_cache.h trunk/myserver/include/conf/vhost/vhost.h trunk/myserver/include/conf/vhost/vhost_manager.h trunk/myserver/include/connection/connection.h trunk/myserver/include/connections_scheduler/connections_scheduler.h trunk/myserver/include/connections_scheduler/listen_threads.h trunk/myserver/include/filter/filter.h trunk/myserver/include/filter/filters_chain.h trunk/myserver/include/filter/filters_factory.h trunk/myserver/include/filter/gzip/gzip.h trunk/myserver/include/filter/gzip/gzip_decompress.h trunk/myserver/include/filter/memory_stream.h trunk/myserver/include/filter/stream.h trunk/myserver/include/http_handler/cgi/cgi.h trunk/myserver/include/http_handler/fastcgi/fastcgi.h trunk/myserver/include/http_handler/http_dir/http_dir.h trunk/myserver/include/http_handler/http_file/http_file.h trunk/myserver/include/http_handler/isapi/isapi.h trunk/myserver/include/http_handler/mscgi/mscgi.h trunk/myserver/include/http_handler/mscgi/mscgi_manager.h trunk/myserver/include/http_handler/scgi/scgi.h trunk/myserver/include/http_handler/wincgi/wincgi.h trunk/myserver/include/log/log_manager.h trunk/myserver/include/plugin/executor/dyn_executor_manager.h trunk/myserver/include/plugin/executor/dynamic_executor.h trunk/myserver/include/plugin/filter/dyn_filter.h trunk/myserver/include/plugin/filter/dyn_filter_file.h trunk/myserver/include/plugin/filter/dyn_filters_manager.h trunk/myserver/include/plugin/generic_plugins_manager.h trunk/myserver/include/plugin/http_command/dyn_http_command.h trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h trunk/myserver/include/plugin/http_manager/dyn_http_manager.h trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h trunk/myserver/include/plugin/plugin.h trunk/myserver/include/plugin/plugins_manager.h trunk/myserver/include/plugin/plugins_namespace.h trunk/myserver/include/plugin/plugins_namespace_manager.h trunk/myserver/include/plugin/protocol/dynamic_protocol.h trunk/myserver/include/plugin/protocol/protocols_manager.h trunk/myserver/include/protocol/control/control_errors.h trunk/myserver/include/protocol/control/control_header.h trunk/myserver/include/protocol/control/control_protocol.h trunk/myserver/include/protocol/ftp/ftp.h trunk/myserver/include/protocol/ftp/ftp_common.h trunk/myserver/include/protocol/ftp/ftp_lexer.h trunk/myserver/include/protocol/ftp/ftp_parser.h trunk/myserver/include/protocol/http/env/env.h trunk/myserver/include/protocol/http/http.h trunk/myserver/include/protocol/http/http_data_handler.h trunk/myserver/include/protocol/http/http_data_read.h trunk/myserver/include/protocol/http/http_errors.h trunk/myserver/include/protocol/http/http_header.h trunk/myserver/include/protocol/http/http_header_checker.h trunk/myserver/include/protocol/http/http_headers.h trunk/myserver/include/protocol/http/http_request.h trunk/myserver/include/protocol/http/http_response.h trunk/myserver/include/protocol/http/http_thread_context.h trunk/myserver/include/protocol/https/https.h trunk/myserver/include/protocol/protocol.h trunk/myserver/include/protocol/protocol_buffer.h trunk/myserver/include/server/clients_thread.h trunk/myserver/include/server/server.h Modified: trunk/myserver/include/base/base64/mime_utils.h =================================================================== --- trunk/myserver/include/base/base64/mime_utils.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/base64/mime_utils.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/dynamic_lib/dynamiclib.h =================================================================== --- trunk/myserver/include/base/dynamic_lib/dynamiclib.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/dynamic_lib/dynamiclib.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/file/file.h =================================================================== --- trunk/myserver/include/base/file/file.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/file/file.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/file/files_utility.h =================================================================== --- trunk/myserver/include/base/file/files_utility.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/file/files_utility.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/files_cache/cached_file.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/files_cache/cached_file.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/files_cache/cached_file_buffer.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file_buffer.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/files_cache/cached_file_buffer.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/files_cache/cached_file_factory.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/find_data/find_data.h =================================================================== --- trunk/myserver/include/base/find_data/find_data.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/find_data/find_data.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/hash_map/hash_map.h =================================================================== --- trunk/myserver/include/base/hash_map/hash_map.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/hash_map/hash_map.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright \xA9 2005, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/home_dir/home_dir.h =================================================================== --- trunk/myserver/include/base/home_dir/home_dir.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/home_dir/home_dir.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/md5/md5.h =================================================================== --- trunk/myserver/include/base/md5/md5.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/md5/md5.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005-2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/mem_buff/mem_buff.h =================================================================== --- trunk/myserver/include/base/mem_buff/mem_buff.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/mem_buff/mem_buff.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/multicast/multicast.h =================================================================== --- trunk/myserver/include/base/multicast/multicast.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/multicast/multicast.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/pipe/pipe.h =================================================================== --- trunk/myserver/include/base/pipe/pipe.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/pipe/pipe.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/process/process.h =================================================================== --- trunk/myserver/include/base/process/process.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/process/process.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/process/process_server_manager.h =================================================================== --- trunk/myserver/include/base/process/process_server_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/process/process_server_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/regex/myserver_regex.h =================================================================== --- trunk/myserver/include/base/regex/myserver_regex.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/regex/myserver_regex.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/safetime/safetime.h =================================================================== --- trunk/myserver/include/base/safetime/safetime.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/safetime/safetime.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/socket/socket.h =================================================================== --- trunk/myserver/include/base/socket/socket.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/socket/socket.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/socket/ssl_socket.h =================================================================== --- trunk/myserver/include/base/socket/ssl_socket.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/socket/ssl_socket.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/ssl/ssl.h =================================================================== --- trunk/myserver/include/base/ssl/ssl.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/ssl/ssl.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/string/securestr.h =================================================================== --- trunk/myserver/include/base/string/securestr.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/string/securestr.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer * strlcpy and strlcat by codingmaster Modified: trunk/myserver/include/base/string/stringutils.h =================================================================== --- trunk/myserver/include/base/string/stringutils.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/string/stringutils.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/event.h =================================================================== --- trunk/myserver/include/base/sync/event.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/sync/event.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2006 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/mutex.h =================================================================== --- trunk/myserver/include/base/sync/mutex.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/sync/mutex.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/read_write_lock.h =================================================================== --- trunk/myserver/include/base/sync/read_write_lock.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/sync/read_write_lock.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/recursive_mutex.h =================================================================== --- trunk/myserver/include/base/sync/recursive_mutex.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/sync/recursive_mutex.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/semaphore.h =================================================================== --- trunk/myserver/include/base/sync/semaphore.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/sync/semaphore.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/thread/thread.h =================================================================== --- trunk/myserver/include/base/thread/thread.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/thread/thread.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/utility.h =================================================================== --- trunk/myserver/include/base/utility.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/utility.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/xml/xml_parser.h =================================================================== --- trunk/myserver/include/base/xml/xml_parser.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/base/xml/xml_parser.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/mime/mime_manager.h =================================================================== --- trunk/myserver/include/conf/mime/mime_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/conf/mime/mime_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/security/security.h =================================================================== --- trunk/myserver/include/conf/security/security.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/conf/security/security.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/security/security_cache.h =================================================================== --- trunk/myserver/include/conf/security/security_cache.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/conf/security/security_cache.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/vhost/vhost.h =================================================================== --- trunk/myserver/include/conf/vhost/vhost.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/conf/vhost/vhost.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/vhost/vhost_manager.h =================================================================== --- trunk/myserver/include/conf/vhost/vhost_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/conf/vhost/vhost_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/connection/connection.h =================================================================== --- trunk/myserver/include/connection/connection.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/connection/connection.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/connections_scheduler/connections_scheduler.h =================================================================== --- trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/connections_scheduler/listen_threads.h =================================================================== --- trunk/myserver/include/connections_scheduler/listen_threads.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/connections_scheduler/listen_threads.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/filter.h =================================================================== --- trunk/myserver/include/filter/filter.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/filter.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/filters_chain.h =================================================================== --- trunk/myserver/include/filter/filters_chain.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/filters_chain.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/filters_factory.h =================================================================== --- trunk/myserver/include/filter/filters_factory.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/filters_factory.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/gzip/gzip.h =================================================================== --- trunk/myserver/include/filter/gzip/gzip.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/gzip/gzip.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/gzip/gzip_decompress.h =================================================================== --- trunk/myserver/include/filter/gzip/gzip_decompress.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/gzip/gzip_decompress.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/memory_stream.h =================================================================== --- trunk/myserver/include/filter/memory_stream.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/memory_stream.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/stream.h =================================================================== --- trunk/myserver/include/filter/stream.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/filter/stream.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/cgi/cgi.h =================================================================== --- trunk/myserver/include/http_handler/cgi/cgi.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/cgi/cgi.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/fastcgi/fastcgi.h =================================================================== --- trunk/myserver/include/http_handler/fastcgi/fastcgi.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/fastcgi/fastcgi.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/http_dir/http_dir.h =================================================================== --- trunk/myserver/include/http_handler/http_dir/http_dir.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/http_dir/http_dir.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/http_file/http_file.h =================================================================== --- trunk/myserver/include/http_handler/http_file/http_file.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/http_file/http_file.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/isapi/isapi.h =================================================================== --- trunk/myserver/include/http_handler/isapi/isapi.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/isapi/isapi.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/mscgi/mscgi.h =================================================================== --- trunk/myserver/include/http_handler/mscgi/mscgi.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/mscgi/mscgi.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/mscgi/mscgi_manager.h =================================================================== --- trunk/myserver/include/http_handler/mscgi/mscgi_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/mscgi/mscgi_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/scgi/scgi.h =================================================================== --- trunk/myserver/include/http_handler/scgi/scgi.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/scgi/scgi.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/wincgi/wincgi.h =================================================================== --- trunk/myserver/include/http_handler/wincgi/wincgi.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/http_handler/wincgi/wincgi.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/log/log_manager.h =================================================================== --- trunk/myserver/include/log/log_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/log/log_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/executor/dyn_executor_manager.h =================================================================== --- trunk/myserver/include/plugin/executor/dyn_executor_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/executor/dyn_executor_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/executor/dynamic_executor.h =================================================================== --- trunk/myserver/include/plugin/executor/dynamic_executor.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/executor/dynamic_executor.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/filter/dyn_filter.h =================================================================== --- trunk/myserver/include/plugin/filter/dyn_filter.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/filter/dyn_filter.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/filter/dyn_filter_file.h =================================================================== --- trunk/myserver/include/plugin/filter/dyn_filter_file.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/filter/dyn_filter_file.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/filter/dyn_filters_manager.h =================================================================== --- trunk/myserver/include/plugin/filter/dyn_filters_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/filter/dyn_filters_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/generic_plugins_manager.h =================================================================== --- trunk/myserver/include/plugin/generic_plugins_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/generic_plugins_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_command/dyn_http_command.h =================================================================== --- trunk/myserver/include/plugin/http_command/dyn_http_command.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/http_command/dyn_http_command.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h =================================================================== --- trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_manager/dyn_http_manager.h =================================================================== --- trunk/myserver/include/plugin/http_manager/dyn_http_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/http_manager/dyn_http_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h =================================================================== --- trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugin.h =================================================================== --- trunk/myserver/include/plugin/plugin.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/plugin.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugins_manager.h =================================================================== --- trunk/myserver/include/plugin/plugins_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/plugins_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugins_namespace.h =================================================================== --- trunk/myserver/include/plugin/plugins_namespace.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/plugins_namespace.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugins_namespace_manager.h =================================================================== --- trunk/myserver/include/plugin/plugins_namespace_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/plugins_namespace_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/protocol/dynamic_protocol.h =================================================================== --- trunk/myserver/include/plugin/protocol/dynamic_protocol.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/protocol/dynamic_protocol.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/protocol/protocols_manager.h =================================================================== --- trunk/myserver/include/plugin/protocol/protocols_manager.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/plugin/protocol/protocols_manager.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/control/control_errors.h =================================================================== --- trunk/myserver/include/protocol/control/control_errors.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/control/control_errors.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2004, 2005 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/control/control_header.h =================================================================== --- trunk/myserver/include/protocol/control/control_header.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/control/control_header.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/control/control_protocol.h =================================================================== --- trunk/myserver/include/protocol/control/control_protocol.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/control/control_protocol.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2004, 2005, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/ftp/ftp.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/ftp/ftp.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/ftp/ftp_common.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp_common.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/ftp/ftp_common.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/ftp/ftp_lexer.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp_lexer.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/ftp/ftp_lexer.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ #ifndef yyHEADER_H #define yyHEADER_H 1 #define yyIN_HEADER 1 Modified: trunk/myserver/include/protocol/ftp/ftp_parser.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp_parser.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/ftp/ftp_parser.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Modified: trunk/myserver/include/protocol/http/env/env.h =================================================================== --- trunk/myserver/include/protocol/http/env/env.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/env/env.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http.h =================================================================== --- trunk/myserver/include/protocol/http/http.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002-2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_data_handler.h =================================================================== --- trunk/myserver/include/protocol/http/http_data_handler.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_data_handler.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_data_read.h =================================================================== --- trunk/myserver/include/protocol/http/http_data_read.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_data_read.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002-2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_errors.h =================================================================== --- trunk/myserver/include/protocol/http/http_errors.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_errors.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_header.h =================================================================== --- trunk/myserver/include/protocol/http/http_header.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_header.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_header_checker.h =================================================================== --- trunk/myserver/include/protocol/http/http_header_checker.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_header_checker.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2005 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_headers.h =================================================================== --- trunk/myserver/include/protocol/http/http_headers.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_headers.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_request.h =================================================================== --- trunk/myserver/include/protocol/http/http_request.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_request.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_response.h =================================================================== --- trunk/myserver/include/protocol/http/http_response.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_response.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_thread_context.h =================================================================== --- trunk/myserver/include/protocol/http/http_thread_context.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/http/http_thread_context.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/https/https.h =================================================================== --- trunk/myserver/include/protocol/https/https.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/https/https.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/protocol.h =================================================================== --- trunk/myserver/include/protocol/protocol.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/protocol.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/protocol_buffer.h =================================================================== --- trunk/myserver/include/protocol/protocol_buffer.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/protocol/protocol_buffer.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/server/clients_thread.h =================================================================== --- trunk/myserver/include/server/clients_thread.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/server/clients_thread.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-15 10:16:19 UTC (rev 2817) +++ trunk/myserver/include/server/server.h 2008-09-15 21:25:57 UTC (rev 2818) @@ -1,3 +1,4 @@ +/* -*- mode: cpp-mode */ /* MyServer Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. From MAILER-DAEMON Tue Sep 16 06:48:34 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KfY6k-0006rX-C2 for mharc-myserver-commit@gnu.org; Tue, 16 Sep 2008 06:48:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KfY6j-0006rP-77 for myserver-commit@gnu.org; Tue, 16 Sep 2008 06:48:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KfY6g-0006r1-Pj for myserver-commit@gnu.org; Tue, 16 Sep 2008 06:48:31 -0400 Received: from [199.232.76.173] (port=45710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KfY6g-0006qy-Fc for myserver-commit@gnu.org; Tue, 16 Sep 2008 06:48:30 -0400 Received: from savannah.gnu.org ([199.232.41.3]:55252 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KfY6f-0002he-Rw for myserver-commit@gnu.org; Tue, 16 Sep 2008 06:48:30 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KfY6f-0004jh-2i for myserver-commit@gnu.org; Tue, 16 Sep 2008 10:48:29 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KfY6e-0004ja-9t for myserver-commit@gnu.org; Tue, 16 Sep 2008 10:48:28 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 16 Sep 2008 10:48:28 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2819] Fixed Emacs mode file comment. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2008 10:48:33 -0000 Revision: 2819 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2819 Author: gscrivano Date: 2008-09-16 10:48:27 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Fixed Emacs mode file comment. Modified Paths: -------------- trunk/myserver/include/base/base64/mime_utils.h trunk/myserver/include/base/dynamic_lib/dynamiclib.h trunk/myserver/include/base/file/file.h trunk/myserver/include/base/file/files_utility.h trunk/myserver/include/base/files_cache/cached_file.h trunk/myserver/include/base/files_cache/cached_file_buffer.h trunk/myserver/include/base/files_cache/cached_file_factory.h trunk/myserver/include/base/find_data/find_data.h trunk/myserver/include/base/hash_map/hash_map.h trunk/myserver/include/base/home_dir/home_dir.h trunk/myserver/include/base/md5/md5.h trunk/myserver/include/base/mem_buff/mem_buff.h trunk/myserver/include/base/multicast/multicast.h trunk/myserver/include/base/pipe/pipe.h trunk/myserver/include/base/process/process.h trunk/myserver/include/base/process/process_server_manager.h trunk/myserver/include/base/regex/myserver_regex.h trunk/myserver/include/base/safetime/safetime.h trunk/myserver/include/base/socket/socket.h trunk/myserver/include/base/socket/ssl_socket.h trunk/myserver/include/base/ssl/ssl.h trunk/myserver/include/base/string/securestr.h trunk/myserver/include/base/string/stringutils.h trunk/myserver/include/base/sync/event.h trunk/myserver/include/base/sync/mutex.h trunk/myserver/include/base/sync/read_write_lock.h trunk/myserver/include/base/sync/recursive_mutex.h trunk/myserver/include/base/sync/semaphore.h trunk/myserver/include/base/thread/thread.h trunk/myserver/include/base/utility.h trunk/myserver/include/base/xml/xml_parser.h trunk/myserver/include/conf/mime/mime_manager.h trunk/myserver/include/conf/security/security.h trunk/myserver/include/conf/security/security_cache.h trunk/myserver/include/conf/vhost/vhost.h trunk/myserver/include/conf/vhost/vhost_manager.h trunk/myserver/include/connection/connection.h trunk/myserver/include/connections_scheduler/connections_scheduler.h trunk/myserver/include/connections_scheduler/listen_threads.h trunk/myserver/include/filter/filter.h trunk/myserver/include/filter/filters_chain.h trunk/myserver/include/filter/filters_factory.h trunk/myserver/include/filter/gzip/gzip.h trunk/myserver/include/filter/gzip/gzip_decompress.h trunk/myserver/include/filter/memory_stream.h trunk/myserver/include/filter/stream.h trunk/myserver/include/http_handler/cgi/cgi.h trunk/myserver/include/http_handler/fastcgi/fastcgi.h trunk/myserver/include/http_handler/http_dir/http_dir.h trunk/myserver/include/http_handler/http_file/http_file.h trunk/myserver/include/http_handler/isapi/isapi.h trunk/myserver/include/http_handler/mscgi/mscgi.h trunk/myserver/include/http_handler/mscgi/mscgi_manager.h trunk/myserver/include/http_handler/scgi/scgi.h trunk/myserver/include/http_handler/wincgi/wincgi.h trunk/myserver/include/log/log_manager.h trunk/myserver/include/plugin/executor/dyn_executor_manager.h trunk/myserver/include/plugin/executor/dynamic_executor.h trunk/myserver/include/plugin/filter/dyn_filter.h trunk/myserver/include/plugin/filter/dyn_filter_file.h trunk/myserver/include/plugin/filter/dyn_filters_manager.h trunk/myserver/include/plugin/generic_plugins_manager.h trunk/myserver/include/plugin/http_command/dyn_http_command.h trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h trunk/myserver/include/plugin/http_manager/dyn_http_manager.h trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h trunk/myserver/include/plugin/plugin.h trunk/myserver/include/plugin/plugins_manager.h trunk/myserver/include/plugin/plugins_namespace.h trunk/myserver/include/plugin/plugins_namespace_manager.h trunk/myserver/include/plugin/protocol/dynamic_protocol.h trunk/myserver/include/plugin/protocol/protocols_manager.h trunk/myserver/include/protocol/control/control_errors.h trunk/myserver/include/protocol/control/control_header.h trunk/myserver/include/protocol/control/control_protocol.h trunk/myserver/include/protocol/ftp/ftp.h trunk/myserver/include/protocol/ftp/ftp_common.h trunk/myserver/include/protocol/ftp/ftp_lexer.h trunk/myserver/include/protocol/ftp/ftp_parser.h trunk/myserver/include/protocol/http/env/env.h trunk/myserver/include/protocol/http/http.h trunk/myserver/include/protocol/http/http_data_handler.h trunk/myserver/include/protocol/http/http_data_read.h trunk/myserver/include/protocol/http/http_errors.h trunk/myserver/include/protocol/http/http_header.h trunk/myserver/include/protocol/http/http_header_checker.h trunk/myserver/include/protocol/http/http_headers.h trunk/myserver/include/protocol/http/http_request.h trunk/myserver/include/protocol/http/http_response.h trunk/myserver/include/protocol/http/http_thread_context.h trunk/myserver/include/protocol/https/https.h trunk/myserver/include/protocol/protocol.h trunk/myserver/include/protocol/protocol_buffer.h trunk/myserver/include/server/clients_thread.h trunk/myserver/include/server/server.h Modified: trunk/myserver/include/base/base64/mime_utils.h =================================================================== --- trunk/myserver/include/base/base64/mime_utils.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/base64/mime_utils.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/dynamic_lib/dynamiclib.h =================================================================== --- trunk/myserver/include/base/dynamic_lib/dynamiclib.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/dynamic_lib/dynamiclib.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/file/file.h =================================================================== --- trunk/myserver/include/base/file/file.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/file/file.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/file/files_utility.h =================================================================== --- trunk/myserver/include/base/file/files_utility.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/file/files_utility.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/files_cache/cached_file.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/files_cache/cached_file.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/files_cache/cached_file_buffer.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file_buffer.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/files_cache/cached_file_buffer.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/files_cache/cached_file_factory.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/files_cache/cached_file_factory.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/find_data/find_data.h =================================================================== --- trunk/myserver/include/base/find_data/find_data.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/find_data/find_data.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/hash_map/hash_map.h =================================================================== --- trunk/myserver/include/base/hash_map/hash_map.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/hash_map/hash_map.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright \xA9 2005, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/home_dir/home_dir.h =================================================================== --- trunk/myserver/include/base/home_dir/home_dir.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/home_dir/home_dir.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/md5/md5.h =================================================================== --- trunk/myserver/include/base/md5/md5.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/md5/md5.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005-2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/mem_buff/mem_buff.h =================================================================== --- trunk/myserver/include/base/mem_buff/mem_buff.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/mem_buff/mem_buff.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/multicast/multicast.h =================================================================== --- trunk/myserver/include/base/multicast/multicast.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/multicast/multicast.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/pipe/pipe.h =================================================================== --- trunk/myserver/include/base/pipe/pipe.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/pipe/pipe.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/process/process.h =================================================================== --- trunk/myserver/include/base/process/process.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/process/process.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/process/process_server_manager.h =================================================================== --- trunk/myserver/include/base/process/process_server_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/process/process_server_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/regex/myserver_regex.h =================================================================== --- trunk/myserver/include/base/regex/myserver_regex.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/regex/myserver_regex.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/safetime/safetime.h =================================================================== --- trunk/myserver/include/base/safetime/safetime.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/safetime/safetime.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/socket/socket.h =================================================================== --- trunk/myserver/include/base/socket/socket.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/socket/socket.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/socket/ssl_socket.h =================================================================== --- trunk/myserver/include/base/socket/ssl_socket.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/socket/ssl_socket.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/ssl/ssl.h =================================================================== --- trunk/myserver/include/base/ssl/ssl.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/ssl/ssl.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/string/securestr.h =================================================================== --- trunk/myserver/include/base/string/securestr.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/string/securestr.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer * strlcpy and strlcat by codingmaster Modified: trunk/myserver/include/base/string/stringutils.h =================================================================== --- trunk/myserver/include/base/string/stringutils.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/string/stringutils.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/event.h =================================================================== --- trunk/myserver/include/base/sync/event.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/sync/event.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2006 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/mutex.h =================================================================== --- trunk/myserver/include/base/sync/mutex.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/sync/mutex.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/read_write_lock.h =================================================================== --- trunk/myserver/include/base/sync/read_write_lock.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/sync/read_write_lock.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/recursive_mutex.h =================================================================== --- trunk/myserver/include/base/sync/recursive_mutex.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/sync/recursive_mutex.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/sync/semaphore.h =================================================================== --- trunk/myserver/include/base/sync/semaphore.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/sync/semaphore.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/thread/thread.h =================================================================== --- trunk/myserver/include/base/thread/thread.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/thread/thread.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/utility.h =================================================================== --- trunk/myserver/include/base/utility.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/utility.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/base/xml/xml_parser.h =================================================================== --- trunk/myserver/include/base/xml/xml_parser.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/base/xml/xml_parser.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/mime/mime_manager.h =================================================================== --- trunk/myserver/include/conf/mime/mime_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/conf/mime/mime_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/security/security.h =================================================================== --- trunk/myserver/include/conf/security/security.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/conf/security/security.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/security/security_cache.h =================================================================== --- trunk/myserver/include/conf/security/security_cache.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/conf/security/security_cache.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/vhost/vhost.h =================================================================== --- trunk/myserver/include/conf/vhost/vhost.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/conf/vhost/vhost.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/conf/vhost/vhost_manager.h =================================================================== --- trunk/myserver/include/conf/vhost/vhost_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/conf/vhost/vhost_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/connection/connection.h =================================================================== --- trunk/myserver/include/connection/connection.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/connection/connection.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/connections_scheduler/connections_scheduler.h =================================================================== --- trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/connections_scheduler/connections_scheduler.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/connections_scheduler/listen_threads.h =================================================================== --- trunk/myserver/include/connections_scheduler/listen_threads.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/connections_scheduler/listen_threads.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/filter.h =================================================================== --- trunk/myserver/include/filter/filter.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/filter.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/filters_chain.h =================================================================== --- trunk/myserver/include/filter/filters_chain.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/filters_chain.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/filters_factory.h =================================================================== --- trunk/myserver/include/filter/filters_factory.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/filters_factory.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/gzip/gzip.h =================================================================== --- trunk/myserver/include/filter/gzip/gzip.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/gzip/gzip.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/gzip/gzip_decompress.h =================================================================== --- trunk/myserver/include/filter/gzip/gzip_decompress.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/gzip/gzip_decompress.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/memory_stream.h =================================================================== --- trunk/myserver/include/filter/memory_stream.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/memory_stream.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/filter/stream.h =================================================================== --- trunk/myserver/include/filter/stream.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/filter/stream.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/cgi/cgi.h =================================================================== --- trunk/myserver/include/http_handler/cgi/cgi.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/cgi/cgi.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/fastcgi/fastcgi.h =================================================================== --- trunk/myserver/include/http_handler/fastcgi/fastcgi.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/fastcgi/fastcgi.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/http_dir/http_dir.h =================================================================== --- trunk/myserver/include/http_handler/http_dir/http_dir.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/http_dir/http_dir.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/http_file/http_file.h =================================================================== --- trunk/myserver/include/http_handler/http_file/http_file.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/http_file/http_file.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/isapi/isapi.h =================================================================== --- trunk/myserver/include/http_handler/isapi/isapi.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/isapi/isapi.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/mscgi/mscgi.h =================================================================== --- trunk/myserver/include/http_handler/mscgi/mscgi.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/mscgi/mscgi.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/mscgi/mscgi_manager.h =================================================================== --- trunk/myserver/include/http_handler/mscgi/mscgi_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/mscgi/mscgi_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/scgi/scgi.h =================================================================== --- trunk/myserver/include/http_handler/scgi/scgi.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/scgi/scgi.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/http_handler/wincgi/wincgi.h =================================================================== --- trunk/myserver/include/http_handler/wincgi/wincgi.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/http_handler/wincgi/wincgi.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/log/log_manager.h =================================================================== --- trunk/myserver/include/log/log_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/log/log_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/executor/dyn_executor_manager.h =================================================================== --- trunk/myserver/include/plugin/executor/dyn_executor_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/executor/dyn_executor_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/executor/dynamic_executor.h =================================================================== --- trunk/myserver/include/plugin/executor/dynamic_executor.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/executor/dynamic_executor.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/filter/dyn_filter.h =================================================================== --- trunk/myserver/include/plugin/filter/dyn_filter.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/filter/dyn_filter.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/filter/dyn_filter_file.h =================================================================== --- trunk/myserver/include/plugin/filter/dyn_filter_file.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/filter/dyn_filter_file.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/filter/dyn_filters_manager.h =================================================================== --- trunk/myserver/include/plugin/filter/dyn_filters_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/filter/dyn_filters_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/generic_plugins_manager.h =================================================================== --- trunk/myserver/include/plugin/generic_plugins_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/generic_plugins_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_command/dyn_http_command.h =================================================================== --- trunk/myserver/include/plugin/http_command/dyn_http_command.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/http_command/dyn_http_command.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h =================================================================== --- trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/http_command/dyn_http_command_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_manager/dyn_http_manager.h =================================================================== --- trunk/myserver/include/plugin/http_manager/dyn_http_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/http_manager/dyn_http_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h =================================================================== --- trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/http_manager/dyn_http_manager_list.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugin.h =================================================================== --- trunk/myserver/include/plugin/plugin.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/plugin.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugins_manager.h =================================================================== --- trunk/myserver/include/plugin/plugins_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/plugins_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugins_namespace.h =================================================================== --- trunk/myserver/include/plugin/plugins_namespace.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/plugins_namespace.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/plugins_namespace_manager.h =================================================================== --- trunk/myserver/include/plugin/plugins_namespace_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/plugins_namespace_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/protocol/dynamic_protocol.h =================================================================== --- trunk/myserver/include/plugin/protocol/dynamic_protocol.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/protocol/dynamic_protocol.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/plugin/protocol/protocols_manager.h =================================================================== --- trunk/myserver/include/plugin/protocol/protocols_manager.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/plugin/protocol/protocols_manager.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/control/control_errors.h =================================================================== --- trunk/myserver/include/protocol/control/control_errors.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/control/control_errors.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2004, 2005 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/control/control_header.h =================================================================== --- trunk/myserver/include/protocol/control/control_header.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/control/control_header.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/control/control_protocol.h =================================================================== --- trunk/myserver/include/protocol/control/control_protocol.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/control/control_protocol.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2004, 2005, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/ftp/ftp.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/ftp/ftp.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/ftp/ftp_common.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp_common.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/ftp/ftp_common.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/ftp/ftp_lexer.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp_lexer.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/ftp/ftp_lexer.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ #ifndef yyHEADER_H #define yyHEADER_H 1 #define yyIN_HEADER 1 Modified: trunk/myserver/include/protocol/ftp/ftp_parser.h =================================================================== --- trunk/myserver/include/protocol/ftp/ftp_parser.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/ftp/ftp_parser.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Modified: trunk/myserver/include/protocol/http/env/env.h =================================================================== --- trunk/myserver/include/protocol/http/env/env.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/env/env.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http.h =================================================================== --- trunk/myserver/include/protocol/http/http.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002-2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_data_handler.h =================================================================== --- trunk/myserver/include/protocol/http/http_data_handler.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_data_handler.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_data_read.h =================================================================== --- trunk/myserver/include/protocol/http/http_data_read.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_data_read.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002-2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_errors.h =================================================================== --- trunk/myserver/include/protocol/http/http_errors.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_errors.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_header.h =================================================================== --- trunk/myserver/include/protocol/http/http_header.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_header.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_header_checker.h =================================================================== --- trunk/myserver/include/protocol/http/http_header_checker.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_header_checker.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2005 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_headers.h =================================================================== --- trunk/myserver/include/protocol/http/http_headers.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_headers.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_request.h =================================================================== --- trunk/myserver/include/protocol/http/http_request.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_request.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_response.h =================================================================== --- trunk/myserver/include/protocol/http/http_response.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_response.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/http/http_thread_context.h =================================================================== --- trunk/myserver/include/protocol/http/http_thread_context.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/http/http_thread_context.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/https/https.h =================================================================== --- trunk/myserver/include/protocol/https/https.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/https/https.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/protocol.h =================================================================== --- trunk/myserver/include/protocol/protocol.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/protocol.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/protocol/protocol_buffer.h =================================================================== --- trunk/myserver/include/protocol/protocol_buffer.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/protocol/protocol_buffer.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/server/clients_thread.h =================================================================== --- trunk/myserver/include/server/clients_thread.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/server/clients_thread.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-15 21:25:57 UTC (rev 2818) +++ trunk/myserver/include/server/server.h 2008-09-16 10:48:27 UTC (rev 2819) @@ -1,4 +1,4 @@ -/* -*- mode: cpp-mode */ +/* -*- mode: c++ -*- */ /* MyServer Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. From MAILER-DAEMON Wed Sep 17 14:05:43 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kg1PK-0007pS-Pi for mharc-myserver-commit@gnu.org; Wed, 17 Sep 2008 14:05:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kg1PI-0007oj-2V for myserver-commit@gnu.org; Wed, 17 Sep 2008 14:05:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kg1PH-0007oB-CZ for myserver-commit@gnu.org; Wed, 17 Sep 2008 14:05:39 -0400 Received: from [199.232.76.173] (port=32897 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kg1PH-0007o7-7N for myserver-commit@gnu.org; Wed, 17 Sep 2008 14:05:39 -0400 Received: from savannah.gnu.org ([199.232.41.3]:59743 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kg1PG-0007nP-VZ for myserver-commit@gnu.org; Wed, 17 Sep 2008 14:05:39 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kg1PG-0006J3-7Z for myserver-commit@gnu.org; Wed, 17 Sep 2008 18:05:38 +0000 Received: from andu by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kg1PF-0006Iy-QK for myserver-commit@gnu.org; Wed, 17 Sep 2008 18:05:38 +0000 MIME-Version: 1.0 Errors-To: andu To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Alexandru IANCU Message-Id: Date: Wed, 17 Sep 2008 18:05:37 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2820] avoid linking to both: ms library and compilation units(obj files) X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 18:05:40 -0000 Revision: 2820 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2820 Author: andu Date: 2008-09-17 18:05:37 +0000 (Wed, 17 Sep 2008) Log Message: ----------- avoid linking to both: ms library and compilation units(obj files) Modified Paths: -------------- trunk/myserver/src/Makefile.am Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-16 10:48:27 UTC (rev 2819) +++ trunk/myserver/src/Makefile.am 2008-09-17 18:05:37 UTC (rev 2820) @@ -6,7 +6,7 @@ myserver_SOURCES = myserver.cpp myserver_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\" myserver_LDFLAGS = -rdynamic -myserver_LDADD = libmyserver.a $(all_libraries) $(PTHREAD_LIB) $(IDN_LIB) \ +myserver_LDADD = libmyserver.a $(PTHREAD_LIB) $(IDN_LIB) \ $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ $(XML_LIBS) $(LDFLAGS) From MAILER-DAEMON Wed Sep 17 15:32:54 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kg2lh-0005ja-Tt for mharc-myserver-commit@gnu.org; Wed, 17 Sep 2008 15:32:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kg2lf-0005is-Tf for myserver-commit@gnu.org; Wed, 17 Sep 2008 15:32:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kg2lf-0005iX-CH for myserver-commit@gnu.org; Wed, 17 Sep 2008 15:32:51 -0400 Received: from [199.232.76.173] (port=50750 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kg2lf-0005iS-2z for myserver-commit@gnu.org; Wed, 17 Sep 2008 15:32:51 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42231 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kg2le-0005jw-N9 for myserver-commit@gnu.org; Wed, 17 Sep 2008 15:32:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kg2lc-0003BT-CH for myserver-commit@gnu.org; Wed, 17 Sep 2008 19:32:48 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kg2lc-0003BO-38 for myserver-commit@gnu.org; Wed, 17 Sep 2008 19:32:48 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 17 Sep 2008 19:32:48 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2821] Removed not used version.h file. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 19:32:52 -0000 Revision: 2821 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2821 Author: gscrivano Date: 2008-09-17 19:32:47 +0000 (Wed, 17 Sep 2008) Log Message: ----------- Removed not used version.h file. Modified Paths: -------------- trunk/myserver/configure.in Removed Paths: ------------- trunk/myserver/version.h.in Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-17 18:05:37 UTC (rev 2820) +++ trunk/myserver/configure.in 2008-09-17 19:32:47 UTC (rev 2821) @@ -363,7 +363,6 @@ dnl AC_CONFIG_SUBDIRS() AC_CONFIG_FILES([ - version.h Makefile binaries/Makefile binaries/certificates/Makefile Deleted: trunk/myserver/version.h.in =================================================================== --- trunk/myserver/version.h.in 2008-09-17 18:05:37 UTC (rev 2820) +++ trunk/myserver/version.h.in 2008-09-17 19:32:47 UTC (rev 2821) @@ -1,3 +0,0 @@ -#define MYSERVER_MAJOR_VERSION @MYSERVER_MAJOR_VERSION@ -#define MYSERVER_MINOR_VERSION @MYSERVER_MINOR_VERSION@ -#define MYSERVER_MICRO_VERSION @MYSERVER_MICRO_VERSION@ From MAILER-DAEMON Thu Sep 18 14:24:10 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KgOAk-0000F0-15 for mharc-myserver-commit@gnu.org; Thu, 18 Sep 2008 14:24:10 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgOAi-0000ET-OE for myserver-commit@gnu.org; Thu, 18 Sep 2008 14:24:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgOAh-0000Dy-5w for myserver-commit@gnu.org; Thu, 18 Sep 2008 14:24:08 -0400 Received: from [199.232.76.173] (port=52575 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgOAg-0000Dq-KR for myserver-commit@gnu.org; Thu, 18 Sep 2008 14:24:06 -0400 Received: from savannah.gnu.org ([199.232.41.3]:44709 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgOAe-00039U-M5 for myserver-commit@gnu.org; Thu, 18 Sep 2008 14:24:06 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KgOAb-00017X-3W for myserver-commit@gnu.org; Thu, 18 Sep 2008 18:24:01 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KgOAZ-00017O-T6 for myserver-commit@gnu.org; Thu, 18 Sep 2008 18:24:00 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 18 Sep 2008 18:23:59 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2822] Refactoring. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 18:24:09 -0000 Revision: 2822 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2822 Author: gscrivano Date: 2008-09-18 18:23:58 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Refactoring. Now `File', `Pipe' and `Socket' use close inherited by `Stream'. Modified Paths: -------------- trunk/myserver/control/control_client.cpp trunk/myserver/control/myserver-configure.cpp trunk/myserver/include/base/file/file.h trunk/myserver/include/base/files_cache/cached_file.h trunk/myserver/include/base/pipe/pipe.h trunk/myserver/include/base/process/process_server_manager.h trunk/myserver/include/base/socket/socket.h trunk/myserver/include/base/socket/ssl_socket.h trunk/myserver/include/filter/stream.h trunk/myserver/src/base/file/file.cpp trunk/myserver/src/base/files_cache/cached_file.cpp trunk/myserver/src/base/files_cache/cached_file_buffer.cpp trunk/myserver/src/base/files_cache/cached_file_factory.cpp trunk/myserver/src/base/home_dir/home_dir.cpp trunk/myserver/src/base/pipe/pipe.cpp trunk/myserver/src/base/process/process_server_manager.cpp trunk/myserver/src/base/socket/socket.cpp trunk/myserver/src/base/socket/ssl_socket.cpp trunk/myserver/src/conf/mime/mime_manager.cpp trunk/myserver/src/conf/vhost/vhost_manager.cpp trunk/myserver/src/connection/connection.cpp trunk/myserver/src/connections_scheduler/connections_scheduler.cpp trunk/myserver/src/connections_scheduler/listen_threads.cpp trunk/myserver/src/filter/stream.cpp trunk/myserver/src/http_handler/cgi/cgi.cpp trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp trunk/myserver/src/http_handler/http_dir/http_dir.cpp trunk/myserver/src/http_handler/http_file/http_file.cpp trunk/myserver/src/http_handler/scgi/scgi.cpp trunk/myserver/src/http_handler/wincgi/wincgi.cpp trunk/myserver/src/log/log_manager.cpp trunk/myserver/src/plugin/executor/dynamic_executor.cpp trunk/myserver/src/protocol/control/control_protocol.cpp trunk/myserver/src/protocol/ftp/ftp.cpp trunk/myserver/src/protocol/http/http.cpp trunk/myserver/src/protocol/http/http_data_read.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/control/control_client.cpp =================================================================== --- trunk/myserver/control/control_client.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/control/control_client.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -41,7 +41,7 @@ memset(UserPass, 0, 64); // no memory snoops here Buffer.free(); if(Connected) - socket->closesocket(); + socket->close(); if(socket) delete socket; } @@ -91,7 +91,7 @@ /*! If the socket was created try to connect. */ if(tcpSocket->connect((MYSERVER_SOCKADDR*)&sockAddr, sockLen) == -1) { - socket->closesocket(); + socket->close(); delete tcpSocket; return -2; } @@ -127,7 +127,7 @@ memset(UserPass, 0, 64); // no memory snoops here Buffer.setLength(0); if(Connected) - socket->closesocket(); + socket->close(); Connected = false; return 0; } Modified: trunk/myserver/control/myserver-configure.cpp =================================================================== --- trunk/myserver/control/myserver-configure.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/control/myserver-configure.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -170,8 +170,8 @@ break; outputF.writeToFile(buffer, nbr, &nbw); } - inputF.closeFile(); - outputF.closeFile(); + inputF.close(); + outputF.close(); if(FilesUtility::fileExists("MIMEtypes.xml.default")) { @@ -186,8 +186,8 @@ break; outputF.writeToFile(buffer, nbr, &nbw); } - inputF.closeFile(); - outputF.closeFile(); + inputF.close(); + outputF.close(); } if(FilesUtility::fileExists("virtualhosts.xml.default")) @@ -205,8 +205,8 @@ break; outputF.writeToFile(buffer, nbr, &nbw); } - inputF.closeFile(); - outputF.closeFile(); + inputF.close(); + outputF.close(); } } } Modified: trunk/myserver/include/base/file/file.h =================================================================== --- trunk/myserver/include/base/file/file.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/base/file/file.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -65,7 +65,7 @@ {return setFilename(name.c_str());} virtual int operator =(File); - virtual int closeFile(); + virtual int close(); /*! Inherithed from Stream. */ virtual int read(char* buffer, u_long len, u_long *nbr); Modified: trunk/myserver/include/base/files_cache/cached_file.h =================================================================== --- trunk/myserver/include/base/files_cache/cached_file.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/base/files_cache/cached_file.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -45,7 +45,7 @@ virtual int setFilePointer(u_long); virtual int operator =(CachedFile); - virtual int closeFile(); + virtual int close(); /*! Inherithed from Stream. */ virtual int write(const char* buffer, u_long len, u_long *nbw); Modified: trunk/myserver/include/base/pipe/pipe.h =================================================================== --- trunk/myserver/include/base/pipe/pipe.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/base/pipe/pipe.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -36,7 +36,7 @@ void inverted(Pipe&); virtual int read(char* buffer, u_long len, u_long *nbr); virtual int write(const char* buffer, u_long len, u_long *nbw); - void close(); + virtual int close(); void closeRead(); void closeWrite(); bool pipeTerminated(){return terminated;} Modified: trunk/myserver/include/base/process/process_server_manager.h =================================================================== --- trunk/myserver/include/base/process/process_server_manager.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/base/process/process_server_manager.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -57,7 +57,7 @@ { if(isLocal) { - socket.closesocket(); + socket.close(); process.terminateProcess(); } } Modified: trunk/myserver/include/base/socket/socket.h =================================================================== --- trunk/myserver/include/base/socket/socket.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/base/socket/socket.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -96,7 +96,7 @@ int setsockopt(int,int, const char*,int); virtual int connect(MYSERVER_SOCKADDR*, int); - virtual int closesocket(); + virtual int close(); virtual int shutdown(int how); virtual int recv(char*, int, int, u_long); virtual int recv(char*, int, int); Modified: trunk/myserver/include/base/socket/ssl_socket.h =================================================================== --- trunk/myserver/include/base/socket/ssl_socket.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/base/socket/ssl_socket.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -62,7 +62,7 @@ SSL* getSSLConnection(); #endif - virtual int closesocket(); + virtual int close(); virtual int shutdown(int how); virtual int connect(MYSERVER_SOCKADDR* sa, int na); virtual int recv(char* buffer,int len,int flags); Modified: trunk/myserver/include/filter/stream.h =================================================================== --- trunk/myserver/include/filter/stream.h 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/include/filter/stream.h 2008-09-18 18:23:58 UTC (rev 2822) @@ -38,6 +38,7 @@ virtual int write(const char* buffer, u_long len, u_long*); virtual int flush(u_long*); virtual FileHandle getHandle(); + virtual int close(); Stream(); /*! Avoid direct instances of this class. */ virtual ~Stream() = 0; Modified: trunk/myserver/src/base/file/file.cpp =================================================================== --- trunk/myserver/src/base/file/file.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/file/file.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -164,7 +164,7 @@ ret = setFilePointer(0); if(ret) { - closeFile(); + close(); filename.clear(); return 1; } @@ -356,7 +356,7 @@ /*! *Close an open base/file/file.handle. */ -int File::closeFile() +int File::close() { int ret = 0; if(handle) @@ -367,7 +367,7 @@ #endif #ifdef NOT_WIN ret = fsync((long)handle); - ret |= close((long)handle); + ret |= ::close((long)handle); #endif } filename.clear(); Modified: trunk/myserver/src/base/files_cache/cached_file.cpp =================================================================== --- trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -155,7 +155,7 @@ /*! *Close an open base/file/file.handle. */ -int CachedFile::closeFile() +int CachedFile::close() { buffer->decRef(); return 0; Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp =================================================================== --- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -64,7 +64,7 @@ file.read(buffer, fileSize, &nbw); - file.closeFile(); + file.close(); } /*! Modified: trunk/myserver/src/base/files_cache/cached_file_factory.cpp =================================================================== --- trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -209,7 +209,7 @@ if(record == 0) { delete record; - file->closeFile(); + file->close(); delete file; mutex.unlock(); return 0; @@ -219,7 +219,7 @@ record->mtime = file->getLastModTime(); - file->closeFile(); + file->close(); delete file; if(buffer == 0) Modified: trunk/myserver/src/base/home_dir/home_dir.cpp =================================================================== --- trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -145,7 +145,7 @@ timestamp = usersFile.getLastModTime(); if(size == (u_long) -1) { - usersFile.closeFile(); + usersFile.close(); return 1; } @@ -201,7 +201,7 @@ /* Next tuple. */ } delete [] buffer; - usersFile.closeFile(); + usersFile.close(); #endif loaded = 1; Modified: trunk/myserver/src/base/pipe/pipe.cpp =================================================================== --- trunk/myserver/src/base/pipe/pipe.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/pipe/pipe.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -192,7 +192,7 @@ /*! *Close the pipe. */ -void Pipe::close() +int Pipe::close() { terminated = true; #ifdef NOT_WIN @@ -208,6 +208,7 @@ CloseHandle(writeHandle); readHandle = writeHandle = 0; #endif + return 0; } /*! Modified: trunk/myserver/src/base/process/process_server_manager.cpp =================================================================== --- trunk/myserver/src/base/process/process_server_manager.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/process/process_server_manager.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -216,7 +216,7 @@ if(s && s->isLocal && !s->process.isProcessAlive()) { - s->socket.closesocket(); + s->socket.close(); s->process.terminateProcess(); if(!s->path.length()) s->path.assign(name); @@ -459,20 +459,20 @@ spi.stdOut = spi.stdError =(FileHandle) -1; if(server->process.execConcurrentProcess(&spi) == -1) { - server->socket.closesocket(); + server->socket.close(); //return 1; allow IPv6 } } else { - server->socket.closesocket(); + server->socket.close(); //return 1; allow IPv6 } } else { - server->socket.closesocket(); + server->socket.close(); //return 1; allow IPv6 } } @@ -490,12 +490,12 @@ if(server->socket.bind(&serverSockAddrIn, sizeof(sockaddr_in6))) { - server->socket.closesocket(); + server->socket.close(); return 1; } if(server->socket.listen(SOMAXCONN)) { - server->socket.closesocket(); + server->socket.close(); return 1; } server->DESCRIPTOR.fileHandle = server->socket.getHandle(); @@ -509,7 +509,7 @@ if(server->process.execConcurrentProcess(&spi) == -1) { - server->socket.closesocket(); + server->socket.close(); return 1; } } @@ -538,7 +538,7 @@ /*! If the socket was created try to connect. */ if(sock->connect(server->host.c_str(), server->port) == -1) { - sock->closesocket(); + sock->close(); return -1; } @@ -552,7 +552,7 @@ /*! If the socket was created try to connect. */ if(sock->connect(server->host, server->port) == -1) { - sock->closesocket(); + sock->close(); return -1; } } Modified: trunk/myserver/src/base/socket/socket.cpp =================================================================== --- trunk/myserver/src/base/socket/socket.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/socket/socket.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -215,7 +215,7 @@ /*! *Close the socket. */ -int Socket::closesocket() +int Socket::close() { #ifdef WIN32 if(socketHandle) @@ -554,7 +554,7 @@ if(Socket::connect((MYSERVER_SOCKADDR*)(&connectionSockAddrIn), nSockLen) == -1) { - Socket::closesocket(); + Socket::close(); } else { @@ -587,7 +587,7 @@ sockAddr.sin_port = htons(port); if(Socket::connect((MYSERVER_SOCKADDR*)&sockAddr, sockLen) == -1) { - Socket::closesocket(); + Socket::close(); return -1; } #endif Modified: trunk/myserver/src/base/socket/ssl_socket.cpp =================================================================== --- trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -63,12 +63,12 @@ /*! *Close the socket. */ -int SslSocket::closesocket() +int SslSocket::close() { #ifndef DO_NOT_USE_SSL freeSSL(); #endif - return Socket::closesocket(); + return Socket::close(); } /*! @@ -152,7 +152,7 @@ if(SSL_connect(sslConnection) < 0) { SSL_CTX_free(sslContext); - closesocket(); + close(); sslContext = 0; return -1; } @@ -229,7 +229,7 @@ { shutdown(2); freeSSL(); - closesocket(); + close(); return -1; } @@ -243,7 +243,7 @@ { shutdown(2); freeSSL(); - closesocket(); + close(); return -1; } SSL_set_read_ahead(sslConnection, 0); @@ -254,7 +254,7 @@ { shutdown(2); freeSSL(); - closesocket(); + close(); return -1; } #endif Modified: trunk/myserver/src/conf/mime/mime_manager.cpp =================================================================== --- trunk/myserver/src/conf/mime/mime_manager.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/conf/mime/mime_manager.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -381,7 +381,7 @@ f.writeToFile("\r\n\r\n", 25, &nbw); } f.writeToFile("\r\n", 14, &nbw); - f.closeFile(); + f.close(); rwLock.writeUnlock(); return 1; Modified: trunk/myserver/src/conf/vhost/vhost_manager.cpp =================================================================== --- trunk/myserver/src/conf/vhost/vhost_manager.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/conf/vhost/vhost_manager.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -741,7 +741,7 @@ } } out.writeToFile("\r\n", 11, &nbw); - out.closeFile(); + out.close(); mutex.unlock(); } catch(...) Modified: trunk/myserver/src/connection/connection.cpp =================================================================== --- trunk/myserver/src/connection/connection.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/connection/connection.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -58,7 +58,7 @@ err = socket->recv(buffer, buffersize, 0); }while((err != -1) && err); - socket->closesocket(); + socket->close(); delete socket; } Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -56,13 +56,13 @@ e = bind(listener, (const struct sockaddr*) &addr, sizeof(addr)); if (e == SOCKET_ERROR) { - closesocket(listener); + close(listener); return -1; } e = getsockname(listener, (struct sockaddr*) &addr, &addrlen); if (e == SOCKET_ERROR) { - closesocket(listener); + close(listener); return -1; } @@ -77,13 +77,13 @@ if ((socks[1] = accept(listener, NULL, NULL)) == INVALID_SOCKET) break; - closesocket(listener); + close(listener); return 0; } while (0); - closesocket(listener); - closesocket(socks[0]); - closesocket(socks[1]); + close(listener); + close(socks[0]); + close(socks[1]); return -1; #endif } @@ -663,7 +663,7 @@ { ConnectionPtr c = *it; if ( c->allowDelete(true) && c->socket) - c->socket->closesocket(); + c->socket->close(); } } catch(...) Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -498,7 +498,7 @@ err = serverSocket->recv(buffer, 256, 0); }while(err != -1); - serverSocket->closesocket(); + serverSocket->close(); delete serverSocket; } delete (*it); Modified: trunk/myserver/src/filter/stream.cpp =================================================================== --- trunk/myserver/src/filter/stream.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/filter/stream.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -31,6 +31,15 @@ } /*! + *Close the stream. + *\return -1 on errors. + */ +int Stream::close() +{ + return 0; +} + +/*! *Write [len] characters to the stream. Returns -1 on errors. */ int Stream::write(const char* buffer, u_long len, u_long *nbw) Modified: trunk/myserver/src/http_handler/cgi/cgi.cpp =================================================================== --- trunk/myserver/src/http_handler/cgi/cgi.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/http_handler/cgi/cgi.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -311,7 +311,7 @@ { if( cgiProc.execConcurrentProcess(&spi) == -1) { - stdInFile.closeFile(); + stdInFile.close(); stdOutFile.close(); td->connection->host->warningsLogRequestAccess(td->id); td->connection->host->warningsLogWrite @@ -351,7 +351,7 @@ td->buffer2->getRealLength() - headerOffset - 1, &nBytesRead)) { - stdInFile.closeFile(); + stdInFile.close(); stdOutFile.close(); td->connection->host->warningsLogRequestAccess(td->id); td->connection->host->warningsLogWrite @@ -386,7 +386,7 @@ td->connection->host->warningsLogTerminateAccess(td->id); td->http->raiseHTTPError(500); stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); cgiProc.terminateProcess(); return 0; @@ -449,7 +449,7 @@ { td->http->sendHTTPRedirect(location->c_str()); stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); cgiProc.terminateProcess(); return 1; @@ -463,7 +463,7 @@ if(chain.write(td->buffer->getBuffer(), static_cast(td->buffer->getLength()), &nbw2)) { - stdInFile.closeFile(); + stdInFile.close(); stdOutFile.close(); chain.clearAllFilters(); /* Remove the connection on sockets error. */ @@ -476,7 +476,7 @@ if(!nph && onlyHeader) { stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); cgiProc.terminateProcess(); return 1; @@ -494,7 +494,7 @@ td->connection->host->warningsLogWrite("Cgi: Error loading filters"); td->connection->host->warningsLogTerminateAccess(td->id); stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); cgiProc.terminateProcess(); chain.clearAllFilters(); return td->http->raiseHTTPError(500); @@ -512,7 +512,7 @@ useChunks)) { stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); /* Remove the connection on sockets error. */ cgiProc.terminateProcess(); @@ -531,7 +531,7 @@ if((int)(getTicks() - procStartTime) > cgiTimeout) { stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); /* Remove the connection on sockets error. */ cgiProc.terminateProcess(); @@ -546,7 +546,7 @@ &nBytesRead)) { stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); /* Remove the connection on sockets error. */ cgiProc.terminateProcess(); @@ -566,7 +566,7 @@ useChunks)) { stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); /* Remove the connection on sockets error. */ cgiProc.terminateProcess(); @@ -581,7 +581,7 @@ if(useChunks && chain.write("0\r\n\r\n", 5, &nbw2)) { stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); chain.clearAllFilters(); /* Remove the connection on sockets error. */ @@ -598,7 +598,7 @@ /* Close the stdin and stdout files used by the CGI. */ stdOutFile.close(); - stdInFile.closeFile(); + stdInFile.close(); /* Delete the file only if it was created by the CGI module. */ if(!td->inputData.getHandle()) Modified: trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp =================================================================== --- trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -218,7 +218,7 @@ chain.clearAllFilters(); return td->http->raiseHTTPError(500); } - td->inputData.closeFile(); + td->inputData.close(); if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_ALWAYS | File::MYSERVER_NO_INHERIT)) @@ -269,7 +269,7 @@ td->connection->host->warningsLogTerminateAccess(td->id); } chain.clearAllFilters(); - con.sock.closesocket(); + con.sock.close(); return td->http->raiseHTTPError(500); } @@ -285,7 +285,7 @@ td->connection->host->warningsLogTerminateAccess(td->id); } chain.clearAllFilters(); - con.sock.closesocket(); + con.sock.close(); return td->http->raiseHTTPError(501); } @@ -300,7 +300,7 @@ td->connection->host->warningsLogTerminateAccess(td->id); } chain.clearAllFilters(); - con.sock.closesocket(); + con.sock.close(); return td->http->raiseHTTPError(500); } @@ -375,7 +375,7 @@ td->connection->host->warningsLogTerminateAccess(td->id); } - con.sock.closesocket(); + con.sock.close(); return td->http->raiseHTTPError(500); } @@ -437,7 +437,7 @@ td->connection->host->warningsLogTerminateAccess(td->id); sendFcgiBody(&con, 0, 0, FCGIABORT_REQUEST, id); con.sock.shutdown(2); - con.sock.closesocket(); + con.sock.close(); break; } /*! @@ -458,7 +458,7 @@ switch(header.type) { case FCGISTDERR: - con.sock.closesocket(); + con.sock.close(); td->http->raiseHTTPError(501); exit = 1; ret = 0; @@ -529,9 +529,9 @@ if((!ret) || con.tempOut.readFromFile(buffer, td->buffer->getRealLength(), &nbr)) { - con.tempOut.closeFile(); + con.tempOut.close(); FilesUtility::deleteFile(outDataPath.c_str()); - con.sock.closesocket(); + con.sock.close(); chain.clearAllFilters(); return td->http->sendHTTPhardError500(); } @@ -562,9 +562,9 @@ u_long nbw2; if(td->response.location[0]) { - con.tempOut.closeFile(); + con.tempOut.close(); FilesUtility::deleteFile(outDataPath.c_str()); - con.sock.closesocket(); + con.sock.close(); chain.clearAllFilters(); return td->http->sendHTTPRedirect((char*)td->response.location.c_str()); } @@ -712,9 +712,9 @@ break; } chain.clearAllFilters(); - con.tempOut.closeFile(); + con.tempOut.close(); FilesUtility::deleteFile(outDataPath.c_str()); - con.sock.closesocket(); + con.sock.close(); return ret; } Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp =================================================================== --- trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -292,7 +292,7 @@ if(ret) { /* Return an internal server error. */ - td->outputData.closeFile(); + td->outputData.close(); chain.clearAllFilters(); return td->http->raiseHTTPError(500); } @@ -314,7 +314,7 @@ if(ret) { - td->outputData.closeFile(); + td->outputData.close(); /* Return an internal server error. */ return td->http->raiseHTTPError(500); } @@ -357,7 +357,7 @@ if(ret) { - td->outputData.closeFile(); + td->outputData.close(); chain.clearAllFilters(); /* Return an internal server error. */ return td->http->raiseHTTPError(500); @@ -386,7 +386,7 @@ if(ret) { fd.findclose(); - td->outputData.closeFile(); + td->outputData.close(); chain.clearAllFilters(); /* Return an internal server error. */ return td->http->raiseHTTPError(500); @@ -479,7 +479,7 @@ td->appendOutputs, useChunks); if(ret) { - td->outputData.closeFile(); + td->outputData.close(); chain.clearAllFilters(); /* Return an internal server error. */ return td->http->raiseHTTPError(500); @@ -515,7 +515,7 @@ if(ret) { - td->outputData.closeFile(); + td->outputData.close(); /* Return an internal server error. */ return td->http->raiseHTTPError(500); } Modified: trunk/myserver/src/http_handler/http_file/http_file.cpp =================================================================== --- trunk/myserver/src/http_handler/http_file/http_file.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/http_handler/http_file/http_file.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -122,7 +122,7 @@ ret = file->setFilePointer(firstByte); if(ret) { - file->closeFile(); + file->close(); delete file; return td->http->raiseHTTPError(500); } @@ -216,7 +216,7 @@ &memStream, &nbw)) { - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 0; @@ -233,7 +233,7 @@ u_long nbw; if(!gzipFilter) { - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 0; @@ -241,7 +241,7 @@ if(chain.addFilter(gzipFilter, &nbw)) { delete gzipFilter; - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 0; @@ -311,7 +311,7 @@ if(s->socket->send(td->buffer->getBuffer(), (u_long)td->buffer->getLength(), 0) == SOCKET_ERROR) { - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 1; @@ -324,7 +324,7 @@ */ if(onlyHeader) { - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 0; @@ -344,7 +344,7 @@ off_t offset = firstByte; ret = sendfile(s->socket->getHandle(), file->getHandle(), &offset, bytesToSend); - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); @@ -373,7 +373,7 @@ if(ret) { - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 0; @@ -391,7 +391,7 @@ td->appendOutputs, useChunks)) { - file->closeFile(); + file->close(); delete file; chain.clearAllFilters(); return 1; @@ -502,12 +502,12 @@ }/* End for loop. */ - file->closeFile(); + file->close(); delete file; } catch(bad_alloc &ba) { - file->closeFile(); + file->close(); delete file; s->host->warningsLogRequestAccess(td->id); s->host->warningsLogWrite("HttpFile: Error allocating memory"); @@ -517,7 +517,7 @@ } catch(...) { - file->closeFile(); + file->close(); delete file; s->host->warningsLogRequestAccess(td->id); s->host->warningsLogWrite("HttpFile: Internal error"); Modified: trunk/myserver/src/http_handler/scgi/scgi.cpp =================================================================== --- trunk/myserver/src/http_handler/scgi/scgi.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/http_handler/scgi/scgi.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -184,7 +184,7 @@ chain.clearAllFilters(); return td->http->raiseHTTPError(500); } - td->inputData.closeFile(); + td->inputData.close(); if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_ALWAYS | File::MYSERVER_NO_INHERIT)) @@ -233,9 +233,9 @@ chain.clearAllFilters(); - con.tempOut.closeFile(); + con.tempOut.close(); - con.sock.closesocket(); + con.sock.close(); return ret; } Modified: trunk/myserver/src/http_handler/wincgi/wincgi.cpp =================================================================== --- trunk/myserver/src/http_handler/wincgi/wincgi.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/http_handler/wincgi/wincgi.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -279,7 +279,7 @@ sprintf(buffer, "Debug Mode=No\r\n", bias); DataFileHandle.writeToFile(buffer, 15, &nbr); - DataFileHandle.closeFile(); + DataFileHandle.close(); /* *Create the out file. @@ -293,14 +293,14 @@ td->connection->host->warningsLogWrite( "WinCGI: Error creating output file"); td->connection->host->warningsLogTerminateAccess(td->id); - DataFileHandle.closeFile(); + DataFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); chain.clearAllFilters(); return td->http->raiseHTTPError(500); } } - OutFileHandle.closeFile(); + OutFileHandle.close(); spi.cmdLine.assign("cmd /c \""); spi.cmdLine.append(filename); spi.cmdLine.append("\" "); @@ -341,7 +341,7 @@ td->connection->host->warningsLogRequestAccess(td->id); td->connection->host->warningsLogWrite(msg.str().c_str()); td->connection->host->warningsLogTerminateAccess(td->id); - OutFileHandle.closeFile(); + OutFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); chain.clearAllFilters(); @@ -385,7 +385,7 @@ (int)strlen((const char*)td->buffer->getBuffer()), &nbw2)) { - OutFileHandle.closeFile(); + OutFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); chain.clearAllFilters(); @@ -394,7 +394,7 @@ if(onlyHeader) { - OutFileHandle.closeFile(); + OutFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); chain.clearAllFilters(); @@ -436,7 +436,7 @@ ret = td->outputData.writeToFile(buffer, nBytesRead, &nbw); if(ret) { - OutFileHandle.closeFile(); + OutFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); chain.clearAllFilters(); @@ -449,7 +449,7 @@ ret = chain.write((char*)buffer, nBytesRead, &nbw2); if(ret == -1) { - OutFileHandle.closeFile(); + OutFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); chain.clearAllFilters(); @@ -465,7 +465,7 @@ td->sentData += nbw; chain.clearAllFilters(); - OutFileHandle.closeFile(); + OutFileHandle.close(); FilesUtility::deleteFile(outFilePath); FilesUtility::deleteFile(dataFilePath); return 1; Modified: trunk/myserver/src/log/log_manager.cpp =================================================================== --- trunk/myserver/src/log/log_manager.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/log/log_manager.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -96,7 +96,7 @@ int LogManager::close() { if(loaded) - file.closeFile(); + file.close(); return 0; } @@ -280,7 +280,7 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } if(gzipLog) @@ -291,7 +291,7 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } gzip.initialize(); @@ -305,7 +305,7 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } if(nbr == 0) @@ -318,7 +318,7 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } } @@ -326,7 +326,7 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } } @@ -338,7 +338,7 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } len=gzip.getFooter(gzipData, 16); @@ -346,13 +346,13 @@ { delete [] buffer; delete [] buffer2; - newFile.closeFile(); + newFile.close(); return 1; } gzip.free(); } - newFile.closeFile(); - currentFile->closeFile(); + newFile.close(); + currentFile->close(); FilesUtility::deleteFile(filepath.c_str()); if(currentFile->openFile(filepath.c_str(), File::MYSERVER_OPEN_APPEND| File::MYSERVER_OPEN_ALWAYS | File::MYSERVER_OPEN_WRITE | Modified: trunk/myserver/src/plugin/executor/dynamic_executor.cpp =================================================================== --- trunk/myserver/src/plugin/executor/dynamic_executor.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/plugin/executor/dynamic_executor.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -108,7 +108,7 @@ if(buffer) delete []buffer; - file.closeFile(); + file.close(); return ret; } Modified: trunk/myserver/src/protocol/control/control_protocol.cpp =================================================================== --- trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -291,7 +291,7 @@ strcpy(b2,"Control: Error in the temporary file creation"); addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0); - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; return 0; @@ -306,7 +306,7 @@ strcpy(b2,"Control: Error writing to temporary file"); addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0); - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -329,7 +329,7 @@ strcpy(b2,"Control: Error in communication"); addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0); - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -342,7 +342,7 @@ strcpy(b2,"Control: Error trying to write on the temporary file"); addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0); - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -357,7 +357,7 @@ strcpy(b2,"Control: Bad content length specified"); addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_BAD_LEN, header, 0); - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -381,7 +381,7 @@ addToErrorLog(a,b2, strlen(b2), header); if(Ifile) { - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -401,7 +401,7 @@ addToErrorLog(a,b2, strlen(b2), header); if(Ifile) { - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -419,7 +419,7 @@ addToErrorLog(a,b2, strlen(b2), header); if(Ifile) { - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -443,7 +443,7 @@ strcpy(b2,"Control: Error in allocating memory"); addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0); - Ifile->closeFile(); + Ifile->close(); FilesUtility::deleteFile(IfilePath.str().c_str()); delete Ifile; Ifile=0; @@ -459,7 +459,7 @@ addToErrorLog(a,b2, strlen(b2), header); sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0); delete Ofile; - Ifile->closeFile(); + Ifile->close(); delete Ifile; FilesUtility::deleteFile(IfilePath.str().c_str()); @@ -540,13 +540,13 @@ sendResponse(b2, bs2, a, CONTROL_OK, header, Ofile); if(Ifile) { - Ifile->closeFile(); + Ifile->close(); delete Ifile; Ifile=0; } if(Ofile) { - Ofile->closeFile(); + Ofile->close(); delete Ofile; Ofile=0; } @@ -570,13 +570,13 @@ if(Ifile) { - Ifile->closeFile(); + Ifile->close(); delete Ifile; Ifile=0; } if(Ofile) { - Ofile->closeFile(); + Ofile->close(); delete Ofile; Ofile=0; } @@ -933,7 +933,7 @@ } - localfile.closeFile(); + localfile.close(); return 0; } @@ -1031,7 +1031,7 @@ return CONTROL_INTERNAL; } } - localfile.closeFile(); + localfile.close(); if(isAutoRebootToEnable) Server::getInstance()->enableAutoReboot(); Modified: trunk/myserver/src/protocol/ftp/ftp.cpp =================================================================== --- trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -162,7 +162,7 @@ if ( m_pDataConnection != NULL && m_pDataConnection->socket != NULL ) { m_pDataConnection->socket->shutdown(SD_BOTH); - m_pDataConnection->socket->closesocket(); + m_pDataConnection->socket->close(); delete m_pDataConnection->socket; m_pDataConnection->socket = NULL; m_pDataConnection->setScheduled(0); @@ -585,7 +585,7 @@ return; pFtpUserData->m_pDataConnection->socket->shutdown(SD_BOTH); - pFtpUserData->m_pDataConnection->socket->closesocket(); + pFtpUserData->m_pDataConnection->socket->close(); delete pFtpUserData->m_pDataConnection->socket; pFtpUserData->m_pDataConnection->socket = new Socket(asock); } @@ -780,7 +780,7 @@ if ( file->readFromFile(buffer.getBuffer(), nBufferSize, &nbr) ) { ftp_reply(pConnection, 451); - file->closeFile(); + file->close(); delete file; pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); @@ -799,7 +799,7 @@ if ( pLine == NULL ) { ftp_reply(pConnection, 451); - file->closeFile(); + file->close(); delete file; pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); @@ -835,8 +835,8 @@ (u_long)buffer2.getLength(), 0) == SOCKET_ERROR ) { ftp_reply(pConnection, 451); - file->closeFile(); - file->closeFile(); + file->close(); + file->close(); delete file; pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); @@ -850,7 +850,7 @@ if ( pFtpUserData->m_bBreakDataConnection ) { pFtpUserData->m_bBreakDataConnection = false; - file->closeFile(); + file->close(); delete file; pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); @@ -862,13 +862,13 @@ #endif } } - file->closeFile(); + file->close(); delete file; } catch (bad_alloc &ba) { if ( file != NULL ) - file->closeFile(); + file->close(); delete file; //report error } @@ -1015,7 +1015,7 @@ (u_long)nBufferSize, 0) == SOCKET_ERROR ) { ftp_reply(pConnection, 451); - file->closeFile(); + file->close(); delete file; pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); @@ -1032,7 +1032,7 @@ if ( pFtpUserData->m_bBreakDataConnection ) { pFtpUserData->m_bBreakDataConnection = false; - file->closeFile(); + file->close(); delete file; pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); @@ -1044,13 +1044,13 @@ #endif } } - file->closeFile(); + file->close(); delete file; } catch (bad_alloc &ba) { if ( file != NULL ) - file->closeFile(); + file->close(); delete file; //report error } @@ -1195,7 +1195,7 @@ if ( pLine == NULL ) { ftp_reply(pConnection, 451); - file.closeFile(); + file.close(); pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); delete pWt; @@ -1235,7 +1235,7 @@ if ( pFtpUserData->m_bBreakDataConnection ) { pFtpUserData->m_bBreakDataConnection = false; - file.closeFile(); + file.close(); pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); delete pWt; @@ -1247,11 +1247,11 @@ } memset(buffer.getBuffer(), 0, buffer.getRealLength()); } - file.closeFile(); + file.close(); } catch (bad_alloc &ba) { - file.closeFile(); + file.close(); //report error } @@ -1386,7 +1386,7 @@ if ( pFtpUserData->m_bBreakDataConnection ) { pFtpUserData->m_bBreakDataConnection = false; - file.closeFile(); + file.close(); pFtpUserData->CloseDataConnection(); pFtpUserData->m_DataConnBusy.unlock(); delete pWt; @@ -1397,12 +1397,12 @@ #endif } } - file.closeFile(); + file.close(); } catch (bad_alloc &ba) { //report error - file.closeFile(); + file.close(); } ftp_reply(pConnection, 226); Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -261,7 +261,7 @@ if(td->inputData.readFromFile(td->buffer->getBuffer(), td->buffer->getRealLength(), &nbr)) { - file.closeFile(); + file.close(); /*! Return an internal server error. */ return raiseHTTPError(500); } @@ -269,7 +269,7 @@ { if(file.writeToFile(td->buffer->getBuffer(), nbr, &nbw)) { - file.closeFile(); + file.close(); /*! Return an internal server error. */ return raiseHTTPError(500); } @@ -278,12 +278,12 @@ break; if(nbw != nbr) { - file.closeFile(); + file.close(); /*! Internal server error. */ return raiseHTTPError(500); } } - file.closeFile(); + file.close(); /*! Successful updated. */ raiseHTTPError(200); @@ -308,14 +308,14 @@ if(td->inputData.readFromFile(td->buffer->getBuffer(), td->buffer->getRealLength(), &nbr)) { - file.closeFile(); + file.close(); return raiseHTTPError(500); } if(nbr) { if(file.writeToFile(td->buffer->getBuffer(), nbr, &nbw)) { - file.closeFile(); + file.close(); return raiseHTTPError(500); } } @@ -323,11 +323,11 @@ break; if( nbw != nbr ) { - file.closeFile(); + file.close(); return raiseHTTPError(500); } } - file.closeFile(); + file.close(); /*! Successful created. */ raiseHTTPError(201); return 1; @@ -1170,12 +1170,12 @@ if(h.readFromFile(linkpath, linkpathSize, &nbr)) { - h.closeFile(); + h.close(); delete [] linkpath; return raiseHTTPError(500);/*!Internal server error*/ } - h.closeFile(); + h.close(); linkpath[nbr]='\0'; pathInfo = new char[td->pathInfo.length() + 1]; @@ -1565,7 +1565,7 @@ */ if(td->inputData.getHandle()) { - td->inputData.closeFile(); + td->inputData.close(); FilesUtility::deleteFile(td->inputDataPath); } @@ -1574,7 +1574,7 @@ */ if(td->outputData.getHandle()) { - td->outputData.closeFile(); + td->outputData.close(); FilesUtility::deleteFile(td->outputDataPath); } logHTTPaccess(); @@ -1610,7 +1610,7 @@ */ if(td->inputData.getHandle()) { - td->inputData.closeFile(); + td->inputData.close(); FilesUtility::deleteFile(td->inputDataPath); } /*! @@ -1618,7 +1618,7 @@ */ if(td->outputData.getHandle()) { - td->outputData.closeFile(); + td->outputData.close(); FilesUtility::deleteFile(td->outputDataPath); } logHTTPaccess(); @@ -1817,7 +1817,7 @@ */ if(td->inputData.getHandle()) { - td->inputData.closeFile(); + td->inputData.close(); FilesUtility::deleteFile(td->inputDataPath); } /* @@ -1825,7 +1825,7 @@ */ if(td->outputData.getHandle()) { - td->outputData.closeFile(); + td->outputData.close(); FilesUtility::deleteFile(td->outputDataPath); } Modified: trunk/myserver/src/protocol/http/http_data_read.cpp =================================================================== --- trunk/myserver/src/protocol/http/http_data_read.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/protocol/http/http_data_read.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -344,7 +344,7 @@ { td->inputDataPath.assign(""); td->outputDataPath.assign(""); - td->inputData.closeFile(); + td->inputData.close(); return -1; } else if(ret) @@ -373,7 +373,7 @@ &nbr, timeout)) { - td->inputData.closeFile(); + td->inputData.close(); FilesUtility::deleteFile(td->inputDataPath); *httpRetCode = 400; return 1; @@ -383,7 +383,7 @@ length -= nbr; else { - td->inputData.closeFile(); + td->inputData.close(); FilesUtility::deleteFile(td->inputDataPath); *httpRetCode = 400; return 1; @@ -395,7 +395,7 @@ { td->inputDataPath.assign(""); td->outputDataPath.assign(""); - td->inputData.closeFile(); + td->inputData.close(); return -1; } Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-17 19:32:47 UTC (rev 2821) +++ trunk/myserver/src/server/server.cpp 2008-09-18 18:23:58 UTC (rev 2822) @@ -1232,7 +1232,7 @@ s.shutdown(2); /* Then close it. */ - s.closesocket(); + s.close(); } return ret; } @@ -1597,8 +1597,8 @@ FilesUtility::copyFile(inputF, outputF); - inputF.closeFile(); - outputF.closeFile(); + inputF.close(); + outputF.close(); } else { @@ -1673,8 +1673,8 @@ FilesUtility::copyFile(inputF, outputF); - inputF.closeFile(); - outputF.closeFile(); + inputF.close(); + outputF.close(); } } @@ -1747,8 +1747,8 @@ FilesUtility::copyFile(inputF, outputF); - inputF.closeFile(); - outputF.closeFile(); + inputF.close(); + outputF.close(); } } catch (...) From MAILER-DAEMON Thu Sep 18 15:44:51 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KgPQp-0004z4-CX for mharc-myserver-commit@gnu.org; Thu, 18 Sep 2008 15:44:51 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgPQo-0004yr-9U for myserver-commit@gnu.org; Thu, 18 Sep 2008 15:44:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgPQm-0004yI-K3 for myserver-commit@gnu.org; Thu, 18 Sep 2008 15:44:48 -0400 Received: from [199.232.76.173] (port=37616 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgPQm-0004y9-Gv for myserver-commit@gnu.org; Thu, 18 Sep 2008 15:44:48 -0400 Received: from savannah.gnu.org ([199.232.41.3]:55380 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgPQm-0002ZX-2V for myserver-commit@gnu.org; Thu, 18 Sep 2008 15:44:48 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KgPQl-0004Oc-Ef for myserver-commit@gnu.org; Thu, 18 Sep 2008 19:44:47 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KgPQl-0004OY-4Y for myserver-commit@gnu.org; Thu, 18 Sep 2008 19:44:47 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 18 Sep 2008 19:44:47 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2823] Fixed configure.in warning. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 19:44:50 -0000 Revision: 2823 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2823 Author: gscrivano Date: 2008-09-18 19:44:46 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Fixed configure.in warning. `GNU MyServer' moved away from `version'. Modified Paths: -------------- trunk/myserver/SConstruct trunk/myserver/configure.in trunk/myserver/generate_myserver_dev.pl trunk/myserver/version Modified: trunk/myserver/SConstruct =================================================================== --- trunk/myserver/SConstruct 2008-09-18 18:23:58 UTC (rev 2822) +++ trunk/myserver/SConstruct 2008-09-18 19:44:46 UTC (rev 2823) @@ -27,7 +27,7 @@ import string f = open('version','r') -MYSERVER_VERSION = f.readline() +MYSERVER_VERSION = "GNU MyServer " + f.readline() f.close() SVN_TRUNK = "svn://svn.savannah.gnu.org/myserver/trunk" Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-18 18:23:58 UTC (rev 2822) +++ trunk/myserver/configure.in 2008-09-18 19:44:46 UTC (rev 2823) @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -AC_INIT([GNU MyServer], [`cat version | awk'{print $NF}'`], [bug-myserver@gnu.org]) +AC_INIT([GNU MyServer], m4_esyscmd([cat version]), [bug-myserver@gnu.org]) AC_PREREQ([2.50]) AM_CONFIG_HEADER(config.h) CFLAGS="${CFLAGS=}" Modified: trunk/myserver/generate_myserver_dev.pl =================================================================== --- trunk/myserver/generate_myserver_dev.pl 2008-09-18 18:23:58 UTC (rev 2822) +++ trunk/myserver/generate_myserver_dev.pl 2008-09-18 19:44:46 UTC (rev 2823) @@ -39,8 +39,8 @@ PrivateResource=myserver_private.rc ResourceIncludes= MakeIncludes= -Compiler=-DMYSERVER_VERSION=\"$version\" -CppCompiler=-DMYSERVER_VERSION=\"$version\" +Compiler=-DMYSERVER_VERSION=\"GNU MyServer $version\" +CppCompiler=-DMYSERVER_VERSION=\"GNU MyServer $version\" Linker=-lz.dll -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -rdynamic_@@_ IsCpp=1 Icon= Modified: trunk/myserver/version =================================================================== --- trunk/myserver/version 2008-09-18 18:23:58 UTC (rev 2822) +++ trunk/myserver/version 2008-09-18 19:44:46 UTC (rev 2823) @@ -1 +1 @@ -GNU MyServer 0.9.0-rc2 \ No newline at end of file +0.9.0-rc2 \ No newline at end of file From MAILER-DAEMON Thu Sep 18 17:02:34 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KgQe2-0000eR-HG for mharc-myserver-commit@gnu.org; Thu, 18 Sep 2008 17:02:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgQe1-0000cl-6X for myserver-commit@gnu.org; Thu, 18 Sep 2008 17:02:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgQe0-0000bm-B0 for myserver-commit@gnu.org; Thu, 18 Sep 2008 17:02:32 -0400 Received: from [199.232.76.173] (port=44840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgQe0-0000bX-44 for myserver-commit@gnu.org; Thu, 18 Sep 2008 17:02:32 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51196 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgQdz-0007Ax-GL for myserver-commit@gnu.org; Thu, 18 Sep 2008 17:02:31 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KgQdy-00082F-Ix for myserver-commit@gnu.org; Thu, 18 Sep 2008 21:02:30 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KgQdy-00082B-BR for myserver-commit@gnu.org; Thu, 18 Sep 2008 21:02:30 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 18 Sep 2008 21:02:30 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2824] Fixed make install problem. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 21:02:33 -0000 Revision: 2824 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2824 Author: gscrivano Date: 2008-09-18 21:02:29 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Fixed make install problem. Now by default `$root_prefix' is `$(DESTDIR)'. Modified Paths: -------------- trunk/myserver/binaries/certificates/Makefile.am trunk/myserver/binaries/web/Makefile.am trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am trunk/myserver/binaries/web/cgi-src/post/Makefile.am trunk/myserver/configure.in Added Paths: ----------- trunk/myserver/binaries/certificates/how_create_certificates.txt Removed Paths: ------------- trunk/myserver/binaries/certificates/how create certificates.txt Modified: trunk/myserver/binaries/certificates/Makefile.am =================================================================== --- trunk/myserver/binaries/certificates/Makefile.am 2008-09-18 19:44:46 UTC (rev 2823) +++ trunk/myserver/binaries/certificates/Makefile.am 2008-09-18 21:02:29 UTC (rev 2824) @@ -1,4 +1,4 @@ install : $(INSTALL) -d '$(root_prefix)/etc/myserver/certificates' - $(INSTALL) 'how create certificates.txt' '$(root_prefix)/etc/myserver/certificates/how create certificates.txt' + $(INSTALL) 'how_create_certificates.txt' '$(root_prefix)/etc/myserver/certificates/how_create_certificates.txt' Deleted: trunk/myserver/binaries/certificates/how create certificates.txt =================================================================== --- trunk/myserver/binaries/certificates/how create certificates.txt 2008-09-18 19:44:46 UTC (rev 2823) +++ trunk/myserver/binaries/certificates/how create certificates.txt 2008-09-18 21:02:29 UTC (rev 2824) @@ -1,15 +0,0 @@ -Use the openSSL package that you can get at -http://www.openssl.org. - -After you have installed openSSL, execute the following commands: - -openssl genrsa -out server.key -openssl req -new -x509 -days 730 -key server.key -out server.pem - -These commands will create two files server.key and server.pem. Put -them in this directory and configure your virtual host file to use these -files adding the following lines under the section: - -certificates/server.key -certificates/server.pem - Copied: trunk/myserver/binaries/certificates/how_create_certificates.txt (from rev 2821, trunk/myserver/binaries/certificates/how create certificates.txt) =================================================================== --- trunk/myserver/binaries/certificates/how_create_certificates.txt (rev 0) +++ trunk/myserver/binaries/certificates/how_create_certificates.txt 2008-09-18 21:02:29 UTC (rev 2824) @@ -0,0 +1,15 @@ +Use the openSSL package that you can get at +http://www.openssl.org. + +After you have installed openSSL, execute the following commands: + +openssl genrsa -out server.key +openssl req -new -x509 -days 730 -key server.key -out server.pem + +These commands will create two files server.key and server.pem. Put +them in this directory and configure your virtual host file to use these +files adding the following lines under the section: + +certificates/server.key +certificates/server.pem + Property changes on: trunk/myserver/binaries/certificates/how_create_certificates.txt ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:mergeinfo + Name: svn:eol-style + native Modified: trunk/myserver/binaries/web/Makefile.am =================================================================== --- trunk/myserver/binaries/web/Makefile.am 2008-09-18 19:44:46 UTC (rev 2823) +++ trunk/myserver/binaries/web/Makefile.am 2008-09-18 21:02:29 UTC (rev 2824) @@ -1,4 +1,3 @@ - if BUILD_MSCGI CGI_SRC = cgi-src endif Modified: trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am =================================================================== --- trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am 2008-09-18 19:44:46 UTC (rev 2823) +++ trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am 2008-09-18 21:02:29 UTC (rev 2824) @@ -9,13 +9,12 @@ libmath_sum.a : - math_sum.mscgi : $(libmath_sum_a_OBJECTS) $(libmath_sum_a_DEPENDENCIES) -rm -f math_sum.mscgi $(CXX) $(libmath_sum_a_OBJECTS) ../../../../src/libmyserver.a $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) -o math_sum.mscgi -shared install : math_sum.mscgi - $(INSTALL) 'math_sum.mscgi' '$(root_prefix)/var/web/cgi-bin/math_sum.mscgi' + $(INSTALL) -D 'math_sum.mscgi' '$(root_prefix)/var/web/cgi-bin/math_sum.mscgi' clean : Modified: trunk/myserver/binaries/web/cgi-src/post/Makefile.am =================================================================== --- trunk/myserver/binaries/web/cgi-src/post/Makefile.am 2008-09-18 19:44:46 UTC (rev 2823) +++ trunk/myserver/binaries/web/cgi-src/post/Makefile.am 2008-09-18 21:02:29 UTC (rev 2824) @@ -15,7 +15,7 @@ $(CXX) $(libpost_a_OBJECTS) ../../../../src/libmyserver.a $(libpost_a_LIBADD) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) -o post.mscgi -shared install : post.mscgi - $(INSTALL) 'post.mscgi' '$(root_prefix)/var/web/cgi-bin/post.mscgi' + $(INSTALL) -D 'post.mscgi' '$(root_prefix)/var/web/cgi-bin/post.mscgi' clean : rm -f post.mscgi Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-18 19:44:46 UTC (rev 2823) +++ trunk/myserver/configure.in 2008-09-18 21:02:29 UTC (rev 2824) @@ -27,7 +27,7 @@ AM_INIT_AUTOMAKE -PACKAGE_STRING=`cat version` +PACKAGE_STRING= m4_esyscmd([cat version]) MYSERVER_VERSION="${PACKAGE_STRING}" AC_SUBST(MYSERVER_VERSION) @@ -51,8 +51,9 @@ CXXFLAGS="$CXXFLAGS $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" LDFLAGS="$LDFLAGS $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" -AC_ARG_WITH([root-prefix], [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], root_prefix=$withval, root_prefix="") +AC_ARG_WITH([root-prefix], [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], root_prefix=$withval, root_prefix="\$(DESTDIR)") + AC_ARG_ENABLE([control-gui], [ --disable-control-gui disable the myserver-configure GUI program], enable_control="no", enable_control="yes") AC_ARG_ENABLE([ipv6], [ --enable-ipv6 Build with IPv6 support], enable_ipv6="yes", enable_ipv6="") From MAILER-DAEMON Thu Sep 18 18:35:47 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KgS6F-0003Nc-00 for mharc-myserver-commit@gnu.org; Thu, 18 Sep 2008 18:35:47 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgS6C-0003MW-HO for myserver-commit@gnu.org; Thu, 18 Sep 2008 18:35:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgS6C-0003M7-49 for myserver-commit@gnu.org; Thu, 18 Sep 2008 18:35:44 -0400 Received: from [199.232.76.173] (port=57547 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgS6B-0003M3-R7 for myserver-commit@gnu.org; Thu, 18 Sep 2008 18:35:43 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53454 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgRlh-0005oG-NK for myserver-commit@gnu.org; Thu, 18 Sep 2008 18:14:33 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KgRlg-0006Cf-AI for myserver-commit@gnu.org; Thu, 18 Sep 2008 22:14:32 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KgRlf-0006Cb-TE for myserver-commit@gnu.org; Thu, 18 Sep 2008 22:14:32 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Thu, 18 Sep 2008 22:14:31 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2825] Include the `how_create_certificates.txt' file in the distribution. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 22:35:45 -0000 Revision: 2825 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2825 Author: gscrivano Date: 2008-09-18 22:14:31 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Include the `how_create_certificates.txt' file in the distribution. Modified Paths: -------------- trunk/myserver/binaries/certificates/Makefile.am trunk/myserver/configure.in Modified: trunk/myserver/binaries/certificates/Makefile.am =================================================================== --- trunk/myserver/binaries/certificates/Makefile.am 2008-09-18 21:02:29 UTC (rev 2824) +++ trunk/myserver/binaries/certificates/Makefile.am 2008-09-18 22:14:31 UTC (rev 2825) @@ -1,4 +1,4 @@ - +EXTRA_DIST = how_create_certificates.txt install : $(INSTALL) -d '$(root_prefix)/etc/myserver/certificates' $(INSTALL) 'how_create_certificates.txt' '$(root_prefix)/etc/myserver/certificates/how_create_certificates.txt' Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-18 21:02:29 UTC (rev 2824) +++ trunk/myserver/configure.in 2008-09-18 22:14:31 UTC (rev 2825) @@ -27,7 +27,7 @@ AM_INIT_AUTOMAKE -PACKAGE_STRING= m4_esyscmd([cat version]) +PACKAGE_STRING="m4_esyscmd([cat version])" MYSERVER_VERSION="${PACKAGE_STRING}" AC_SUBST(MYSERVER_VERSION) From MAILER-DAEMON Fri Sep 19 18:22:08 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KgoMa-00044N-EE for mharc-myserver-commit@gnu.org; Fri, 19 Sep 2008 18:22:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgoMY-00044I-6D for myserver-commit@gnu.org; Fri, 19 Sep 2008 18:22:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgoMX-000446-HP for myserver-commit@gnu.org; Fri, 19 Sep 2008 18:22:05 -0400 Received: from [199.232.76.173] (port=56533 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgoMX-000443-AY for myserver-commit@gnu.org; Fri, 19 Sep 2008 18:22:05 -0400 Received: from savannah.gnu.org ([199.232.41.3]:38957 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgoMW-0001BS-Us for myserver-commit@gnu.org; Fri, 19 Sep 2008 18:22:05 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KgoMW-0002Si-2w for myserver-commit@gnu.org; Fri, 19 Sep 2008 22:22:04 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KgoMV-0002Se-Kv for myserver-commit@gnu.org; Fri, 19 Sep 2008 22:22:03 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 19 Sep 2008 22:22:03 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2826] The `temporaryFileName' function was moved from the class `Server' to the class `FilesUtility'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 22:22:06 -0000 Revision: 2826 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2826 Author: gscrivano Date: 2008-09-19 22:22:02 +0000 (Fri, 19 Sep 2008) Log Message: ----------- The `temporaryFileName' function was moved from the class `Server' to the class `FilesUtility'. Modified Paths: -------------- trunk/myserver/include/base/file/files_utility.h trunk/myserver/include/server/server.h trunk/myserver/src/base/file/files_utility.cpp trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp trunk/myserver/src/protocol/http/http.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/base/file/files_utility.h =================================================================== --- trunk/myserver/include/base/file/files_utility.h 2008-09-18 22:14:31 UTC (rev 2825) +++ trunk/myserver/include/base/file/files_utility.h 2008-09-19 22:22:02 UTC (rev 2826) @@ -1,7 +1,7 @@ /* -*- mode: c++ -*- */ /* MyServer -Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -28,77 +28,81 @@ class FilesUtility { - FileHandle handle; - string filename; +private: + /*! Don't allow instances for this class. */ + FilesUtility(); -private: - /*! Don't allow instances for this class. */ - FilesUtility(); public: - static int getPathRecursionLevel(const char*); + static int getPathRecursionLevel(const char*); static int getPathRecursionLevel(string& filename) - {return getPathRecursionLevel(filename.c_str()); } + {return getPathRecursionLevel(filename.c_str()); } - static time_t getLastModTime(const char *filename); - static time_t getLastModTime(string const &filename) + static time_t getLastModTime(const char *filename); + static time_t getLastModTime(string const &filename) {return getLastModTime(filename.c_str());} - static time_t getCreationTime(const char *filename); - static time_t getCreationTime(string const &filename) + static time_t getCreationTime(const char *filename); + static time_t getCreationTime(string const &filename) {return getCreationTime(filename.c_str());} - static time_t getLastAccTime(const char *filename); - static time_t getLastAccTime(string const &filename) + static time_t getLastAccTime(const char *filename); + static time_t getLastAccTime(string const &filename) {return getLastAccTime(filename.c_str());} static int chown(const char* filename, int uid, int gid); static int chown(string const &filename, int uid, int gid) {return chown(filename.c_str(), uid, gid);} - static int completePath(char**, int *size, int dontRealloc=0); + static int completePath(char**, int *size, int dontRealloc=0); static int completePath(string &fileName); - static int isDirectory(const char*); + static int isDirectory(const char*); static int isDirectory(string& dir){return isDirectory(dir.c_str());} - static int isLink(const char*); + static int isLink(const char*); static int isLink(string& dir){return isLink(dir.c_str());} static int getShortFileName(char*,char*,int); - static int fileExists(const char * ); - static int fileExists(string const &file) + static int fileExists(const char * ); + static int fileExists(string const &file) {return fileExists(file.c_str());} - static int deleteFile(const char * ); - static int deleteFile(string const &file) + static int deleteFile(const char * ); + static int deleteFile(string const &file) {return deleteFile(file.c_str());} static int renameFile(const char*, const char*); - static int renameFile(string const &before, string const &after) + static int renameFile(string const &before, string const &after) {return renameFile(before.c_str(), after.c_str());} - static int copyFile(const char*, const char*, int overwrite); - static int copyFile(File, File); - static int copyFile(string const &src, string const &dest, int overwrite) - {return copyFile(src.c_str(), dest.c_str(), overwrite);} + static int copyFile(const char*, const char*, int overwrite); + static int copyFile(File, File); + static int copyFile(string const &src, string const &dest, int overwrite) + {return copyFile(src.c_str(), dest.c_str(), overwrite);} - static void getFileExt(char* ext,const char* filename); - static void getFileExt(string& ext, string const &filename); + static void getFileExt(char* ext,const char* filename); + static void getFileExt(string& ext, string const &filename); static void splitPathLength(const char *path, int *dir, int *filename); - static void splitPath(const char* path, char* dir, char*filename); - static void splitPath(string const &path, string& dir, string& filename); + static void splitPath(const char* path, char* dir, char*filename); + static void splitPath(string const &path, string& dir, string& filename); static int getFilenameLength(const char*, int *); - static void getFilename(const char* path, char* filename); - static void getFilename(string const &path, string& filename); + static void getFilename(const char* path, char* filename); + static void getFilename(string const &path, string& filename); - static int simpleMakeDirectory(const char *path); - static int deleteDirectory(const char *path); - static int simpleMakeDirectory(string const &path) - { return simpleMakeDirectory(path.c_str()); } - static int deleteDirectory(string const &path) - { return deleteDirectory(path.c_str()); } + static int simpleMakeDirectory(const char *path); + static int deleteDirectory(const char *path); + static int simpleMakeDirectory(string const &path) + { return simpleMakeDirectory(path.c_str()); } + static int deleteDirectory(string const &path) + { return deleteDirectory(path.c_str()); } + + static void temporaryFileName(u_long tid, string &out); + + static void setTmpPath(string & path){tmpPath.assign(path);} +private: + static string tmpPath; }; #endif Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-18 22:14:31 UTC (rev 2825) +++ trunk/myserver/include/server/server.h 2008-09-19 22:22:02 UTC (rev 2826) @@ -140,7 +140,6 @@ u_long getBuffersize(); u_long getBuffersize2(); u_long getThrottlingRate(); - void temporaryFileName(u_long tid, string &out); int waitNewConnection(u_long tid, u_long timeout); XmlParser *getConfiguration(){return &configurationFileManager;} ListenThreads *getListenThreads(){return &listenThreads;} @@ -248,7 +247,6 @@ string* mainConfigurationFile; string* vhostConfigurationFile; string* mimeConfigurationFile; - string tmpPath; PluginsManager pluginsManager; GenericPluginsManager genericPluginsManager; ProcessServerManager processServerManager; Modified: trunk/myserver/src/base/file/files_utility.cpp =================================================================== --- trunk/myserver/src/base/file/files_utility.cpp 2008-09-18 22:14:31 UTC (rev 2825) +++ trunk/myserver/src/base/file/files_utility.cpp 2008-09-19 22:22:02 UTC (rev 2826) @@ -17,9 +17,9 @@ #include "stdafx.h" +#include #include #include -#include #ifdef NOT_WIN extern "C" { @@ -43,6 +43,8 @@ using namespace std; +string FilesUtility::tmpPath; + /*! *Constructor body. */ @@ -780,3 +782,22 @@ return rmdir(path); #endif } + + +/*! + *Create an unique temporary file name. This function doesn't create the + *file or open it but generates only its name. + *\param + */ +void FilesUtility::temporaryFileName(u_long tid, string &out) +{ + ostringstream stream; + static u_long counter = 1; + counter++; + + if(tmpPath.length() == 0) + tmpPath.assign(getdefaultwd(0, 0)); + + stream << tmpPath << "/tmp_" << counter << "_" << tid; + out.assign(stream.str()); +} Modified: trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp =================================================================== --- trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-18 22:14:31 UTC (rev 2825) +++ trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-19 22:22:02 UTC (rev 2826) @@ -387,7 +387,7 @@ initialTicks = getTicks(); - Server::getInstance()->temporaryFileName(td->id, outDataPath); + FilesUtility::temporaryFileName(td->id, outDataPath); if(con.tempOut.createTemporaryFile(outDataPath.c_str())) { Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-18 22:14:31 UTC (rev 2825) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-19 22:22:02 UTC (rev 2826) @@ -1495,8 +1495,8 @@ *For methods that accept data after the HTTP header set the correct *pointer and create a file containing the informations after the header. */ - Server::getInstance()->temporaryFileName(td->id, td->inputDataPath); - Server::getInstance()->temporaryFileName(td->id, td->outputDataPath); + FilesUtility::temporaryFileName(td->id, td->inputDataPath); + FilesUtility::temporaryFileName(td->id, td->outputDataPath); dynamicCommand = staticHttp.dynCmdManager.getPlugin(td->request.cmd); Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-18 22:14:31 UTC (rev 2825) +++ trunk/myserver/src/server/server.cpp 2008-09-19 22:22:02 UTC (rev 2826) @@ -38,7 +38,6 @@ extern "C" { #ifdef WIN32 - //#include #include #endif #ifdef NOT_WIN @@ -1014,13 +1013,10 @@ data = configurationFileManager.getValue("TEMP_DIRECTORY"); if(data) { - tmpPath.assign(data); + string tmpPath(data); FilesUtility::completePath(tmpPath); + FilesUtility::setTmpPath(tmpPath); } - else - { - tmpPath.assign(getdefaultwd(0, 0)); - } data = configurationFileManager.getValue("MAX_FILESCACHE_FILESIZE"); if(data) @@ -1272,9 +1268,9 @@ newConnection->setLocalPort(localPort); newConnection->setIpAddr(ipAddr); newConnection->setLocalIpAddr(localIpAddr); - newConnection->host = Server::getInstance()->vhostList->getVHost(0, - localIpAddr, - localPort); + newConnection->host = vhostList->getVHost(0, + localIpAddr, + localPort); /* No vhost for the connection so bail. */ if(newConnection->host == 0) @@ -1283,7 +1279,7 @@ return 0; } - protocol = Server::getInstance()->getProtocol(newConnection->host->getProtocolName()); + protocol = getProtocol(newConnection->host->getProtocolName()); if(protocol) opts = protocol->getProtocolOptions(); @@ -2284,20 +2280,6 @@ } /*! - *Create an unique temporary file name. This function doesn't create the - *file or open it but generates only its name. - *\param - */ -void Server::temporaryFileName(u_long tid, string &out) -{ - ostringstream stream; - static u_long counter = 1; - counter++; - stream << tmpPath << "/tmp_" << counter << "_" << tid; - out.assign(stream.str()); -} - -/*! *Prepare the log to print an error. */ int Server::logPreparePrintError() From MAILER-DAEMON Sat Sep 20 07:12:17 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kh0Nt-0000Ix-1o for mharc-myserver-commit@gnu.org; Sat, 20 Sep 2008 07:12:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh0Nr-0000Ic-OA for myserver-commit@gnu.org; Sat, 20 Sep 2008 07:12:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh0Nq-0000IK-PY for myserver-commit@gnu.org; Sat, 20 Sep 2008 07:12:14 -0400 Received: from [199.232.76.173] (port=51890 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh0Nq-0000IH-LR for myserver-commit@gnu.org; Sat, 20 Sep 2008 07:12:14 -0400 Received: from savannah.gnu.org ([199.232.41.3]:52786 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kh0Nq-0007ZE-Da for myserver-commit@gnu.org; Sat, 20 Sep 2008 07:12:14 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kh0Np-0000qe-N6 for myserver-commit@gnu.org; Sat, 20 Sep 2008 11:12:13 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kh0Np-0000qa-4a for myserver-commit@gnu.org; Sat, 20 Sep 2008 11:12:13 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 20 Sep 2008 11:12:13 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2827] Support `find' without the -iregex switch. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 11:12:15 -0000 Revision: 2827 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2827 Author: gscrivano Date: 2008-09-20 11:12:11 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Support `find' without the -iregex switch. Modified Paths: -------------- trunk/myserver/src/Makefile.am Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-19 22:22:02 UTC (rev 2826) +++ trunk/myserver/src/Makefile.am 2008-09-20 11:12:11 UTC (rev 2827) @@ -10,13 +10,16 @@ $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \ $(XML_LIBS) $(LDFLAGS) + clean-libmyserver.a: rm -f libmyserver.a + libmyserver.a: clean-libmyserver.a - find -iregex .*\\.$(OBJEXT) | xargs $(AR) cru libmyserver.a + find . | grep .*\\.$(OBJEXT)$ | xargs $(AR) cru libmyserver.a $(RANLIB) libmyserver.a + all-local: libmyserver.a myserver${EXEEXT} cp myserver${EXEEXT} ../binaries From MAILER-DAEMON Sat Sep 20 08:54:59 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kh1zH-0005f6-Ap for mharc-myserver-commit@gnu.org; Sat, 20 Sep 2008 08:54:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh1zF-0005ez-SJ for myserver-commit@gnu.org; Sat, 20 Sep 2008 08:54:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh1zE-0005ee-DZ for myserver-commit@gnu.org; Sat, 20 Sep 2008 08:54:56 -0400 Received: from [199.232.76.173] (port=40813 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh1zE-0005eb-7D for myserver-commit@gnu.org; Sat, 20 Sep 2008 08:54:56 -0400 Received: from savannah.gnu.org ([199.232.41.3]:34121 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kh1zD-0004Tm-TU for myserver-commit@gnu.org; Sat, 20 Sep 2008 08:54:56 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kh1zC-0003yc-SQ for myserver-commit@gnu.org; Sat, 20 Sep 2008 12:54:54 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kh1zC-0003yY-Gv for myserver-commit@gnu.org; Sat, 20 Sep 2008 12:54:54 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 20 Sep 2008 12:54:54 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2828] All tests are successful on `FreeBSD'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 12:54:58 -0000 Revision: 2828 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2828 Author: gscrivano Date: 2008-09-20 12:54:53 +0000 (Sat, 20 Sep 2008) Log Message: ----------- All tests are successful on `FreeBSD'. Modified Paths: -------------- trunk/myserver/include/base/utility.h trunk/myserver/src/Makefile.am trunk/myserver/src/base/home_dir/home_dir.cpp trunk/myserver/src/base/sync/recursive_mutex.cpp trunk/myserver/src/base/utility.cpp trunk/myserver/tests/test_regex.cpp Modified: trunk/myserver/include/base/utility.h =================================================================== --- trunk/myserver/include/base/utility.h 2008-09-20 11:12:11 UTC (rev 2827) +++ trunk/myserver/include/base/utility.h 2008-09-20 12:54:53 UTC (rev 2828) @@ -35,11 +35,12 @@ #define MYSERVER_KB(x) (x << 10) //x * 1024 #define MYSERVER_MB(x) (x << 20) //x * 1024 * 1024 #define MYSERVER_SEC(x) (x * 1000) -#define OS_WINDOWS_9X 1 -#define OS_WINDOWS_2000 2 -#define OS_WINDOWS_NT3 3 -#define OS_WINDOWS_XP 4 -#define OS_LINUX 100 // Add room for future windows +#define OS_WINDOWS_9X 1 +#define OS_WINDOWS_2000 2 +#define OS_WINDOWS_NT3 3 +#define OS_WINDOWS_XP 4 +#define OS_GNU_LINUX 100 +#define OS_FREEBSD 200 int preparePrintError(); int endPrintError(); Modified: trunk/myserver/src/Makefile.am =================================================================== --- trunk/myserver/src/Makefile.am 2008-09-20 11:12:11 UTC (rev 2827) +++ trunk/myserver/src/Makefile.am 2008-09-20 12:54:53 UTC (rev 2828) @@ -25,4 +25,4 @@ clean-local: rm -f libmyserver.a - find -iregex .*\\.$(OBJEXT) | xargs rm -f + find . | grep .*\\.$(OBJEXT)$ | xargs rm -f Modified: trunk/myserver/src/base/home_dir/home_dir.cpp =================================================================== --- trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-20 11:12:11 UTC (rev 2827) +++ trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-20 12:54:53 UTC (rev 2828) @@ -153,20 +153,28 @@ usersFile.read(buffer, size, &read); buffer[read] = '\0'; - - for(counter = 0; counter < read; counter++) - if(buffer[counter] == ':' || buffer[counter] == '\n') - buffer[counter] = '\0'; - for(counter = 0; buffer[counter] != 0;) + for(counter = 0; counter < read; counter++) + if(buffer[counter] == ':') + buffer[counter] = '\0'; + + + for(counter = 0; counter < size;) { char *username = 0; char *home = 0; string sUsername; string *sHome; - string *old; - /* Username. */ - + string *old; + + if(buffer[counter] == '#') + while(buffer[counter++] != '\n'); + + if(counter >= size) + break; + + /* Username. */ + username = &buffer[counter]; while(buffer[counter++] != '\0'); @@ -183,7 +191,6 @@ while(buffer[counter++] != '\0'); /* Home. */ - home = &buffer[counter++]; sUsername = string(username); @@ -197,7 +204,7 @@ while(buffer[counter++] != '\0'); /* Shell. */ - while(buffer[counter++] != '\0'); + while(buffer[counter++] != '\n'); /* Next tuple. */ } delete [] buffer; Modified: trunk/myserver/src/base/sync/recursive_mutex.cpp =================================================================== --- trunk/myserver/src/base/sync/recursive_mutex.cpp 2008-09-20 11:12:11 UTC (rev 2827) +++ trunk/myserver/src/base/sync/recursive_mutex.cpp 2008-09-20 12:54:53 UTC (rev 2828) @@ -64,6 +64,7 @@ } #ifdef HAVE_PTHREAD pthread_mutexattr_t mta; + pthread_mutexattr_init(&mta); pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE); ret = pthread_mutex_init(&mutex, &mta); #else Modified: trunk/myserver/src/base/utility.cpp =================================================================== --- trunk/myserver/src/base/utility.cpp 2008-09-20 11:12:11 UTC (rev 2827) +++ trunk/myserver/src/base/utility.cpp 2008-09-20 12:54:53 UTC (rev 2828) @@ -86,13 +86,16 @@ ret = OS_WINDOWS_XP; break; } -#else +#endif + #ifdef __linux__ - ret = OS_LINUX; -#else - ret = 0; + ret = OS_GNU_LINUX; #endif + +#ifdef __FreeBSD__ + ret = OS_FREEBSD; #endif + return ret; } Modified: trunk/myserver/tests/test_regex.cpp =================================================================== --- trunk/myserver/tests/test_regex.cpp 2008-09-20 11:12:11 UTC (rev 2827) +++ trunk/myserver/tests/test_regex.cpp 2008-09-20 12:54:53 UTC (rev 2828) @@ -55,8 +55,8 @@ CPPUNIT_ASSERT_EQUAL(ret, 0); - CPPUNIT_ASSERT_EQUAL(pm[1].rm_so, 6); - CPPUNIT_ASSERT_EQUAL(pm[1].rm_eo, 11); + CPPUNIT_ASSERT_EQUAL((int)pm[1].rm_so, 6); + CPPUNIT_ASSERT_EQUAL((int)pm[1].rm_eo, 11); } void testStarMatch() From MAILER-DAEMON Sat Sep 20 09:50:31 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kh2r0-0007C9-Pa for mharc-myserver-commit@gnu.org; Sat, 20 Sep 2008 09:50:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh2qz-0007Br-J5 for myserver-commit@gnu.org; Sat, 20 Sep 2008 09:50:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh2qy-0007BV-Ua for myserver-commit@gnu.org; Sat, 20 Sep 2008 09:50:29 -0400 Received: from [199.232.76.173] (port=53565 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh2qy-0007BS-OL for myserver-commit@gnu.org; Sat, 20 Sep 2008 09:50:28 -0400 Received: from savannah.gnu.org ([199.232.41.3]:41961 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kh2qy-0006Q0-HW for myserver-commit@gnu.org; Sat, 20 Sep 2008 09:50:28 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kh2qx-0005Y2-BN for myserver-commit@gnu.org; Sat, 20 Sep 2008 13:50:27 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kh2qw-0005Xy-VA for myserver-commit@gnu.org; Sat, 20 Sep 2008 13:50:27 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 20 Sep 2008 13:50:27 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2829] Now the parser for the `/etc/passwd' file works well with multiline comments. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 13:50:29 -0000 Revision: 2829 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2829 Author: gscrivano Date: 2008-09-20 13:50:26 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Now the parser for the `/etc/passwd' file works well with multiline comments. Modified Paths: -------------- trunk/myserver/src/base/home_dir/home_dir.cpp Modified: trunk/myserver/src/base/home_dir/home_dir.cpp =================================================================== --- trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-20 12:54:53 UTC (rev 2828) +++ trunk/myserver/src/base/home_dir/home_dir.cpp 2008-09-20 13:50:26 UTC (rev 2829) @@ -168,15 +168,14 @@ string *old; if(buffer[counter] == '#') + { while(buffer[counter++] != '\n'); + continue; + } - if(counter >= size) - break; - /* Username. */ - username = &buffer[counter]; - + while(buffer[counter++] != '\0'); /* Password. */ From MAILER-DAEMON Sat Sep 20 13:02:03 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kh5qN-0008TE-JH for mharc-myserver-commit@gnu.org; Sat, 20 Sep 2008 13:02:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh5qM-0008Sx-4o for myserver-commit@gnu.org; Sat, 20 Sep 2008 13:02:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh5qL-0008Sc-Ij for myserver-commit@gnu.org; Sat, 20 Sep 2008 13:02:01 -0400 Received: from [199.232.76.173] (port=57510 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh5qL-0008SU-9P for myserver-commit@gnu.org; Sat, 20 Sep 2008 13:02:01 -0400 Received: from savannah.gnu.org ([199.232.41.3]:46530 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kh5qK-000515-Nk for myserver-commit@gnu.org; Sat, 20 Sep 2008 13:02:00 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kh5qK-0001q0-2e for myserver-commit@gnu.org; Sat, 20 Sep 2008 17:02:00 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kh5qJ-0001pv-Q0 for myserver-commit@gnu.org; Sat, 20 Sep 2008 17:01:59 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 20 Sep 2008 17:01:59 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2830] Added tests for the `MemoryStream' class. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 17:02:02 -0000 Revision: 2830 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2830 Author: gscrivano Date: 2008-09-20 17:01:59 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Added tests for the `MemoryStream' class. Now `MemoryStream::read' uses `memcpy'. Modified Paths: -------------- trunk/myserver/include/filter/memory_stream.h trunk/myserver/src/filter/memory_stream.cpp trunk/myserver/tests/Makefile.am Added Paths: ----------- trunk/myserver/tests/test_mem_stream.cpp Modified: trunk/myserver/include/filter/memory_stream.h =================================================================== --- trunk/myserver/include/filter/memory_stream.h 2008-09-20 13:50:26 UTC (rev 2829) +++ trunk/myserver/include/filter/memory_stream.h 2008-09-20 17:01:59 UTC (rev 2830) @@ -25,10 +25,6 @@ class MemoryStream : public Stream { -private: - int internalData; - MemBuf *data; - int readSeek; public: virtual int read(char* buffer, u_long len, u_long*); virtual int write(const char* buffer, u_long len, u_long*); @@ -39,6 +35,10 @@ MemoryStream(); MemoryStream(MemBuf*); virtual ~MemoryStream(); +private: + int internalData; + MemBuf *data; + int readSeek; }; Modified: trunk/myserver/src/filter/memory_stream.cpp =================================================================== --- trunk/myserver/src/filter/memory_stream.cpp 2008-09-20 13:50:26 UTC (rev 2829) +++ trunk/myserver/src/filter/memory_stream.cpp 2008-09-20 17:01:59 UTC (rev 2830) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -22,20 +22,21 @@ #include using namespace std; +#include + /*! *Inherited from Stream. */ -int MemoryStream::read(char* buffer,u_long len, u_long *nbr) +int MemoryStream::read(char* buffer, u_long len, u_long *nbr) { char *b; - u_long towrite; - towrite = *nbr = std::min(len, static_cast(data->getLength() - readSeek)); + *nbr = std::min(len, static_cast(data->getLength() - readSeek)); b = data->getBuffer() + readSeek; - while(towrite--) - { - *buffer++ = *b++; - } + + memcpy(buffer, b, *nbr); + readSeek += (*nbr); + return 0; } Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-20 13:50:26 UTC (rev 2829) +++ trunk/myserver/tests/Makefile.am 2008-09-20 17:01:59 UTC (rev 2830) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp +tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_mem_stream.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Added: trunk/myserver/tests/test_mem_stream.cpp =================================================================== --- trunk/myserver/tests/test_mem_stream.cpp (rev 0) +++ trunk/myserver/tests/test_mem_stream.cpp 2008-09-20 17:01:59 UTC (rev 2830) @@ -0,0 +1,133 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include + +#include + +#include +#include +#include +#include +#include + +class TestMemStream : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestMemStream ); + CPPUNIT_TEST( testRead ); + CPPUNIT_TEST( testWrite ); + CPPUNIT_TEST( testFlush ); + CPPUNIT_TEST( testRefresh ); + CPPUNIT_TEST( testAvailableToRead ); + CPPUNIT_TEST_SUITE_END(); + + MemoryStream *stream; + +public: + void setUp() + { + stream = new MemoryStream(); + } + + void tearDown() + { + delete stream; + } + + + /* Helper method. */ + u_long addSomeData(MemoryStream* s) + { + u_long nbw; + + char data[512] = "This program is free software; you can redistribute it and/or modify\n\ + it under the terms of the GNU General Public License as published by\n\ + the Free Software Foundation; either version 3 of the License, or\n\ + (at your option) any later version.\n"; + + s->write(data, 512, &nbw); + + return nbw; + } + + void testAvailableToRead() + { + u_long nbr; + u_long size = addSomeData(stream); + + char buffer[20]; + + CPPUNIT_ASSERT_EQUAL(size, (u_long)stream->availableToRead()); + } + + void testRead() + { + u_long nbr; + u_long size = addSomeData(stream); + + char buffer[20]; + + CPPUNIT_ASSERT_EQUAL(size, (u_long)stream->availableToRead()); + + stream->read(buffer, 20, &nbr); + + CPPUNIT_ASSERT_EQUAL(size - 20u, (u_long)stream->availableToRead()); + } + + + void testRefresh() + { + u_long nbr; + u_long size = addSomeData(stream); + + char buffer[20]; + + CPPUNIT_ASSERT_EQUAL(size, (u_long)stream->availableToRead()); + + stream->read(buffer, 20, &nbr); + stream->refresh(); + + CPPUNIT_ASSERT_EQUAL((u_long)stream->availableToRead(), 0ul); + } + + + void testWrite() + { + u_long nbw; + + int ret = stream->write("hello world!", 12, &nbw); + + CPPUNIT_ASSERT_EQUAL(ret, 0); + + CPPUNIT_ASSERT_EQUAL((u_long)stream->availableToRead(), 12ul); + } + + void testFlush() + { + u_long nbw; + u_long size = addSomeData(stream); + int ret = stream->flush(&nbw); + + CPPUNIT_ASSERT(nbw >= 0); + CPPUNIT_ASSERT_EQUAL(ret, 0); + } + + +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestMemStream ); From MAILER-DAEMON Sun Sep 21 13:41:50 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KhSwP-0001yz-UC for mharc-myserver-commit@gnu.org; Sun, 21 Sep 2008 13:41:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhSwN-0001yD-WB for myserver-commit@gnu.org; Sun, 21 Sep 2008 13:41:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhSwL-0001vl-6s for myserver-commit@gnu.org; Sun, 21 Sep 2008 13:41:46 -0400 Received: from [199.232.76.173] (port=37317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhSwK-0001vi-VU for myserver-commit@gnu.org; Sun, 21 Sep 2008 13:41:45 -0400 Received: from savannah.gnu.org ([199.232.41.3]:52495 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhSwI-0000DM-MO for myserver-commit@gnu.org; Sun, 21 Sep 2008 13:41:44 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KhSwF-00039y-NM for myserver-commit@gnu.org; Sun, 21 Sep 2008 17:41:39 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KhSwF-00039t-8U for myserver-commit@gnu.org; Sun, 21 Sep 2008 17:41:39 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 21 Sep 2008 17:41:39 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2831] Initial texinfo documentation files. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2008 17:41:48 -0000 Revision: 2831 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2831 Author: gscrivano Date: 2008-09-21 17:41:38 +0000 (Sun, 21 Sep 2008) Log Message: ----------- Initial texinfo documentation files. Modified Paths: -------------- trunk/myserver/documentation/Makefile.am Added Paths: ----------- trunk/myserver/documentation/basic_configuration.texi trunk/myserver/documentation/doclicense.texi trunk/myserver/documentation/general_description.texi trunk/myserver/documentation/gpl.texi trunk/myserver/documentation/myserver.texi trunk/myserver/documentation/virtual_hosts.texi Modified: trunk/myserver/documentation/Makefile.am =================================================================== --- trunk/myserver/documentation/Makefile.am 2008-09-20 17:01:59 UTC (rev 2830) +++ trunk/myserver/documentation/Makefile.am 2008-09-21 17:41:38 UTC (rev 2831) @@ -1,2 +1,6 @@ +info_TEXINFOS=myserver.texi + +#any other .texi that is not myserver.texi +myserver_TEXINFOS=basic_configuration.texi doclicense.texi general_description.texi gpl.texi virtual_hosts.texi + SUBDIRS = english - Added: trunk/myserver/documentation/basic_configuration.texi =================================================================== --- trunk/myserver/documentation/basic_configuration.texi (rev 0) +++ trunk/myserver/documentation/basic_configuration.texi 2008-09-21 17:41:38 UTC (rev 2831) @@ -0,0 +1,66 @@ +@c -*-texinfo-*- +In the myserver.xml file you can set the default page for your +websites hosted on MyServer. + +Similar lines already exist in your configuration file: + +@example +default.htm +default.php +default.php3 +index.htm +index.php +index.php3 +default.htm +@end example + +In the errors section you learned how to create and use your own error +pages. But you can also disable the custom error pages, by changing +the line below: + +@example +YES +@end example + +So, if you set the value to NO, like in the line below, + +@example +NO +@end example + +MyServer will (by default) just send a header to your browser with the +error code. But you have the option to send a HTTP body included in +the error, by adding this line: + +@example +YES +@end example + +You can change the layout of the directory browsing page. The line +below, in myserver.xml, points to the CSS file used to configure the +layout for the browsing directory pages: + +@example +system/folderstyle.css +@end example + +CGI Scripts can get the Server Administrator E-mail and show them to +the user (through the SERVER_ADMIN environment variable). So, it can +be important you define this address properly, by setting the value in +the line below, in myserver.xml: + +@example +administrator@@localhost +@end example + +MyServer offers the feature to follow symlinks on Unix-like Operating +systems (e.g.: Linux, *BSD, GNU/HURD, Solaris, etc.). +You can add the symlink following feature for all hosts in the +myserver.xml file. + +@example +YES +@end example + +The default value used by MyServer is: +@code{NO}. Added: trunk/myserver/documentation/doclicense.texi =================================================================== --- trunk/myserver/documentation/doclicense.texi (rev 0) +++ trunk/myserver/documentation/doclicense.texi 2008-09-21 17:41:38 UTC (rev 2831) @@ -0,0 +1,412 @@ +@c -*-texinfo-*- +@center Version 1.2, November 2002 + +@display +Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display +@sp 1 +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document ``free'' in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft,'' which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@sp 1 +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document,'' below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you.'' You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (Thus, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque.'' + + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements,'' +``Dedications,'' ``Endorsements,'' or ``History.'') To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +@sp 1 +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +@sp 1 +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +@sp 1 +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission.@* +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement.@* +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher.@* +D. Preserve all the copyright notices of the Document.@* +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices.@* +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below.@* +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice.@* +H. Include an unaltered copy of this License.@* +I. Preserve the section Entitled ``History,'' Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled ``History'' in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence.@* +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the ``History'' section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission.@* +K. For any section Entitled ``Acknowledgements'' or ``Dedications,'' + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein.@* +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles.@* +M. Delete any section Entitled ``Endorsements.'' Such a section + may not be included in the Modified Version.@* +N. Do not retitle any existing section to be Entitled ``Endorsements'' + or to conflict in title with any Invariant Section.@* +O. Preserve any Warranty Disclaimers.@* +@sp 1 +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements,'' provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +@sp 1 +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements,'' +and any sections Entitled ``Dedications.'' You must delete all sections +Entitled ``Endorsements.'' +@sp 1 +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +@sp 1 +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +@sp 1 +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements,'' +``Dedications,'' or ``History,'' the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +@sp 1 +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. +@sp 1 +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + +@end enumerate + +@unnumberedsec ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group +Copyright (C) @var{year} @var{your name}. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled ``GNU +Free Documentation License.'' +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with...Texts.'' line with this: + +@smallexample +@group +with the Invariant Sections being @var{list their titles}, with the +Front-Cover Texts being @var{list}, and with the Back-Cover Texts being +@var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. Added: trunk/myserver/documentation/general_description.texi =================================================================== --- trunk/myserver/documentation/general_description.texi (rev 0) +++ trunk/myserver/documentation/general_description.texi 2008-09-21 17:41:38 UTC (rev 2831) @@ -0,0 +1,9 @@ +@c -*-texinfo-*- +MyServer is a powerful web server designed, to be easily run on a +personal computer by the average computer user. +It is based on multi-threaded architecture, which makes it extremely +scalable and usable in large scale sites, as well as in small +networks. It has built-in supports for the HTTP, HTTPS and FTP +protocols. +Support for dynamic pages is made available trough CGI, ISAPI, WinCGI, +SCGI and FastCGI protocols. Added: trunk/myserver/documentation/gpl.texi =================================================================== --- trunk/myserver/documentation/gpl.texi (rev 0) +++ trunk/myserver/documentation/gpl.texi 2008-09-21 17:41:38 UTC (rev 2831) @@ -0,0 +1,717 @@ +@c The GNU General Public License. +@center Version 3, 29 June 2007 + +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. + +@display +Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. +@end display + +@heading Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program---to make sure it remains +free software for all its users. We, the Free Software Foundation, +use the GNU General Public License for most of our software; it +applies also to any other work released this way by its authors. You +can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, +receive or can get the source code. And you must show them these +terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + +@heading TERMS AND CONDITIONS + +@enumerate 0 +@item Definitions. + +``This License'' refers to version 3 of the GNU General Public License. + +``Copyright'' also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +``The Program'' refers to any copyrightable work licensed under this +License. Each licensee is addressed as ``you''. ``Licensees'' and +``recipients'' may be individuals or organizations. + +To ``modify'' a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a ``modified version'' of +the earlier work or a work ``based on'' the earlier work. + +A ``covered work'' means either the unmodified Program or a work based +on the Program. + +To ``propagate'' a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To ``convey'' a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays ``Appropriate Legal Notices'' to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +@item Source Code. + +The ``source code'' for a work means the preferred form of the work for +making modifications to it. ``Object code'' means any non-source form +of a work. + +A ``Standard Interface'' means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The ``System Libraries'' of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +``Major Component'', in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The ``Corresponding Source'' for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +@item Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +@item Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +@item Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +@item Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +@enumerate a +@item +The work must carry prominent notices stating that you modified it, +and giving a relevant date. + +@item +The work must carry prominent notices stating that it is released +under this License and any conditions added under section 7. This +requirement modifies the requirement in section 4 to ``keep intact all +notices''. + +@item +You must license the entire work, as a whole, under this License to +anyone who comes into possession of a copy. This License will +therefore apply, along with any applicable section 7 additional terms, +to the whole of the work, and all its parts, regardless of how they +are packaged. This License gives no permission to license the work in +any other way, but it does not invalidate such permission if you have +separately received it. + +@item +If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your work +need not make them do so. +@end enumerate + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +``aggregate'' if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +@item Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +@enumerate a +@item +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium customarily +used for software interchange. + +@item +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a written +offer, valid for at least three years and valid for as long as you +offer spare parts or customer support for that product model, to give +anyone who possesses the object code either (1) a copy of the +Corresponding Source for all the software in the product that is +covered by this License, on a durable physical medium customarily used +for software interchange, for a price no more than your reasonable +cost of physically performing this conveying of source, or (2) access +to copy the Corresponding Source from a network server at no charge. + +@item +Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is +allowed only occasionally and noncommercially, and only if you +received the object code with such an offer, in accord with subsection +6b. + +@item +Convey the object code by offering access from a designated place +(gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to copy +the object code is a network server, the Corresponding Source may be +on a different server (operated by you or a third party) that supports +equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. +Regardless of what server hosts the Corresponding Source, you remain +obligated to ensure that it is available for as long as needed to +satisfy these requirements. + +@item +Convey the object code using peer-to-peer transmission, provided you +inform other peers where the object code and Corresponding Source of +the work are being offered to the general public at no charge under +subsection 6d. + +@end enumerate + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A ``User Product'' is either (1) a ``consumer product'', which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +``normally used'' refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +``Installation Information'' for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +@item Additional Terms. + +``Additional permissions'' are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +@enumerate a +@item +Disclaiming warranty or limiting liability differently from the terms +of sections 15 and 16 of this License; or + +@item +Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices +displayed by works containing it; or + +@item +Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or + +@item +Limiting the use for publicity purposes of names of licensors or +authors of the material; or + +@item +Declining to grant rights under trademark law for use of some trade +names, trademarks, or service marks; or + +@item +Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with +contractual assumptions of liability to the recipient, for any +liability that these contractual assumptions directly impose on those +licensors and authors. +@end enumerate + +All other non-permissive additional terms are considered ``further +restrictions'' within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +@item Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +@item Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +@item Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An ``entity transaction'' is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +@item Patents. + +A ``contributor'' is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's ``contributor version''. + +A contributor's ``essential patent claims'' are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, ``control'' includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a ``patent license'' is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To ``grant'' such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. ``Knowingly relying'' means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is ``discriminatory'' if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +@item No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey +a covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree +to terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +@item Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +@item Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If +the Program does not specify a version number of the GNU General +Public License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +@item Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +@item Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +@item Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +@end enumerate + +@heading END OF TERMS AND CONDITIONS + +@heading How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the ``copyright'' line and a pointer to where the full notice is found. + +@smallexample +@var{one line to give the program's name and a brief idea of what it does.} +Copyright (C) @var{year} @var{name of author} + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see @url{http://www.gnu.org/licenses/}. +@end smallexample + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + +@smallexample +@var{program} Copyright (C) @var{year} @var{name of author} +This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. +This is free software, and you are welcome to redistribute it +under certain conditions; type @samp{show c} for details. +@end smallexample + +The hypothetical commands @samp{show w} and @samp{show c} should show +the appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an ``about box''. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a ``copyright disclaimer'' for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +@url{http://www.gnu.org/licenses/}. + +The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use +the GNU Lesser General Public License instead of this License. But +first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. Added: trunk/myserver/documentation/myserver.texi =================================================================== --- trunk/myserver/documentation/myserver.texi (rev 0) +++ trunk/myserver/documentation/myserver.texi 2008-09-21 17:41:38 UTC (rev 2831) @@ -0,0 +1,58 @@ +@c -*-texinfo-*- +\input texinfo +@setfilename myserver.info +@settitle GNU MyServer documentation + +@setchapternewpage odd + +@titlepage +@sp 10 +@center @titlefont{GNU MyServer} + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 2008 Free Software Foundation, Inc. +@end titlepage + +@node Top, Copying, (dir), (dir) + +This is the manual for the GNU MyServer web server. + +@menu +* Copying:: The GNU General Public License gives you permission to + redistribute GNU MyServer on certain terms; it also explains that + there is no warranty. +* GNU Free Documentation License:: The license for this documentation. +* General description:: GNU MyServer general description. +* Basic configuration:: Basic server configuration. +* Virtual hosts:: Virtual hosts configuration. +@end menu + + +@node Copying, GNU Free Documentation License, Top, Top +@appendix GNU GENERAL PUBLIC LICENSE +@include gpl.texi + +@node GNU Free Documentation License, General description, Copying, Top +@appendix GNU Free Documentation License +@include doclicense.texi + +@node General description, Basic configuration, GNU Free Documentation License, Top +@chapter General description +@cindex General description +@include general_description.texi + +@node Basic configuration, Virtual hosts, General description, Top +@chapter Basic configuration +@cindex Basic configuration +@include basic_configuration.texi + +@node Virtual hosts, , Basic configuration, Top +@chapter Virtual hosts +@cindex Virtual hosts +@include virtual_hosts.texi + + +@printindex cp +@contents +@bye Added: trunk/myserver/documentation/virtual_hosts.texi =================================================================== --- trunk/myserver/documentation/virtual_hosts.texi (rev 0) +++ trunk/myserver/documentation/virtual_hosts.texi 2008-09-21 17:41:38 UTC (rev 2831) @@ -0,0 +1,92 @@ +@c -*-texinfo-*- +In theory, virtual hosts allow users to lodge an infinite number of +sites on a single machine. For example http://mypc.net is different +from http://sub.mypc.net. To define virtual hosts in myServer open the +file virtualhosts.xml in a text editor (such as notepad in Windows or +GNU Emacs in GNU/Linux). A sample virtual hosts configuration file +looks like: + +@example + + + Every connection + 80 + 127.0.0.1 + HTTP + web + system + www.mysite.com + logs/myServer.log + logs/myServer.err + NO + + +@end example + +@noindent @code{} gives the server administrator an idea of what the virtual host +is such as internal Ethernet, external ethernet or every connection. +@code{} is the port used for accepting connections. +@code{} is optional. It is the IP address for the interface your +virtual host will be working on. The optional useRegex="YES" means the +address would act as a regular expression, not only a fixed +value. This is more useful for networks with dynamic IP addressing. +@code{} is the protocol to be used by the host. +@code{} is the directory where the files are found. +@code{} is the system directory. +@code{} is your virtual host's name. The optional useRegex="YES" +means the address would act as a regular expression, not only a fixed +value. +@code{} is the access log used by the virtual host +@code{} is the errors log file used by the virtual host. +@code{} This option would deny the access to CGI in this +virtual host. This line can exist in myserver.xml too, as a global +configuration, but if it is included in virtualhosts.xml, this is the +one that will be considered. @code{ALLOW_CGI} can also appear as +@code{ALLOW_FASTCGI}, @code{ALLOW_ISAPI}, @code{ALLOW_MSCGI}, @code{ALLOW_WINCGI}, +@code{ALLOW_SEND_LINK}, @code{ALLOW_EXTERNAL_COMMANDS}, +@code{ALLOW_SEND_FILE}, each of them denying/allowing the proper HTTP +data handler to be used. + +Log files can have extra options: +@code{logs/myServerHTTP.log} +With this option, the logs will have two extra fields: HTTP Referrer +and HTTP User Agent. +Using cycle="yes" you will enable log cycler on the log file. When a +log file with cycling enabled reaches the max size for log files it +will write its content to a new file and recreate the original +file. By default cycled log files uses the gzip compression to save +space, if you don't want to use gzip specify cycle_gzip="no". +Here is an example of a FTP virtual host: + +@example + + + Ftp connection + 21 + 127.0.0.1 + FTP + web + system + ftp.downloads.com + logs/myServer.log + logs/myServer.err + + +@end example + +Tags semantics are identical with first example. +Although FTP is used for public file sharing, restrictions may be +imposed using security file. + +MyServer gives you the option to enable the HTTP TRACE command for +each virtual host. All you need to do is edit the security.xml file of +the root of your virtual host (not a subdirectory in it! if the file +doesn't exist, you may create a new one, in the format described in +the Security section of this documentation), and add the parameter + +@example + +@end example + +Once you do that, you enable HTTP TRACE command. By default, it's +disabled (so, simply delete the line, if you want to disable it) From MAILER-DAEMON Sun Sep 21 15:52:09 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KhUyX-0000GE-58 for mharc-myserver-commit@gnu.org; Sun, 21 Sep 2008 15:52:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhUyW-0000Fx-4x for myserver-commit@gnu.org; Sun, 21 Sep 2008 15:52:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhUyV-0000Fk-HJ for myserver-commit@gnu.org; Sun, 21 Sep 2008 15:52:07 -0400 Received: from [199.232.76.173] (port=53196 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhUyV-0000Fh-DD for myserver-commit@gnu.org; Sun, 21 Sep 2008 15:52:07 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53044 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhUyU-0006aJ-Sx for myserver-commit@gnu.org; Sun, 21 Sep 2008 15:52:07 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KhUyT-0000dq-Sp for myserver-commit@gnu.org; Sun, 21 Sep 2008 19:52:05 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KhUyT-0000dm-Gg for myserver-commit@gnu.org; Sun, 21 Sep 2008 19:52:05 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 21 Sep 2008 19:52:05 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2832] Added new texinfo nodes. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2008 19:52:08 -0000 Revision: 2832 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2832 Author: gscrivano Date: 2008-09-21 19:52:04 +0000 (Sun, 21 Sep 2008) Log Message: ----------- Added new texinfo nodes. Modified Paths: -------------- trunk/myserver/documentation/Makefile.am trunk/myserver/documentation/myserver.texi trunk/myserver/documentation/virtual_hosts.texi Added Paths: ----------- trunk/myserver/documentation/mime_types.texi trunk/myserver/documentation/process_security.texi trunk/myserver/documentation/ssl_certificates.texi Modified: trunk/myserver/documentation/Makefile.am =================================================================== --- trunk/myserver/documentation/Makefile.am 2008-09-21 17:41:38 UTC (rev 2831) +++ trunk/myserver/documentation/Makefile.am 2008-09-21 19:52:04 UTC (rev 2832) @@ -1,6 +1,6 @@ info_TEXINFOS=myserver.texi #any other .texi that is not myserver.texi -myserver_TEXINFOS=basic_configuration.texi doclicense.texi general_description.texi gpl.texi virtual_hosts.texi +myserver_TEXINFOS=basic_configuration.texi doclicense.texi general_description.texi mime_types.texi gpl.texi process_security.texi virtual_hosts.texi ssl_certificates.texi SUBDIRS = english Added: trunk/myserver/documentation/mime_types.texi =================================================================== --- trunk/myserver/documentation/mime_types.texi (rev 0) +++ trunk/myserver/documentation/mime_types.texi 2008-09-21 19:52:04 UTC (rev 2832) @@ -0,0 +1,110 @@ +@c -*-texinfo-*- +You can modify the MIME types used by MyServer by modifying the file +"MIMEtypes.xml". The following is an example of the .xml file: + +@example + + + + htm + text/html + SEND + ALLOW + gzip + NONE + + + +@end example + +@itemize +Each block describes a different MIME type. + +@item EXT +is the type of file + +@item MIME +is the Mime type. + +@item CMD +is the way to send the file to the client. +@end itemize + +@noindent @code{ALLOW} +will allow access to the desired MIME Type if the Host is +"localhost". +In the line @code{} we declare that +the MIME type will DENY access from any host we don't set in the +proper ACTION tag (so, it will have to exist in the +configuration). Also, the property defaultAction is optional (when +it's omitted, it's set to "ALLOW"). In the above example, HTML files +will be accessed only through the hostname "localhost". + +The tag @code{} is optional, unless you specify "DENY" for +your defaultAction in your MIME Type. + +@code{} defines a filter for that MIME type. The data will +pass through the filter before being sent to the user. In the example +above, the data would be sent gzipped to the user. It means Gzip works +as a filter in MyServer. you can define Gzip to automatically run for +every file based in its size, setting the @code{}, in +myserver.xml file. For obvious reasons, data will be sent gzipped only +if the client supports gzip - otherwise he'd receive a lot of weird +characters instead of the site requested. + +In general, filters can also be applied to dynamic data - like CGI, +ISAPI, FastCGI - but they need to be filters that don't modify the +contents of the page to be shown to the user. + +@code{} completes the @code{} command specifying, if +necessary for the command, an external application to use. +For example using the RUNCGI command, it will be necessary to specify +an external process to execute the CGI command, MANAGER under +GNU/Linux will be something like this: + +@example +/usr/bin/php-cgi +or under Windows: +c:\php\php-cgi.exe +@end example + + +The following values for sending the file to the client are valid in +the @code{} section: +@enumerate +@item SEND +Send the file statically as is. This command is used for files +extensions such as .html and .jpg that don't need any external +intervention from the web server. +@item RUNCGI +Run the CGI script indicated in the path. It is used for file +extensions such as .php and .pl that need to be processed before +sending any data to the client. +@item RUNFASTCGI +Run the Fastcgi script. This type will need a fastcgi parser +downloaded (see the PHP page). It is also used for file extensions +such as .php and .pl. +@item EXECUTEFASTCGI +This also runs the Fastcgi script, but unlike the RUNFASTCGI above, it +does not need a server to run the script, instead it acts as a self +server. +@item RUNSCGI +Handle a specified mime type with this SCGI server. +@item EXECUTESCGI +Handle the file as a self SCGI process. +@item RUNMSCGI +Run the MSCGI script. This library is only available for MyServer. It +is used to build fast and efficient CGIs that needs to access MyServer +internal data. +@item EXECUTE +Treat the file as an executable and send the output to the client. +@item SENDLINK +Send the file that is contained in a link. +@item EXECUTEWINCGI +Send the file as a WinCGI +@item RUNISAPI +Run the ISAPI script. +@item EXECUTEISAPI +Run the ISAPI script but does not need a server to run. Instead, it +acts as a self server. +@end enumerate Modified: trunk/myserver/documentation/myserver.texi =================================================================== --- trunk/myserver/documentation/myserver.texi 2008-09-21 17:41:38 UTC (rev 2831) +++ trunk/myserver/documentation/myserver.texi 2008-09-21 19:52:04 UTC (rev 2832) @@ -1,4 +1,3 @@ -@c -*-texinfo-*- \input texinfo @setfilename myserver.info @settitle GNU MyServer documentation @@ -26,6 +25,9 @@ * General description:: GNU MyServer general description. * Basic configuration:: Basic server configuration. * Virtual hosts:: Virtual hosts configuration. +* MIME types:: MIME types configuration. +* Process security:: Process security. +* SSL certificates:: Show how to use SSL certificates. @end menu @@ -47,12 +49,28 @@ @cindex Basic configuration @include basic_configuration.texi -@node Virtual hosts, , Basic configuration, Top +@node Virtual hosts, MIME types, Basic configuration, Top @chapter Virtual hosts @cindex Virtual hosts @include virtual_hosts.texi +@node MIME types, Process security, Virtual hosts, Top +@chapter MIME types +@cindex MIME types +@include mime_types.texi +@node Process security, SSL certificates, MIME types, Top +@chapter Process security +@cindex Process security +@include process_security.texi + +@node SSL certificates, , Process security, Top +@chapter SSL certificates +@cindex SSL certificates +@include ssl_certificates.texi + + @printindex cp @contents @bye +@c -*-texinfo-*- Added: trunk/myserver/documentation/process_security.texi =================================================================== --- trunk/myserver/documentation/process_security.texi (rev 0) +++ trunk/myserver/documentation/process_security.texi 2008-09-21 19:52:04 UTC (rev 2832) @@ -0,0 +1,23 @@ +@c -*-texinfo-*- +On POSIX it is possible to change the MyServer process user identifier +and group identifier after it has bound the necessary ports (only the +root user can bind ports < 1024). + +To specify a different process user id (PID), you must specify it in +the myserver.xml file as: + +@example +PID +@end example + +Differently, to change the process group id (GID), the configuration +line to use is: + +@example +GID +@end example + +When one of these features is used, MyServer will not use the +auto-reboot because it will not be possible to get back old +permissions. + Added: trunk/myserver/documentation/ssl_certificates.texi =================================================================== --- trunk/myserver/documentation/ssl_certificates.texi (rev 0) +++ trunk/myserver/documentation/ssl_certificates.texi 2008-09-21 19:52:04 UTC (rev 2832) @@ -0,0 +1,57 @@ +@c -*-texinfo-*- + +@section Brief notes on data encryption +The data encryption is used to protect the data that is sent between +the client and the server. There are two types of algorithm: symmetric +and asymmetric data encryption algorithms. The difference between the +two types of algorithm is that for the symmetric algorithms the same +key is used both for encryption and decryption. These algorithms are +not used by servers with a potentially large number of clients because +the data captured can be decrypted by any client that know the key and +because the key needs to be distribute in a safe manner(for example +using a floppy disk) and not distributing it on a large network like +Internet. The asymmetric algorithms work in a different way, the data +encrypted with a key can be decrypted only with the other key and +vice-versa. Anyone know the public key but only the owner knows the +private one. In this way the key owner do not have to distribute the +key only to know clients but he can distributes it to a large scale +network. + +@section How create SSL certificates with OpenSSL +A certificate is needed to certify your identity through a +CA (Certification Authority). You can use a certificate without +register it to third party CA, it is called self-signed certificate. +You can find all the necessary tools to create certificates in the +library OpenSSL at: www.openssl.org. +After OpenSSL is installed correctly, type the following commands: + +@example +openssl genrsa -out server.key +openssl req -new -x509 -days 730 -config openssl.cnf \ + -key server.key -out server.pem +@end example + +@section How use certificates in MyServer +To configure certificates in MyServer you have to put the two files: +@code{server.key}, @code{server.pem} in the MyServer certificates +directory. + +To configure a HTTPS host that will use the created certificate, add +the following lines in the virtualhosts.xml file: + +@example + + Every connection + 443 + certificates/server.key + certificates/server.pem + HTTPS + web + system + logs/myServer.log + logs/myServer.err + +@end example + +Take a look at the @pxref{Virtual hosts} documentation to get more +information about other tags. Modified: trunk/myserver/documentation/virtual_hosts.texi =================================================================== --- trunk/myserver/documentation/virtual_hosts.texi 2008-09-21 17:41:38 UTC (rev 2831) +++ trunk/myserver/documentation/virtual_hosts.texi 2008-09-21 19:52:04 UTC (rev 2832) @@ -23,29 +23,41 @@ @end example -@noindent @code{} gives the server administrator an idea of what the virtual host +@itemize +@item +it gives the server administrator an idea of what the virtual host is such as internal Ethernet, external ethernet or every connection. -@code{} is the port used for accepting connections. -@code{} is optional. It is the IP address for the interface your +@item +it is the port used for accepting connections. +@item +it is optional. It is the IP address for the interface your virtual host will be working on. The optional useRegex="YES" means the address would act as a regular expression, not only a fixed value. This is more useful for networks with dynamic IP addressing. -@code{} is the protocol to be used by the host. -@code{} is the directory where the files are found. -@code{} is the system directory. -@code{} is your virtual host's name. The optional useRegex="YES" +@item +it is the protocol to be used by the host. +@item +it is the directory where the files are found. +@item +it is the system directory. +@item +it is your virtual host's name. The optional useRegex="YES" means the address would act as a regular expression, not only a fixed value. -@code{} is the access log used by the virtual host -@code{} is the errors log file used by the virtual host. -@code{} This option would deny the access to CGI in this +@item +it is the access log used by the virtual host +@item +it is the errors log file used by the virtual host. +@item +This option would deny the access to CGI in this virtual host. This line can exist in myserver.xml too, as a global configuration, but if it is included in virtualhosts.xml, this is the one that will be considered. @code{ALLOW_CGI} can also appear as -@code{ALLOW_FASTCGI}, @code{ALLOW_ISAPI}, @code{ALLOW_MSCGI}, @code{ALLOW_WINCGI}, -@code{ALLOW_SEND_LINK}, @code{ALLOW_EXTERNAL_COMMANDS}, -@code{ALLOW_SEND_FILE}, each of them denying/allowing the proper HTTP -data handler to be used. +@code{ALLOW_FASTCGI}, @code{ALLOW_ISAPI}, @code{ALLOW_MSCGI}, +@code{ALLOW_WINCGI}, @code{ALLOW_SEND_LINK}, +@code{ALLOW_EXTERNAL_COMMANDS}, @code{ALLOW_SEND_FILE}, each of them +denying/allowing the proper HTTP data handler to be used. +@end itemize Log files can have extra options: @code{logs/myServerHTTP.log} From MAILER-DAEMON Sun Sep 21 16:49:23 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KhVrv-0007gr-8P for mharc-myserver-commit@gnu.org; Sun, 21 Sep 2008 16:49:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhVru-0007gm-3e for myserver-commit@gnu.org; Sun, 21 Sep 2008 16:49:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhVrs-0007ga-7J for myserver-commit@gnu.org; Sun, 21 Sep 2008 16:49:20 -0400 Received: from [199.232.76.173] (port=48495 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhVrs-0007gX-3h for myserver-commit@gnu.org; Sun, 21 Sep 2008 16:49:20 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60741 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhVrr-0002dd-LO for myserver-commit@gnu.org; Sun, 21 Sep 2008 16:49:19 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KhVrr-0002xY-4W for myserver-commit@gnu.org; Sun, 21 Sep 2008 20:49:19 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KhVrq-0002xU-Qx for myserver-commit@gnu.org; Sun, 21 Sep 2008 20:49:19 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 21 Sep 2008 20:49:18 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2833] Move the index in a separate node and use the right texinfo tag for file names . X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2008 20:49:22 -0000 Revision: 2833 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2833 Author: gscrivano Date: 2008-09-21 20:49:18 +0000 (Sun, 21 Sep 2008) Log Message: ----------- Move the index in a separate node and use the right texinfo tag for file names. Modified Paths: -------------- trunk/myserver/documentation/basic_configuration.texi trunk/myserver/documentation/mime_types.texi trunk/myserver/documentation/myserver.texi trunk/myserver/documentation/process_security.texi trunk/myserver/documentation/ssl_certificates.texi trunk/myserver/documentation/virtual_hosts.texi Modified: trunk/myserver/documentation/basic_configuration.texi =================================================================== --- trunk/myserver/documentation/basic_configuration.texi 2008-09-21 19:52:04 UTC (rev 2832) +++ trunk/myserver/documentation/basic_configuration.texi 2008-09-21 20:49:18 UTC (rev 2833) @@ -1,5 +1,5 @@ @c -*-texinfo-*- -In the myserver.xml file you can set the default page for your +In the @file{myserver.xml} file you can set the default page for your websites hosted on MyServer. Similar lines already exist in your configuration file: @@ -37,8 +37,8 @@ @end example You can change the layout of the directory browsing page. The line -below, in myserver.xml, points to the CSS file used to configure the -layout for the browsing directory pages: +below, in @file{myserver.xml}, points to the CSS file used to +configure the layout for the browsing directory pages: @example system/folderstyle.css @@ -47,7 +47,7 @@ CGI Scripts can get the Server Administrator E-mail and show them to the user (through the SERVER_ADMIN environment variable). So, it can be important you define this address properly, by setting the value in -the line below, in myserver.xml: +the line below, in @file{myserver.xml}: @example administrator@@localhost @@ -56,7 +56,7 @@ MyServer offers the feature to follow symlinks on Unix-like Operating systems (e.g.: Linux, *BSD, GNU/HURD, Solaris, etc.). You can add the symlink following feature for all hosts in the -myserver.xml file. +@file{myserver.xml} file. @example YES Modified: trunk/myserver/documentation/mime_types.texi =================================================================== --- trunk/myserver/documentation/mime_types.texi 2008-09-21 19:52:04 UTC (rev 2832) +++ trunk/myserver/documentation/mime_types.texi 2008-09-21 20:49:18 UTC (rev 2833) @@ -1,6 +1,6 @@ @c -*-texinfo-*- You can modify the MIME types used by MyServer by modifying the file -"MIMEtypes.xml". The following is an example of the .xml file: +@file{MIMEtypes.xml}. The following is an example of this file: @example @@ -48,9 +48,9 @@ above, the data would be sent gzipped to the user. It means Gzip works as a filter in MyServer. you can define Gzip to automatically run for every file based in its size, setting the @code{}, in -myserver.xml file. For obvious reasons, data will be sent gzipped only -if the client supports gzip - otherwise he'd receive a lot of weird -characters instead of the site requested. +@file{myserver.xml} file. For obvious reasons, data will be sent +gzipped only if the client supports gzip - otherwise he'd receive a +lot of weird characters instead of the site requested. In general, filters can also be applied to dynamic data - like CGI, ISAPI, FastCGI - but they need to be filters that don't modify the Modified: trunk/myserver/documentation/myserver.texi =================================================================== --- trunk/myserver/documentation/myserver.texi 2008-09-21 19:52:04 UTC (rev 2832) +++ trunk/myserver/documentation/myserver.texi 2008-09-21 20:49:18 UTC (rev 2833) @@ -13,7 +13,7 @@ Copyright @copyright{} 2008 Free Software Foundation, Inc. @end titlepage -@node Top, Copying, (dir), (dir) +@node Top, Copying,, This is the manual for the GNU MyServer web server. @@ -28,9 +28,9 @@ * MIME types:: MIME types configuration. * Process security:: Process security. * SSL certificates:: Show how to use SSL certificates. +* Table of contents:: Table of contents. @end menu - @node Copying, GNU Free Documentation License, Top, Top @appendix GNU GENERAL PUBLIC LICENSE @include gpl.texi @@ -69,7 +69,8 @@ @cindex SSL certificates @include ssl_certificates.texi - +@node Table of contents, , Top, Top +@unnumbered Table of contents @printindex cp @contents @bye Modified: trunk/myserver/documentation/process_security.texi =================================================================== --- trunk/myserver/documentation/process_security.texi 2008-09-21 19:52:04 UTC (rev 2832) +++ trunk/myserver/documentation/process_security.texi 2008-09-21 20:49:18 UTC (rev 2833) @@ -4,7 +4,7 @@ root user can bind ports < 1024). To specify a different process user id (PID), you must specify it in -the myserver.xml file as: +the @file{myserver.xml} file as: @example PID Modified: trunk/myserver/documentation/ssl_certificates.texi =================================================================== --- trunk/myserver/documentation/ssl_certificates.texi 2008-09-21 19:52:04 UTC (rev 2832) +++ trunk/myserver/documentation/ssl_certificates.texi 2008-09-21 20:49:18 UTC (rev 2833) @@ -8,14 +8,13 @@ key is used both for encryption and decryption. These algorithms are not used by servers with a potentially large number of clients because the data captured can be decrypted by any client that know the key and -because the key needs to be distribute in a safe manner(for example -using a floppy disk) and not distributing it on a large network like -Internet. The asymmetric algorithms work in a different way, the data -encrypted with a key can be decrypted only with the other key and -vice-versa. Anyone know the public key but only the owner knows the -private one. In this way the key owner do not have to distribute the -key only to know clients but he can distributes it to a large scale -network. +because the key needs to be distribute in a safe manner not +distributing it on a large network like Internet. +The asymmetric algorithms work in a different way, the data encrypted +with a key can be decrypted only with the other key and vice-versa. +Anyone know the public key but only the owner knows the private one. +In this way the key owner do not have to distribute the key only to +know clients but he can distributes it to a large scale network. @section How create SSL certificates with OpenSSL A certificate is needed to certify your identity through a @@ -23,6 +22,7 @@ register it to third party CA, it is called self-signed certificate. You can find all the necessary tools to create certificates in the library OpenSSL at: www.openssl.org. + After OpenSSL is installed correctly, type the following commands: @example @@ -37,7 +37,7 @@ directory. To configure a HTTPS host that will use the created certificate, add -the following lines in the virtualhosts.xml file: +the following lines in the @file{virtualhosts.xml} file: @example Modified: trunk/myserver/documentation/virtual_hosts.texi =================================================================== --- trunk/myserver/documentation/virtual_hosts.texi 2008-09-21 19:52:04 UTC (rev 2832) +++ trunk/myserver/documentation/virtual_hosts.texi 2008-09-21 20:49:18 UTC (rev 2833) @@ -2,9 +2,8 @@ In theory, virtual hosts allow users to lodge an infinite number of sites on a single machine. For example http://mypc.net is different from http://sub.mypc.net. To define virtual hosts in myServer open the -file virtualhosts.xml in a text editor (such as notepad in Windows or -GNU Emacs in GNU/Linux). A sample virtual hosts configuration file -looks like: +file @file{virtualhosts.xml} in a text editor. A sample virtual hosts +configuration file looks like: @example @@ -50,11 +49,11 @@ it is the errors log file used by the virtual host. @item This option would deny the access to CGI in this -virtual host. This line can exist in myserver.xml too, as a global -configuration, but if it is included in virtualhosts.xml, this is the -one that will be considered. @code{ALLOW_CGI} can also appear as -@code{ALLOW_FASTCGI}, @code{ALLOW_ISAPI}, @code{ALLOW_MSCGI}, -@code{ALLOW_WINCGI}, @code{ALLOW_SEND_LINK}, +virtual host. This line can exist in @file{myserver.xml} too, as a global +configuration, but if it is included in the @file{virtualhosts.xml} +file, this is the one that will be considered. @code{ALLOW_CGI} can +also appear as @code{ALLOW_FASTCGI}, @code{ALLOW_ISAPI}, +@code{ALLOW_MSCGI}, @code{ALLOW_WINCGI}, @code{ALLOW_SEND_LINK}, @code{ALLOW_EXTERNAL_COMMANDS}, @code{ALLOW_SEND_FILE}, each of them denying/allowing the proper HTTP data handler to be used. @end itemize @@ -91,10 +90,9 @@ imposed using security file. MyServer gives you the option to enable the HTTP TRACE command for -each virtual host. All you need to do is edit the security.xml file of -the root of your virtual host (not a subdirectory in it! if the file -doesn't exist, you may create a new one, in the format described in -the Security section of this documentation), and add the parameter +each virtual host. All you need to do is edit the @file{security.xml} +file of the root of your virtual host (not a subdirectory! If the +file doesn't exist, you may create a new one), and add the parameter: @example From MAILER-DAEMON Mon Sep 22 16:20:30 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KhrtW-0005Le-3Q for mharc-myserver-commit@gnu.org; Mon, 22 Sep 2008 16:20:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhrtS-0005K3-4H for myserver-commit@gnu.org; Mon, 22 Sep 2008 16:20:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhrtQ-0005JX-6o for myserver-commit@gnu.org; Mon, 22 Sep 2008 16:20:25 -0400 Received: from [199.232.76.173] (port=59115 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhrtP-0005JP-Sz for myserver-commit@gnu.org; Mon, 22 Sep 2008 16:20:24 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56822 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhrtO-0008HG-MB for myserver-commit@gnu.org; Mon, 22 Sep 2008 16:20:23 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KhrtM-0000zp-82 for myserver-commit@gnu.org; Mon, 22 Sep 2008 20:20:20 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KhrtK-0000zl-9W for myserver-commit@gnu.org; Mon, 22 Sep 2008 20:20:19 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Mon, 22 Sep 2008 20:20:18 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2834] Added the new LogManager. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2008 20:20:26 -0000 Revision: 2834 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2834 Author: francesco_pipita Date: 2008-09-22 20:20:14 +0000 (Mon, 22 Sep 2008) Log Message: ----------- Added the new LogManager. Modified Paths: -------------- trunk/myserver/AUTHORS trunk/myserver/configure.in trunk/myserver/include/filter/Makefile.am trunk/myserver/include/filter/filters_chain.h trunk/myserver/include/log/Makefile.am trunk/myserver/include/log/log_manager.h trunk/myserver/src/filter/Makefile.am trunk/myserver/src/filter/filters_chain.cpp trunk/myserver/src/log/Makefile.am trunk/myserver/src/log/log_manager.cpp trunk/myserver/tests/Makefile.am Added Paths: ----------- trunk/myserver/include/filter/console.h trunk/myserver/include/log/stream/ trunk/myserver/include/log/stream/Makefile.am trunk/myserver/include/log/stream/console_stream.h trunk/myserver/include/log/stream/console_stream_creator.h trunk/myserver/include/log/stream/file_stream.h trunk/myserver/include/log/stream/file_stream_creator.h trunk/myserver/include/log/stream/log_stream.h trunk/myserver/include/log/stream/log_stream_creator.h trunk/myserver/include/log/stream/log_stream_factory.h trunk/myserver/include/log/stream/socket_stream.h trunk/myserver/include/log/stream/socket_stream_creator.h trunk/myserver/src/filter/console.cpp trunk/myserver/src/log/stream/ trunk/myserver/src/log/stream/Makefile.am trunk/myserver/src/log/stream/console_stream.cpp trunk/myserver/src/log/stream/console_stream_creator.cpp trunk/myserver/src/log/stream/file_stream.cpp trunk/myserver/src/log/stream/file_stream_creator.cpp trunk/myserver/src/log/stream/log_stream.cpp trunk/myserver/src/log/stream/log_stream_creator.cpp trunk/myserver/src/log/stream/log_stream_factory.cpp trunk/myserver/src/log/stream/socket_stream.cpp trunk/myserver/src/log/stream/socket_stream_creator.cpp Modified: trunk/myserver/AUTHORS =================================================================== --- trunk/myserver/AUTHORS 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/AUTHORS 2008-09-22 20:20:14 UTC (rev 2834) @@ -8,3 +8,4 @@ Russ Bohnhoff Alexandru Iancu Giuseppe Scrivano +Francesco Pipita Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/configure.in 2008-09-22 20:20:14 UTC (rev 2834) @@ -391,6 +391,7 @@ include/Makefile include/connection/Makefile include/log/Makefile + include/log/stream/Makefile include/conf/Makefile include/conf/mime/Makefile include/conf/security/Makefile @@ -444,6 +445,7 @@ src/Makefile src/connection/Makefile src/log/Makefile + src/log/stream/Makefile src/conf/Makefile src/conf/mime/Makefile src/conf/security/Makefile Modified: trunk/myserver/include/filter/Makefile.am =================================================================== --- trunk/myserver/include/filter/Makefile.am 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/include/filter/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -1,3 +1,3 @@ -include_HEADERS = filter.h filters_chain.h filters_factory.h memory_stream.h stream.h +include_HEADERS = filter.h filters_chain.h filters_factory.h memory_stream.h stream.h console.h SUBDIRS = gzip Added: trunk/myserver/include/filter/console.h =================================================================== --- trunk/myserver/include/filter/console.h (rev 0) +++ trunk/myserver/include/filter/console.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,37 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONSOLE_H +#define CONSOLE_H + +#include + +#include + +using namespace std; + +class Console : public Stream +{ + public: + Console(); + virtual ~Console(); + virtual int flush (u_long* nbw); + virtual int read (char* buffer, u_long len, u_long* nbr); + virtual int write (const char* buffer, u_long len, u_long* nbw); +}; + +#endif Modified: trunk/myserver/include/filter/filters_chain.h =================================================================== --- trunk/myserver/include/filter/filters_chain.h 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/include/filter/filters_chain.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -59,6 +59,7 @@ int clear(); void getName(string& out); int hasModifiersFilters(); + list getFilters (); virtual int read(char* buffer, u_long len, u_long*); virtual int write(const char* buffer, u_long len, u_long*); virtual int flush(u_long*); Modified: trunk/myserver/include/log/Makefile.am =================================================================== --- trunk/myserver/include/log/Makefile.am 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/include/log/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -1,3 +1,3 @@ include_HEADERS = log_manager.h -SUBDIRS = +SUBDIRS = stream Modified: trunk/myserver/include/log/log_manager.h =================================================================== --- trunk/myserver/include/log/log_manager.h 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/include/log/log_manager.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -1,7 +1,7 @@ /* -*- mode: c++ -*- */ /* MyServer -Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +Copyright (C) 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -19,60 +19,227 @@ #ifndef LOG_MANAGER_H #define LOG_MANAGER_H -#include "stdafx.h" -#include -#include +#include +#include + #include +#include +#include +#include +#include -#include using namespace std; + +/*! + * Defines different types of logging level. + */ +enum LoggingLevel + { + INFO, + WARNING, + ERROR + }; + + class LogManager { -private: - File file; - int type; +public: + + /*! - *loaded is used to store if the file object is initialized correctly. + * Default constructor. It is only used to support the old + * interface. */ - int loaded; + LogManager (); + + + LogManager (FiltersFactory* filtersFactory, + LogStreamFactory* logStreamFactory, + LoggingLevel level = WARNING); + + + /*! + * Deallocates all LogStream owned by the LogManager and + * other objects (like the Mutex and the LogStreamFactory) + * allocated by the LogManager. + */ + ~LogManager (); + + + /*! + * Add a new LogStream to the LogManager. Prevents duplicate + * LogStream being added. + * \param location The location where the new LogStream will point. + * \param filters A list of filters used within the new LogStream. + * \param cycleLog A non-zero value establishes the threshold for + * the LogStream's growth before cycling it. + */ + void addLogStream (string& location, + list& filters, + u_long cycleLog); + + + /*! + * Remove the LogStream that point to location if it exists. + * \param location The location where the LogStream which has to + * be removed points to. + */ + void removeLogStream (string& location); + + + LogStream* getLogStream (string& location); + + + /*! + * Write `message' to the LogStream that points to `location'. If + * no location is provided, it writes the message on all LogStreams + * owned by this LogManager. + * \param message The message string to write. + * \param level The message logging level. If it is lower than the + * LogManager's logging level, the LogManager discards it. + * \param location The location where `message' will be written. + * \return 0 on success. + */ + int log (string& message, + LoggingLevel level = WARNING, + string location = "all"); + + + /*! + * Close the LogStream that points to `location'. If no location + * is provided, it closes all LogStreams owned by this LogManager. + * \return 0 on success. + */ + int close (string location = "all"); + + + /*! + * \return The cycleLog value for the LogStream that points to + * location. + */ + u_long getCycleLog (string& location); + + + /*! + * Set the cycleLog field for the LogStream that points to `location'. + * If no location is provided, it will set the cycleLog to the same value + * for all LogStreams. + * \param cycleLog The new cycleLog value. + * \param location The LogStream whose cycleLog will be changed. + */ + void setCycleLog (u_long cycleLog, + string location); + + + /*! + * Set the default logging level. + * \param level The new logging level value. + * \return The old logging level. + */ + LoggingLevel setLoggingLevel (LoggingLevel level); + + + LoggingLevel getLoggingLevel (); + + + void setLogStreamFactory (LogStreamFactory* logStreamFactory); + + + LogStreamFactory* getLogStreamFactory (); + + + void setFiltersFactory (FiltersFactory* filtersFactory); + + + FiltersFactory* getFiltersFactory (); + + + int size (); + + + bool empty (); + + + bool contains (string& location); + + + /*! + * Delete all LogStream objects owned by this LogManager. + */ + void clear (); + + + /*! + * Deprecated methods and fields. + */ + int getLogSize (); + int storeFile (); + int load (char const*); + void setGzip (int); + int write (char const*, int len = 0); + int writeln (char const*); + File* getFile (); + u_long setMaxSize (u_long); + u_long getMaxSize (); + int getType (); + int getGzip (); + void setType (int); + int preparePrintError (); + int endPrintError (); + int requestAccess (); + int terminateAccess (); + void setCycleLog (u_long); + int const static TYPE_CONSOLE; + int const static TYPE_FILE; + int type; + int gzipLog; + int cycleLog; u_long maxSize; - Mutex mutex; - int cycleLog; - int gzipLog; -public: - void setGzip(bool); - int getGzip(); - void setCycleLog(int); - int getCycleLog(); - const static int TYPE_CONSOLE; - const static int TYPE_FILE; - File *getFile(); - LogManager(); - ~LogManager(); - u_long setMaxSize( u_long ); - u_long getMaxSize(); - int requestAccess(); - int terminateAccess(); +protected: - int load(const char *filename ); - int load(string const &filename) - {return load(filename.c_str());} - int close(); - int preparePrintError(); - int endPrintError(); - void setType( int ); - int getType(); - int write( const char *str, int len = 0 ); - int writeln(const char *); + /*! + * Send events to LogStreams. + * \param evt The event that should be notified to LogStreams. + * \param message The message to deliver. + * \param reply The receiver will put its data here. + * \return 0 on success. + */ + int notifyLogStreams (LogStreamEvent evt, + void* message = 0, + void* reply = 0); +private: - int write(string const &str, int len = 0 ) - {return write(str.c_str(), len);} - int writeln(string const& str) - {return writeln(str.c_str());} - int getLogSize(); - int storeFile(); + /*! + * Hold the default logging level for the LogManager. + */ + LoggingLevel level; + + + /*! + * Ensure atomic operations to prevent interleaving. + */ + Mutex* mutex; + + + /*! + * The LogStream creator. + */ + LogStreamFactory* logStreamFactory; + + + /*! + * The Filter creator. + */ + FiltersFactory* filtersFactory; + + + /*! + * Hold all LogStream owned by this LogManager. + */ + map logStreams; }; + #endif Added: trunk/myserver/include/log/stream/Makefile.am =================================================================== --- trunk/myserver/include/log/stream/Makefile.am (rev 0) +++ trunk/myserver/include/log/stream/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,5 @@ +include_HEADERS = console_stream.h file_stream.h log_stream.h \ + log_stream_factory.h log_stream_creator.h \ + file_stream_creator.h console_stream_creator.h \ + socket_stream.h socket_stream_creator.h +SUBDIRS = Added: trunk/myserver/include/log/stream/console_stream.h =================================================================== --- trunk/myserver/include/log/stream/console_stream.h (rev 0) +++ trunk/myserver/include/log/stream/console_stream.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,37 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONSOLE_STREAM_H +#define CONSOLE_STREAM_H + +#include +#include + +#include +#include + +class ConsoleStream : public LogStream +{ + public: + ConsoleStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); +}; + +#endif Property changes on: trunk/myserver/include/log/stream/console_stream.h ___________________________________________________________________ Name: svn:mergeinfo + Added: trunk/myserver/include/log/stream/console_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/console_stream_creator.h (rev 0) +++ trunk/myserver/include/log/stream/console_stream_creator.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,34 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONSOLE_STREAM_CREATOR_H +#define CONSOLE_STREAM_CREATOR_H + +#include +#include + +class ConsoleStreamCreator : public LogStreamCreator +{ + public: + virtual LogStream* create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog); +}; + +#endif Added: trunk/myserver/include/log/stream/file_stream.h =================================================================== --- trunk/myserver/include/log/stream/file_stream.h (rev 0) +++ trunk/myserver/include/log/stream/file_stream.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,58 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef FILE_STREAM_H +#define FILE_STREAM_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +class FileStream : public LogStream +{ + public: + + + FileStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); + + + /*! + * The default file mask used to create a log file. + */ + int const static defaultFileMask; + + + virtual u_long streamSize (); + + + protected: + + + virtual int streamCycle (); +}; + +#endif Property changes on: trunk/myserver/include/log/stream/file_stream.h ___________________________________________________________________ Name: svn:mergeinfo + Added: trunk/myserver/include/log/stream/file_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/file_stream_creator.h (rev 0) +++ trunk/myserver/include/log/stream/file_stream_creator.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,34 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef FILE_STREAM_CREATOR_H +#define FILE_STREAM_CREATOR_H + +#include +#include + +class FileStreamCreator : public LogStreamCreator +{ + public: + virtual LogStream* create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog); +}; + +#endif Added: trunk/myserver/include/log/stream/log_stream.h =================================================================== --- trunk/myserver/include/log/stream/log_stream.h (rev 0) +++ trunk/myserver/include/log/stream/log_stream.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,189 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef LOG_STREAM_H +#define LOG_STREAM_H + +#include +#include + +#include +#include +#include + + +/*! + * Defines some events of interest for LogStream objects. + */ +enum LogStreamEvent +{ + EVT_SET_CYCLE_LOG, + EVT_LOG, + EVT_CLOSE, + EVT_ADD_FILTER +}; + + +using namespace std; + + +class LogStream +{ + public: + + + /*! + * The constructor. + * \param filtersFactory An instance of FiltersFactory. + * \param cycleLog The cycleLog value. + * \param outStream The Stream where this LogStream will + * write the log messages. + * \param filtersChain The messages will pass through a + * FiltersChain before being written to the Stream. + */ + LogStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); + + + /*! + * \return 0 on success. + */ + int addFilter (Filter* filter); + + + /*! + * \return 0 on success. + */ + int removeFilter (Filter* filter); + + + /*! + * \return 0 on success. + */ + int update (LogStreamEvent evt, void* message = 0, void* reply = 0); + + + /*! + * \return 0 on success. + */ + int close (); + + + /*! + * \return 0 the close method was called. + */ + int getIsOpened (); + + + u_long getLatestWrittenBytes (); + + + virtual u_long streamSize (); + + + u_long getCycleLog (); + + + Stream* getOutStream (); + + + FiltersFactory const* getFiltersFactory (); + + + FiltersChain* getFiltersChain (); + + + void setCycleLog (u_long cycleLog); + + + /*! + * Check if we have reached the max allowed size for the log. + * \return 0 if there is no need to cycle the log yet. + */ + int needToCycle (); + + + /*! + * \return 0 on success. + */ + virtual int log (string& message); + + + virtual ~LogStream (); + + protected: + + + /*! + * \return 0 on success. + */ + virtual int streamCycle (); + + + /*! + * Flushes any remaining data in the FiltersChain, cycle the stream + * and recreates all filters. + * \return 0 on success. + */ + int doCycle (); + + + /*! + * \return 0 on success. + */ + int write (string& message); + + + /*! + * \return 0 on success. + */ + int resetFilters (); + + + /*! + * The latest number of bytes written to the Stream. + */ + u_long nbw; + + + /*! + * Will be zero after a successful call to the close method. + */ + int isOpened; + + + /*! + * A zero value means `never cycle'. A non-zero value establishes + * the maximum size allowed for the LogStream's growth before + * cycling it. + */ + u_long cycleLog; + + + FiltersChain* filtersChain; + + + Stream* outStream; + + + FiltersFactory* filtersFactory; +}; + +#endif Property changes on: trunk/myserver/include/log/stream/log_stream.h ___________________________________________________________________ Name: svn:mergeinfo + Added: trunk/myserver/include/log/stream/log_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/log_stream_creator.h (rev 0) +++ trunk/myserver/include/log/stream/log_stream_creator.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,37 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef LOG_STREAM_CREATOR_H +#define LOG_STREAM_CREATOR_H + +#include +#include + +#include +#include + +class LogStreamCreator +{ + public: + virtual LogStream* create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog) = 0; +}; + +#endif Added: trunk/myserver/include/log/stream/log_stream_factory.h =================================================================== --- trunk/myserver/include/log/stream/log_stream_factory.h (rev 0) +++ trunk/myserver/include/log/stream/log_stream_factory.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,100 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef LOG_STREAM_FACTORY_H +#define LOG_STREAM_FACTORY_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace std; + +class LogStreamFactory +{ +public: + + + /*! + * This constructor initializes the logStreamCreators map. To + * add more LogStreams, you have to create a new class implementing + * the LogStreamCreator interface and then add it here providing + * a valid protocol string (in the form protocol://) as key. + */ + LogStreamFactory (); + + + /*! + * The destructor. Ensures that the memory allocated for + * all the LogStreamCreator objects gets freed. + */ + ~LogStreamFactory (); + + + /*! + * Factory method. Creates a new concrete LogStream. + * \param filtersFactory Self explicating. + * \param location This is the path where the LogStream will point to. + * The location string must follow the syntax `protocol://path/to/log'. + * The protocol:// part can't be missing, since it is required to get + * the proper constructor for the new object that will be created. + * \param filters A list of strings representing filters to be used within + * the new LogStream. + * \param cycleLog Whether the log should be cycled or not. 0 means never + * cycle. + * \return A new instance of one of LogStream subclasses. + */ + LogStream* createLogStream (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog); + + + /*! + * A helper method useful to get the protocol part of a location string. + * \param location The string representing a valid location as explained + * in createLogStream method description. + * \return A new string with the protocol part of the location. + */ + string getProtocol (string& location); + + + /*! + * A helper method useful to get the path part of a location string. + * \param location The string representing a valid location as explained + * in createLogStream method description. + * \return A new string with the path part of the location. + */ + string getPath (string& location); + +private: + + + /*! + * Holds all the constructors known by the LogStreamFactory. + */ + map logStreamCreators; +}; + +#endif Property changes on: trunk/myserver/include/log/stream/log_stream_factory.h ___________________________________________________________________ Name: svn:mergeinfo + Added: trunk/myserver/include/log/stream/socket_stream.h =================================================================== --- trunk/myserver/include/log/stream/socket_stream.h (rev 0) +++ trunk/myserver/include/log/stream/socket_stream.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,38 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef SOCKET_STREAM_H +#define SOCKET_STREAM_H + +#include +#include + +#include +#include + +class SocketStream : public LogStream +{ + public: + + SocketStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); +}; + +#endif Added: trunk/myserver/include/log/stream/socket_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/socket_stream_creator.h (rev 0) +++ trunk/myserver/include/log/stream/socket_stream_creator.h 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,48 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef SOCKET_STREAM_CREATOR_H +#define SOCKET_STREAM_CREATOR_H + +#include +#include + +#include + +class SocketStreamCreator : public LogStreamCreator +{ + public: + virtual LogStream* create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog); + + + /*! + * A helper method to get the port part of an URL. + */ + u_short getPort (string& location); + + + /*! + * A helper method to get the host part of an URL. + */ + string getHost (string& location); +}; + +#endif Modified: trunk/myserver/src/filter/Makefile.am =================================================================== --- trunk/myserver/src/filter/Makefile.am 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/src/filter/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -1,5 +1,6 @@ lib_LIBRARIES = libfilter.a -libfilter_a_SOURCES = filter.cpp filters_chain.cpp filters_factory.cpp memory_stream.cpp stream.cpp +libfilter_a_SOURCES = filter.cpp filters_chain.cpp filters_factory.cpp memory_stream.cpp stream.cpp \ + console.cpp SUBDIRS = gzip INCLUDES = $(all_includes) Added: trunk/myserver/src/filter/console.cpp =================================================================== --- trunk/myserver/src/filter/console.cpp (rev 0) +++ trunk/myserver/src/filter/console.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,48 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +Console::Console () : Stream () +{ + +} + +Console::~Console () +{ + +} + +int +Console::flush (u_long* nbw) +{ + return *nbw = 0; +} + +int +Console::read (char* buffer, u_long len, u_long* nbr) +{ + return *nbr = 0; +} + +int +Console::write (const char* buffer, u_long len, u_long* nbw) +{ + cout << buffer; + *nbw = len; + return 0; +} Modified: trunk/myserver/src/filter/filters_chain.cpp =================================================================== --- trunk/myserver/src/filter/filters_chain.cpp 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/src/filter/filters_chain.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -355,3 +355,13 @@ } } + +list +FiltersChain::getFilters () +{ + list::iterator it; + list filters; + for (it = this->filters.begin (); it != this->filters.end (); it++) + filters.push_back (string ((*it)->getName (0, 0))); + return filters; +} Modified: trunk/myserver/src/log/Makefile.am =================================================================== --- trunk/myserver/src/log/Makefile.am 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/src/log/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -1,5 +1,4 @@ lib_LIBRARIES = liblog.a liblog_a_SOURCES = log_manager.cpp -SUBDIRS = +SUBDIRS = stream INCLUDES = $(all_includes) - Modified: trunk/myserver/src/log/log_manager.cpp =================================================================== --- trunk/myserver/src/log/log_manager.cpp 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/src/log/log_manager.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -1,6 +1,6 @@ /* MyServer -Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -15,451 +15,342 @@ along with this program. If not, see . */ - -#include "stdafx.h" #include -#include -#include -#include -#include -#include -#include +int const LogManager::TYPE_CONSOLE = 1; +int const LogManager::TYPE_FILE = 2; -using namespace std; +LogManager::LogManager (FiltersFactory* filtersFactory, + LogStreamFactory* logStreamFactory, + LoggingLevel level) : level (level) +{ + this->filtersFactory = filtersFactory; + this->logStreamFactory = logStreamFactory; + mutex = new Mutex (); + mutex->init (); +} -const int LogManager::TYPE_CONSOLE = 1; -const int LogManager::TYPE_FILE = 2; +LogManager::~LogManager () +{ + if (!empty ()) + clear (); + delete mutex; +} -/*! - *Initialize the object. - */ -LogManager::LogManager() +void +LogManager::addLogStream (string& location, + list& filters, + u_long cycleLog) { - loaded = 0; - /*! - *By default put everything on the console. - */ - type = TYPE_CONSOLE; - gzipLog = 1; - maxSize = 0; - mutex.init(); - cycleLog = 0; + mutex->lock (); + if (!contains (location)) + { + logStreams[location] = + logStreamFactory->createLogStream (filtersFactory, + location, + filters, + cycleLog); + } + mutex->unlock (); } -/*! - *Destroy the object. - */ -LogManager::~LogManager() +void +LogManager::removeLogStream (string& location) { - /*! - *Try to close the file. - */ - mutex.destroy(); - close(); + mutex->lock (); + if (contains (location)) + { + delete logStreams[location]; + logStreams.erase (location); + } + mutex->unlock (); } -/*! - *Load and use the file to save logs. - *Return zero on sucess. - */ -int LogManager::load(const char *filename) +LogStream* +LogManager::getLogStream (string& location) { - int opt, ret; - /*! - *If the file is still loaded close it before load again. - */ - if(loaded) - close(); + if (contains (location)) + return logStreams[location]; + return 0; +} - opt = File::MYSERVER_OPEN_APPEND | - File::MYSERVER_OPEN_ALWAYS | - File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_READ | - File::MYSERVER_NO_INHERIT; +int +LogManager::notifyLogStreams (LogStreamEvent evt, + void* message, + void* reply) +{ + mutex->lock (); + map::iterator it; + int retVal = 0; + for (it = logStreams.begin (); it != logStreams.end (); it++) + { + retVal |= it->second->update (evt, message, reply); + } + mutex->unlock (); + return retVal; +} - ret = file.openFile(filename, opt); +int +LogManager::log (string& message, LoggingLevel level, string location) +{ + if (level >= this->level) + { + if (contains (location)) + { + return logStreams[location]->log (message); + } + else + { + return notifyLogStreams (EVT_LOG, static_cast(&message)); + } + } + return 1; +} - if(ret) - { - return 1; - } - setType(TYPE_FILE); - loaded = 1; - return 0; - +int +LogManager::close (string location) +{ + if (contains (location)) + { + return logStreams[location]->close (); + } + return notifyLogStreams (EVT_CLOSE); } -/*! - *Close the file. - */ -int LogManager::close() +void +LogManager::setCycleLog (u_long cycleLog, string location) { - if(loaded) - file.close(); - return 0; + if (contains (location)) + { + logStreams[location]->setCycleLog (cycleLog); + } + else + { + notifyLogStreams (EVT_SET_CYCLE_LOG, static_cast(&cycleLog)); + } } -/*! - *Set the type for the log. - */ -void LogManager::setType(int nType) +LoggingLevel +LogManager::setLoggingLevel (LoggingLevel level) { - type = nType; + LoggingLevel oldLevel = level; + this->level = level; + return oldLevel; } -/*! - *Set the max size for the log. - *Returns the old limit. - *Using a size of zero means that this limit is not used. - */ -u_long LogManager::setMaxSize(u_long nMax) +u_long +LogManager::getCycleLog (string& location) { - u_long oldMax = maxSize; - maxSize = nMax; - return oldMax; + if (contains (location)) + return logStreams[location]->getCycleLog (); } +LoggingLevel +LogManager::getLoggingLevel () +{ + return level; +} -/*! - *Write the string to the log plus termination character[s]. - *Returns 0 on success. - */ -int LogManager::writeln(const char *str) +void +LogManager::setLogStreamFactory (LogStreamFactory* logStreamFactory) { - int ret = write(str); -#ifdef WIN32 - if(ret == 0) - ret = write("\r\n"); -#else - if(ret == 0) - ret = write("\n"); -#endif - return ret; + this->logStreamFactory = logStreamFactory; } -/*! - *Set the log to save results on a new file when the max size is reached. - */ -void LogManager::setCycleLog(int l) +LogStreamFactory* +LogManager::getLogStreamFactory () { - cycleLog = l; + return logStreamFactory; } -/*! - *Get if the log store log data on a new file when the max size is reached. - */ -int LogManager::getCycleLog() +void +LogManager::setFiltersFactory (FiltersFactory* filtersFactory) { - return cycleLog; + this->filtersFactory = filtersFactory; } -/*! - *Write the string to the log. - *Returns 0 on success. - */ -int LogManager::write(const char *str, int len) +FiltersFactory* +LogManager::getFiltersFactory () { - int ret; - if(type == TYPE_CONSOLE) - { - cout << str; - } - else if(type == TYPE_FILE) - { - u_long nbw; + return filtersFactory; +} - /*! - *File was not loaded correctly. - */ - if(!loaded) - { - return 1; - } +int +LogManager::size () +{ + return logStreams.size (); +} - /*! - *We reached the max file size. - *Don't use this limitation if maxSize is equal to zero. - */ - if(maxSize && (file.getFileSize() > maxSize)) - { - if(storeFile()) - return 1; - } +void +LogManager::clear () +{ + map::iterator it; + for (it = logStreams.begin (); it != logStreams.end (); it++) + delete it->second; + logStreams.clear (); +} - /*! - *If the len specified is equal to zero write the string as - *a null character terminated one. - */ - ret = file.writeToFile(str, len ? len : (u_long)strlen(str), &nbw); - return ret; - } - return 0; +bool +LogManager::empty () +{ + return size () == 0; } -/*! - *Set if the log will cycle log files using gzip. - */ -void LogManager::setGzip(bool useGzip) +bool +LogManager::contains (string& location) { - gzipLog = useGzip; + return logStreams.count (location) > 0; } -/*! - *Returns nonzero if the log is using gzip for cycled logs. +/* + * ******************************************************************* + * + * D E P R E C A T E D + * + * ******************************************************************* */ -int LogManager::getGzip() + +LogManager::LogManager () : level (WARNING) { - return gzipLog; + mutex = new Mutex (); + this->filtersFactory = new FiltersFactory (); + this->filtersFactory->insert ("gzip", Gzip::factory); + logStreamFactory = new LogStreamFactory (); + mutex->init (); + type = TYPE_CONSOLE; + maxSize = 0; + gzipLog = 1; + cycleLog = 0; + string location ("console://"); + list filters; + addLogStream (location, filters, maxSize); } -/*! - *Store the log manager in another file and reload the file. - */ -int LogManager::storeFile() +int +LogManager::load (const char *filename) { - char *buffer = 0; - char *buffer2= 0; - const u_long bufferSize = MYSERVER_KB(64); - try - { - string filepath; - string filedir; - string filename; - ostringstream newfilename; - string time; - Gzip gzip; + setType (TYPE_FILE); + clear (); + string location ("file://"); + location.append (filename); + list filters; + addLogStream (location, filters, maxSize); + return 0; +} - /*! Do nothing if we haven't to cycle log files. */ - if(!cycleLog) - return 1; +int +LogManager::write (const char *str, int len) +{ + string message (str); + return notifyLogStreams (EVT_LOG, static_cast(&message)); +} -#ifdef DO_NOT_USE_GZIP - gzipLog = 0; -#endif +int LogManager::getLogSize () +{ + if (getFile ()) + return getFile ()->getFileSize (); + return 0; +} - filepath.assign(getFile()->getFilename()); - FilesUtility::completePath(filepath); - FilesUtility::splitPath(filepath, filedir, filename); +void +LogManager::setCycleLog (u_long cycleLog) +{ + cycleLog = 1; + notifyLogStreams (EVT_SET_CYCLE_LOG, static_cast(&maxSize)); +} - getRFC822LocalTime(time, 32); - time = trim(time.substr(5,32)); - - for(int i=0;i< static_cast(time.length()); i++) - if((time[i] == ' ') || (time[i] == ':')) - time[i]= '.'; - - newfilename << filedir << "/" << filename << "." << time; - - if(gzipLog) - newfilename << ".gz"; - +File* +LogManager::getFile () +{ + map::iterator it; + for (it = logStreams.begin (); it != logStreams.end (); it++) { - char gzipData[16]; - File newFile; - File *currentFile = getFile(); - - buffer = new char[bufferSize]; - if(buffer == 0) - return 1; - buffer2 = new char[bufferSize]; - if(buffer == 0) - { - delete [] buffer; - return 1; - } - - if(newFile.openFile(newfilename.str().c_str(), - File::MYSERVER_OPEN_WRITE | File::MYSERVER_NO_INHERIT | File::MYSERVER_CREATE_ALWAYS )) - { - delete [] buffer; - delete [] buffer2; - return 1; - } - if(currentFile->setFilePointer(0)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - if(gzipLog) - { - u_long nbw; - u_long len = gzip.getHeader(gzipData, 16); - if(newFile.writeToFile(gzipData, len, &nbw)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - gzip.initialize(); - } - - for(;;) - { - u_long nbr; - u_long nbw; - if(currentFile->readFromFile(buffer,gzipLog ? bufferSize/2 : bufferSize, &nbr)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - if(nbr == 0) - break; - if(gzipLog) - { - u_long nbw; - u_long size=gzip.compress(buffer,nbr, buffer2, bufferSize/2); - if(newFile.writeToFile(buffer2, size, &nbw)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - } - else if(newFile.writeToFile(buffer, nbr, &nbw)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - } - if(gzipLog) - { - u_long nbw; - u_long len = gzip.flush(buffer2, bufferSize/2); - if(newFile.writeToFile(buffer2, len, &nbw)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - len=gzip.getFooter(gzipData, 16); - if(newFile.writeToFile(gzipData, len, &nbw)) - { - delete [] buffer; - delete [] buffer2; - newFile.close(); - return 1; - } - gzip.free(); - } - newFile.close(); - currentFile->close(); - FilesUtility::deleteFile(filepath.c_str()); - if(currentFile->openFile(filepath.c_str(), File::MYSERVER_OPEN_APPEND| - File::MYSERVER_OPEN_ALWAYS | File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_READ | File::MYSERVER_NO_INHERIT)) - { - delete [] buffer; - delete [] buffer2; - return 1; - } + if (it->first.find ("file://") != string::npos) + { + return dynamic_cast(it->second->getOutStream ()); + } } + return 0; +} - delete [] buffer; - delete [] buffer2; - return 0; - } - catch(...) - { - if(buffer) - delete [] buffer; - if(buffer2) - delete [] buffer2; - throw; - }; +int +LogManager::writeln (const char *str) +{ + int ret = write (str); +#ifdef WIN32 + if (ret == 0) + ret = write ("\r\n"); +#else + if (ret == 0) + ret = write ("\n"); +#endif + return ret; } -/*! - *Get the type of log. - */ -int LogManager::getType() +u_long LogManager::getMaxSize() { - return type; + return maxSize; } -/*! - *Switch in the error output mode. - */ -int LogManager::preparePrintError() +u_long +LogManager::setMaxSize (u_long nMax) { + u_long old = maxSize; + maxSize = nMax; + setCycleLog (cycleLog); + return old; +} - if(type == TYPE_CONSOLE) - { - ::preparePrintError(); - } +void +LogManager::setGzip (int useGzip) +{ + gzipLog = useGzip; + if (gzipLog) + notifyLogStreams (EVT_ADD_FILTER, new Gzip ()); +} - return 0; +int +LogManager::getType () +{ + return type; } -/*! - *Exit from printing errors. - */ -int LogManager::endPrintError() +void +LogManager::setType (int nType) { - if(type == TYPE_CONSOLE) - { - ::endPrintError(); - } - return 0; + type = nType; } -/*! - *Get a pointer to the file object. - */ -File *LogManager::getFile() +int +LogManager::preparePrintError () { - return &file; + return 0; } -/*! - *Request access for the thread. - */ -int LogManager::requestAccess() +int +LogManager::endPrintError () { - mutex.lock(); return 0; } -/*! - *Terminate the access for the thread. - */ -int LogManager::terminateAccess() +int LogManager::requestAccess () { - mutex.unlock(); return 0; } -/*! - *Return the max size for the log. - */ -u_long LogManager::getMaxSize() +int LogManager::terminateAccess () { - return maxSize; + return 0; } -/*! - *Return the actual size for the log file. - */ -int LogManager::getLogSize() +int +LogManager::getGzip () { - switch(type) - { - case TYPE_FILE: - return file.getFileSize(); + return gzipLog; +} - case TYPE_CONSOLE: - return 0; - } - +int +LogManager::storeFile() +{ return 0; - } Added: trunk/myserver/src/log/stream/Makefile.am =================================================================== --- trunk/myserver/src/log/stream/Makefile.am (rev 0) +++ trunk/myserver/src/log/stream/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,8 @@ +lib_LIBRARIES = libstream.a +libstream_a_SOURCES = console_stream.cpp file_stream.cpp \ + log_stream.cpp log_stream_factory.cpp \ + log_stream_creator.cpp file_stream_creator.cpp \ + console_stream_creator.cpp socket_stream.cpp \ + socket_stream_creator.cpp +SUBDIRS = +INCLUDE = $(all_includes) Added: trunk/myserver/src/log/stream/console_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/console_stream.cpp (rev 0) +++ trunk/myserver/src/log/stream/console_stream.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,29 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +ConsoleStream::ConsoleStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : +LogStream (filtersFactory, + cycleLog, + outStream, + filtersChain) +{ +} Added: trunk/myserver/src/log/stream/console_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/console_stream_creator.cpp (rev 0) +++ trunk/myserver/src/log/stream/console_stream_creator.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,35 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +LogStream* +ConsoleStreamCreator::create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog) +{ + Console* outStream = new Console (); + u_long nbw; + FiltersChain* filtersChain = filtersFactory->chain (filters, + outStream, + &nbw); + return new ConsoleStream (filtersFactory, + cycleLog, + outStream, + filtersChain); +} Added: trunk/myserver/src/log/stream/file_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/file_stream.cpp (rev 0) +++ trunk/myserver/src/log/stream/file_stream.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,145 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +int const FileStream::defaultFileMask = File::MYSERVER_OPEN_APPEND | + File::MYSERVER_OPEN_ALWAYS | + File::MYSERVER_OPEN_WRITE | + File::MYSERVER_OPEN_READ | + File::MYSERVER_NO_INHERIT; + +FileStream::FileStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : + LogStream (filtersFactory, cycleLog, outStream, filtersChain) +{ +} + +u_long +FileStream::streamSize () +{ + return dynamic_cast(outStream)->getFileSize (); +} + +int +FileStream::streamCycle () +{ + char *buffer = 0; + char *buffer2 = 0; + const u_long bufferSize = MYSERVER_KB (64); + try + { + string filepath; + string filedir; + string filename; + string ext; + ostringstream newfilename; + string time; + + filepath.assign (dynamic_cast(outStream)->getFilename ()); + FilesUtility::completePath (filepath); + FilesUtility::splitPath (filepath, filedir, filename); + + FilesUtility::getFileExt (ext, filename); + + getRFC822LocalTime (time, 32); + time = trim (time.substr (5, 32)); + + for (int i = 0; i < static_cast(time.length ()); i++) + if ((time[i] == ' ') || (time[i] == ':')) + time[i]= '.'; + if (ext.size ()) + { + filename = (filename.substr (0, filename.find (string (".") + ext))); + } + newfilename << filedir << "/" << filename << "." << time << + (ext.size () ? "." : "") << ext; + + File newFile; + File *currentFile = dynamic_cast(outStream); + + buffer = new char[bufferSize]; + if (buffer == 0) + return 1; + buffer2 = new char[bufferSize]; + if (buffer == 0) + { + delete [] buffer; + return 1; + } + + if (newFile.openFile (newfilename.str ().c_str (), + File::MYSERVER_OPEN_WRITE | + File::MYSERVER_NO_INHERIT | + File::MYSERVER_CREATE_ALWAYS)) + { + delete [] buffer; + delete [] buffer2; + return 1; + } + if (currentFile->setFilePointer (0)) + { + delete [] buffer; + delete [] buffer2; + newFile.close (); + return 1; + } + for (;;) + { + u_long nbr; + u_long nbw; + if(currentFile->readFromFile (buffer, bufferSize, &nbr)) + { + delete [] buffer; + delete [] buffer2; + newFile.close (); + return 1; + } + if (nbr == 0) + break; + if (newFile.writeToFile (buffer, nbr, &nbw)) + { + delete [] buffer; + delete [] buffer2; + newFile.close (); + return 1; + } + } + newFile.close (); + currentFile->close (); + FilesUtility::deleteFile (filepath.c_str ()); + if (currentFile->openFile (filepath.c_str(), defaultFileMask)) + { + delete [] buffer; + delete [] buffer2; + return 1; + } + delete [] buffer; + delete [] buffer2; + return 0; + } + catch (...) + { + if (buffer) + delete [] buffer; + if (buffer2) + delete [] buffer2; + throw; + }; +} Added: trunk/myserver/src/log/stream/file_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/file_stream_creator.cpp (rev 0) +++ trunk/myserver/src/log/stream/file_stream_creator.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,36 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +LogStream* +FileStreamCreator::create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog) +{ + Stream* outStream = new File (const_cast(location.c_str ()), + FileStream::defaultFileMask); + u_long nbw; + FiltersChain* filtersChain = filtersFactory->chain (filters, + outStream, + &nbw); + return new FileStream (filtersFactory, + cycleLog, + outStream, + filtersChain); +} Added: trunk/myserver/src/log/stream/log_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/log_stream.cpp (rev 0) +++ trunk/myserver/src/log/stream/log_stream.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,177 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +LogStream::LogStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : +cycleLog (cycleLog), isOpened (1) +{ + this->filtersFactory = filtersFactory; + this->outStream = outStream; + this->filtersChain = filtersChain; +} + +LogStream::~LogStream () +{ + if (isOpened) + close (); + filtersChain->clearAllFilters (); + delete outStream; + delete filtersChain; +} + +int +LogStream::resetFilters () +{ + list filters (filtersChain->getFilters ()); + filtersChain->clearAllFilters (); + return filtersFactory->chain (filtersChain, filters, outStream, &nbw); +} + +int +LogStream::log (string& message) +{ + if (needToCycle ()) + { + return doCycle () || write (message); + } + return write (message); +} + +int +LogStream::needToCycle () +{ + return cycleLog && (streamSize () >= cycleLog); +} + +int +LogStream::doCycle () +{ + return filtersChain->flush (&nbw) || streamCycle () || resetFilters (); +} + +int +LogStream::write (string& message) +{ + return filtersChain->write (message.c_str (), message.size (), &nbw); +} + +void +LogStream::setCycleLog (u_long cycleLog) +{ + this->cycleLog = cycleLog; +} + +u_long +LogStream::getCycleLog () +{ + return cycleLog; +} + +Stream* +LogStream::getOutStream () +{ + return outStream; +} + +FiltersChain* +LogStream::getFiltersChain () +{ + return filtersChain; +} + +int +LogStream::close () +{ + return isOpened = (filtersChain->flush (&nbw) || outStream->close ()); +} + +int +LogStream::update (LogStreamEvent evt, void* message, void* reply) +{ + switch (evt) + { + case EVT_SET_CYCLE_LOG: + { + setCycleLog (*static_cast(message)); + return 0; + } + break; + case EVT_LOG: + { + return log (*static_cast(message)); + } + break; + case EVT_CLOSE: + { + return close (); + } + break; + case EVT_ADD_FILTER: + { + return addFilter (static_cast(message)); + } + break; + default: + return 1; + } +} + +int +LogStream::addFilter (Filter* filter) +{ + return filtersChain->addFilter (filter, &nbw); +} + +int +LogStream::removeFilter (Filter* filter) +{ + return filtersChain->removeFilter (filter); +} + +FiltersFactory const* +LogStream::getFiltersFactory () +{ + return filtersFactory; +} + +u_long +LogStream::streamSize () +{ + return 0; +} + +int +LogStream::streamCycle () +{ + return 0; +} + +int +LogStream::getIsOpened () +{ + return isOpened; +} + +u_long +LogStream::getLatestWrittenBytes () +{ + return nbw; +} Added: trunk/myserver/src/log/stream/log_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/log_stream_creator.cpp (rev 0) +++ trunk/myserver/src/log/stream/log_stream_creator.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,18 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include Added: trunk/myserver/src/log/stream/log_stream_factory.cpp =================================================================== --- trunk/myserver/src/log/stream/log_stream_factory.cpp (rev 0) +++ trunk/myserver/src/log/stream/log_stream_factory.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,61 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +LogStreamFactory::LogStreamFactory () +{ + logStreamCreators["file://"] = new FileStreamCreator (); + logStreamCreators["console://"] = new ConsoleStreamCreator (); + logStreamCreators["socket://"] = new SocketStreamCreator (); +} + +LogStreamFactory::~LogStreamFactory () +{ + map::iterator it; + for (it = logStreamCreators.begin (); + it != logStreamCreators.end (); it++) + { + delete it->second; + } +} + +LogStream* +LogStreamFactory::createLogStream (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog) +{ + string protocol (getProtocol (location)); + string path (getPath (location)); + return logStreamCreators[protocol]->create (filtersFactory, + path, + filters, + cycleLog); +} + +string +LogStreamFactory::getProtocol (string& location) +{ + return (location.substr (0, location.find("://"))).append ("://"); +} + +string +LogStreamFactory::getPath (string& location) +{ + return location.substr (getProtocol (location).size (), location.size ()); +} Added: trunk/myserver/src/log/stream/socket_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/socket_stream.cpp (rev 0) +++ trunk/myserver/src/log/stream/socket_stream.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,29 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +SocketStream::SocketStream (FiltersFactory* filtersFactory, + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : +LogStream (filtersFactory, + cycleLog, + outStream, + filtersChain) +{ +} Property changes on: trunk/myserver/src/log/stream/socket_stream.cpp ___________________________________________________________________ Name: svn:mergeinfo + Added: trunk/myserver/src/log/stream/socket_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/socket_stream_creator.cpp (rev 0) +++ trunk/myserver/src/log/stream/socket_stream_creator.cpp 2008-09-22 20:20:14 UTC (rev 2834) @@ -0,0 +1,49 @@ +/* +MyServer +Copyright (C) 2006, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include + +LogStream* +SocketStreamCreator::create (FiltersFactory* filtersFactory, + string& location, + list& filters, + u_long cycleLog) +{ + Stream* outStream = new Socket (); + u_long nbw; + dynamic_cast(outStream)->connect (getHost (location).c_str (), + getPort (location)); + FiltersChain* filtersChain = filtersFactory->chain (filters, + outStream, + &nbw); + return new SocketStream (filtersFactory, + cycleLog, + outStream, + filtersChain); +} + +u_short +SocketStreamCreator::getPort (string& location) +{ + return static_cast(atoi (location.substr (location.find (":") + 1).c_str ())); +} + +string +SocketStreamCreator::getHost (string& location) +{ + return location.substr (0, location.find (":")); +} Property changes on: trunk/myserver/src/log/stream/socket_stream_creator.cpp ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-21 20:49:18 UTC (rev 2833) +++ trunk/myserver/tests/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_mem_stream.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp +tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_mem_stream.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp test_log_manager.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) From MAILER-DAEMON Tue Sep 23 14:48:06 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiCve-0005Ac-EF for mharc-myserver-commit@gnu.org; Tue, 23 Sep 2008 14:48:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiCvb-00059O-OV for myserver-commit@gnu.org; Tue, 23 Sep 2008 14:48:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiCva-000591-OB for myserver-commit@gnu.org; Tue, 23 Sep 2008 14:48:03 -0400 Received: from [199.232.76.173] (port=43538 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiCva-00058o-7h for myserver-commit@gnu.org; Tue, 23 Sep 2008 14:48:02 -0400 Received: from savannah.gnu.org ([199.232.41.3]:32772 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiCvZ-0005yg-Ql for myserver-commit@gnu.org; Tue, 23 Sep 2008 14:48:02 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiCvZ-0000gj-6R for myserver-commit@gnu.org; Tue, 23 Sep 2008 18:48:01 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiCvY-0000gf-Sn for myserver-commit@gnu.org; Tue, 23 Sep 2008 18:48:01 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 23 Sep 2008 18:48:00 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2835] The general description node was integrated on the front page, added the concept index and fixed the structure. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 18:48:04 -0000 Revision: 2835 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2835 Author: gscrivano Date: 2008-09-23 18:48:00 +0000 (Tue, 23 Sep 2008) Log Message: ----------- The general description node was integrated on the front page, added the concept index and fixed the structure. Modified Paths: -------------- trunk/myserver/documentation/Makefile.am trunk/myserver/documentation/myserver.texi trunk/myserver/documentation/virtual_hosts.texi Removed Paths: ------------- trunk/myserver/documentation/general_description.texi Modified: trunk/myserver/documentation/Makefile.am =================================================================== --- trunk/myserver/documentation/Makefile.am 2008-09-22 20:20:14 UTC (rev 2834) +++ trunk/myserver/documentation/Makefile.am 2008-09-23 18:48:00 UTC (rev 2835) @@ -1,6 +1,6 @@ info_TEXINFOS=myserver.texi #any other .texi that is not myserver.texi -myserver_TEXINFOS=basic_configuration.texi doclicense.texi general_description.texi mime_types.texi gpl.texi process_security.texi virtual_hosts.texi ssl_certificates.texi +myserver_TEXINFOS=basic_configuration.texi doclicense.texi mime_types.texi gpl.texi process_security.texi virtual_hosts.texi ssl_certificates.texi SUBDIRS = english Deleted: trunk/myserver/documentation/general_description.texi =================================================================== --- trunk/myserver/documentation/general_description.texi 2008-09-22 20:20:14 UTC (rev 2834) +++ trunk/myserver/documentation/general_description.texi 2008-09-23 18:48:00 UTC (rev 2835) @@ -1,9 +0,0 @@ -@c -*-texinfo-*- -MyServer is a powerful web server designed, to be easily run on a -personal computer by the average computer user. -It is based on multi-threaded architecture, which makes it extremely -scalable and usable in large scale sites, as well as in small -networks. It has built-in supports for the HTTP, HTTPS and FTP -protocols. -Support for dynamic pages is made available trough CGI, ISAPI, WinCGI, -SCGI and FastCGI protocols. Modified: trunk/myserver/documentation/myserver.texi =================================================================== --- trunk/myserver/documentation/myserver.texi 2008-09-22 20:20:14 UTC (rev 2834) +++ trunk/myserver/documentation/myserver.texi 2008-09-23 18:48:00 UTC (rev 2835) @@ -1,9 +1,40 @@ \input texinfo -@setfilename myserver.info -@settitle GNU MyServer documentation +@setfilename myserver +@settitle GNU MyServer Manual + @setchapternewpage odd +@copying +This is the manual for GNU MyServer. + +Copyright @copyright{} 2008 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``The GNU Manifesto,'' ``Distribution'' and +``GNU GENERAL PUBLIC LICENSE,'' with the Front-Cover texts being ``A GNU +Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License.'' + +(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and +modify this GNU manual. Buying copies from the FSF supports it in +developing GNU and promoting software freedom.'' +@end quotation +@end copying + +@dircategory MyServer +@direntry +* MyServer: (myserver). GNU MyServer. +@end direntry + +@tex +\global\hbadness=100000 +@end tex + @titlepage @sp 10 @center @titlefont{GNU MyServer} @@ -13,38 +44,47 @@ Copyright @copyright{} 2008 Free Software Foundation, Inc. @end titlepage -@node Top, Copying,, +@iftex +@summarycontents +@contents +@end iftex -This is the manual for the GNU MyServer web server. +@ifnottex +@node Top, Copying, (dir), (dir) +@top GNU MyServer +GNU MyServer is a powerful web server designed, to be easily executed +on a personal computer by the average computer user. +It is based on multi-threaded architecture, which makes it extremely +scalable and usable in large scale sites, as well as in small +networks. It has built-in supports for the HTTP, HTTPS and FTP +protocols. +Support for dynamic pages is made available trough CGI, ISAPI, WinCGI, +SCGI and FastCGI protocols. +@end ifnottex @menu * Copying:: The GNU General Public License gives you permission to redistribute GNU MyServer on certain terms; it also explains that there is no warranty. * GNU Free Documentation License:: The license for this documentation. -* General description:: GNU MyServer general description. * Basic configuration:: Basic server configuration. * Virtual hosts:: Virtual hosts configuration. * MIME types:: MIME types configuration. * Process security:: Process security. * SSL certificates:: Show how to use SSL certificates. -* Table of contents:: Table of contents. + +* Concept Index:: An item for each concept. @end menu @node Copying, GNU Free Documentation License, Top, Top @appendix GNU GENERAL PUBLIC LICENSE @include gpl.texi -@node GNU Free Documentation License, General description, Copying, Top +@node GNU Free Documentation License, Basic configuration, Copying, Top @appendix GNU Free Documentation License @include doclicense.texi -@node General description, Basic configuration, GNU Free Documentation License, Top -@chapter General description -@cindex General description -@include general_description.texi - -@node Basic configuration, Virtual hosts, General description, Top +@node Basic configuration, Virtual hosts, GNU Free Documentation License, Top @chapter Basic configuration @cindex Basic configuration @include basic_configuration.texi @@ -64,14 +104,14 @@ @cindex Process security @include process_security.texi -@node SSL certificates, , Process security, Top +@node SSL certificates, Concept Index, Process security, Top @chapter SSL certificates @cindex SSL certificates @include ssl_certificates.texi -@node Table of contents, , Top, Top -@unnumbered Table of contents +@node Concept Index, , SSL certificates, Top +@unnumbered Concept Index @printindex cp -@contents + @bye @c -*-texinfo-*- Modified: trunk/myserver/documentation/virtual_hosts.texi =================================================================== --- trunk/myserver/documentation/virtual_hosts.texi 2008-09-22 20:20:14 UTC (rev 2834) +++ trunk/myserver/documentation/virtual_hosts.texi 2008-09-23 18:48:00 UTC (rev 2835) @@ -59,7 +59,11 @@ @end itemize Log files can have extra options: -@code{logs/myServerHTTP.log} + +@example +logs/myServerHTTP.log +@end example + With this option, the logs will have two extra fields: HTTP Referrer and HTTP User Agent. Using cycle="yes" you will enable log cycler on the log file. When a From MAILER-DAEMON Tue Sep 23 15:15:18 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiDLx-0006bv-S5 for mharc-myserver-commit@gnu.org; Tue, 23 Sep 2008 15:15:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiDLv-0006bR-V6 for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:15:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiDLv-0006b7-IT for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:15:15 -0400 Received: from [199.232.76.173] (port=48514 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiDLv-0006b4-Bs for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:15:15 -0400 Received: from savannah.gnu.org ([199.232.41.3]:46801 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiDLv-0007ue-CW for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:15:15 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiDLu-0001xK-DU for myserver-commit@gnu.org; Tue, 23 Sep 2008 19:15:14 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiDLu-0001xF-6c for myserver-commit@gnu.org; Tue, 23 Sep 2008 19:15:14 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 23 Sep 2008 19:15:14 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2836] Move old english documentation from trunk/myserver/ to trunk/ documentation/. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 19:15:16 -0000 Revision: 2836 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2836 Author: gscrivano Date: 2008-09-23 19:15:13 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Move old english documentation from trunk/myserver/ to trunk/documentation/. Added Paths: ----------- trunk/documentation/english/ Removed Paths: ------------- trunk/myserver/documentation/english/ Copied: trunk/documentation/english (from rev 2835, trunk/myserver/documentation/english) From MAILER-DAEMON Tue Sep 23 15:17:39 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiDOF-0007S8-MD for mharc-myserver-commit@gnu.org; Tue, 23 Sep 2008 15:17:39 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiDOE-0007QX-Gf for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:17:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiDOE-0007Pl-3P for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:17:38 -0400 Received: from [199.232.76.173] (port=48578 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiDOD-0007Pe-OE for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:17:37 -0400 Received: from savannah.gnu.org ([199.232.41.3]:46834 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiDOD-0000Ku-JB for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:17:37 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiDOC-00022d-45 for myserver-commit@gnu.org; Tue, 23 Sep 2008 19:17:36 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiDOB-00022X-SK for myserver-commit@gnu.org; Tue, 23 Sep 2008 19:17:36 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 23 Sep 2008 19:17:35 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2837] Updated file paths after commit `2836'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 19:17:38 -0000 Revision: 2837 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2837 Author: gscrivano Date: 2008-09-23 19:17:35 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Updated file paths after commit `2836'. Modified Paths: -------------- trunk/myserver/binaries/NSIS installer script.nsi trunk/myserver/configure.in Modified: trunk/myserver/binaries/NSIS installer script.nsi =================================================================== --- trunk/myserver/binaries/NSIS installer script.nsi 2008-09-23 19:15:13 UTC (rev 2836) +++ trunk/myserver/binaries/NSIS installer script.nsi 2008-09-23 19:17:35 UTC (rev 2837) @@ -268,18 +268,7 @@ Section "Documentation" SecDocumentation SetOutPath "$INSTDIR\web\documentation" - File "..\documentation\english\*.htm" - - SetOutPath "$INSTDIR\web\documentation\images" - File "..\Documentation\english\images\*.png" - File "..\Documentation\english\images\*.jpg" - - SetOutPath "$INSTDIR\web\documentation\style" - File "..\documentation\english\style\*.css" - - SetOutPath "$INSTDIR\web\documentation\texts" - File "..\documentation\english\texts\*.htm" - + File "..\documentation\myserver\*.html" SectionEnd Section "Install other languages" SecLanguages Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-23 19:15:13 UTC (rev 2836) +++ trunk/myserver/configure.in 2008-09-23 19:17:35 UTC (rev 2837) @@ -384,10 +384,6 @@ binaries/system/icons/codes/Makefile control/Makefile documentation/Makefile - documentation/english/Makefile - documentation/english/images/Makefile - documentation/english/style/Makefile - documentation/english/texts/Makefile include/Makefile include/connection/Makefile include/log/Makefile From MAILER-DAEMON Tue Sep 23 15:47:49 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiDrR-0001xn-5h for mharc-myserver-commit@gnu.org; Tue, 23 Sep 2008 15:47:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiDrP-0001xh-S0 for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:47:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiDrO-0001xV-EJ for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:47:46 -0400 Received: from [199.232.76.173] (port=53839 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiDrO-0001xS-8m for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:47:46 -0400 Received: from savannah.gnu.org ([199.232.41.3]:47949 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiDrO-0003zq-04 for myserver-commit@gnu.org; Tue, 23 Sep 2008 15:47:46 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiDrJ-0003fj-HA for myserver-commit@gnu.org; Tue, 23 Sep 2008 19:47:41 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiDrJ-0003ff-BZ for myserver-commit@gnu.org; Tue, 23 Sep 2008 19:47:41 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Tue, 23 Sep 2008 19:47:41 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2838] Toy file to remake the repository consistent. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 19:47:48 -0000 Revision: 2838 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2838 Author: francesco_pipita Date: 2008-09-23 19:47:41 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Toy file to remake the repository consistent. Added Paths: ----------- trunk/myserver/tests/test_log_manager.cpp Added: trunk/myserver/tests/test_log_manager.cpp =================================================================== --- trunk/myserver/tests/test_log_manager.cpp (rev 0) +++ trunk/myserver/tests/test_log_manager.cpp 2008-09-23 19:47:41 UTC (rev 2838) @@ -0,0 +1,39 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +class TestLogManager : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE (TestLogManager); + CPPUNIT_TEST_SUITE_END (); + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION (TestLogManager); From MAILER-DAEMON Tue Sep 23 17:01:03 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiF0J-0004uL-4L for mharc-myserver-commit@gnu.org; Tue, 23 Sep 2008 17:01:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiF0G-0004sk-Mz for myserver-commit@gnu.org; Tue, 23 Sep 2008 17:01:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiF0F-0004s8-7X for myserver-commit@gnu.org; Tue, 23 Sep 2008 17:00:59 -0400 Received: from [199.232.76.173] (port=53041 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiF0F-0004s5-1d for myserver-commit@gnu.org; Tue, 23 Sep 2008 17:00:59 -0400 Received: from savannah.gnu.org ([199.232.41.3]:50475 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiF0E-0006FJ-P5 for myserver-commit@gnu.org; Tue, 23 Sep 2008 17:00:59 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiF0D-0007fB-QB for myserver-commit@gnu.org; Tue, 23 Sep 2008 21:00:57 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiF0D-0007f7-Ds for myserver-commit@gnu.org; Tue, 23 Sep 2008 21:00:57 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 23 Sep 2008 21:00:57 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2839] Keep header files hierarchy with `make install'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 21:01:01 -0000 Revision: 2839 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2839 Author: gscrivano Date: 2008-09-23 21:00:56 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Keep header files hierarchy with `make install'. Modified Paths: -------------- trunk/myserver/configure.in trunk/myserver/documentation/Makefile.am trunk/myserver/include/Makefile.am trunk/myserver/include/base/Makefile.am trunk/myserver/include/base/base64/Makefile.am trunk/myserver/include/base/dynamic_lib/Makefile.am trunk/myserver/include/base/file/Makefile.am trunk/myserver/include/base/files_cache/Makefile.am trunk/myserver/include/base/find_data/Makefile.am trunk/myserver/include/base/hash_map/Makefile.am trunk/myserver/include/base/home_dir/Makefile.am trunk/myserver/include/base/md5/Makefile.am trunk/myserver/include/base/mem_buff/Makefile.am trunk/myserver/include/base/multicast/Makefile.am trunk/myserver/include/base/pipe/Makefile.am trunk/myserver/include/base/process/Makefile.am trunk/myserver/include/base/regex/Makefile.am trunk/myserver/include/base/safetime/Makefile.am trunk/myserver/include/base/socket/Makefile.am trunk/myserver/include/base/ssl/Makefile.am trunk/myserver/include/base/string/Makefile.am trunk/myserver/include/base/sync/Makefile.am trunk/myserver/include/base/thread/Makefile.am trunk/myserver/include/base/xml/Makefile.am trunk/myserver/include/conf/Makefile.am trunk/myserver/include/conf/mime/Makefile.am trunk/myserver/include/conf/security/Makefile.am trunk/myserver/include/conf/vhost/Makefile.am trunk/myserver/include/connection/Makefile.am trunk/myserver/include/connections_scheduler/Makefile.am trunk/myserver/include/filter/Makefile.am trunk/myserver/include/filter/gzip/Makefile.am trunk/myserver/include/http_handler/Makefile.am trunk/myserver/include/http_handler/cgi/Makefile.am trunk/myserver/include/http_handler/fastcgi/Makefile.am trunk/myserver/include/http_handler/http_dir/Makefile.am trunk/myserver/include/http_handler/http_file/Makefile.am trunk/myserver/include/http_handler/isapi/Makefile.am trunk/myserver/include/http_handler/mscgi/Makefile.am trunk/myserver/include/http_handler/scgi/Makefile.am trunk/myserver/include/http_handler/wincgi/Makefile.am trunk/myserver/include/log/Makefile.am trunk/myserver/include/log/stream/Makefile.am trunk/myserver/include/plugin/Makefile.am trunk/myserver/include/plugin/executor/Makefile.am trunk/myserver/include/plugin/filter/Makefile.am trunk/myserver/include/plugin/http_command/Makefile.am trunk/myserver/include/plugin/http_manager/Makefile.am trunk/myserver/include/plugin/protocol/Makefile.am trunk/myserver/include/protocol/Makefile.am trunk/myserver/include/protocol/control/Makefile.am trunk/myserver/include/protocol/ftp/Makefile.am trunk/myserver/include/protocol/http/Makefile.am trunk/myserver/include/protocol/http/env/Makefile.am trunk/myserver/include/protocol/https/Makefile.am trunk/myserver/include/server/Makefile.am Modified: trunk/myserver/configure.in =================================================================== --- trunk/myserver/configure.in 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/configure.in 2008-09-23 21:00:56 UTC (rev 2839) @@ -53,14 +53,12 @@ AC_ARG_WITH([root-prefix], [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], root_prefix=$withval, root_prefix="\$(DESTDIR)") - AC_ARG_ENABLE([control-gui], [ --disable-control-gui disable the myserver-configure GUI program], enable_control="no", enable_control="yes") AC_ARG_ENABLE([ipv6], [ --enable-ipv6 Build with IPv6 support], enable_ipv6="yes", enable_ipv6="") AC_ARG_ENABLE([mingw32], [ --enable-mingw32 Enable mingw32], enable_mingw32="yes", enable_mingw32="") - root_bindir='${root_prefix}/bin' root_sbindir='${root_prefix}/sbin' root_sysconfdir='${root_prefix}/etc' @@ -70,13 +68,6 @@ AC_SUBST(root_sbindir) AC_SUBST(root_sysconfdir) - -AC_ARG_WITH([myserver-headers], [ --with-myserver-headers=path Override the myserver headers location (used by modules)], MYSERVER_HEADERS=$withval, MYSERVER_HEADERS="`pwd`") - -AC_SUBST(MYSERVER_HEADERS) -AC_SUBST(MSCGI_HEADERS) - - dnl Looking for argp.h AC_CHECK_HEADER([argp.h], AC_DEFINE(ARGP, 1, [Define if GNU argp tools are available])) Modified: trunk/myserver/documentation/Makefile.am =================================================================== --- trunk/myserver/documentation/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/documentation/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -3,4 +3,4 @@ #any other .texi that is not myserver.texi myserver_TEXINFOS=basic_configuration.texi doclicense.texi mime_types.texi gpl.texi process_security.texi virtual_hosts.texi ssl_certificates.texi -SUBDIRS = english +SUBDIRS = Modified: trunk/myserver/include/Makefile.am =================================================================== --- trunk/myserver/include/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,2 +1,4 @@ +includeincludedir=$(includedir)/myserver/include/find_data +includeinclude_HEADERS = SUBDIRS = base conf connection connections_scheduler filter http_handler log plugin protocol server Modified: trunk/myserver/include/base/Makefile.am =================================================================== --- trunk/myserver/include/base/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = utility.h +baseincludedir=$(includedir)/myserver/include/base +baseinclude_HEADERS = utility.h SUBDIRS = base64 dynamic_lib file files_cache find_data hash_map home_dir md5 mem_buff multicast pipe process regex safetime socket ssl string sync thread xml Modified: trunk/myserver/include/base/base64/Makefile.am =================================================================== --- trunk/myserver/include/base/base64/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/base64/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = mime_utils.h +base64includedir=$(includedir)/myserver/include/base/base64 +base64include_HEADERS = mime_utils.h SUBDIRS = Modified: trunk/myserver/include/base/dynamic_lib/Makefile.am =================================================================== --- trunk/myserver/include/base/dynamic_lib/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/dynamic_lib/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = dynamiclib.h +dynamic_libincludedir=$(includedir)/myserver/include/base/dynamic_lib +dynamic_libinclude_HEADERS = dynamiclib.h SUBDIRS = Modified: trunk/myserver/include/base/file/Makefile.am =================================================================== --- trunk/myserver/include/base/file/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/file/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = file.h files_utility.h +fileincludedir=$(includedir)/myserver/include/base/file +fileinclude_HEADERS = file.h files_utility.h SUBDIRS = Modified: trunk/myserver/include/base/files_cache/Makefile.am =================================================================== --- trunk/myserver/include/base/files_cache/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/files_cache/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = cached_file_buffer.h cached_file_factory.h cached_file.h +files_cacheincludedir=$(includedir)/myserver/include/base/files_cache +files_cacheinclude_HEADERS = cached_file_buffer.h cached_file_factory.h cached_file.h SUBDIRS = Modified: trunk/myserver/include/base/find_data/Makefile.am =================================================================== --- trunk/myserver/include/base/find_data/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/find_data/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = find_data.h +find_dataincludedir=$(includedir)/myserver/include/base/find_data +find_datainclude_HEADERS = find_data.h SUBDIRS = Modified: trunk/myserver/include/base/hash_map/Makefile.am =================================================================== --- trunk/myserver/include/base/hash_map/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/hash_map/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = hash_map.h +hash_mapincludedir=$(includedir)/myserver/include/base/hash_map +hash_mapinclude_HEADERS = hash_map.h SUBDIRS = Modified: trunk/myserver/include/base/home_dir/Makefile.am =================================================================== --- trunk/myserver/include/base/home_dir/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/home_dir/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = home_dir.h +home_dirincludedir=$(includedir)/myserver/include/base/home_dir +home_dirinclude_HEADERS = home_dir.h SUBDIRS = Modified: trunk/myserver/include/base/md5/Makefile.am =================================================================== --- trunk/myserver/include/base/md5/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/md5/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = md5.h +md5includedir=$(includedir)/myserver/include/base/md5 +md5include_HEADERS = md5.h SUBDIRS = Modified: trunk/myserver/include/base/mem_buff/Makefile.am =================================================================== --- trunk/myserver/include/base/mem_buff/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/mem_buff/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = mem_buff.h +mem_buffincludedir=$(includedir)/myserver/include/base/mem_buff +mem_buffinclude_HEADERS = mem_buff.h SUBDIRS = Modified: trunk/myserver/include/base/multicast/Makefile.am =================================================================== --- trunk/myserver/include/base/multicast/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/multicast/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = multicast.h +multicastincludedir=$(includedir)/myserver/include/base/multicast +multicastinclude_HEADERS = multicast.h SUBDIRS = Modified: trunk/myserver/include/base/pipe/Makefile.am =================================================================== --- trunk/myserver/include/base/pipe/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/pipe/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = pipe.h +pipeincludedir=$(includedir)/myserver/include/base/pipe +pipeinclude_HEADERS = pipe.h SUBDIRS = Modified: trunk/myserver/include/base/process/Makefile.am =================================================================== --- trunk/myserver/include/base/process/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/process/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = process.h process_server_manager.h +processincludedir=$(includedir)/myserver/include/base/process +processinclude_HEADERS = process.h process_server_manager.h SUBDIRS = Modified: trunk/myserver/include/base/regex/Makefile.am =================================================================== --- trunk/myserver/include/base/regex/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/regex/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = myserver_regex.h +regexincludedir=$(includedir)/myserver/include/base/regex +regexinclude_HEADERS = myserver_regex.h SUBDIRS = Modified: trunk/myserver/include/base/safetime/Makefile.am =================================================================== --- trunk/myserver/include/base/safetime/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/safetime/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = safetime.h +safetimeincludedir=$(includedir)/myserver/include/base/safetime +safetimeinclude_HEADERS = safetime.h SUBDIRS = Modified: trunk/myserver/include/base/socket/Makefile.am =================================================================== --- trunk/myserver/include/base/socket/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/socket/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = socket.h ssl_socket.h +socketincludedir=$(includedir)/myserver/include/base/socket +socketinclude_HEADERS = socket.h ssl_socket.h SUBDIRS = Modified: trunk/myserver/include/base/ssl/Makefile.am =================================================================== --- trunk/myserver/include/base/ssl/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/ssl/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = ssl.h +sslincludedir=$(includedir)/myserver/include/base/ssl +sslinclude_HEADERS = ssl.h SUBDIRS = Modified: trunk/myserver/include/base/string/Makefile.am =================================================================== --- trunk/myserver/include/base/string/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/string/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = securestr.h stringutils.h +stringincludedir=$(includedir)/myserver/include/base/string +stringinclude_HEADERS = securestr.h stringutils.h SUBDIRS = Modified: trunk/myserver/include/base/sync/Makefile.am =================================================================== --- trunk/myserver/include/base/sync/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/sync/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = event.h mutex.h read_write_lock.h recursive_mutex.h semaphore.h +syncincludedir=$(includedir)/myserver/include/base/sync +syncinclude_HEADERS = event.h mutex.h read_write_lock.h recursive_mutex.h semaphore.h SUBDIRS = Modified: trunk/myserver/include/base/thread/Makefile.am =================================================================== --- trunk/myserver/include/base/thread/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/thread/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = thread.h +threadincludedir=$(includedir)/myserver/include/base/thread +threadinclude_HEADERS = thread.h SUBDIRS = Modified: trunk/myserver/include/base/xml/Makefile.am =================================================================== --- trunk/myserver/include/base/xml/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/base/xml/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = xml_parser.h +xmlincludedir=$(includedir)/myserver/include/base/xml +xmlinclude_HEADERS = xml_parser.h SUBDIRS = Modified: trunk/myserver/include/conf/Makefile.am =================================================================== --- trunk/myserver/include/conf/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/conf/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = +confincludedir=$(includedir)/myserver/include/conf +confinclude_HEADERS = SUBDIRS = mime security vhost Modified: trunk/myserver/include/conf/mime/Makefile.am =================================================================== --- trunk/myserver/include/conf/mime/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/conf/mime/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = mime_manager.h +mimeincludedir=$(includedir)/myserver/include/conf/mime +mimeinclude_HEADERS = mime_manager.h SUBDIRS = Modified: trunk/myserver/include/conf/security/Makefile.am =================================================================== --- trunk/myserver/include/conf/security/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/conf/security/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = security_cache.h security.h +securityincludedir=$(includedir)/myserver/include/conf/security +securityinclude_HEADERS = security_cache.h security.h SUBDIRS = Modified: trunk/myserver/include/conf/vhost/Makefile.am =================================================================== --- trunk/myserver/include/conf/vhost/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/conf/vhost/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = vhost.h vhost_manager.h +vhostincludedir=$(includedir)/myserver/include/conf/vhost +vhostinclude_HEADERS = vhost.h vhost_manager.h SUBDIRS = Modified: trunk/myserver/include/connection/Makefile.am =================================================================== --- trunk/myserver/include/connection/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/connection/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = connection.h +connectionincludedir=$(includedir)/myserver/include/connection +connectioninclude_HEADERS = connection.h SUBDIRS = Modified: trunk/myserver/include/connections_scheduler/Makefile.am =================================================================== --- trunk/myserver/include/connections_scheduler/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/connections_scheduler/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = connections_scheduler.h listen_threads.h +connections_schedulerincludedir=$(includedir)/myserver/include/connections_scheduler +connections_schedulerinclude_HEADERS = connections_scheduler.h listen_threads.h SUBDIRS = Modified: trunk/myserver/include/filter/Makefile.am =================================================================== --- trunk/myserver/include/filter/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/filter/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = filter.h filters_chain.h filters_factory.h memory_stream.h stream.h console.h +filterincludedir=$(includedir)/myserver/include/filter +filterinclude_HEADERS = console.h filter.h filters_chain.h filters_factory.h memory_stream.h stream.h SUBDIRS = gzip Modified: trunk/myserver/include/filter/gzip/Makefile.am =================================================================== --- trunk/myserver/include/filter/gzip/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/filter/gzip/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = gzip_decompress.h gzip.h +gzipincludedir=$(includedir)/myserver/include/filter/gzip +gzipinclude_HEADERS = gzip_decompress.h gzip.h SUBDIRS = Modified: trunk/myserver/include/http_handler/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = +http_handlerincludedir=$(includedir)/myserver/include/http_handler +http_handlerinclude_HEADERS = SUBDIRS = cgi fastcgi http_dir http_file isapi mscgi scgi wincgi Modified: trunk/myserver/include/http_handler/cgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/cgi/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/cgi/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = cgi.h +cgiincludedir=$(includedir)/myserver/include/http_handler/cgi +cgiinclude_HEADERS = cgi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/fastcgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/fastcgi/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/fastcgi/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = fastcgi.h +fastcgiincludedir=$(includedir)/myserver/include/http_handler/fastcgi +fastcgiinclude_HEADERS = fastcgi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/http_dir/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/http_dir/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/http_dir/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = http_dir.h +http_dirincludedir=$(includedir)/myserver/include/http_handler/http_dir +http_dirinclude_HEADERS = http_dir.h SUBDIRS = Modified: trunk/myserver/include/http_handler/http_file/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/http_file/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/http_file/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = http_file.h +http_fileincludedir=$(includedir)/myserver/include/http_handler/http_file +http_fileinclude_HEADERS = http_file.h SUBDIRS = Modified: trunk/myserver/include/http_handler/isapi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/isapi/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/isapi/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = isapi.h +isapiincludedir=$(includedir)/myserver/include/http_handler/isapi +isapiinclude_HEADERS = isapi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/mscgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/mscgi/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/mscgi/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = mscgi.h mscgi_manager.h +mscgiincludedir=$(includedir)/myserver/include/http_handler/mscgi +mscgiinclude_HEADERS = mscgi.h mscgi_manager.h SUBDIRS = Modified: trunk/myserver/include/http_handler/scgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/scgi/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/scgi/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = scgi.h +scgiincludedir=$(includedir)/myserver/include/http_handler/scgi +scgiinclude_HEADERS = scgi.h SUBDIRS = Modified: trunk/myserver/include/http_handler/wincgi/Makefile.am =================================================================== --- trunk/myserver/include/http_handler/wincgi/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/http_handler/wincgi/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = wincgi.h +wincgiincludedir=$(includedir)/myserver/include/http_handler/wincgi +wincgiinclude_HEADERS = wincgi.h SUBDIRS = Modified: trunk/myserver/include/log/Makefile.am =================================================================== --- trunk/myserver/include/log/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/log/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = log_manager.h +logincludedir=$(includedir)/myserver/include/log +loginclude_HEADERS = log_manager.h SUBDIRS = stream Modified: trunk/myserver/include/log/stream/Makefile.am =================================================================== --- trunk/myserver/include/log/stream/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/log/stream/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,5 +1,4 @@ -include_HEADERS = console_stream.h file_stream.h log_stream.h \ - log_stream_factory.h log_stream_creator.h \ - file_stream_creator.h console_stream_creator.h \ - socket_stream.h socket_stream_creator.h -SUBDIRS = +streamincludedir=$(includedir)/myserver/include/log/stream +streaminclude_HEADERS = console_stream_creator.h console_stream.h file_stream_creator.h file_stream.h log_stream_creator.h log_stream_factory.h log_stream.h socket_stream_creator.h socket_stream.h +SUBDIRS = + Modified: trunk/myserver/include/plugin/Makefile.am =================================================================== --- trunk/myserver/include/plugin/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/plugin/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = generic_plugins_manager.h plugin.h plugins_manager.h plugins_namespace.h plugins_namespace_manager.h +pluginincludedir=$(includedir)/myserver/include/plugin +plugininclude_HEADERS = generic_plugins_manager.h plugin.h plugins_manager.h plugins_namespace.h plugins_namespace_manager.h SUBDIRS = executor filter http_command http_manager protocol Modified: trunk/myserver/include/plugin/executor/Makefile.am =================================================================== --- trunk/myserver/include/plugin/executor/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/plugin/executor/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = dynamic_executor.h dyn_executor_manager.h +executorincludedir=$(includedir)/myserver/include/plugin/executor +executorinclude_HEADERS = dynamic_executor.h dyn_executor_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/filter/Makefile.am =================================================================== --- trunk/myserver/include/plugin/filter/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/plugin/filter/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = dyn_filter_file.h dyn_filter.h dyn_filters_manager.h +filterincludedir=$(includedir)/myserver/include/plugin/filter +filterinclude_HEADERS = dyn_filter_file.h dyn_filter.h dyn_filters_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/http_command/Makefile.am =================================================================== --- trunk/myserver/include/plugin/http_command/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/plugin/http_command/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = dyn_http_command.h dyn_http_command_manager.h +http_commandincludedir=$(includedir)/myserver/include/plugin/http_command +http_commandinclude_HEADERS = dyn_http_command.h dyn_http_command_manager.h SUBDIRS = Modified: trunk/myserver/include/plugin/http_manager/Makefile.am =================================================================== --- trunk/myserver/include/plugin/http_manager/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/plugin/http_manager/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = dyn_http_manager.h dyn_http_manager_list.h +http_managerincludedir=$(includedir)/myserver/include/plugin/http_manager +http_managerinclude_HEADERS = dyn_http_manager.h dyn_http_manager_list.h SUBDIRS = Modified: trunk/myserver/include/plugin/protocol/Makefile.am =================================================================== --- trunk/myserver/include/plugin/protocol/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/plugin/protocol/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = dynamic_protocol.h protocols_manager.h +protocolincludedir=$(includedir)/myserver/include/plugin/protocol +protocolinclude_HEADERS = dynamic_protocol.h protocols_manager.h SUBDIRS = Modified: trunk/myserver/include/protocol/Makefile.am =================================================================== --- trunk/myserver/include/protocol/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/protocol/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = protocol_buffer.h protocol.h +protocolincludedir=$(includedir)/myserver/include/protocol +protocolinclude_HEADERS = protocol_buffer.h protocol.h SUBDIRS = control ftp http https Modified: trunk/myserver/include/protocol/control/Makefile.am =================================================================== --- trunk/myserver/include/protocol/control/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/protocol/control/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = control_errors.h control_header.h control_protocol.h +controlincludedir=$(includedir)/myserver/include/protocol/control +controlinclude_HEADERS = control_errors.h control_header.h control_protocol.h SUBDIRS = Modified: trunk/myserver/include/protocol/ftp/Makefile.am =================================================================== --- trunk/myserver/include/protocol/ftp/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/protocol/ftp/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = ftp_common.h ftp.h ftp_lexer.h ftp_parser.h +ftpincludedir=$(includedir)/myserver/include/protocol/ftp +ftpinclude_HEADERS = ftp_common.h ftp.h ftp_lexer.h ftp_parser.h SUBDIRS = Modified: trunk/myserver/include/protocol/http/Makefile.am =================================================================== --- trunk/myserver/include/protocol/http/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/protocol/http/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = http_data_handler.h http_data_read.h http_errors.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h +httpincludedir=$(includedir)/myserver/include/protocol/http +httpinclude_HEADERS = http_data_handler.h http_data_read.h http_errors.h http.h http_header_checker.h http_header.h http_headers.h http_request.h http_response.h http_thread_context.h SUBDIRS = env Modified: trunk/myserver/include/protocol/http/env/Makefile.am =================================================================== --- trunk/myserver/include/protocol/http/env/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/protocol/http/env/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = env.h +envincludedir=$(includedir)/myserver/include/protocol/http/env +envinclude_HEADERS = env.h SUBDIRS = Modified: trunk/myserver/include/protocol/https/Makefile.am =================================================================== --- trunk/myserver/include/protocol/https/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/protocol/https/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = https.h +httpsincludedir=$(includedir)/myserver/include/protocol/https +httpsinclude_HEADERS = https.h SUBDIRS = Modified: trunk/myserver/include/server/Makefile.am =================================================================== --- trunk/myserver/include/server/Makefile.am 2008-09-23 19:47:41 UTC (rev 2838) +++ trunk/myserver/include/server/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) @@ -1,3 +1,4 @@ -include_HEADERS = clients_thread.h server.h +serverincludedir=$(includedir)/myserver/include/server +serverinclude_HEADERS = clients_thread.h server.h SUBDIRS = From MAILER-DAEMON Wed Sep 24 13:21:46 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiY3e-0003vt-2i for mharc-myserver-commit@gnu.org; Wed, 24 Sep 2008 13:21:46 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiY3c-0003v3-1c for myserver-commit@gnu.org; Wed, 24 Sep 2008 13:21:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiY3Z-0003u4-L7 for myserver-commit@gnu.org; Wed, 24 Sep 2008 13:21:43 -0400 Received: from [199.232.76.173] (port=60162 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiY3Z-0003tp-9f for myserver-commit@gnu.org; Wed, 24 Sep 2008 13:21:41 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40418 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiY3X-0002YR-Nv for myserver-commit@gnu.org; Wed, 24 Sep 2008 13:21:41 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiY3U-0006Dg-Cx for myserver-commit@gnu.org; Wed, 24 Sep 2008 17:21:36 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiY3T-0006Dc-J0 for myserver-commit@gnu.org; Wed, 24 Sep 2008 17:21:35 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Wed, 24 Sep 2008 17:21:35 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2840] Replaced tabs by blanks in the LogManager related classes and added new tests for them . X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2008 17:21:44 -0000 Revision: 2840 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2840 Author: francesco_pipita Date: 2008-09-24 17:21:34 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Replaced tabs by blanks in the LogManager related classes and added new tests for them. Modified Paths: -------------- trunk/myserver/include/filter/filters_chain.h trunk/myserver/include/log/log_manager.h trunk/myserver/include/log/stream/console_stream.h trunk/myserver/include/log/stream/console_stream_creator.h trunk/myserver/include/log/stream/file_stream.h trunk/myserver/include/log/stream/file_stream_creator.h trunk/myserver/include/log/stream/log_stream.h trunk/myserver/include/log/stream/log_stream_creator.h trunk/myserver/include/log/stream/log_stream_factory.h trunk/myserver/include/log/stream/socket_stream.h trunk/myserver/include/log/stream/socket_stream_creator.h trunk/myserver/src/log/log_manager.cpp trunk/myserver/src/log/stream/console_stream.cpp trunk/myserver/src/log/stream/console_stream_creator.cpp trunk/myserver/src/log/stream/file_stream.cpp trunk/myserver/src/log/stream/file_stream_creator.cpp trunk/myserver/src/log/stream/log_stream.cpp trunk/myserver/src/log/stream/log_stream_factory.cpp trunk/myserver/src/log/stream/socket_stream.cpp trunk/myserver/src/log/stream/socket_stream_creator.cpp trunk/myserver/tests/Makefile.am trunk/myserver/tests/test_log_manager.cpp Added Paths: ----------- trunk/myserver/tests/test_file_stream.cpp trunk/myserver/tests/test_file_stream_creator.cpp trunk/myserver/tests/test_log_stream_factory.cpp trunk/myserver/tests/test_socket_stream_creator.cpp Modified: trunk/myserver/include/filter/filters_chain.h =================================================================== --- trunk/myserver/include/filter/filters_chain.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/filter/filters_chain.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -62,7 +62,7 @@ list getFilters (); virtual int read(char* buffer, u_long len, u_long*); virtual int write(const char* buffer, u_long len, u_long*); - virtual int flush(u_long*); + virtual int flush(u_long*); FiltersChain(); ~FiltersChain(); protected: Modified: trunk/myserver/include/log/log_manager.h =================================================================== --- trunk/myserver/include/log/log_manager.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/log_manager.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -55,14 +55,15 @@ LogManager (FiltersFactory* filtersFactory, - LogStreamFactory* logStreamFactory, - LoggingLevel level = WARNING); + LogStreamFactory* logStreamFactory, + LoggingLevel level = WARNING); /*! * Deallocates all LogStream owned by the LogManager and - * other objects (like the Mutex and the LogStreamFactory) - * allocated by the LogManager. + * the objects (like the Mutex) allocated by the LogManager. + * Other objects, like the FiltersFactory and the + * LogStreamFactory should be destroied from the outside. */ ~LogManager (); @@ -74,21 +75,23 @@ * \param filters A list of filters used within the new LogStream. * \param cycleLog A non-zero value establishes the threshold for * the LogStream's growth before cycling it. + * \return 0 on success. */ - void addLogStream (string& location, - list& filters, - u_long cycleLog); + int addLogStream (string location, + list& filters, + u_long cycleLog); /*! * Remove the LogStream that point to location if it exists. * \param location The location where the LogStream which has to * be removed points to. + * \return 0 on success. */ - void removeLogStream (string& location); + int removeLogStream (string location); - LogStream* getLogStream (string& location); + LogStream* getLogStream (string location); /*! @@ -101,9 +104,9 @@ * \param location The location where `message' will be written. * \return 0 on success. */ - int log (string& message, - LoggingLevel level = WARNING, - string location = "all"); + int log (string message, + LoggingLevel level = WARNING, + string location = "all"); /*! @@ -118,7 +121,7 @@ * \return The cycleLog value for the LogStream that points to * location. */ - u_long getCycleLog (string& location); + u_long getCycleLog (string location); /*! @@ -129,7 +132,7 @@ * \param location The LogStream whose cycleLog will be changed. */ void setCycleLog (u_long cycleLog, - string location); + string location); /*! @@ -161,7 +164,7 @@ bool empty (); - bool contains (string& location); + bool contains (string location); /*! @@ -177,8 +180,8 @@ int storeFile (); int load (char const*); void setGzip (int); - int write (char const*, int len = 0); - int writeln (char const*); + int write (string message, int len = 0); + int writeln (string message); File* getFile (); u_long setMaxSize (u_long); u_long getMaxSize (); @@ -207,8 +210,8 @@ * \return 0 on success. */ int notifyLogStreams (LogStreamEvent evt, - void* message = 0, - void* reply = 0); + void* message = 0, + void* reply = 0); private: Modified: trunk/myserver/include/log/stream/console_stream.h =================================================================== --- trunk/myserver/include/log/stream/console_stream.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/console_stream.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -29,9 +29,9 @@ { public: ConsoleStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain); + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); }; #endif Modified: trunk/myserver/include/log/stream/console_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/console_stream_creator.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/console_stream_creator.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -26,9 +26,9 @@ { public: virtual LogStream* create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog); + string location, + list& filters, + u_long cycleLog); }; #endif Modified: trunk/myserver/include/log/stream/file_stream.h =================================================================== --- trunk/myserver/include/log/stream/file_stream.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/file_stream.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -35,9 +35,9 @@ FileStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain); + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); /*! @@ -49,6 +49,9 @@ virtual u_long streamSize (); + string makeNewFileName (string oldFileName); + + protected: Modified: trunk/myserver/include/log/stream/file_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/file_stream_creator.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/file_stream_creator.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -26,9 +26,9 @@ { public: virtual LogStream* create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog); + string location, + list& filters, + u_long cycleLog); }; #endif Modified: trunk/myserver/include/log/stream/log_stream.h =================================================================== --- trunk/myserver/include/log/stream/log_stream.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/log_stream.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -57,9 +57,9 @@ * FiltersChain before being written to the Stream. */ LogStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain); + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); /*! @@ -123,11 +123,15 @@ /*! * \return 0 on success. */ - virtual int log (string& message); + virtual int log (string message); virtual ~LogStream (); + + list& getCycledStreams (); + + protected: @@ -148,7 +152,7 @@ /*! * \return 0 on success. */ - int write (string& message); + int write (string message); /*! @@ -184,6 +188,9 @@ FiltersFactory* filtersFactory; + + + list cycledStreams; }; #endif Modified: trunk/myserver/include/log/stream/log_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/log_stream_creator.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/log_stream_creator.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -28,10 +28,16 @@ class LogStreamCreator { public: + + + /*! + * Create a new instance of a concrete LogStream. If something + * of wrong happens, it must return 0. + */ virtual LogStream* create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog) = 0; + string location, + list& filters, + u_long cycleLog) = 0; }; #endif Modified: trunk/myserver/include/log/stream/log_stream_factory.h =================================================================== --- trunk/myserver/include/log/stream/log_stream_factory.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/log_stream_factory.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -63,31 +63,44 @@ * the new LogStream. * \param cycleLog Whether the log should be cycled or not. 0 means never * cycle. - * \return A new instance of one of LogStream subclasses. + * \return A new instance of one of LogStream subclasses or 0 if + * the location string does not contain a protocol known by the + * LogStreamFactory or if something of wrong happened during the LogStream + * creation. */ LogStream* createLogStream (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog); + string location, + list& filters, + u_long cycleLog); /*! - * A helper method useful to get the protocol part of a location string. + * Get the protocol part of a location string. * \param location The string representing a valid location as explained * in createLogStream method description. - * \return A new string with the protocol part of the location. + * \return A new string with the protocol part of the location, an empty + * string if an invalid protocol was detected. */ - string getProtocol (string& location); + string getProtocol (string location); /*! - * A helper method useful to get the path part of a location string. + * Get the path part of a location string. * \param location The string representing a valid location as explained * in createLogStream method description. - * \return A new string with the path part of the location. + * \return A new string with the path part of the location, an empty + * string is an invalid protocol was detected. */ - string getPath (string& location); + string getPath (string location); + + /*! + * Checks wheter `protocol' is between those known by the LogStreamFactory. + * \return true If it is. + */ + bool protocolCheck (string protocol); + + private: Modified: trunk/myserver/include/log/stream/socket_stream.h =================================================================== --- trunk/myserver/include/log/stream/socket_stream.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/socket_stream.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -30,9 +30,9 @@ public: SocketStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain); + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain); }; #endif Modified: trunk/myserver/include/log/stream/socket_stream_creator.h =================================================================== --- trunk/myserver/include/log/stream/socket_stream_creator.h 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/include/log/stream/socket_stream_creator.h 2008-09-24 17:21:34 UTC (rev 2840) @@ -28,21 +28,21 @@ { public: virtual LogStream* create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog); + string location, + list& filters, + u_long cycleLog); /*! * A helper method to get the port part of an URL. */ - u_short getPort (string& location); + u_short getPort (string location); /*! * A helper method to get the host part of an URL. */ - string getHost (string& location); + string getHost (string location); }; #endif Modified: trunk/myserver/src/log/log_manager.cpp =================================================================== --- trunk/myserver/src/log/log_manager.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/log_manager.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -1,18 +1,18 @@ /* -MyServer -Copyright (C) 2006, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. + MyServer + Copyright (C) 2006, 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #include @@ -21,8 +21,8 @@ int const LogManager::TYPE_FILE = 2; LogManager::LogManager (FiltersFactory* filtersFactory, - LogStreamFactory* logStreamFactory, - LoggingLevel level) : level (level) + LogStreamFactory* logStreamFactory, + LoggingLevel level) : level (level) { this->filtersFactory = filtersFactory; this->logStreamFactory = logStreamFactory; @@ -37,112 +37,136 @@ delete mutex; } -void -LogManager::addLogStream (string& location, - list& filters, - u_long cycleLog) +int +LogManager::addLogStream (string location, + list& filters, + u_long cycleLog) { mutex->lock (); + int retVal = 1; if (!contains (location)) { - logStreams[location] = - logStreamFactory->createLogStream (filtersFactory, - location, - filters, - cycleLog); + LogStream* logStream = logStreamFactory->createLogStream (filtersFactory, + location, + filters, + cycleLog); + if (logStream) + { + logStreams[location] = logStream; + retVal = 0; + } } mutex->unlock (); + return retVal; } -void -LogManager::removeLogStream (string& location) +int +LogManager::removeLogStream (string location) { mutex->lock (); + int retVal = 1; if (contains (location)) { delete logStreams[location]; logStreams.erase (location); + retVal = 0; } mutex->unlock (); + return retVal; } LogStream* -LogManager::getLogStream (string& location) +LogManager::getLogStream (string location) { + LogStream* retVal = 0; if (contains (location)) - return logStreams[location]; - return 0; + retVal = logStreams[location]; + return retVal; } int LogManager::notifyLogStreams (LogStreamEvent evt, - void* message, - void* reply) + void* message, + void* reply) { - mutex->lock (); map::iterator it; int retVal = 0; for (it = logStreams.begin (); it != logStreams.end (); it++) { retVal |= it->second->update (evt, message, reply); } - mutex->unlock (); return retVal; } int -LogManager::log (string& message, LoggingLevel level, string location) +LogManager::log (string message, LoggingLevel level, string location) { + mutex->lock (); + int retVal = 1; if (level >= this->level) { if (contains (location)) - { - return logStreams[location]->log (message); - } - else - { - return notifyLogStreams (EVT_LOG, static_cast(&message)); - } + { + retVal = logStreams[location]->log (message); + } + else if (!location.compare ("all")) + { + retVal = notifyLogStreams (EVT_LOG, static_cast(&message)); + } } - return 1; + mutex->unlock (); + return retVal; } int LogManager::close (string location) { + mutex->lock (); + int retVal = 1; if (contains (location)) { - return logStreams[location]->close (); + retVal = logStreams[location]->close (); } - return notifyLogStreams (EVT_CLOSE); + else if (!location.compare ("all")) + { + retVal = notifyLogStreams (EVT_CLOSE); + } + mutex->unlock (); + return retVal; } void LogManager::setCycleLog (u_long cycleLog, string location) { + mutex->lock (); if (contains (location)) { logStreams[location]->setCycleLog (cycleLog); } - else + else if (!location.compare ("all")) { notifyLogStreams (EVT_SET_CYCLE_LOG, static_cast(&cycleLog)); } + mutex->unlock (); } LoggingLevel LogManager::setLoggingLevel (LoggingLevel level) { + mutex->lock (); LoggingLevel oldLevel = level; this->level = level; + mutex->unlock (); return oldLevel; } u_long -LogManager::getCycleLog (string& location) +LogManager::getCycleLog (string location) { + u_long retVal = -1; if (contains (location)) - return logStreams[location]->getCycleLog (); + retVal = logStreams[location]->getCycleLog (); + return retVal; } LoggingLevel @@ -154,7 +178,9 @@ void LogManager::setLogStreamFactory (LogStreamFactory* logStreamFactory) { + mutex->lock (); this->logStreamFactory = logStreamFactory; + mutex->unlock (); } LogStreamFactory* @@ -166,7 +192,9 @@ void LogManager::setFiltersFactory (FiltersFactory* filtersFactory) { + mutex->lock (); this->filtersFactory = filtersFactory; + mutex->unlock (); } FiltersFactory* @@ -184,10 +212,12 @@ void LogManager::clear () { + mutex->lock (); map::iterator it; for (it = logStreams.begin (); it != logStreams.end (); it++) delete it->second; logStreams.clear (); + mutex->unlock (); } bool @@ -197,7 +227,7 @@ } bool -LogManager::contains (string& location) +LogManager::contains (string location) { return logStreams.count (location) > 0; } @@ -221,9 +251,8 @@ maxSize = 0; gzipLog = 1; cycleLog = 0; - string location ("console://"); list filters; - addLogStream (location, filters, maxSize); + addLogStream ("console://", filters, maxSize); } int @@ -239,9 +268,8 @@ } int -LogManager::write (const char *str, int len) +LogManager::write (string message, int len) { - string message (str); return notifyLogStreams (EVT_LOG, static_cast(&message)); } @@ -266,17 +294,17 @@ for (it = logStreams.begin (); it != logStreams.end (); it++) { if (it->first.find ("file://") != string::npos) - { - return dynamic_cast(it->second->getOutStream ()); - } + { + return dynamic_cast(it->second->getOutStream ()); + } } return 0; } int -LogManager::writeln (const char *str) +LogManager::writeln (string message) { - int ret = write (str); + int ret = write (message); #ifdef WIN32 if (ret == 0) ret = write ("\r\n"); Modified: trunk/myserver/src/log/stream/console_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/console_stream.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/console_stream.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -18,12 +18,12 @@ #include ConsoleStream::ConsoleStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain) : + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : LogStream (filtersFactory, - cycleLog, - outStream, - filtersChain) + cycleLog, + outStream, + filtersChain) { } Modified: trunk/myserver/src/log/stream/console_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/console_stream_creator.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/console_stream_creator.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -19,17 +19,17 @@ LogStream* ConsoleStreamCreator::create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog) + string location, + list& filters, + u_long cycleLog) { Console* outStream = new Console (); u_long nbw; FiltersChain* filtersChain = filtersFactory->chain (filters, - outStream, - &nbw); + outStream, + &nbw); return new ConsoleStream (filtersFactory, - cycleLog, - outStream, - filtersChain); + cycleLog, + outStream, + filtersChain); } Modified: trunk/myserver/src/log/stream/file_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/file_stream.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/file_stream.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -18,15 +18,15 @@ #include int const FileStream::defaultFileMask = File::MYSERVER_OPEN_APPEND | - File::MYSERVER_OPEN_ALWAYS | - File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_READ | - File::MYSERVER_NO_INHERIT; + File::MYSERVER_OPEN_ALWAYS | + File::MYSERVER_OPEN_WRITE | + File::MYSERVER_OPEN_READ | + File::MYSERVER_NO_INHERIT; FileStream::FileStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain) : + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : LogStream (filtersFactory, cycleLog, outStream, filtersChain) { } @@ -45,91 +45,70 @@ const u_long bufferSize = MYSERVER_KB (64); try { - string filepath; - string filedir; - string filename; - string ext; - ostringstream newfilename; - string time; - - filepath.assign (dynamic_cast(outStream)->getFilename ()); - FilesUtility::completePath (filepath); - FilesUtility::splitPath (filepath, filedir, filename); - - FilesUtility::getFileExt (ext, filename); - - getRFC822LocalTime (time, 32); - time = trim (time.substr (5, 32)); - - for (int i = 0; i < static_cast(time.length ()); i++) - if ((time[i] == ' ') || (time[i] == ':')) - time[i]= '.'; - if (ext.size ()) - { - filename = (filename.substr (0, filename.find (string (".") + ext))); - } - newfilename << filedir << "/" << filename << "." << time << - (ext.size () ? "." : "") << ext; - File newFile; File *currentFile = dynamic_cast(outStream); - + string filepath (currentFile->getFilename ()); + string newFileName (makeNewFileName (currentFile->getFilename ())); + cycledStreams.push_back (newFileName); buffer = new char[bufferSize]; if (buffer == 0) - return 1; + { + return 1; + } buffer2 = new char[bufferSize]; if (buffer == 0) - { - delete [] buffer; - return 1; - } + { + delete [] buffer; + return 1; + } - if (newFile.openFile (newfilename.str ().c_str (), - File::MYSERVER_OPEN_WRITE | - File::MYSERVER_NO_INHERIT | - File::MYSERVER_CREATE_ALWAYS)) - { - delete [] buffer; - delete [] buffer2; - return 1; - } + if (newFile.openFile (newFileName, + File::MYSERVER_OPEN_WRITE | + File::MYSERVER_NO_INHERIT | + File::MYSERVER_CREATE_ALWAYS)) + { + cerr << "could not open " << newFileName << endl; + delete [] buffer; + delete [] buffer2; + return 1; + } if (currentFile->setFilePointer (0)) - { - delete [] buffer; - delete [] buffer2; - newFile.close (); - return 1; - } + { + delete [] buffer; + delete [] buffer2; + newFile.close (); + return 1; + } for (;;) - { - u_long nbr; - u_long nbw; - if(currentFile->readFromFile (buffer, bufferSize, &nbr)) - { - delete [] buffer; - delete [] buffer2; - newFile.close (); - return 1; - } - if (nbr == 0) - break; - if (newFile.writeToFile (buffer, nbr, &nbw)) - { - delete [] buffer; - delete [] buffer2; - newFile.close (); - return 1; - } - } + { + u_long nbr; + u_long nbw; + if(currentFile->readFromFile (buffer, bufferSize, &nbr)) + { + delete [] buffer; + delete [] buffer2; + newFile.close (); + return 1; + } + if (nbr == 0) + break; + if (newFile.writeToFile (buffer, nbr, &nbw)) + { + delete [] buffer; + delete [] buffer2; + newFile.close (); + return 1; + } + } newFile.close (); currentFile->close (); FilesUtility::deleteFile (filepath.c_str ()); if (currentFile->openFile (filepath.c_str(), defaultFileMask)) - { - delete [] buffer; - delete [] buffer2; - return 1; - } + { + delete [] buffer; + delete [] buffer2; + return 1; + } delete [] buffer; delete [] buffer2; return 0; @@ -137,9 +116,37 @@ catch (...) { if (buffer) - delete [] buffer; + delete [] buffer; if (buffer2) - delete [] buffer2; + delete [] buffer2; throw; }; } + +string +FileStream::makeNewFileName (string oldFileName) +{ + string filedir; + string filename; + string ext; + ostringstream newfilename; + string time; + + FilesUtility::completePath (oldFileName); + FilesUtility::splitPath (oldFileName, filedir, filename); + FilesUtility::getFileExt (ext, oldFileName); + + getRFC822LocalTime (time, 32); + time = trim (time.substr (5, 32)); + + for (int i = 0; i < static_cast(time.length ()); i++) + if ((time[i] == ' ') || (time[i] == ':')) + time[i]= '.'; + if (ext.size ()) + { + filename = (filename.substr (0, filename.find (string (".") + ext))); + } + newfilename << filedir << filename << "." << time << + (ext.size () ? "." : "") << ext; + return newfilename.str (); +} Modified: trunk/myserver/src/log/stream/file_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/file_stream_creator.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/file_stream_creator.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -19,18 +19,22 @@ LogStream* FileStreamCreator::create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog) + string location, + list& filters, + u_long cycleLog) { - Stream* outStream = new File (const_cast(location.c_str ()), - FileStream::defaultFileMask); - u_long nbw; - FiltersChain* filtersChain = filtersFactory->chain (filters, - outStream, - &nbw); - return new FileStream (filtersFactory, - cycleLog, - outStream, - filtersChain); + File* outStream = new File (); + if (!outStream->openFile (const_cast(location.c_str ()), + FileStream::defaultFileMask)) + { + u_long nbw; + FiltersChain* filtersChain = filtersFactory->chain (filters, + outStream, + &nbw); + return new FileStream (filtersFactory, + cycleLog, + outStream, + filtersChain); + } + return 0; } Modified: trunk/myserver/src/log/stream/log_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/log_stream.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/log_stream.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -18,9 +18,9 @@ #include LogStream::LogStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain) : + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : cycleLog (cycleLog), isOpened (1) { this->filtersFactory = filtersFactory; @@ -46,7 +46,7 @@ } int -LogStream::log (string& message) +LogStream::log (string message) { if (needToCycle ()) { @@ -68,7 +68,7 @@ } int -LogStream::write (string& message) +LogStream::write (string message) { return filtersChain->write (message.c_str (), message.size (), &nbw); } @@ -100,7 +100,9 @@ int LogStream::close () { - return isOpened = (filtersChain->flush (&nbw) || outStream->close ()); + if (isOpened) + return isOpened = (filtersChain->flush (&nbw) || outStream->close ()); + return isOpened; } int @@ -110,23 +112,23 @@ { case EVT_SET_CYCLE_LOG: { - setCycleLog (*static_cast(message)); - return 0; + setCycleLog (*static_cast(message)); + return 0; } break; case EVT_LOG: { - return log (*static_cast(message)); + return log (*static_cast(message)); } break; case EVT_CLOSE: { - return close (); + return close (); } break; case EVT_ADD_FILTER: { - return addFilter (static_cast(message)); + return addFilter (static_cast(message)); } break; default: @@ -175,3 +177,9 @@ { return nbw; } + +list& +LogStream::getCycledStreams () +{ + return cycledStreams; +} Modified: trunk/myserver/src/log/stream/log_stream_factory.cpp =================================================================== --- trunk/myserver/src/log/stream/log_stream_factory.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/log_stream_factory.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -36,26 +36,40 @@ LogStream* LogStreamFactory::createLogStream (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog) + string location, + list& filters, + u_long cycleLog) { string protocol (getProtocol (location)); string path (getPath (location)); - return logStreamCreators[protocol]->create (filtersFactory, - path, - filters, - cycleLog); + if (protocolCheck (protocol)) + { + return logStreamCreators[protocol]->create (filtersFactory, + path, + filters, + cycleLog); + } + return 0; } string -LogStreamFactory::getProtocol (string& location) +LogStreamFactory::getProtocol (string location) { - return (location.substr (0, location.find("://"))).append ("://"); + if (location.find ("://") != string::npos) + return (location.substr (0, location.find("://"))).append ("://"); + return string (""); } string -LogStreamFactory::getPath (string& location) +LogStreamFactory::getPath (string location) { - return location.substr (getProtocol (location).size (), location.size ()); + if (protocolCheck (getProtocol (location))) + return location.substr (getProtocol (location).size (), location.size ()); + return string (""); } + +bool +LogStreamFactory::protocolCheck (string protocol) +{ + return logStreamCreators.count (protocol) != 0; +} Modified: trunk/myserver/src/log/stream/socket_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/socket_stream.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/socket_stream.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -18,12 +18,12 @@ #include SocketStream::SocketStream (FiltersFactory* filtersFactory, - u_long cycleLog, - Stream* outStream, - FiltersChain* filtersChain) : + u_long cycleLog, + Stream* outStream, + FiltersChain* filtersChain) : LogStream (filtersFactory, - cycleLog, - outStream, - filtersChain) + cycleLog, + outStream, + filtersChain) { } Modified: trunk/myserver/src/log/stream/socket_stream_creator.cpp =================================================================== --- trunk/myserver/src/log/stream/socket_stream_creator.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/src/log/stream/socket_stream_creator.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -19,31 +19,33 @@ LogStream* SocketStreamCreator::create (FiltersFactory* filtersFactory, - string& location, - list& filters, - u_long cycleLog) + string location, + list& filters, + u_long cycleLog) { - Stream* outStream = new Socket (); + Socket* outStream = new Socket (); u_long nbw; - dynamic_cast(outStream)->connect (getHost (location).c_str (), - getPort (location)); - FiltersChain* filtersChain = filtersFactory->chain (filters, - outStream, - &nbw); - return new SocketStream (filtersFactory, - cycleLog, - outStream, - filtersChain); + if (!outStream->connect (getHost (location).c_str (), getPort (location))) + { + FiltersChain* filtersChain = filtersFactory->chain (filters, + outStream, + &nbw); + return new SocketStream (filtersFactory, + cycleLog, + outStream, + filtersChain); + } + return 0; } u_short -SocketStreamCreator::getPort (string& location) +SocketStreamCreator::getPort (string location) { return static_cast(atoi (location.substr (location.find (":") + 1).c_str ())); } string -SocketStreamCreator::getHost (string& location) +SocketStreamCreator::getHost (string location) { return location.substr (0, location.find (":")); } Modified: trunk/myserver/tests/Makefile.am =================================================================== --- trunk/myserver/tests/Makefile.am 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/tests/Makefile.am 2008-09-24 17:21:34 UTC (rev 2840) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_mem_stream.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp test_log_manager.cpp +tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_mem_stream.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp test_log_manager.cpp test_log_stream_factory.cpp test_socket_stream_creator.cpp test_file_stream_creator.cpp test_file_stream.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Added: trunk/myserver/tests/test_file_stream.cpp =================================================================== --- trunk/myserver/tests/test_file_stream.cpp (rev 0) +++ trunk/myserver/tests/test_file_stream.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -0,0 +1,106 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +class TestFileStream : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE (TestFileStream); + CPPUNIT_TEST (testCycleLog); + CPPUNIT_TEST (testMakeNewFileName); + CPPUNIT_TEST_SUITE_END (); +public: + void setUp() + { + fsc = new FileStreamCreator (); + ff = new FiltersFactory (); + setcwdBuffer (); + } + + void testMakeNewFileName () + { + list filters; + LogStream* ls = fsc->create (ff, "foo", filters, 0); + FileStream* fs = dynamic_cast(ls); + File* outStream = dynamic_cast(fs->getOutStream ()); + string newFileName = fs->makeNewFileName (outStream->getFilename ()); + string wd; + getdefaultwd (wd); + wd.append ("/foo"); + CPPUNIT_ASSERT (newFileName.find (wd) != string::npos); + delete fs; + } + + void testCycleLog () + { + list filters; + string message ("thisisaverylongmessage\n"); + string message2 ("thisisanothermessage\n"); + LogStream* ls = fsc->create (ff, "foo", filters, 10); + File* outStream = dynamic_cast(ls->getOutStream ()); + CPPUNIT_ASSERT (!ls->log (message)); + CPPUNIT_ASSERT (!ls->log (message2)); + ls->close (); + File f; + f.openFile ("foo", FileStream::defaultFileMask); + char buf[64]; + u_long nbr; + f.read (buf, 64, &nbr); + buf[nbr] = '\0'; + CPPUNIT_ASSERT (!message2.compare (buf)); + f.close (); + list cs = ls->getCycledStreams (); + CPPUNIT_ASSERT (cs.size ()); + list::iterator it; + for (it = cs.begin (); it != cs.end (); it++) + { + f.openFile (*it, FileStream::defaultFileMask); + f.read (buf, 64, &nbr); + buf[nbr] = '\0'; + CPPUNIT_ASSERT (!message.compare (buf)); + f.close (); + CPPUNIT_ASSERT (!FilesUtility::deleteFile (*it)); + } + delete ls; + } + + void tearDown() + { + delete ff; + delete fsc; + FilesUtility::deleteFile ("foo"); + } + +private: + FiltersFactory* ff; + FileStreamCreator* fsc; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION (TestFileStream); Added: trunk/myserver/tests/test_file_stream_creator.cpp =================================================================== --- trunk/myserver/tests/test_file_stream_creator.cpp (rev 0) +++ trunk/myserver/tests/test_file_stream_creator.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -0,0 +1,65 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +class TestFileStreamCreator : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE (TestFileStreamCreator); + CPPUNIT_TEST (testCreation); + CPPUNIT_TEST_SUITE_END (); +public: + void setUp () + { + fsc = new FileStreamCreator (); + ff = new FiltersFactory (); + } + + void testCreation () + { + list filters; + LogStream* ls = fsc->create (ff, "foo", filters, 0); + CPPUNIT_ASSERT (ls); +#ifdef NOT_WIN + ls = fsc->create (ff, "/dev/", filters, 0); + CPPUNIT_ASSERT (!ls); +#endif + } + + void tearDown () + { + delete fsc; + delete ff; + FilesUtility::deleteFile ("foo"); + } +private: + FileStreamCreator* fsc; + FiltersFactory* ff; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION (TestFileStreamCreator); Modified: trunk/myserver/tests/test_log_manager.cpp =================================================================== --- trunk/myserver/tests/test_log_manager.cpp 2008-09-23 21:00:56 UTC (rev 2839) +++ trunk/myserver/tests/test_log_manager.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -28,12 +28,184 @@ #include #include #include +#include +#include +#include class TestLogManager : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE (TestLogManager); + CPPUNIT_TEST (testEmpty); + CPPUNIT_TEST (testSize); + CPPUNIT_TEST (testContains); + CPPUNIT_TEST (testAddLogStream); + CPPUNIT_TEST (testRemoveLogStream); + CPPUNIT_TEST (testLog); + CPPUNIT_TEST (testClose); + CPPUNIT_TEST (testCycleLog); + CPPUNIT_TEST (testLoggingLevel); + CPPUNIT_TEST (testClear); + CPPUNIT_TEST (testLogThroughGzip); CPPUNIT_TEST_SUITE_END (); +public: + void setUp() + { + lsf = new LogStreamFactory (); + ff = new FiltersFactory (); + ff->insert ("gzip", Gzip::factory); + ff->insert ("gunzip", GzipDecompress::factory); + lm = new LogManager (ff, lsf); + setcwdBuffer (); + } + void testEmpty () + { + CPPUNIT_ASSERT (lm->empty ()); + } + + void testSize () + { + CPPUNIT_ASSERT (lm->size () == 0); + } + + void testContains () + { + CPPUNIT_ASSERT (!lm->contains ("foo")); + } + + void testAddLogStream () + { + list filters; + CPPUNIT_ASSERT (lm->addLogStream ("foo", filters, 0)); + CPPUNIT_ASSERT (lm->addLogStream ("file", filters, 0)); + CPPUNIT_ASSERT (!lm->addLogStream ("file://foo", filters, 0)); + CPPUNIT_ASSERT (lm->addLogStream ("file://foo", filters, 0)); + } + + void testRemoveLogStream () + { + list filters; + CPPUNIT_ASSERT (lm->removeLogStream ("foo")); + lm->addLogStream ("file://foo", filters, 0); + CPPUNIT_ASSERT (!lm->removeLogStream ("file://foo")); + } + + void testLog () + { + string message ("A message"); + list filters; + lm->addLogStream ("file://foo", filters, 0); + lm->log (message); + CPPUNIT_ASSERT (!lm->removeLogStream ("file://foo")); + File f; + f.openFile ("foo", + File::MYSERVER_OPEN_APPEND | + File::MYSERVER_OPEN_ALWAYS | + File::MYSERVER_OPEN_WRITE | + File::MYSERVER_OPEN_READ | + File::MYSERVER_NO_INHERIT); + f.setFilePointer (0); + char buf[message.size () + 1]; + u_long nbr; + f.read (buf, message.size () + 1, &nbr); + buf[nbr] = '\0'; + CPPUNIT_ASSERT (!message.compare (buf)); + f.close (); + } + + void testClose () + { + list filters; + lm->addLogStream ("file://foo", filters, 0); + lm->close (); + CPPUNIT_ASSERT (!lm->getLogStream ("file://foo")->getIsOpened ()); + } + + void testCycleLog () + { + string message ("A message\n"); + string message1 ("Another message\n"); + list filters; + lm->addLogStream ("file://foo", filters, 10); + lm->log (message); + CPPUNIT_ASSERT (!lm->log (message1)); + lm->close (); + File f; + f.openFile ("foo", FileStream::defaultFileMask); + char buf[64]; + u_long nbr; + f.read (buf, 64, &nbr); + buf[nbr] = '\0'; + f.close (); + CPPUNIT_ASSERT (!message1.compare (buf)); + list cs = lm->getLogStream ("file://foo")->getCycledStreams (); + list::iterator it; + for (it = cs.begin (); it != cs.end (); it++) + { + f.openFile (*it, FileStream::defaultFileMask); + f.read (buf, 64, &nbr); + buf[nbr] = '\0'; + f.close (); + CPPUNIT_ASSERT (!message.compare (buf)); + CPPUNIT_ASSERT (!FilesUtility::deleteFile (*it)); + } + } + + void testLoggingLevel () + { + list filters; + lm->addLogStream ("file://foo", filters, 0); + CPPUNIT_ASSERT (lm->log ("a message", INFO)); + CPPUNIT_ASSERT (!lm->log ("a message", ERROR)); + CPPUNIT_ASSERT (!lm->log ("a message", WARNING)); + lm->setLoggingLevel (INFO); + CPPUNIT_ASSERT (!lm->log ("a message", INFO)); + } + + void testClear () + { + list filters; + lm->addLogStream ("file://foo", filters, 0); + lm->addLogStream ("console://", filters, 0); + CPPUNIT_ASSERT (!lm->empty ()); + lm->clear (); + CPPUNIT_ASSERT (lm->empty ()); + } + + void testLogThroughGzip () + { +// list filters; +// string message ("a message"); +// filters.push_back (string ("gzip")); +// lm->addLogStream ("file://foo", filters, 0); +// lm->log (message); +// lm->close (); +// File f; +// f.openFile ("foo", FileStream::defaultFileMask); +// char buf[64]; +// char d_buf[64]; +// u_long nbr; +// f.read (buf, 64, &nbr); +// cout << nbr << endl; +// f.close (); +// GzipDecompress gzdc; +// gzdc.decompress (buf, 64, d_buf, 64); +// d_buf[message.size ()] = '\0'; +// CPPUNIT_ASSERT (!message.compare (d_buf)); + } + + void tearDown() + { + delete lm; + delete lsf; + delete ff; + FilesUtility::deleteFile ("foo"); + } + +private: + LogManager* lm; + LogStreamFactory* lsf; + FiltersFactory* ff; }; CPPUNIT_TEST_SUITE_REGISTRATION (TestLogManager); Added: trunk/myserver/tests/test_log_stream_factory.cpp =================================================================== --- trunk/myserver/tests/test_log_stream_factory.cpp (rev 0) +++ trunk/myserver/tests/test_log_stream_factory.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -0,0 +1,78 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include + +class TestLogStreamFactory : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE (TestLogStreamFactory); + CPPUNIT_TEST (testGetProtocol); + CPPUNIT_TEST (testGetPath); + CPPUNIT_TEST (testCreation); + CPPUNIT_TEST_SUITE_END (); +public: + void setUp () + { + lsf = new LogStreamFactory (); + } + + void testGetProtocol () + { + CPPUNIT_ASSERT (!lsf->protocolCheck (lsf->getProtocol ("foo"))); + CPPUNIT_ASSERT (!lsf->protocolCheck (lsf->getProtocol ("foo:bar"))); + CPPUNIT_ASSERT (!lsf->protocolCheck (lsf->getProtocol ("foo://"))); + CPPUNIT_ASSERT (!lsf->protocolCheck (lsf->getProtocol ("://"))); + CPPUNIT_ASSERT (!lsf->protocolCheck (lsf->getProtocol ("://foo"))); + CPPUNIT_ASSERT (lsf->protocolCheck (lsf->getProtocol ("file://"))); + } + + void testGetPath () + { + CPPUNIT_ASSERT (!lsf->getPath ("foo:bla").size ()); + CPPUNIT_ASSERT (!lsf->getPath ("foo://bar").size ()); + CPPUNIT_ASSERT (lsf->getPath ("socket://foo").size ()); + } + + void testCreation () + { + list filters; + FiltersFactory ff; + CPPUNIT_ASSERT (!lsf->createLogStream (&ff, "foo", filters, 0)); + LogStream* ls = lsf->createLogStream (&ff, "console://", filters, 0); + CPPUNIT_ASSERT (ls); + CPPUNIT_ASSERT (!lsf->createLogStream (&ff, "socket://foo_bar:-1", filters, 0)); + delete ls; + } + + void tearDown () + { + delete lsf; + } +private: + LogStreamFactory* lsf; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION (TestLogStreamFactory); Added: trunk/myserver/tests/test_socket_stream_creator.cpp =================================================================== --- trunk/myserver/tests/test_socket_stream_creator.cpp (rev 0) +++ trunk/myserver/tests/test_socket_stream_creator.cpp 2008-09-24 17:21:34 UTC (rev 2840) @@ -0,0 +1,71 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +class TestSocketStreamCreator : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE (TestSocketStreamCreator); + CPPUNIT_TEST (testCreation); + CPPUNIT_TEST (testGetPort); + CPPUNIT_TEST (testGetHost); + CPPUNIT_TEST_SUITE_END (); +public: + void setUp () + { + ssc = new SocketStreamCreator (); + ff = new FiltersFactory (); + } + + void testCreation () + { + list filters; + LogStream* ls = ssc->create (ff, "foo:0", filters, 0); + CPPUNIT_ASSERT (!ls); + } + + void testGetPort () + { + CPPUNIT_ASSERT (ssc->getPort ("foohost:8081") == 8081); + } + + void testGetHost () + { + CPPUNIT_ASSERT (!ssc->getHost ("foohost:8081").compare (string ("foohost"))); + } + + void tearDown () + { + delete ssc; + delete ff; + } +private: + SocketStreamCreator* ssc; + FiltersFactory* ff; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION (TestSocketStreamCreator); From MAILER-DAEMON Wed Sep 24 15:44:02 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KiaHK-0008Kk-Ii for mharc-myserver-commit@gnu.org; Wed, 24 Sep 2008 15:44:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiaHI-0008K1-K9 for myserver-commit@gnu.org; Wed, 24 Sep 2008 15:44:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiaHF-0008JV-Up for myserver-commit@gnu.org; Wed, 24 Sep 2008 15:44:00 -0400 Received: from [199.232.76.173] (port=35247 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiaHF-0008JS-Lk for myserver-commit@gnu.org; Wed, 24 Sep 2008 15:43:57 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53256 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiaHF-0003en-0U for myserver-commit@gnu.org; Wed, 24 Sep 2008 15:43:57 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiaHE-00062x-1T for myserver-commit@gnu.org; Wed, 24 Sep 2008 19:43:56 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiaHD-00062t-Lg for myserver-commit@gnu.org; Wed, 24 Sep 2008 19:43:55 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Wed, 24 Sep 2008 19:43:55 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2841] Define configuration files in myserver. cpp and not in the Server class. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2008 19:44:00 -0000 Revision: 2841 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2841 Author: gscrivano Date: 2008-09-24 19:43:55 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Define configuration files in myserver.cpp and not in the Server class. It closes the task #8587. Thanks to Daniele Cocca . Ticket Links: :----------- http://savannah.gnu.org/task/?8587 Modified Paths: -------------- trunk/myserver/include/server/server.h trunk/myserver/src/myserver.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-24 17:21:34 UTC (rev 2840) +++ trunk/myserver/include/server/server.h 2008-09-24 19:43:55 UTC (rev 2841) @@ -65,40 +65,40 @@ class Server : public MulticastRegistry { public: - ProcessServerManager* getProcessServerManager() - { - return &processServerManager; - } - PluginsManager* getPluginsManager(){return &pluginsManager;} - bool stopServer(){return mustEndServer;} - HomeDir* getHomeDir(); - static void createInstance(); - static Server* getInstance() - { - return instance; - } + ProcessServerManager* getProcessServerManager() + { + return &processServerManager; + } + PluginsManager* getPluginsManager(){return &pluginsManager;} + bool stopServer(){return mustEndServer;} + HomeDir* getHomeDir(); + static void createInstance(); + static Server* getInstance() + { + return instance; + } int loadLibraries(); - CachedFileFactory* getCachedFiles(); + CachedFileFactory* getCachedFiles(); const char* getHashedData(const char* name); void setGlobalData(const char* name, void* data); void* getGlobalData(const char* name); FiltersFactory* getFiltersFactory(); - int getMaxThreads(); + int getMaxThreads(); u_long getUid(); u_long getGid(); int countAvailableThreads(); - void checkThreadsNumber(); + void checkThreadsNumber(); int removeThread(u_long ID); int isServerReady(); ProtocolsManager* getProtocolsManager(); void disableAutoReboot(); void enableAutoReboot(); int isAutorebootEnabled(); - int isRebooting(){return rebooting;} + int isRebooting(){return rebooting;} void rebootOnNextLoop(); const char* getMainConfFile(); const char* getVhostConfFile(); @@ -107,28 +107,28 @@ const char* getLanguageFile(); const char* getExternalPath(); XmlParser* getLanguageParser(); - ~Server(); - Protocol* getProtocol(const char *protocolName); - int addConnection(Socket,MYSERVER_SOCKADDRIN*); - u_long getNumConnections(); - u_long getNumTotalConnections(); + ~Server(); + Protocol* getProtocol(const char *protocolName); + int addConnection(Socket,MYSERVER_SOCKADDRIN*); + u_long getNumConnections(); + u_long getNumTotalConnections(); void getConnections(list&); - ConnectionPtr getConnection(int); - u_long getTimeout(); - const char *getAddresses(); - const char *getPath(); - u_long getNumThreads(); - const char *getDefaultFilenamePath(u_long ID = 0); - const char *getServerName(); - u_long getVerbosity(); - const char *getServerAdmin(); - int getMaxLogFileSize(); - int mustUseLogonOption(); - void setVerbosity(u_long); - void start(); - void stop(); - void finalCleanup(); - int terminate(); + ConnectionPtr getConnection(int); + u_long getTimeout(); + const char *getAddresses(); + const char *getPath(); + u_long getNumThreads(); + const char *getDefaultFilenamePath(u_long ID = 0); + const char *getServerName(); + u_long getVerbosity(); + const char *getServerAdmin(); + int getMaxLogFileSize(); + int mustUseLogonOption(); + void setVerbosity(u_long); + void start(string &, string &, string &, string &, string &); + void stop(); + void finalCleanup(); + int terminate(); int logWriteln(const char*); int logWriteln(string const &str) {return logWriteln(str.c_str());}; @@ -137,120 +137,118 @@ int logLockAccess(); int logUnlockAccess(); int setLogFile(char*); - u_long getBuffersize(); - u_long getBuffersize2(); + u_long getBuffersize(); + u_long getBuffersize2(); u_long getThrottlingRate(); - int waitNewConnection(u_long tid, u_long timeout); - XmlParser *getConfiguration(){return &configurationFileManager;} - ListenThreads *getListenThreads(){return &listenThreads;} + int waitNewConnection(u_long tid, u_long timeout); + XmlParser *getConfiguration(){return &configurationFileManager;} + ListenThreads *getListenThreads(){return &listenThreads;} - void *getEnvString(){return envString;} - VhostManager *getVhosts(){return vhostList;} - MimeManager *getMimeManager(){return mimeManager;} + void *getEnvString(){return envString;} + VhostManager *getVhosts(){return vhostList;} + MimeManager *getMimeManager(){return mimeManager;} - void setProcessPermissions(); - ConnectionsScheduler* getConnectionsScheduler(){return &connectionsScheduler;} - int deleteConnection(ConnectionPtr, int); + void setProcessPermissions(); + ConnectionsScheduler* getConnectionsScheduler(){return &connectionsScheduler;} + int deleteConnection(ConnectionPtr, int); - void increaseFreeThread(); - void decreaseFreeThread(); + void increaseFreeThread(); + void decreaseFreeThread(); private: friend class ClientsThread; #ifdef WIN32 - friend int __stdcall control_handler(u_long control_type); + friend int __stdcall control_handler(u_long control_type); #endif #ifdef NOT_WIN - friend int control_handler (u_long control_type); + friend int control_handler (u_long control_type); #endif - /*! - *When the flag mustEndServer is 1 all the threads are - *stopped and the application stop its execution. - */ - int mustEndServer; + /*! + *When the flag mustEndServer is 1 all the threads are + *stopped and the application stop its execution. + */ + int mustEndServer; - /*! Singleton instance. Call createInstance before use it. */ - static Server* instance; + /*! Singleton instance. Call createInstance before use it. */ + static Server* instance; - /*! Do not allow to create directly objects. */ - Server(); + /*! Do not allow to create directly objects. */ + Server(); void mainLoop(); void loadPlugins(); void displayBoot(); - CachedFileFactory cachedFiles; + CachedFileFactory cachedFiles; - void *envString; - VhostManager *vhostList; - MimeManager *mimeManager; - ListenThreads listenThreads; - HomeDir homeDir; + void *envString; + VhostManager *vhostList; + MimeManager *mimeManager; + ListenThreads listenThreads; + HomeDir homeDir; HashMap hashedData; HashMap globalData; FiltersFactory filtersFactory; DynamicFiltersManager filters; - DynExecutorManager executors; + DynExecutorManager executors; u_long uid; u_long gid; int currentThreadID; - /*! Used when rebooting to load new configuration files. */ - int pausing; - ProtocolsManager protocols; - XmlParser configurationFileManager; - XmlParser languageParser; + /*! Used when rebooting to load new configuration files. */ + int pausing; + ProtocolsManager protocols; + XmlParser configurationFileManager; + XmlParser languageParser; int autoRebootEnabled; int toReboot; - int rebooting; + int rebooting; LogManager logManager; int serverReady; - u_long verbosity; + u_long verbosity; u_long throttlingRate; - u_long buffersize; - u_long buffersize2; - /*! Buffer that contains all the local machine IP values. */ - string *ipAddresses; - char serverName[HOST_NAME_MAX + 1]; - string* path; + u_long buffersize; + u_long buffersize2; + /*! Buffer that contains all the local machine IP values. */ + string *ipAddresses; + char serverName[HOST_NAME_MAX + 1]; + string* path; string* externalPath; - string* serverAdmin; - int initialize(); + string* serverAdmin; + int initialize(); int addThread(int staticThread = 0); - ConnectionPtr addConnectionToList(Socket* s, MYSERVER_SOCKADDRIN *asock_in, + ConnectionPtr addConnectionToList(Socket* s, MYSERVER_SOCKADDRIN *asock_in, char *ipAddr, char *localIpAddr, u_short port, u_short localPort, int); - u_long maxConnections; - u_long maxConnectionsToAccept; - void clearAllConnections(); - int freeHashedData(); - u_long connectionTimeout; - u_long maxLogFileSize; - int loadMainConfFilesLocation(); - int loadVHostConfFilesLocation(); - int loadMimeConfFilesLocation(); - int loadExternalPath(); - int loadLanguagesPath(); - int loadConfFilesLocation(); - Mutex* connectionsMutex; - u_long nStaticThreads; + u_long maxConnections; + u_long maxConnectionsToAccept; + void clearAllConnections(); + int freeHashedData(); + u_long connectionTimeout; + u_long maxLogFileSize; + int copyConfigurationFromDefault(const char *); + void logWriteNTimes(const char *, unsigned); + int checkConfigurationPaths(); + bool resetConfigurationPaths(string &, string &, string &, string &, string &); + Mutex* connectionsMutex; + u_long nStaticThreads; u_long nMaxThreads; - u_long freeThreads; + u_long freeThreads; - u_long purgeThreadsThreshold; + u_long purgeThreadsThreshold; Mutex* threadsMutex; list threads; int purgeThreads(); - int reboot(); - string* languageFile; - string* languagesPath; - string* mainConfigurationFile; - string* vhostConfigurationFile; - string* mimeConfigurationFile; - PluginsManager pluginsManager; - GenericPluginsManager genericPluginsManager; - ProcessServerManager processServerManager; - ConnectionsScheduler connectionsScheduler; + int reboot(); + string* languageFile; + string* languagesPath; + string* mainConfigurationFile; + string* vhostConfigurationFile; + string* mimeConfigurationFile; + PluginsManager pluginsManager; + GenericPluginsManager genericPluginsManager; + ProcessServerManager processServerManager; + ConnectionsScheduler connectionsScheduler; bool endServer; }; Modified: trunk/myserver/src/myserver.cpp =================================================================== --- trunk/myserver/src/myserver.cpp 2008-09-24 17:21:34 UTC (rev 2840) +++ trunk/myserver/src/myserver.cpp 2008-09-24 19:43:55 UTC (rev 2841) @@ -17,6 +17,7 @@ #include "stdafx.h" #include +#include #include #include extern "C" { @@ -38,11 +39,11 @@ #define MYSERVER_RUNAS_CONSOLE 1 #define MYSERVER_RUNAS_SERVICE 2 -void consoleService (); +void consoleService(string &, string &, string &, string &, string &); #ifdef WIN32 void __stdcall myServerCtrlHandler(u_long fdwControl); -void __stdcall myServerMain (u_long , LPTSTR *argv); +void __stdcall myServerMain (u_long , LPTSTR *argv); static BOOL SignalHandler(DWORD type) ; #else int writePidfile(const char*); @@ -51,7 +52,6 @@ void registerService(); void removeService(); void RunAsService(); -static char *path; int argn; char **argv; @@ -75,8 +75,8 @@ registerSignals(); } #else -static BOOL SignalHandler(DWORD type) -{ +static BOOL SignalHandler(DWORD type) +{ Server::getInstance()->logWriteln("Exiting..."); Server::getInstance()->stop(); registerSignals(); @@ -89,7 +89,7 @@ { #ifdef NOT_WIN struct sigaction sig1, sig2, sig3; - sig1.sa_flags = sig2.sa_flags = sig3.sa_flags = SA_RESETHAND; + memset(&sig1, 0, sizeof(sig1)); memset(&sig2, 0, sizeof(sig2)); memset(&sig3, 0, sizeof(sig3)); @@ -124,25 +124,25 @@ static char argsDoc[] = ""; /* Use the GNU C argp parser under not windows environments. */ -static struct argp_option options[] = +static struct argp_option options[] = { /* LONG NAME - SHORT NAME - PARAMETER NAME - FLAGS - DESCRIPTION. */ {"version", 'v', "VERSION", OPTION_ARG_OPTIONAL , "Print the version for the application"}, {"run", 'r', "RUN", OPTION_ARG_OPTIONAL, "Specify how run the server (by default console mode)"}, {"logfile", 'l', "log", 0, "Specify the file to use to log main myserver messages"}, - {"pidfile", 'p', "pidfile", OPTION_HIDDEN, "Specify the file where write the PID"}, + {"pidfile", 'p', "pidfile", OPTION_HIDDEN, "Specify the file where write the PID"}, {0} }; static error_t parseOpt(int key, char *arg, struct argp_state *state) -{ +{ argp_input *in = static_cast(state->input); switch(key) { case 'v': in->version = 1; break; - + case 'r': if(arg) { @@ -158,15 +158,15 @@ case 'l': in->logFileName = arg; break; - + case 'p': in->pidFileName = arg; break; - + case ARGP_KEY_ARG: case ARGP_KEY_END: break; - + default: return static_cast(ARGP_ERR_UNKNOWN); } @@ -177,7 +177,230 @@ #endif + /*! + *Load the external path. + *Return nonzero on errors. + */ +int loadExternalPath(string &externalPath) +{ + try + { + externalPath = ""; + +#ifdef NOT_WIN + if(FilesUtility::fileExists("plugins")) + externalPath.assign("plugins"); + else + { +#ifdef PREFIX + externalPath.assign(PREFIX); + externalPath.append("/lib/myserver/plugins"); +#else + externalPath.assign("/usr/lib/myserver/plugins"); +#endif + } + +#endif + +#ifdef WIN32 + externalPath.assign("plugins"); +#endif + } + catch (...) + { + } + return 0; +} + + +/*! + *Load the languages path. + *Return nonzero on errors. + */ +int loadLanguagesPath(string &languagesPath) +{ + try + { + languagesPath = ""; + +#ifndef WIN32 + /* + *Do not use the files in the directory /usr/share/myserver/languages + *if exists a local directory. + */ + if (FilesUtility::fileExists("languages")) + { + languagesPath.assign(getdefaultwd(0, 0)); + languagesPath.append("/languages/"); + } + else + { +#ifdef PREFIX + languagesPath.assign(PREFIX); + languagesPath.append("/share/myserver/languages/"); +#else + /* Default PREFIX is /usr/. */ + languagesPath.assign("/usr/share/myserver/languages/"); +#endif + } +#endif + +#ifdef WIN32 + languagesPath.assign( "languages/" ); +#endif + } + catch (...) + { + } + return 0; +} + +/*! + *Load the vhost configuration files locations. + *Return nonzero on errors. + */ +int loadVHostConfFilesLocation(string &vhostConfigurationFile) +{ + try + { + vhostConfigurationFile = ""; + +#ifndef WIN32 + /* + *Under an *nix environment look for .xml files in the following order. + *1) myserver executable working directory + *2) ~/.myserver/ + *3) /etc/myserver/ + *4) default files will be copied in myserver executable working + */ + if (FilesUtility::fileExists("virtualhosts.xml")) + { + vhostConfigurationFile.assign("virtualhosts.xml"); + } + else if (FilesUtility::fileExists("~/.myserver/virtualhosts.xml")) + { + vhostConfigurationFile.assign("~/.myserver/virtualhosts.xml"); + } + else if (FilesUtility::fileExists("/etc/myserver/virtualhosts.xml")) + { + vhostConfigurationFile.assign("/etc/myserver/virtualhosts.xml"); + } +#endif + } + catch (...) + { + } + return 0; +} + + +/*! + *Load the mime configuration files locations. + *Return nonzero on errors. + */ +int loadMimeConfFilesLocation(string &mimeConfigurationFile) +{ + try + { + mimeConfigurationFile = ""; + +#ifndef WIN32 + /* + *Under an *nix environment look for .xml files in the following order. + *1) myserver executable working directory + *2) ~/.myserver/ + *3) /etc/myserver/ + *4) default files will be copied in myserver executable working + */ + if (FilesUtility::fileExists("MIMEtypes.xml")) + { + mimeConfigurationFile.assign("MIMEtypes.xml"); + } + else if (FilesUtility::fileExists("~/.myserver/MIMEtypes.xml")) + { + mimeConfigurationFile.assign("~/.myserver/MIMEtypes.xml"); + } + else if (FilesUtility::fileExists("/etc/myserver/MIMEtypes.xml")) + { + mimeConfigurationFile.assign("/etc/myserver/MIMEtypes.xml"); + } +#endif + } + catch (...) + { + } + return 0; +} + + +/*! + *Load the main configuration files locations. + *Return nonzero on errors. + */ +int loadMainConfFilesLocation(string &mainConfigurationFile) +{ + try + { + mainConfigurationFile = ""; + +#ifndef WIN32 + + /* + *Under an *nix environment look for .xml files in the following order. + *1) myserver executable working directory + *2) ~/.myserver/ + *3) /etc/myserver/ + *4) default files will be copied in myserver executable working + */ + if (FilesUtility::fileExists("myserver.xml")) + { + mainConfigurationFile.assign("myserver.xml"); + } + else if (FilesUtility::fileExists("~/.myserver/myserver.xml")) + { + mainConfigurationFile.assign("~/.myserver/myserver.xml"); + } + else if (FilesUtility::fileExists("/etc/myserver/myserver.xml")) + { + mainConfigurationFile.assign("/etc/myserver/myserver.xml"); + } +#endif + } + catch (...) + { + } + return 0; +} + + +/*! + *Load the configuration files locations. + *Return nonzero on errors. + */ +int loadConfFilesLocation(string &mainConfigurationFile, string &mimeConfigurationFile, + string &vhostConfigurationFile, string &externalPath, string &languagesPath) +{ + if (loadMainConfFilesLocation(mainConfigurationFile)) + return -1; + + if (loadMimeConfFilesLocation(mimeConfigurationFile)) + return -1; + + if (loadVHostConfFilesLocation(vhostConfigurationFile)) + return -1; + + if (loadExternalPath(externalPath)) + return -1; + + if (loadLanguagesPath(languagesPath)) + return -1; + + return 0; +} + + +/*! *Main function for MyServer. */ int main (int argn, char **argv) @@ -190,7 +413,8 @@ pid_t pid; pid_t sid; #endif - + string mainConf, mimeConf, vhostConf, externPath, langPath; + ::argn=argn; ::argv=argv; @@ -205,11 +429,12 @@ /* Die if we get exceptions here. */ return(1); }; - + { u_int pathLen = 0; u_int len = 0; bool differentCwd = false; + char *path; pathLen = strlen(argv[0]); path = new char[pathLen + 1]; @@ -225,23 +450,23 @@ break; } } - len = pathLen; - while((path[len] != '\\') && (path[len] != '/')) - len--; - path[len] = '\0'; - /* Current working directory is where the myserver executable is. */ if(differentCwd) { + len = pathLen; + while((path[len] != '\\') && (path[len] != '/')) + len--; + path[len] = '\0'; + setcwd(path); } /* We can free path memory now. */ delete [] path; } - - + + #ifdef ARGP /* Reset the struct. */ input.version = 0; @@ -263,19 +488,19 @@ if(input.version) { cout << MYSERVER_VERSION << endl; - - cout + + cout #ifdef __DATE__ - << "Compiled on " << __DATE__ + << "Compiled on " << __DATE__ #endif << endl; cout << "http://www.gnu.org/software/myserver" << endl; - return 0; + return 0; } #else if(argn > 1) - { + { if(!strcmpi(argv[1], "VERSION")) { cout << MYSERVER_VERSION << endl; @@ -318,10 +543,13 @@ */ try { + setcwdBuffer(); + loadConfFilesLocation(mainConf, mimeConf, vhostConf, externPath, langPath); + switch(runas) { case MYSERVER_RUNAS_CONSOLE: - consoleService(); + consoleService(mainConf, mimeConf, vhostConf, externPath, langPath); break; case MYSERVER_RUNAS_SERVICE: #ifdef WIN32 @@ -334,17 +562,17 @@ */ pid = fork(); - /* + /* *An error happened, return with errors. */ - if (pid < 0) + if (pid < 0) { return 1; } /* - *A good process id, return with success. + *A good process id, return with success. */ - if (pid > 0) + if (pid > 0) { return 0; } @@ -367,15 +595,15 @@ /* *Error in setting a new sid, return the error. */ - if (sid < 0) + if (sid < 0) { return 1; } - + /* *Finally run the server from the forked process. */ - consoleService(); + consoleService(mainConf, mimeConf, vhostConf, externPath, langPath); #endif break; } @@ -385,7 +613,7 @@ return 1; }; return 0; -} +} #ifndef WIN32 @@ -395,7 +623,7 @@ int writePidfile(const char* filename) { int pidfile; - pid_t pid = getpid(); + pid_t pid = getpid(); char buff[12]; int ret; pidfile = open(filename, O_RDWR | O_CREAT); @@ -414,9 +642,9 @@ /*! *Start MyServer in console mode. */ -void consoleService () +void consoleService(string &mainConf, string &mimeConf, string &vhostConf, string &externPath, string &langPath) { - Server::getInstance()->start(); + Server::getInstance()->start(mainConf, mimeConf, vhostConf, externPath, langPath); } @@ -424,8 +652,8 @@ *These functions are available only on the windows platform. */ #ifdef WIN32 -SERVICE_STATUS MyServiceStatus; -SERVICE_STATUS_HANDLE MyServiceStatusHandle; +SERVICE_STATUS MyServiceStatus; +SERVICE_STATUS_HANDLE MyServiceStatusHandle; /*! *Entry-point for the NT service. @@ -439,7 +667,7 @@ MyServiceStatus.dwServiceSpecificExitCode = NO_ERROR; MyServiceStatus.dwCheckPoint = 0; MyServiceStatus.dwWaitHint = 0; - + try { Server::createInstance(); @@ -450,25 +678,25 @@ return; }; - - MyServiceStatusHandle = RegisterServiceCtrlHandler( "MyServer", + + MyServiceStatusHandle = RegisterServiceCtrlHandler( "MyServer", myServerCtrlHandler ); if(MyServiceStatusHandle) { MyServiceStatus.dwCurrentState = SERVICE_START_PENDING; SetServiceStatus( MyServiceStatusHandle, &MyServiceStatus ); - - MyServiceStatus.dwControlsAccepted |= (SERVICE_ACCEPT_STOP + + MyServiceStatus.dwControlsAccepted |= (SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN); MyServiceStatus.dwCurrentState = SERVICE_RUNNING; SetServiceStatus( MyServiceStatusHandle, &MyServiceStatus ); - + Server::getInstance()->start(); - + MyServiceStatus.dwCurrentState = SERVICE_STOP_PENDING; SetServiceStatus( MyServiceStatusHandle, &MyServiceStatus ); - - MyServiceStatus.dwControlsAccepted &= ~(SERVICE_ACCEPT_STOP + + MyServiceStatus.dwControlsAccepted &= ~(SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN); MyServiceStatus.dwCurrentState = SERVICE_STOPPED; SetServiceStatus( MyServiceStatusHandle, &MyServiceStatus ); @@ -484,17 +712,17 @@ { case SERVICE_CONTROL_INTERROGATE: break; - + case SERVICE_CONTROL_SHUTDOWN: case SERVICE_CONTROL_STOP: MyServiceStatus.dwCurrentState = SERVICE_STOP_PENDING; SetServiceStatus( MyServiceStatusHandle, &MyServiceStatus ); Server::getInstance()->stop(); return; - + case SERVICE_CONTROL_PAUSE: break; - + case SERVICE_CONTROL_CONTINUE: break; default: @@ -548,7 +776,7 @@ GetCurrentDirectory(MAX_PATH,path); strcat(path,"\\"); strcat(path,"myserver.exe SERVICE"); - + manager = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); if (manager) { @@ -592,7 +820,7 @@ } /*! - *Start the service. + *Start the service. */ void RunAsService() { Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-24 17:21:34 UTC (rev 2840) +++ trunk/myserver/src/server/server.cpp 2008-09-24 19:43:55 UTC (rev 2841) @@ -101,14 +101,127 @@ freeThreads = 0; } + /*! + *Reinitialize the configuration paths, setting them to the specified ones. + *Returns false on error. + */ +bool Server::resetConfigurationPaths(string &mainConf, string &mimeConf, string &vhostConf, string &externPath, string &langPath) +{ + if (!mainConfigurationFile) + mainConfigurationFile = new string(mainConf); + else + mainConfigurationFile->assign(mainConf); + + if (!mimeConfigurationFile) + mimeConfigurationFile = new string(mimeConf); + else + mimeConfigurationFile->assign(mimeConf); + + if (!vhostConfigurationFile) + vhostConfigurationFile = new string(vhostConf); + else + vhostConfigurationFile->assign(vhostConf); + + if (!externalPath) + externalPath = new string(externPath); + else + externalPath->assign(externPath); + + if (!languagesPath) + languagesPath = new string(langPath); + else + languagesPath->assign(langPath); + + return true; +} + +/*! + *Check that the configuration paths are not empty, otherwise fall back to + *the default ones. + *Returns nonzero on error. + */ +int Server::checkConfigurationPaths() +{ + if (mainConfigurationFile->length() == 0) + { + mainConfigurationFile->assign("myserver.xml"); + + if (copyConfigurationFromDefault("myserver.xml")) + { + logPreparePrintError(); + logWriteln("Error loading configuration file\n"); + logEndPrintError(); + return -1; + } + } + + if (mimeConfigurationFile->length() == 0) + { + mimeConfigurationFile->assign("MIMEtypes.xml"); + + if (copyConfigurationFromDefault("MIMEtypes.xml")) + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADMIME")); + logEndPrintError(); + return -1; + } + } + + if (vhostConfigurationFile->length() == 0) + { + vhostConfigurationFile->assign("virtualhosts.xml"); + + if (copyConfigurationFromDefault("virtualhosts.xml") != 0) + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADVHOSTS")); + logEndPrintError(); + return -1; + } + } + + return 0; +} + + +/*! + *Copy a configuration file from the default one. + *Return nonzero on errors. + */ +int Server::copyConfigurationFromDefault(const char *fileName) +{ + File inputF; + File outputF; + int ret; + string sSource(fileName); + + sSource.append(".default"); + ret = inputF.openFile(sSource, File::MYSERVER_OPEN_READ + | File::MYSERVER_OPEN_IFEXISTS); + if (ret) + return -1; + + ret = outputF.openFile(fileName, File::MYSERVER_OPEN_WRITE + | File::MYSERVER_OPEN_ALWAYS); + if (ret) + return -1; + + FilesUtility::copyFile(inputF, outputF); + + inputF.close(); + outputF.close(); +} + + +/*! *Load here all the libraries. */ int Server::loadLibraries() { Process::initialize(); - setcwdBuffer(); XmlParser::startXML(); myserver_safetime_init(); @@ -140,7 +253,7 @@ /*! *Start the server. */ -void Server::start() +void Server::start(string &mainConf, string &mimeConf, string &vhostConf, string &externPath, string &langPath) { u_long i; string buffer; @@ -166,8 +279,14 @@ *Setup the server configuration. */ logWriteln("Initializing server configuration..."); - err = 0; + if (!resetConfigurationPaths(mainConf, mimeConf, vhostConf, externPath, langPath)) + return; + + err = checkConfigurationPaths(); + if (err) + return; + err = initialize(); if(err) return; @@ -520,6 +639,13 @@ } } +void Server::logWriteNTimes(const char *str, unsigned n) +{ + while (n--) + logManager.write(str); + logManager.writeln(""); +} + /*! *Display the MyServer boot. */ @@ -560,21 +686,16 @@ { try { + size_t length; string softwareSignature; softwareSignature.assign("************"); softwareSignature.append(MYSERVER_VERSION); softwareSignature.append("************"); + length = softwareSignature.length(); - i = softwareSignature.length(); - while(i--) - logManager.write("*"); - logManager.writeln(""); - logManager.write(softwareSignature.c_str()); - logManager.write("\n"); - i = softwareSignature.length(); - while(i--) - logManager.write("*"); - logManager.writeln(""); + logWriteNTimes("*", length); + logManager.writeln(softwareSignature.c_str()); + logWriteNTimes("*", length); } catch(exception& e) { @@ -897,9 +1018,6 @@ serverAdmin = 0; autoRebootEnabled = 1; - if(loadConfFilesLocation()) - return -1; - if(configurationFileManager.open(mainConfigurationFile->c_str())) return -1; @@ -1081,6 +1199,7 @@ return 0; } + /*! *Check if there are free threads to handle a new request. If there *are not enough threads create a new one. @@ -1530,341 +1649,8 @@ return externalPath ? externalPath->c_str() : ""; } -/*! - *Load the main configuration files locations. - *Return nonzero on errors. - */ -int Server::loadMainConfFilesLocation() -{ - int ret; - try - { - if (mainConfigurationFile) - delete mainConfigurationFile; - mainConfigurationFile = new string(); -#ifndef WIN32 - - /* - *Under an *nix environment look for .xml files in the following order. - *1) myserver executable working directory - *2) ~/.myserver/ - *3) /etc/myserver/ - *4) default files will be copied in myserver executable working - */ - if (FilesUtility::fileExists("myserver.xml")) - { - mainConfigurationFile->assign("myserver.xml"); - } - else if (FilesUtility::fileExists("~/.myserver/myserver.xml")) - { - mainConfigurationFile->assign("~/.myserver/myserver.xml"); - } - else if (FilesUtility::fileExists("/etc/myserver/myserver.xml")) - { - mainConfigurationFile->assign("/etc/myserver/myserver.xml"); - } - else -#endif - /* If the myserver.xml files doesn't exist copy it from the default one. */ - if (mainConfigurationFile->length() == 0) - { - mainConfigurationFile->assign("myserver.xml"); - File inputF; - File outputF; - ret = inputF.openFile("myserver.xml.default", File::MYSERVER_OPEN_READ - | File::MYSERVER_OPEN_IFEXISTS); - if (ret) - { - logPreparePrintError(); - logWriteln("Error loading configuration file\n"); - logEndPrintError(); - return -1; - } - ret = outputF.openFile("myserver.xml", File::MYSERVER_OPEN_WRITE - | File::MYSERVER_OPEN_ALWAYS); - if (ret) - { - logPreparePrintError(); - logWriteln("Error loading configuration file\n"); - logEndPrintError(); - return -1; - } - - FilesUtility::copyFile(inputF, outputF); - - inputF.close(); - outputF.close(); - } - else - { - mainConfigurationFile->assign("myserver.xml"); - } - } - catch (...) - { - } - return 0; -} - - /*! - *Load the mime configuration files locations. - *Return nonzero on errors. - */ -int Server::loadMimeConfFilesLocation() -{ - int ret; - try - { - if (mimeConfigurationFile) - delete mimeConfigurationFile; - - mimeConfigurationFile = new string(); - -#ifndef WIN32 - /* - *Under an *nix environment look for .xml files in the following order. - *1) myserver executable working directory - *2) ~/.myserver/ - *3) /etc/myserver/ - *4) default files will be copied in myserver executable working - */ - if (FilesUtility::fileExists("MIMEtypes.xml")) - { - mimeConfigurationFile->assign("MIMEtypes.xml"); - } - else if (FilesUtility::fileExists("~/.myserver/MIMEtypes.xml")) - { - mimeConfigurationFile->assign("~/.myserver/MIMEtypes.xml"); - } - else if (FilesUtility::fileExists("/etc/myserver/MIMEtypes.xml")) - { - mimeConfigurationFile->assign("/etc/myserver/MIMEtypes.xml"); - } - else -#endif - /* - *If the MIMEtypes.xml files doesn't exist copy it - *from the default one. - */ - if (mimeConfigurationFile->length() == 0) - { - File inputF; - File outputF; - mimeConfigurationFile->assign("MIMEtypes.xml"); - ret = inputF.openFile("MIMEtypes.xml.default", File::MYSERVER_OPEN_READ - | File::MYSERVER_OPEN_IFEXISTS); - if (ret) - { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADMIME")); - logEndPrintError(); - return -1; - } - ret = outputF.openFile("MIMEtypes.xml", File::MYSERVER_OPEN_WRITE - | File::MYSERVER_OPEN_ALWAYS); - if (ret) - return -1; - - FilesUtility::copyFile(inputF, outputF); - - inputF.close(); - outputF.close(); - } - - } - catch (...) - { - } - return 0; -} - - -/*! - *Load the vhost configuration files locations. - *Return nonzero on errors. - */ -int Server::loadVHostConfFilesLocation() -{ - int ret; - try - { - if (vhostConfigurationFile) - delete vhostConfigurationFile; - - vhostConfigurationFile = new string(); - -#ifndef WIN32 - /* - *Under an *nix environment look for .xml files in the following order. - *1) myserver executable working directory - *2) ~/.myserver/ - *3) /etc/myserver/ - *4) default files will be copied in myserver executable working - */ - if (FilesUtility::fileExists("virtualhosts.xml")) - { - vhostConfigurationFile->assign("virtualhosts.xml"); - } - else if (FilesUtility::fileExists("~/.myserver/virtualhosts.xml")) - { - vhostConfigurationFile->assign("~/.myserver/virtualhosts.xml"); - } - else if (FilesUtility::fileExists("/etc/myserver/virtualhosts.xml")) - { - vhostConfigurationFile->assign("/etc/myserver/virtualhosts.xml"); - } - else -#endif - /* - *If the virtualhosts.xml file doesn't exist copy it - *from the default one. - */ - if (vhostConfigurationFile->length() == 0) - { - File inputF; - File outputF; - - vhostConfigurationFile->assign("virtualhosts.xml"); - ret = inputF.openFile("virtualhosts.xml.default", - File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_IFEXISTS); - if (ret) - { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADVHOSTS")); - logEndPrintError(); - return -1; - } - ret = outputF.openFile("virtualhosts.xml", File::MYSERVER_OPEN_WRITE - | File::MYSERVER_OPEN_ALWAYS); - if (ret) - return -1; - - FilesUtility::copyFile(inputF, outputF); - - inputF.close(); - outputF.close(); - } - } - catch (...) - { - } - return 0; -} - -/*! - *Load the external path. - *Return nonzero on errors. - */ -int Server::loadExternalPath() -{ - try - { - if (externalPath) - delete externalPath; - externalPath = new string(); - -#ifdef NOT_WIN - if(FilesUtility::fileExists("plugins")) - externalPath->assign("plugins"); - else - { -#ifdef PREFIX - externalPath->assign(PREFIX); - externalPath->append("/lib/myserver/plugins"); -#else - externalPath->assign("/usr/lib/myserver/plugins"); -#endif - } - -#endif - -#ifdef WIN32 - externalPath->assign("plugins"); -#endif - } - catch (...) - { - } - return 0; -} - - - - -/*! - *Load the languages path. - *Return nonzero on errors. - */ -int Server::loadLanguagesPath() -{ - try - { - if (languagesPath) - delete languagesPath; - - languagesPath = new string(); - -#ifndef WIN32 - /* - *Do not use the files in the directory /usr/share/myserver/languages - *if exists a local directory. - */ - if (FilesUtility::fileExists("languages")) - { - languagesPath->assign(getdefaultwd(0, 0)); - languagesPath->append("/languages/"); - } - else - { -#ifdef PREFIX - languagesPath->assign(PREFIX); - languagesPath->append("/share/myserver/languages/"); -#else - /* Default PREFIX is /usr/. */ - languagesPath->assign("/usr/share/myserver/languages/"); -#endif - } -#endif - -#ifdef WIN32 - languagesPath->assign( "languages/" ); -#endif - } - catch (...) - { - } - return 0; -} - - -/*! - *Load the configuration files locations. - *Return nonzero on errors. - */ -int Server::loadConfFilesLocation() -{ - if (loadMainConfFilesLocation()) - return -1; - - if (loadMimeConfFilesLocation()) - return -1; - - if (loadVHostConfFilesLocation()) - return -1; - - if (loadExternalPath()) - return -1; - - if (loadLanguagesPath()) - return -1; - - return 0; -} - - -/*! *If specified set the uid/gid for the process. */ void Server::setProcessPermissions() From MAILER-DAEMON Fri Sep 26 18:36:07 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjLux-0007DX-On for mharc-myserver-commit@gnu.org; Fri, 26 Sep 2008 18:36:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjLuu-0007D0-Ui for myserver-commit@gnu.org; Fri, 26 Sep 2008 18:36:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjLut-0007Co-Dh for myserver-commit@gnu.org; Fri, 26 Sep 2008 18:36:03 -0400 Received: from [199.232.76.173] (port=58330 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjLut-0007Cl-7e for myserver-commit@gnu.org; Fri, 26 Sep 2008 18:36:03 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42119 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjLut-0003KL-5o for myserver-commit@gnu.org; Fri, 26 Sep 2008 18:36:03 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjLus-00027e-ES for myserver-commit@gnu.org; Fri, 26 Sep 2008 22:36:02 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjLus-00027a-83 for myserver-commit@gnu.org; Fri, 26 Sep 2008 22:36:02 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Fri, 26 Sep 2008 22:36:02 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2842] Added more tests for the LogManager class. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2008 22:36:05 -0000 Revision: 2842 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2842 Author: francesco_pipita Date: 2008-09-26 22:36:01 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Added more tests for the LogManager class. Fixed a bug and removed an useless test for the FileStream class. Modified Paths: -------------- trunk/myserver/include/log/stream/log_stream_factory.h trunk/myserver/src/log/log_manager.cpp trunk/myserver/src/log/stream/file_stream.cpp trunk/myserver/tests/test_file_stream.cpp trunk/myserver/tests/test_log_manager.cpp trunk/myserver/tests/test_socket_stream_creator.cpp Modified: trunk/myserver/include/log/stream/log_stream_factory.h =================================================================== --- trunk/myserver/include/log/stream/log_stream_factory.h 2008-09-24 19:43:55 UTC (rev 2841) +++ trunk/myserver/include/log/stream/log_stream_factory.h 2008-09-26 22:36:01 UTC (rev 2842) @@ -95,7 +95,7 @@ /*! - * Checks wheter `protocol' is between those known by the LogStreamFactory. + * Checks whether `protocol' is between those known by the LogStreamFactory. * \return true If it is. */ bool protocolCheck (string protocol); Modified: trunk/myserver/src/log/log_manager.cpp =================================================================== --- trunk/myserver/src/log/log_manager.cpp 2008-09-24 19:43:55 UTC (rev 2841) +++ trunk/myserver/src/log/log_manager.cpp 2008-09-26 22:36:01 UTC (rev 2842) @@ -259,10 +259,15 @@ LogManager::load (const char *filename) { setType (TYPE_FILE); - clear (); + removeLogStream ("console://"); string location ("file://"); location.append (filename); + location.append (".gz"); list filters; + /* + we use the gzip compression by default, for now. + */ + filters.push_back ("gzip"); addLogStream (location, filters, maxSize); return 0; } @@ -270,34 +275,24 @@ int LogManager::write (string message, int len) { - return notifyLogStreams (EVT_LOG, static_cast(&message)); + return log (message); } int LogManager::getLogSize () { - if (getFile ()) - return getFile ()->getFileSize (); return 0; } void -LogManager::setCycleLog (u_long cycleLog) +LogManager::setCycleLog (u_long l) { - cycleLog = 1; - notifyLogStreams (EVT_SET_CYCLE_LOG, static_cast(&maxSize)); + cycleLog = l; + setCycleLog (maxSize, "all"); } File* LogManager::getFile () { - map::iterator it; - for (it = logStreams.begin (); it != logStreams.end (); it++) - { - if (it->first.find ("file://") != string::npos) - { - return dynamic_cast(it->second->getOutStream ()); - } - } return 0; } @@ -332,9 +327,7 @@ void LogManager::setGzip (int useGzip) { - gzipLog = useGzip; - if (gzipLog) - notifyLogStreams (EVT_ADD_FILTER, new Gzip ()); + } int Modified: trunk/myserver/src/log/stream/file_stream.cpp =================================================================== --- trunk/myserver/src/log/stream/file_stream.cpp 2008-09-24 19:43:55 UTC (rev 2841) +++ trunk/myserver/src/log/stream/file_stream.cpp 2008-09-26 22:36:01 UTC (rev 2842) @@ -146,7 +146,7 @@ { filename = (filename.substr (0, filename.find (string (".") + ext))); } - newfilename << filedir << filename << "." << time << + newfilename << filedir << "/" << filename << "." << time << (ext.size () ? "." : "") << ext; return newfilename.str (); } Modified: trunk/myserver/tests/test_file_stream.cpp =================================================================== --- trunk/myserver/tests/test_file_stream.cpp 2008-09-24 19:43:55 UTC (rev 2841) +++ trunk/myserver/tests/test_file_stream.cpp 2008-09-26 22:36:01 UTC (rev 2842) @@ -34,30 +34,15 @@ { CPPUNIT_TEST_SUITE (TestFileStream); CPPUNIT_TEST (testCycleLog); - CPPUNIT_TEST (testMakeNewFileName); CPPUNIT_TEST_SUITE_END (); public: - void setUp() + void setUp () { fsc = new FileStreamCreator (); ff = new FiltersFactory (); setcwdBuffer (); } - void testMakeNewFileName () - { - list filters; - LogStream* ls = fsc->create (ff, "foo", filters, 0); - FileStream* fs = dynamic_cast(ls); - File* outStream = dynamic_cast(fs->getOutStream ()); - string newFileName = fs->makeNewFileName (outStream->getFilename ()); - string wd; - getdefaultwd (wd); - wd.append ("/foo"); - CPPUNIT_ASSERT (newFileName.find (wd) != string::npos); - delete fs; - } - void testCycleLog () { list filters; @@ -91,7 +76,7 @@ delete ls; } - void tearDown() + void tearDown () { delete ff; delete fsc; Modified: trunk/myserver/tests/test_log_manager.cpp =================================================================== --- trunk/myserver/tests/test_log_manager.cpp 2008-09-24 19:43:55 UTC (rev 2841) +++ trunk/myserver/tests/test_log_manager.cpp 2008-09-26 22:36:01 UTC (rev 2842) @@ -1,19 +1,19 @@ /* - MyServer - Copyright (C) 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ #include #include @@ -46,9 +46,10 @@ CPPUNIT_TEST (testLoggingLevel); CPPUNIT_TEST (testClear); CPPUNIT_TEST (testLogThroughGzip); + CPPUNIT_TEST (testCycleLogWithGzipChain); CPPUNIT_TEST_SUITE_END (); public: - void setUp() + void setUp () { lsf = new LogStreamFactory (); ff = new FiltersFactory (); @@ -96,15 +97,9 @@ list filters; lm->addLogStream ("file://foo", filters, 0); lm->log (message); - CPPUNIT_ASSERT (!lm->removeLogStream ("file://foo")); + lm->close (); File f; - f.openFile ("foo", - File::MYSERVER_OPEN_APPEND | - File::MYSERVER_OPEN_ALWAYS | - File::MYSERVER_OPEN_WRITE | - File::MYSERVER_OPEN_READ | - File::MYSERVER_NO_INHERIT); - f.setFilePointer (0); + f.openFile ("foo", FileStream::defaultFileMask); char buf[message.size () + 1]; u_long nbr; f.read (buf, message.size () + 1, &nbr); @@ -174,28 +169,70 @@ void testLogThroughGzip () { -// list filters; -// string message ("a message"); -// filters.push_back (string ("gzip")); -// lm->addLogStream ("file://foo", filters, 0); -// lm->log (message); -// lm->close (); -// File f; -// f.openFile ("foo", FileStream::defaultFileMask); -// char buf[64]; -// char d_buf[64]; -// u_long nbr; -// f.read (buf, 64, &nbr); -// cout << nbr << endl; -// f.close (); -// GzipDecompress gzdc; -// gzdc.decompress (buf, 64, d_buf, 64); -// d_buf[message.size ()] = '\0'; -// CPPUNIT_ASSERT (!message.compare (d_buf)); + list filters; + string message ("a message"); + filters.push_back ("gzip"); + lm->addLogStream ("file://foo", filters, 0); + lm->log (message); + lm->close (); + File f; + f.openFile ("foo", FileStream::defaultFileMask); + char gzipChainComp[64]; + char gzipChainDecomp[64]; + u_long nbr; + f.read (gzipChainComp, 64, &nbr); + f.close (); + GzipDecompress gzdc; + gzdc.decompress (&gzipChainComp[gzdc.headerSize ()], + nbr - gzdc.headerSize (), + gzipChainDecomp, 64); + gzipChainDecomp[message.size ()] = '\0'; + CPPUNIT_ASSERT (!message.compare (gzipChainDecomp)); } - void tearDown() + void testCycleLogWithGzipChain () { + u_long cycleLog = 40; + list filters; + string message ("The quick brown fox jumped over the lazy dog."); + string message1 ("Yet another short log message."); + File f; + char gzipComp[128]; + char gzipDecomp[128]; + GzipDecompress gzdc; + u_long nbr = 0; + list cs; + list::iterator it; + + filters.push_back ("gzip"); + lm->addLogStream ("file://foo", filters, cycleLog); + lm->log (message); + CPPUNIT_ASSERT (!lm->log (message1)); + f.openFile ("foo", FileStream::defaultFileMask); + f.read (gzipComp, 128, &nbr); + f.close (); + gzdc.decompress (&gzipComp[gzdc.headerSize ()], + nbr - gzdc.headerSize (), + gzipDecomp, 128); + gzipDecomp[message1.size ()] = '\0'; + CPPUNIT_ASSERT (!message1.compare (gzipDecomp)); + cs = lm->getLogStream ("file://foo")->getCycledStreams (); + for (it = cs.begin (); it != cs.end (); it++) + { + f.openFile (*it, FileStream::defaultFileMask); + f.read (gzipComp, 128, &nbr); + f.close (); + gzdc.decompress (&gzipComp[gzdc.headerSize ()], + nbr - gzdc.headerSize (), + gzipDecomp, 128); + gzipDecomp[message.size ()] = '\0'; + CPPUNIT_ASSERT (!message.compare (gzipDecomp)); + CPPUNIT_ASSERT (!FilesUtility::deleteFile (*it)); + } + } + + void tearDown () + { delete lm; delete lsf; delete ff; Modified: trunk/myserver/tests/test_socket_stream_creator.cpp =================================================================== --- trunk/myserver/tests/test_socket_stream_creator.cpp 2008-09-24 19:43:55 UTC (rev 2841) +++ trunk/myserver/tests/test_socket_stream_creator.cpp 2008-09-26 22:36:01 UTC (rev 2842) @@ -55,7 +55,7 @@ void testGetHost () { - CPPUNIT_ASSERT (!ssc->getHost ("foohost:8081").compare (string ("foohost"))); + CPPUNIT_ASSERT (!ssc->getHost ("foohost:8081").compare ("foohost")); } void tearDown () From MAILER-DAEMON Fri Sep 26 19:47:37 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjN28-0004vx-U0 for mharc-myserver-commit@gnu.org; Fri, 26 Sep 2008 19:47:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjN25-0004qq-FJ for myserver-commit@gnu.org; Fri, 26 Sep 2008 19:47:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjN22-0004mn-WC for myserver-commit@gnu.org; Fri, 26 Sep 2008 19:47:31 -0400 Received: from [199.232.76.173] (port=41722 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjN22-0004m1-5k for myserver-commit@gnu.org; Fri, 26 Sep 2008 19:47:30 -0400 Received: from savannah.gnu.org ([199.232.41.3]:41095 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjN21-0002nn-4b for myserver-commit@gnu.org; Fri, 26 Sep 2008 19:47:29 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjN20-00040r-Kg for myserver-commit@gnu.org; Fri, 26 Sep 2008 23:47:28 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjN20-00040n-Bc for myserver-commit@gnu.org; Fri, 26 Sep 2008 23:47:28 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Fri, 26 Sep 2008 23:47:28 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2843] Use `RTLD_DEEPBIND' in the `dlopen' flags when it is available. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2008 23:47:35 -0000 Revision: 2843 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2843 Author: gscrivano Date: 2008-09-26 23:47:27 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Use `RTLD_DEEPBIND' in the `dlopen' flags when it is available. Modified Paths: -------------- trunk/myserver/binaries/web/cgi-src/post/post.cpp trunk/myserver/src/base/dynamic_lib/dynamiclib.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/binaries/web/cgi-src/post/post.cpp =================================================================== --- trunk/myserver/binaries/web/cgi-src/post/post.cpp 2008-09-26 22:36:01 UTC (rev 2842) +++ trunk/myserver/binaries/web/cgi-src/post/post.cpp 2008-09-26 23:47:27 UTC (rev 2843) @@ -6,7 +6,7 @@ extern "C" int myserver_main (char *cmd,MsCgiData* data) #endif { - MscgiManager cm(data); + MscgiManager cm(data); if(strlen(cmd)==0) { cm.write("\r\n) id 1KjXxf-000860-Fr for myserver-commit@gnu.org; Sat, 27 Sep 2008 07:27:43 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjXxe-00050m-N1 for myserver-commit@gnu.org; Sat, 27 Sep 2008 11:27:42 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjXxe-00050i-95 for myserver-commit@gnu.org; Sat, 27 Sep 2008 11:27:42 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 27 Sep 2008 11:27:42 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2844] Fixed a problem with reboots. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 11:27:45 -0000 Revision: 2844 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2844 Author: gscrivano Date: 2008-09-27 11:27:41 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Fixed a problem with reboots. Some dependencies to the `Server' singleton instance were removed. Modified Paths: -------------- trunk/myserver/include/server/clients_thread.h trunk/myserver/include/server/server.h trunk/myserver/src/connections_scheduler/connections_scheduler.cpp trunk/myserver/src/server/clients_thread.cpp trunk/myserver/src/server/server.cpp trunk/myserver/tests/test_connection.cpp Modified: trunk/myserver/include/server/clients_thread.h =================================================================== --- trunk/myserver/include/server/clients_thread.h 2008-09-26 23:47:27 UTC (rev 2843) +++ trunk/myserver/include/server/clients_thread.h 2008-09-27 11:27:41 UTC (rev 2844) @@ -22,50 +22,53 @@ #include #include #include -#include #include -#include -#include -class Ftp; +class FtpParser; +class HttpProtocol; +class HttpsProtocol; +class ControlProtocol; +class Server; + + class ClientsThread { - friend class Server; + friend class Server; #ifdef WIN32 - friend unsigned int __stdcall clients_thread(void* pParam); + friend unsigned int __stdcall clients_thread(void* pParam); #endif #ifdef HAVE_PTHREAD - friend void* clients_thread(void* pParam); + friend void* clients_thread(void* pParam); #endif public: - enum RETURN_CODE - { - /*! - *Delete the current connection from the connections pool. - */ - DELETE_CONNECTION = 0, - /*! - *Keep the connection in the connections pool waiting for new data. - */ - KEEP_CONNECTION = 1, - /*! - *The request present in the connection buffer is not complete, keep - *data in the buffer and append to it. - */ - INCOMPLETE_REQUEST = 2, - /*! - *The request present in the buffer is not complete, append to the buffer - *and check before new data is present. - */ - INCOMPLETE_REQUEST_NO_WAIT = 3 - }; - MemBuf *getBuffer(); - MemBuf *getBuffer2(); - ClientsThread(); - ~ClientsThread(); - void stop(); + enum RETURN_CODE + { + /*! + *Delete the current connection from the connections pool. + */ + DELETE_CONNECTION = 0, + /*! + *Keep the connection in the connections pool waiting for new data. + */ + KEEP_CONNECTION = 1, + /*! + *The request present in the connection buffer is not complete, keep + *data in the buffer and append to it. + */ + INCOMPLETE_REQUEST = 2, + /*! + *The request present in the buffer is not complete, append to the buffer + *and check before new data is present. + */ + INCOMPLETE_REQUEST_NO_WAIT = 3 + }; + MemBuf *getBuffer(); + MemBuf *getBuffer2(); + ClientsThread(Server* server); + ~ClientsThread(); + void stop(); int getTimeout(); void setTimeout(int); int isToDestroy(); @@ -73,31 +76,34 @@ int isStatic(); int isBusy(); void setStatic(int); - int run(); - ThreadID getThreadId(){return tid;} + int run(); + ThreadID getThreadId(){return tid;} int join(); + + private: - ThreadID tid; + Server* server; + ThreadID tid; int toDestroy; int timeout; - int initialized; + int initialized; int staticThread; - u_long id; + u_long id; int busy; - int threadIsStopped; - int threadIsRunning; - u_long buffersize; - u_long buffersize2; - int isRunning(); - int isStopped(); - HttpProtocol* httpParser; - HttpsProtocol* httpsParser; - ControlProtocol *controlProtocolParser; - Ftp *ftpParser; - MemBuf buffer; - MemBuf buffer2; - int controlConnections(); - u_long nBytesToRead; + int threadIsStopped; + int threadIsRunning; + u_long buffersize; + u_long buffersize2; + int isRunning(); + int isStopped(); + FtpParser *ftpParser; + HttpProtocol* httpParser; + HttpsProtocol* httpsParser; + ControlProtocol *controlProtocolParser; + MemBuf buffer; + MemBuf buffer2; + int controlConnections(); + u_long nBytesToRead; }; #ifdef WIN32 Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-26 23:47:27 UTC (rev 2843) +++ trunk/myserver/include/server/server.h 2008-09-27 11:27:41 UTC (rev 2844) @@ -60,8 +60,6 @@ void* listenServer(void* pParam); #endif -extern int rebootMyServerConsole; - class Server : public MulticastRegistry { public: @@ -93,12 +91,12 @@ int countAvailableThreads(); void checkThreadsNumber(); int removeThread(u_long ID); - int isServerReady(); + bool isServerReady(); ProtocolsManager* getProtocolsManager(); void disableAutoReboot(); void enableAutoReboot(); - int isAutorebootEnabled(); - int isRebooting(){return rebooting;} + bool isAutorebootEnabled(); + bool isRebooting(){return rebooting;} void rebootOnNextLoop(); const char* getMainConfFile(); const char* getVhostConfFile(); @@ -150,10 +148,12 @@ void setProcessPermissions(); ConnectionsScheduler* getConnectionsScheduler(){return &connectionsScheduler;} - int deleteConnection(ConnectionPtr, int); + int deleteConnection(ConnectionPtr); void increaseFreeThread(); void decreaseFreeThread(); + + private: friend class ClientsThread; #ifdef WIN32 @@ -177,6 +177,7 @@ void mainLoop(); void loadPlugins(); void displayBoot(); + int postLoad(); CachedFileFactory cachedFiles; @@ -193,16 +194,16 @@ u_long uid; u_long gid; int currentThreadID; - /*! Used when rebooting to load new configuration files. */ - int pausing; ProtocolsManager protocols; XmlParser configurationFileManager; XmlParser languageParser; - int autoRebootEnabled; - int toReboot; - int rebooting; + + bool autoRebootEnabled; + bool toReboot; + bool rebooting; + LogManager logManager; - int serverReady; + bool serverReady; u_long verbosity; u_long throttlingRate; u_long buffersize; @@ -214,7 +215,7 @@ string* externalPath; string* serverAdmin; int initialize(); - int addThread(int staticThread = 0); + int addThread(bool staticThread = false); ConnectionPtr addConnectionToList(Socket* s, MYSERVER_SOCKADDRIN *asock_in, char *ipAddr, char *localIpAddr, u_short port, u_short localPort, int); Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-26 23:47:27 UTC (rev 2843) +++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-27 11:27:41 UTC (rev 2844) @@ -167,11 +167,15 @@ if(event == EV_TIMEOUT) { - server->deleteConnection(connection, 0); + if(!connection->allowDelete()) + return; + + server->deleteConnection(connection); + removeConnection(connection); } else if(event == EV_READ) { - server->getConnectionsScheduler()->addReadyConnection(connection); + addReadyConnection(connection); } } @@ -207,7 +211,7 @@ event_once(handle, EV_READ | EV_TIMEOUT, newDataHandler, da, &tv); } if(cmd == 'r') - break; + return; /* Handle other cmd without do anything else. */ } @@ -587,6 +591,8 @@ if(dispatchedThreadId) Thread::join(dispatchedThreadId); + terminateConnections(); + eventsMutex.lock(); list::iterator it = listeners.begin(); @@ -606,8 +612,6 @@ listeners.clear(); eventsMutex.unlock(); - - terminateConnections(); } /*! @@ -645,6 +649,7 @@ if(connection->socket) connections.remove(connection->socket->getHandle()); connectionsMutex.unlock(); + delete connection; } /*! @@ -662,7 +667,7 @@ for(; it != connections.end(); it++) { ConnectionPtr c = *it; - if ( c->allowDelete(true) && c->socket) + if (c->allowDelete(true) && c->socket) c->socket->close(); } } Modified: trunk/myserver/src/server/clients_thread.cpp =================================================================== --- trunk/myserver/src/server/clients_thread.cpp 2008-09-26 23:47:27 UTC (rev 2843) +++ trunk/myserver/src/server/clients_thread.cpp 2008-09-27 11:27:41 UTC (rev 2844) @@ -16,15 +16,18 @@ */ #include "stdafx.h" +#include + #include #include -#include #include -#include -#include #include #include + +#include #include +#include +#include #include #ifdef NOT_WIN @@ -48,13 +51,15 @@ /*! *Construct the object. */ -ClientsThread::ClientsThread() +ClientsThread::ClientsThread(Server* server) { + this->server = server; busy = 0; initialized = 0; toDestroy = 0; staticThread = 0; nBytesToRead = 0; + httpParser = 0; httpsParser = 0; controlProtocolParser = 0; @@ -124,8 +129,6 @@ #endif { - Server* server = Server::getInstance(); - #ifdef NOT_WIN /* Block SigTerm, SigInt, and SigPipe in threads. */ sigset_t sigmask; @@ -148,8 +151,8 @@ ct->threadIsRunning = 1; ct->threadIsStopped = 0; - ct->buffersize = server->getInstance()->getBuffersize(); - ct->buffersize2 = server->getInstance()->getBuffersize2(); + ct->buffersize = ct->server->getBuffersize(); + ct->buffersize2 = ct->server->getBuffersize2(); ct->buffer.setLength(ct->buffersize); ct->buffer.m_nSizeLimit = ct->buffersize; @@ -163,11 +166,10 @@ ct->initialized = 1; - Server::getInstance()->increaseFreeThread(); + ct->server->increaseFreeThread(); - /* Wait that the server is ready before go in the running loop. */ - while(!server->isServerReady() && ct->threadIsRunning) + while(!ct->server->isServerReady() && ct->threadIsRunning) { Thread::wait(500); } @@ -191,7 +193,7 @@ } ret = ct->controlConnections(); - Server::getInstance()->increaseFreeThread(); + ct->server->increaseFreeThread(); ct->busy = 0; /* @@ -207,23 +209,24 @@ ostringstream s; s << "Bad alloc: " << ba.what(); - Server::getInstance()->logPreparePrintError(); - Server::getInstance()->logWriteln(s.str().c_str()); - Server::getInstance()->logEndPrintError(); + ct->server->logPreparePrintError(); + ct->server->logWriteln(s.str().c_str()); + ct->server->logEndPrintError(); } catch( exception &e) { ostringstream s; s << "Error: " << e.what(); - Server::getInstance()->logPreparePrintError(); - Server::getInstance()->logWriteln(s.str().c_str()); - Server::getInstance()->logEndPrintError(); + ct->server->logPreparePrintError(); + ct->server->logWriteln(s.str().c_str()); + ct->server->logEndPrintError(); }; } - Server::getInstance()->decreaseFreeThread(); + ct->server->decreaseFreeThread(); + delete ct; Thread::terminate(); @@ -303,10 +306,11 @@ Protocol* protocol = 0; u_long dataRead = 0; - c = Server::getInstance()->getConnection(this->id); - Server::getInstance()->decreaseFreeThread(); + c = server->getConnection(this->id); + server->decreaseFreeThread(); + /* *Check if c is a valid connection structure. */ @@ -319,7 +323,7 @@ err = c->socket->recv(&((char*)(buffer.getBuffer()))[dataRead], MYSERVER_KB(8) - dataRead - 1, 0); - if(err == -1 && !Server::getInstance()->deleteConnection(c, this->id)) + if(err == -1 && !server->deleteConnection(c)) return 0; buffer.setLength(dataRead + err); @@ -336,7 +340,7 @@ } else { - Server::getInstance()->deleteConnection(c, this->id); + server->deleteConnection(c); return 0; } @@ -365,7 +369,7 @@ } else { - protocol = Server::getInstance()->getProtocol(c->host->getProtocolName()); + protocol = server->getProtocol(c->host->getProtocolName()); if(protocol) { retcode = protocol->controlConnection(c, @@ -388,14 +392,14 @@ /*! Delete the connection. */ if(retcode == DELETE_CONNECTION) { - Server::getInstance()->deleteConnection(c, this->id); + server->deleteConnection(c); return 0; } /*! Keep the connection. */ else if(retcode == KEEP_CONNECTION) { c->connectionBuffer.setLength(0); - Server::getInstance()->getConnectionsScheduler()->addWaitingConnection(c); + server->getConnectionsScheduler()->addWaitingConnection(c); } /*! Incomplete request to buffer. */ else if(retcode == INCOMPLETE_REQUEST) @@ -406,13 +410,13 @@ *Save the header in the connection buffer. */ c->connectionBuffer.setBuffer(buffer.getBuffer(), nBytesToRead); - Server::getInstance()->getConnectionsScheduler()->addWaitingConnection(c); + server->getConnectionsScheduler()->addWaitingConnection(c); } /* Incomplete request to check before new data is available. */ else if(retcode == INCOMPLETE_REQUEST_NO_WAIT) { c->setForceControl(1); - Server::getInstance()->getConnectionsScheduler()->addReadyConnection(c); + server->getConnectionsScheduler()->addReadyConnection(c); } c->setTimeout( getTicks() ); Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-26 23:47:27 UTC (rev 2843) +++ trunk/myserver/src/server/server.cpp 2008-09-27 11:27:41 UTC (rev 2844) @@ -77,12 +77,11 @@ Server::Server() : connectionsScheduler(this), listenThreads(&connectionsScheduler, this) { - toReboot = 0; - autoRebootEnabled = 1; - pausing = 0; - rebooting = 0; + toReboot = false; + autoRebootEnabled = true; + rebooting = false; maxConnections = 0; - serverReady = 0; + serverReady = false; throttlingRate = 0; uid = 0; gid = 0; @@ -289,12 +288,8 @@ */ void Server::start(string &mainConf, string &mimeConf, string &vhostConf, string &externPath, string &langPath) { - u_long i; - string buffer; int err = 0; int ret; - ostringstream nCPU; - string strCPU; #ifdef WIN32 DWORD eventsCount, cNumRead; INPUT_RECORD irInBuf[128]; @@ -328,101 +323,9 @@ logWriteln( languageParser.getValue("MSG_SERVER_CONF") ); - /* - *Get the name of the local machine. - */ - memset(serverName, 0, HOST_NAME_MAX+1); - Socket::gethostname(serverName, HOST_NAME_MAX); - - buffer.assign(languageParser.getValue("MSG_GETNAME")); - buffer.append(" "); - buffer.append(serverName); - logWriteln(buffer.c_str()); - - /* - *Find the IP addresses of the local machine. - */ - if(ipAddresses) - delete ipAddresses; - ipAddresses = new string(); - buffer.assign("Host: "); - buffer.append(serverName); - logWriteln(buffer.c_str() ); - - if(Socket::getLocalIPsList(*ipAddresses)) - { - string msg; - msg.assign(languageParser.getValue("ERR_ERROR")); - msg.append(" : Reading IP list"); - logPreparePrintError(); - logWriteln(msg.c_str()); - logEndPrintError(); + if(postLoad()) return; - } - else - { - string msg; - msg.assign("IP: "); - msg.append(*ipAddresses); - logWriteln(msg.c_str()); - } - /* Load the MIME types. */ - logWriteln(languageParser.getValue("MSG_LOADMIME")); - if(mimeManager) - delete mimeManager; - mimeManager = new MimeManager(); - - if(int nMIMEtypes = mimeManager->loadXML(mimeConfigurationFile->c_str())) - { - ostringstream stream; - stream << languageParser.getValue("MSG_MIMERUN") << ": " << nMIMEtypes; - logWriteln(stream.str().c_str()); - } - else - { - logPreparePrintError(); - logWriteln(languageParser.getValue("ERR_LOADMIME")); - logEndPrintError(); - } - - nCPU << (u_int)getCPUCount(); - - strCPU.assign(languageParser.getValue("MSG_NUM_CPU")); - strCPU.append(" "); - strCPU.append(nCPU.str()); - logWriteln(strCPU.c_str()); - - connectionsScheduler.restart(); - - listenThreads.initialize(&languageParser); - - if(vhostList) - delete vhostList; - - vhostList = new VhostManager(&listenThreads); - - if(vhostList == NULL) - return; - - getProcessServerManager()->load(); - - /* Load the home directories configuration. */ - homeDir.load(); - - loadPlugins(); - - /* Load the virtual hosts configuration from the xml file. */ - vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), - getMaxLogFileSize()); - - - if(path == 0) - path = new string(); - - if(getdefaultwd(*path)) - return; - setProcessPermissions(); if(getGid()) @@ -439,23 +342,12 @@ logWriteln(out.str().c_str()); } - for(i = 0; i < nStaticThreads; i++) - { - logWriteln(languageParser.getValue("MSG_CREATET")); - ret = addThread(1); - - if(ret) - return; - - logWriteln(languageParser.getValue("MSG_THREADR")); - } - logWriteln(languageParser.getValue("MSG_READY")); if(logManager.getType() == LogManager::TYPE_CONSOLE) logWriteln(languageParser.getValue("MSG_BREAK")); - serverReady = 1; + serverReady = true; /* Finally we can give control to the main loop. */ mainLoop(); @@ -482,6 +374,124 @@ } /*! + *Complete the loading phase. + */ +int Server::postLoad() +{ + ostringstream nCPU; + string strCPU; + string buffer; + + /* + *Get the name of the local machine. + */ + memset(serverName, 0, HOST_NAME_MAX+1); + Socket::gethostname(serverName, HOST_NAME_MAX); + + buffer.assign(languageParser.getValue("MSG_GETNAME")); + buffer.append(" "); + buffer.append(serverName); + logWriteln(buffer.c_str()); + + /* + *Find the IP addresses of the local machine. + */ + if(ipAddresses) + delete ipAddresses; + ipAddresses = new string(); + buffer.assign("Host: "); + buffer.append(serverName); + logWriteln(buffer.c_str() ); + + if(Socket::getLocalIPsList(*ipAddresses)) + { + string msg; + msg.assign(languageParser.getValue("ERR_ERROR")); + msg.append(" : Reading IP list"); + logPreparePrintError(); + logWriteln(msg.c_str()); + logEndPrintError(); + return -1; + } + else + { + string msg; + msg.assign("IP: "); + msg.append(*ipAddresses); + logWriteln(msg.c_str()); + } + + /* Load the MIME types. */ + logWriteln(languageParser.getValue("MSG_LOADMIME")); + + if(mimeManager) + delete mimeManager; + + mimeManager = new MimeManager(); + + if(int nMIMEtypes = mimeManager->loadXML(mimeConfigurationFile->c_str())) + { + ostringstream stream; + stream << languageParser.getValue("MSG_MIMERUN") << ": " << nMIMEtypes; + logWriteln(stream.str().c_str()); + } + else + { + logPreparePrintError(); + logWriteln(languageParser.getValue("ERR_LOADMIME")); + logEndPrintError(); + } + + nCPU << (u_int)getCPUCount(); + + strCPU.assign(languageParser.getValue("MSG_NUM_CPU")); + strCPU.append(" "); + strCPU.append(nCPU.str()); + logWriteln(strCPU.c_str()); + + connectionsScheduler.restart(); + + listenThreads.initialize(&languageParser); + + if(vhostList) + delete vhostList; + + vhostList = new VhostManager(&listenThreads); + + if(vhostList == NULL) + return -1; + + getProcessServerManager()->load(); + + /* Load the home directories configuration. */ + homeDir.load(); + + loadPlugins(); + + /* Load the virtual hosts configuration from the xml file. */ + vhostList->loadXMLConfigurationFile(vhostConfigurationFile->c_str(), + getMaxLogFileSize()); + + + if(path == 0) + path = new string(); + + if(getdefaultwd(*path)) + return -1; + + for(u_long i = 0; i < nStaticThreads; i++) + { + logWriteln(languageParser.getValue("MSG_CREATET")); + if(addThread(true)) + return -1; + + logWriteln(languageParser.getValue("MSG_THREADR")); + } + + return 0; +} + +/*! *Load the plugins. */ void Server::loadPlugins() @@ -625,10 +635,8 @@ listenThreads.terminate(); - connectionsScheduler.terminateConnections(); clearAllConnections(); - Socket::stopBlockingOperations(false); connectionsScheduler.restart(); @@ -918,7 +926,7 @@ if(verbosity > 1) { - logWriteln(languageParser.getValue("MSG_MEMCLEAN")); + logWriteln(languageParser.getValue("MSG_MEMCLEAN")); } freeHashedData(); @@ -931,15 +939,19 @@ languageParser.close(); if(mimeManager) + { mimeManager->clean(); - delete mimeManager; - mimeManager = 0; + delete mimeManager; + mimeManager = 0; + } + #ifdef WIN32 /* *Under WIN32 cleanup environment strings. */ FreeEnvironmentStrings((LPTSTR)envString); #endif + getProcessServerManager()->clear(); filtersFactory.free(); @@ -1010,7 +1022,7 @@ if(serverAdmin) delete serverAdmin; serverAdmin = 0; - autoRebootEnabled = 1; + autoRebootEnabled = false; if(configurationFileManager.open(mainConfigurationFile->c_str())) return -1; @@ -1207,9 +1219,8 @@ *we did not reach the limit. */ if((threads.size() < nMaxThreads) && (freeThreads < 1)) - { - addThread(0); - } + addThread(false); + threadsMutex->unlock(); } @@ -1472,22 +1483,13 @@ } /*! - *Delete a connection from the list. + *Get notified when a connection is closed. */ -int Server::deleteConnection(ConnectionPtr s, int /*id*/) +int Server::deleteConnection(ConnectionPtr s) { string msg("remove-connection"); vector*>* handlers; - int ret = 0; - /* - *Remove the connection from the active connections list. - */ - if(!s || !s->allowDelete()) - { - return 0; - } - handlers = getHandlers(msg); if(handlers) @@ -1497,12 +1499,7 @@ (*handlers)[i]->updateMulticast(this, msg, s); } } - - connectionsScheduler.removeConnection(s); - - delete s; - - return ret; + return 0; } /*! @@ -1527,7 +1524,7 @@ { for(it = connections.begin(); it != connections.end(); it++) { - deleteConnection(*it, 1); + deleteConnection(*it); } } catch(...) @@ -1673,7 +1670,7 @@ logWriteln(out.str().c_str()); logEndPrintError(); } - autoRebootEnabled = 0; + autoRebootEnabled = false; } /* @@ -1691,7 +1688,7 @@ logWriteln(out.str().c_str()); logEndPrintError(); } - autoRebootEnabled = 0; + autoRebootEnabled = false; } } @@ -1727,16 +1724,14 @@ if(handlers) { for(size_t i = 0; i < handlers->size(); i++) - { (*handlers)[i]->updateMulticast(this, msg, 0); - } } - serverReady = 0; + serverReady = false; /* Reset the toReboot flag. */ - toReboot = 0; + toReboot = false; - rebooting = 1; + rebooting = true; /* Do nothing if the reboot is disabled. */ if(!autoRebootEnabled) @@ -1761,13 +1756,14 @@ mustEndServer = false; - rebooting = 0; + rebooting = false; - ret = initialize(); + ret = initialize() || postLoad(); if(ret) return ret; + serverReady = true; logWriteln("Rebooted"); @@ -1777,7 +1773,7 @@ /*! *Returns if the server is ready. */ -int Server::isServerReady() +bool Server::isServerReady() { return serverReady; } @@ -1787,8 +1783,8 @@ */ void Server::rebootOnNextLoop() { - serverReady = 0; - toReboot = 1; + serverReady = false; + toReboot = true; } @@ -1838,7 +1834,7 @@ */ void Server::disableAutoReboot() { - autoRebootEnabled = 0; + autoRebootEnabled = false; } /*! @@ -1846,7 +1842,7 @@ */ void Server::enableAutoReboot() { - autoRebootEnabled = 1; + autoRebootEnabled = true; } @@ -1877,7 +1873,7 @@ /*! *Return nonzero if the autoreboot is enabled. */ -int Server::isAutorebootEnabled() +bool Server::isAutorebootEnabled() { return autoRebootEnabled; } @@ -1885,7 +1881,7 @@ /*! *Create a new thread. */ -int Server::addThread(int staticThread) +int Server::addThread(bool staticThread) { int ret; string msg("new-thread"); @@ -1916,7 +1912,7 @@ return 0; } - newThread = new ClientsThread(); + newThread = new ClientsThread(this); if(newThread == 0) return -1; @@ -1949,9 +1945,6 @@ return -1; } - /* - *If everything was done correctly add the new thread to the linked list. - */ threads.push_back(newThread); return 0; } Modified: trunk/myserver/tests/test_connection.cpp =================================================================== --- trunk/myserver/tests/test_connection.cpp 2008-09-26 23:47:27 UTC (rev 2843) +++ trunk/myserver/tests/test_connection.cpp 2008-09-27 11:27:41 UTC (rev 2844) @@ -92,7 +92,7 @@ void testActiveThread() { - ClientsThread *ct = new ClientsThread(); + ClientsThread *ct = new ClientsThread(NULL); connection->setActiveThread(ct); From MAILER-DAEMON Sat Sep 27 07:35:50 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjY5W-00079Y-TN for mharc-myserver-commit@gnu.org; Sat, 27 Sep 2008 07:35:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjY5V-00079R-MF for myserver-commit@gnu.org; Sat, 27 Sep 2008 07:35:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjY5V-00079E-6C for myserver-commit@gnu.org; Sat, 27 Sep 2008 07:35:49 -0400 Received: from [199.232.76.173] (port=37755 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjY5V-00079B-2t for myserver-commit@gnu.org; Sat, 27 Sep 2008 07:35:49 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53895 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjY5U-0000nS-Mu for myserver-commit@gnu.org; Sat, 27 Sep 2008 07:35:48 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjY5U-0005Kp-6e for myserver-commit@gnu.org; Sat, 27 Sep 2008 11:35:48 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjY5U-0005Kl-03 for myserver-commit@gnu.org; Sat, 27 Sep 2008 11:35:48 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 27 Sep 2008 11:35:48 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2845] Fixed segfault in the `TestConnectionsScheduler' test class. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 11:35:49 -0000 Revision: 2845 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2845 Author: gscrivano Date: 2008-09-27 11:35:47 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Fixed segfault in the `TestConnectionsScheduler' test class. Modified Paths: -------------- trunk/myserver/tests/test_connections_scheduler.cpp Modified: trunk/myserver/tests/test_connections_scheduler.cpp =================================================================== --- trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-27 11:27:41 UTC (rev 2844) +++ trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-27 11:35:47 UTC (rev 2845) @@ -220,8 +220,7 @@ scheduler->removeConnection(conn); CPPUNIT_ASSERT_EQUAL(scheduler->getNumTotalConnections(), 0ul); - - delete conn; + //The connection is freed by the scheduler. } From MAILER-DAEMON Sat Sep 27 10:23:06 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjahO-0001fg-Gg for mharc-myserver-commit@gnu.org; Sat, 27 Sep 2008 10:23:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjahM-0001dy-Gf for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:23:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjahK-0001b7-Ny for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:23:04 -0400 Received: from [199.232.76.173] (port=35306 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjahK-0001b4-In for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:23:02 -0400 Received: from savannah.gnu.org ([199.232.41.3]:34546 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjahJ-0003FV-Po for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:23:02 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjahF-0002tU-Ck for myserver-commit@gnu.org; Sat, 27 Sep 2008 14:22:57 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjahF-0002tQ-14 for myserver-commit@gnu.org; Sat, 27 Sep 2008 14:22:57 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Sat, 27 Sep 2008 14:22:57 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2846] Added a first document scratch about the new log management usage. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 14:23:05 -0000 Revision: 2846 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2846 Author: francesco_pipita Date: 2008-09-27 14:22:55 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Added a first document scratch about the new log management usage. Modified Paths: -------------- trunk/myserver/documentation/myserver.texi Added Paths: ----------- trunk/myserver/documentation/log_management.texi Added: trunk/myserver/documentation/log_management.texi =================================================================== --- trunk/myserver/documentation/log_management.texi (rev 0) +++ trunk/myserver/documentation/log_management.texi 2008-09-27 14:22:55 UTC (rev 2846) @@ -0,0 +1,115 @@ +@c -*-texinfo-*- + +@section Overview of the log management features +The MyServer's log management system was designed to support logging +over different targets. By default, log messages can be sent to a file, +to a socket and of course to the console. The main class which achieves +logging tasks is still the @code{LogManager} class. One single instance +of it can now handle multiple targets. These targets are called +@code{LogStream} objects. In addition, it is possible to provide a list +of filters (e.g. the Gzip filter) to each @code{LogStream} object. This +offers interesting possibilities, like logging over a TCP Socket while +taking advantage of the Gzip compression. The new @code{LogManager} also +ensures that all the operations that modify its internal data +structures, through its interface, are atomics. + +@section Use of the new LogManager interface +This section introduces the use of the new @code{LogManager}'s +interface. + +@subsection Construction +The @code{LogManager} constructor, requires an instance of +@code{FiltersFactory}, an instance of @code{LogStreamFactory} and a +logging level, choosen between @code{INFO, WARNING, ERROR}. The third +parameter is optional. +@example +LogManager (FiltersFactory* filtersFactory, + LogStreamFactory* logStreamFactory, + LoggingLevel level = WARNING); +@end example + + +@subsection Adding a new LogStream target +The adding of a new @code{LogStream} target can be done calling the +@code{addLogStream} method over an instance of the +@code{LogManager}. Below, we can look at the method signature : +@example +int addLogStream (string location, + list& filters, + u_long cycleLog); +@end example +The @code{location} string holds the location where the @code{LogStream} +will point to as well as the protocol it will use. That string must +follow a special syntax, that will be covered in next section. The +@code{filters} parameter holds a list of filter names that will be added +to the @code{LogStream}. Finally, the @code{cycleLog} parameter holds +the max size, in bytes, that the new @code{LogStream} can reach. Over +that limit, the @code{LogStream} will be cycled, that is, its content +will be saved somewhere else. The current @code{LogStream} will be +emptied and the location name of its saved content, will be available +looking at the latest element of a FIFO queue returned by the +@code{getCycledStreams} method. The @code{addLogStream} method returns a +zero value if the new @code{LogStream} was successful added, a non-zero +value otherwise, according to the MyServer standard. + +@subsubsection Location strings +A location string must be provided in the form +`@code{protocol://path/to/resource}'. The `@code{protocol://}' part is +used by the @code{LogStreamFactory} to fetch the proper constructor for +the new object that it will create. The `@code{path/to/resource}' part, +instead, is used within the @code{LogStreamCreator}. The +@code{LogStream} creation process, must ensure, through checks at +increasing depth levels, that only valid @code{LogStream} objects can +be returned. For example, syntactically a location string like +`@code{socket://foo_host:-1}' is correct, but of course, the +`@code{path/to/resource}' part doesn't represent any valid host:port +pair for a socket. So giving a such location string, the +@code{addLogStream} method, must fail. + +@subsection Removing an existing LogStream +The interface provides also a method that can detach a @code{LogStream} +from the @code{LogManager}. Here is the method signature : +@example +int removeLogStream (string location); +@end example +It will remove the @code{LogStream} that points to @code{location}. If +the provided location doesn't belong to the @code{LogManager}, the +method doesn't nothing and it simply returns a non-zero value. + +@subsection Adding new LogStream classes +To add new targets which can be used within the @code{LogManager}, you +have to subclass the @code{LogStream} class. Then, if needed, override +the following virtual methods : +@example +virtual u_long streamSize (); +virtual int streamCycle (); +@end example +The first one should return the size of the @code{Stream} owned by the +@code{LogStream} while the second should manage its cycling process. The +return value for the latter method must conform with the MyServer +standard. The next step is to subclass @code{LogStreamCreator}, +overriding the @code{create} abstract method. Finally, you have to add +the new @code{LogStreamCreator} to the @code{LogStreamFactory}, merely +adding a line to its constructor, something that looks like : +@example +logStreamCreators["foo://"] = new FooStreamCreator (); +@end example + +@subsection Writing log messages on the LogStream objects +To log messages, simply call the method @code{log} on a +@code{LogManager} object. That method takes three parameters, but only +the first one is needed. +@example +int log (string message, + LoggingLevel level = WARNING, + string location = "all"); +@end example +The first parameter represent a message to output on the log. The +@code{level} parameter represent the @code{LoggingLevel} of the incoming +message. If it is lesser than the @code{LogManager}'s logging level, the +@code{LogManager} discards the message. The @code{location} parameter +tells the @code{LogManager} to output the message only to the specified +location. By default, if no @code{location} is provided, the +@code{LogManager} will log the message on all its +@code{LogStream} objects. If a non-valid or non-existent location is +provided, the @code{LogManager} simply discards the message. Property changes on: trunk/myserver/documentation/log_management.texi ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/myserver/documentation/myserver.texi =================================================================== --- trunk/myserver/documentation/myserver.texi 2008-09-27 11:35:47 UTC (rev 2845) +++ trunk/myserver/documentation/myserver.texi 2008-09-27 14:22:55 UTC (rev 2846) @@ -72,6 +72,7 @@ * MIME types:: MIME types configuration. * Process security:: Process security. * SSL certificates:: Show how to use SSL certificates. +* Log management:: Describe how to use the log management features. * Concept Index:: An item for each concept. @end menu @@ -104,12 +105,17 @@ @cindex Process security @include process_security.texi -@node SSL certificates, Concept Index, Process security, Top +@node SSL certificates, Log management, Process security, Top @chapter SSL certificates @cindex SSL certificates @include ssl_certificates.texi -@node Concept Index, , SSL certificates, Top +@node Log management, Concept Index, SSL certificates, Top +@chapter Log management +@cindex Log Management +@include log_management.texi + +@node Concept Index, , Log management, Top @unnumbered Concept Index @printindex cp From MAILER-DAEMON Sat Sep 27 10:36:34 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjauQ-0008Mq-4d for mharc-myserver-commit@gnu.org; Sat, 27 Sep 2008 10:36:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjauO-0008MZ-KR for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:36:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjauN-0008Lz-2Q for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:36:32 -0400 Received: from [199.232.76.173] (port=50023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjauM-0008Le-Uk for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:36:30 -0400 Received: from savannah.gnu.org ([199.232.41.3]:52311 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjauL-00085r-Hs for myserver-commit@gnu.org; Sat, 27 Sep 2008 10:36:30 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjauI-0003HB-PR for myserver-commit@gnu.org; Sat, 27 Sep 2008 14:36:26 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjauI-0003H7-KB for myserver-commit@gnu.org; Sat, 27 Sep 2008 14:36:26 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 27 Sep 2008 14:36:26 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2847] Created branch for the new security implementation. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 14:36:32 -0000 Revision: 2847 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2847 Author: gscrivano Date: 2008-09-27 14:36:26 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Created branch for the new security implementation. Added Paths: ----------- branches/myserver_sec_new/ Copied: branches/myserver_sec_new (from rev 2846, trunk/myserver) From MAILER-DAEMON Sat Sep 27 16:09:02 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kjg69-0007zN-Sd for mharc-myserver-commit@gnu.org; Sat, 27 Sep 2008 16:09:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kjg67-0007xZ-MY for myserver-commit@gnu.org; Sat, 27 Sep 2008 16:08:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kjg65-0007vh-Eb for myserver-commit@gnu.org; Sat, 27 Sep 2008 16:08:58 -0400 Received: from [199.232.76.173] (port=33484 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kjg64-0007vW-LS for myserver-commit@gnu.org; Sat, 27 Sep 2008 16:08:56 -0400 Received: from savannah.gnu.org ([199.232.41.3]:58247 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kjg62-0007kS-PA for myserver-commit@gnu.org; Sat, 27 Sep 2008 16:08:56 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kjg62-0005ZP-Ag for myserver-commit@gnu.org; Sat, 27 Sep 2008 20:08:54 +0000 Received: from ignacy by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kjg61-0005ZK-VH for myserver-commit@gnu.org; Sat, 27 Sep 2008 20:08:54 +0000 MIME-Version: 1.0 Errors-To: ignacy To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ignacy Moryc Message-Id: Date: Sat, 27 Sep 2008 20:08:53 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2848] Added MIME types in tree view X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 20:09:00 -0000 Revision: 2848 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2848 Author: ignacy Date: 2008-09-27 20:08:53 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Added MIME types in tree view Modified Paths: -------------- trunk/misc/PyGTK_Control/ConfigGUI.py trunk/misc/PyGTK_Control/MIMEtypes.py trunk/misc/PyGTK_Control/XMLGui.glade Modified: trunk/misc/PyGTK_Control/ConfigGUI.py =================================================================== --- trunk/misc/PyGTK_Control/ConfigGUI.py 2008-09-27 14:36:26 UTC (rev 2847) +++ trunk/misc/PyGTK_Control/ConfigGUI.py 2008-09-27 20:08:53 UTC (rev 2848) @@ -16,6 +16,7 @@ import sys import gobject + try: import pygtk pygtk.require("2.0") @@ -32,7 +33,6 @@ UI for configurtion tool""" def __init__(self): - """Default constructor for GUI. No params""" # Connect the Glade file self.gladefile = "XMLGui.glade" @@ -79,17 +79,13 @@ renderer=gtk.CellRendererText() # Add list items to tree view - self.insert_row(self.treemodelEXT,None,'ai') - self.insert_row(self.treemodelEXT,None,'aif') - self.insert_row(self.treemodelEXT,None,'aifc') - self.insert_row(self.treemodelEXT,None,'aiff') - self.insert_row(self.treemodelEXT,None,'asc') - self.insert_row(self.treemodelEXT,None,'au') - self.insert_row(self.treemodelEXT,None,'avi') - self.insert_row(self.treemodelEXT,None,'bcpio') - self.insert_row(self.treemodelEXT,None,'bin') - self.insert_row(self.treemodelEXT,None,'bmp') - self.insert_row(self.treemodelEXT,None,'cdf') + # this types are parsed from xml file using helper class MIMEtpe + from MIMEtypes import MIMEtype, ParseTypes + TYPES = ParseTypes("MIMEtypes.xml") + + #populate + for element in TYPES: + self.insert_row(self.treemodelEXT,None,element.ext) self.treeviewEXT.show() Modified: trunk/misc/PyGTK_Control/MIMEtypes.py =================================================================== --- trunk/misc/PyGTK_Control/MIMEtypes.py 2008-09-27 14:36:26 UTC (rev 2847) +++ trunk/misc/PyGTK_Control/MIMEtypes.py 2008-09-27 20:08:53 UTC (rev 2848) @@ -27,9 +27,9 @@ #TODO: Override __str__ method -def ParseTypes(): +def ParseTypes(filename): """ Parse types """ - sock = open("MIMEtypes.xml") + sock = open(filename) tree = ET.parse(sock) sock.close() elem = tree.getroot() @@ -50,7 +50,7 @@ #To test if it works: if __name__ == "__main__": - LIST = ParseTypes() + LIST = ParseTypes("MIMEtypes.xml") for el in LIST: print "=======" print el.ext Modified: trunk/misc/PyGTK_Control/XMLGui.glade =================================================================== --- trunk/misc/PyGTK_Control/XMLGui.glade 2008-09-27 14:36:26 UTC (rev 2847) +++ trunk/misc/PyGTK_Control/XMLGui.glade 2008-09-27 20:08:53 UTC (rev 2848) @@ -1,391 +1,423 @@ - - - + + + - - - True - Myserver configuration tool - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - False - 0 - - - - True - GTK_PACK_DIRECTION_LTR - GTK_PACK_DIRECTION_LTR - - - - True - _File - True - - - - - - - True - gtk-open - True - - - - - - True - gtk-undo - True - - - - - - - True - Run - True - - - - True - gtk-media-play - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - True - as Service - True - - - - - True - gtk-missing-image - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - as Console - True - - - - - True - gtk-bold - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - - True - Stop - True - - - - - True - gtk-stop - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - True - Service - True - - - - - True - gtk-missing-image - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Console - True - - - - - True - gtk-bold - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - - True - gtk-save - True - - - - - - True - gtk-open - True - - - - - - - - - - True - Ser_vice - True - - - - - - - True - Install service - True - - - - - - True - Remove service - True - - - - - - - - - - True - Re_mote - True - - - - - - - True - Login... - True - - - - - True - gtk-go-forward - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Logout - True - - - - - - - True - Get Config - True - - - - - - - True - Send Config - True - - - - - - - True - Connections... - True - - - - - - - True - Reboot.. - True - - - - - - - - - - - True - _Help - True - - - - - - - True - gtk-about - True - - - - - - - - - 0 - False - True - - - - - - True - True - True - True - GTK_POS_TOP - False - False - - - - True - True - - - - - - - - True - 6 - 2 - False - 0 - 0 - - - - True - german.xml + + True + Myserver configuration tool + + + True + + + True + + + True + + + True + _File + True + + + + + True + gtk-open + True + True + + + + + True + gtk-undo + True + True + + + + + + True + Run + True + + + + + True + as Service + True + + + + True + gtk-missing-image + 1 + + + + + + + True + as Console + True + + + + True + gtk-bold + 1 + + + + + + + + + True + gtk-media-play + 1 + + + + + + + True + Stop + True + + + + + + True + Service + True + + + + True + gtk-missing-image + 1 + + + + + + + True + Console + True + + + + True + gtk-bold + 1 + + + + + + + + + True + gtk-stop + 1 + + + + + + + True + gtk-save + True + True + + + + + True + gtk-open + True + True + + + + + + + + + True + Ser_vice + True + + + + + True + Install service + True + + + + + True + Remove service + True + + + + + + + + + True + Re_mote + True + + + + + True + Login... + True + + + + True + gtk-go-forward + 1 + + + + + + + True + Logout + True + + + + + + True + Get Config + True + + + + + + True + Send Config + True + + + + + + True + Connections... + True + + + + + + True + Reboot.. + True + + + + + + + + + + True + _Help + True + + + + + True + gtk-about + True + True + + + + + + + + + False + + + + + True + True + + + True + True + + + + + + True + 6 + 2 + + + True + Memory buffer (in bytes): + GTK_JUSTIFY_RIGHT + + + + + True + Verbosity level: + GTK_JUSTIFY_RIGHT + + + 1 + 2 + + + + + True + Max log file size (in bytes): + GTK_JUSTIFY_RIGHT + + + 2 + 3 + + + + + True + Always active threads: + GTK_JUSTIFY_RIGHT + + + 3 + 4 + + + + + True + Maximum number of threads: + GTK_JUSTIFY_RIGHT + + + 4 + 5 + + + + + True + Language: + GTK_JUSTIFY_RIGHT + + + 5 + 6 + + + + + True + True + 102400 + + + 1 + 2 + + + + + True + True + 1048576 + + + 1 + 2 + 2 + 3 + + + + + True + True + 5 + + + 1 + 2 + 3 + 4 + + + + + True + True + 200 + + + 1 + 2 + 4 + 5 + + + + + True + None +Normal +Higher +Highest + + + 1 + 2 + 1 + 2 + + + + + + True + german.xml itliano.xml russian_koi8r.xml brazilian.xml @@ -396,809 +428,385 @@ spnish.xml - False - True - - - 1 - 2 - 5 - 6 - - - - - - - True - None -Normal -Higher -Highest - False - True - - - 1 - 2 - 1 - 2 - - - - - - - True - True - True - True - 0 - 200 - True - ● - False - - - 1 - 2 - 4 - 5 - - - - - - True - True - True - True - 0 - 5 - True - ● - False - - - 1 - 2 - 3 - 4 - - - - - - True - True - True - True - 0 - 1048576 - True - ● - False - - - 1 - 2 - 2 - 3 - - - - - - True - True - True - True - 0 - 102400 - True - ● - False - - - 1 - 2 - 0 - 1 - - - - - - True - Language: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - - - - - - True - Maximum number of threads: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - - - - - - True - Always active threads: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - - - - - - True - Max log file size (in bytes): - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - - - - - - True - Verbosity level: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - - - - - - True - Memory buffer (in bytes): - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - - - - - True - True - - - - - False - True - - - - - - True - System - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - True - 5 - 3 - False - 0 - 0 - - - - True - Connection time-out (in sec): - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - - - - - - True - Max connections: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - - - - - - True - Gzip compression threshold (in bytes): - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - - - - - - True - Stylesheet - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - - - - - - True - True - True - True - 0 - 60 - True - ● - False - - - 1 - 2 - 0 - 1 - - - - - - True - True - True - True - 0 - 0 - True - ● - False - - - 1 - 2 - 1 - 2 - - - - - - True - True - True - True - 0 - 1048576 - True - ● - False - - - 1 - 2 - 2 - 3 - - - - - - True - True - True - True - 0 - /sys/css/browsestyle.css - True - ● - False - - - 1 - 2 - 3 - 4 - - - - - - True - True - Personalized error pages: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 4 - 5 - - - - - - True - Browse.. - GTK_FILE_CHOOSER_ACTION_OPEN - True - False - False - -1 - - - - 2 - 3 - 3 - 4 - - - - - 0 - True - True - - - - - - True - False - 0 - - - - - - - - True - False - 0 - - - - True - True - False - False - False - True - False - False - False - - - 0 - True - True - - - - - - True - False - 0 - - - - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - False - True - - - - - - True - Server - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - True - True - False - False - True - False - False - False - - - 0 - True - True - - - - - - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - 5 - 2 - False - 0 - 0 - - - - True - True - True - True - 0 - NONE - True - ● - False - - - 1 - 2 - 3 - 4 - - - - - - True - Manager: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - - - - - - True - Send the file + + + 1 + 2 + 5 + 6 + + + + + + True + True + + + + + + + True + System + + + tab + False + + + + + True + + + True + 5 + 3 + + + + + + + + + + + + + + + + + + True + Browse.. + 7 + + + + 2 + 3 + 3 + 4 + + + + + True + True + Personalized error pages: + True + 0 + True + + + 1 + 2 + 4 + 5 + + + + + True + True + /sys/css/browsestyle.css + + + 1 + 2 + 3 + 4 + + + + + True + True + 1048576 + + + 1 + 2 + 2 + 3 + + + + + True + True + 0 + + + 1 + 2 + 1 + 2 + + + + + True + True + 60 + + + 1 + 2 + + + + + True + Stylesheet + + + 3 + 4 + + + + + True + Gzip compression threshold (in bytes): + + + 2 + 3 + + + + + True + Max connections: + + + 1 + 2 + + + + + True + Connection time-out (in sec): + + + + + + + True + + + + + + True + + + True + True + False + + + + + True + + + True + True + gtk-add + True + 0 + + + + False + False + + + + + True + True + gtk-remove + True + 0 + + + + False + False + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + True + Server + + + tab + 1 + False + + + + + True + + + True + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + 300 + True + True + GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + + + + + False + + + + + True + True + gtk-add + True + 0 + + + + False + False + 1 + + + + + True + True + gtk-remove + True + 0 + + + + False + False + 2 + + + + + + + True + 5 + 2 + + + + + + + + + True + True + gtk-add + True + 0 + + + + 1 + 2 + 1 + 2 + + + + + + + True + Browse.. + 7 + + + + 4 + 5 + + + + + + + True + MIME Type: + + + + + True + + + 1 + 2 + + + + + + True + Action: + + + 2 + 3 + + + + + True + 1 + 0 + Send the file URL link Run as CGI Run as FastCGI @@ -1210,937 +818,475 @@ Execute as an ISAPI module Execute self contined FastCGI Run self contained SCGI - False - True - - - 1 - 2 - 2 - 3 - - - - - - - True - Action: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - - - - - - True - False - True - - - 1 - 2 - 0 - 1 - - - - - - - True - MIME Type: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - - - - - - True - Browse.. - GTK_FILE_CHOOSER_ACTION_OPEN - True - False - False - -1 - - - - 0 - 1 - 4 - 5 - - - - - - - - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - 1 - 2 - 1 - 2 - - - - - - - 0 - True - True - - - - - False - True - - - - - - True - MIME - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - Name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - Every HTTP connection + + + 1 + 2 + 2 + 3 + + + + + + True + Manager: + + + 3 + 4 + + + + + True + True + NONE + + + 1 + 2 + 3 + 4 + + + + + 1 + + + + + 2 + + + + + True + MIME + + + tab + 2 + False + + + + + True + + + 20 + True + + + 100 + 20 + True + Name: + True + + + False + False + + + + + 20 + True + False + Every HTTP connection FTP connection - False - True - - - 0 - True - False - - - - - - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - True - True - True - GTK_POS_TOP - False - False - - - - True - False - 0 - - - - True - False - 0 - - - - True - Accesses log file: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - True - True - 0 - - True - ● - False - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Wrning log file: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - True - True - 0 - - True - ● - False - - - 0 - True - True - - - - - 0 - True - True - - - - - False - True - - - - - - True - Protocol - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - - - - - True - Arpa - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - - - - - True - HTTP Services - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - - - - - True - Directories - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - - - - - True - Logs - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - False - True - - - - - - True - Hosts - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - 4 - 2 - False - 0 - 0 - - - - True - True - True - True - 0 - - True - ● - False - - - 1 - 2 - 2 - 3 - - - - - - True - True - True - True - 0 - - True - ● - False - - - 1 - 2 - 1 - 2 - - - - - - True - True - True - True - 0 - administrator@localhost - True - ● - False - - - 1 - 2 - 0 - 1 - - - - - - True - True - Enable control protocol - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 3 - 4 - - - - - - True - Administrtor password: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - - - - - - True - Administrator user name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - - - - - - True - Administrtor e-mail: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - - - - - False - True - - - - - - True - Administrator - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - Enable: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.579999983311 - 0 - 1 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - Anonymous Access - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - True - True - - - - - - True - True - Asynchronous Commands - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - True - True - - - - - - True - True - Pipelining - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - True - True - - - - - - True - True - Write Commands - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - True - Anonymous Needs Password - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - True - True - - - - - False - True - - - - - - True - FTP Services - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - + + + False + False + 1 + + + + + 20 + True + True + gtk-add + True + 0 + + + + False + False + 2 + + + + + 20 + True + True + gtk-remove + True + 0 + + + + False + False + 3 + + + + + + + True + True + + + True + + + True + + + True + Accesses log file: + + + + + True + True + + + 1 + + + + + + + True + + + True + Wrning log file: + + + + + True + True + + + 1 + + + + + 1 + + + + + + + True + Protocol + + + tab + False + + + + + + + + True + Arpa + + + tab + 1 + False + + + + + + + + True + HTTP Services + + + tab + 2 + False + + + + + + + + True + Directories + + + tab + 3 + False + + + + + + + + True + Logs + + + tab + 4 + False + + + + + 1 + + + + + 3 + + + + + True + Hosts + + + tab + 3 + False + + + + + True + 4 + 2 + + + + + + True + Administrtor e-mail: + + + + + True + Administrator user name: + + + 1 + 2 + + + + + True + Administrtor password: + + + 2 + 3 + + + + + True + True + Enable control protocol + True + 0 + True + + + 1 + 2 + 3 + 4 + + + + + True + True + administrator@localhost + + + 1 + 2 + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + 4 + + + + + True + Administrator + + + tab + 4 + False + + + + + True + + + True + + + True + 0.57999998331069946 + 1 + Enable: + + + + + True + True + Anonymous Access + True + 0 + True + + + 1 + + + + + True + True + Asynchronous Commands + True + 0 + True + True + + + 2 + + + + + True + True + Pipelining + True + 0 + True + True + + + 3 + + + + + True + True + Write Commands + True + 0 + True + + + 4 + + + + + + + True + True + Anonymous Needs Password + True + 0 + True + True + + + 1 + + + + + 5 + + + + + True + FTP Services + + + tab + 5 + False + + + + + 1 + + + + + + + From MAILER-DAEMON Sat Sep 27 17:40:23 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjhWZ-00010j-JM for mharc-myserver-commit@gnu.org; Sat, 27 Sep 2008 17:40:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjhWX-0000zt-3Z for myserver-commit@gnu.org; Sat, 27 Sep 2008 17:40:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjhWV-0000zB-TH for myserver-commit@gnu.org; Sat, 27 Sep 2008 17:40:20 -0400 Received: from [199.232.76.173] (port=50235 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjhWU-0000z4-Hs for myserver-commit@gnu.org; Sat, 27 Sep 2008 17:40:18 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35602 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjhWT-00076F-MK for myserver-commit@gnu.org; Sat, 27 Sep 2008 17:40:18 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjhWS-0003D9-PA for myserver-commit@gnu.org; Sat, 27 Sep 2008 21:40:16 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjhWR-0003D1-Vt for myserver-commit@gnu.org; Sat, 27 Sep 2008 21:40:16 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sat, 27 Sep 2008 21:40:16 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2849] Added classes for the new security implementation. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 21:40:21 -0000 Revision: 2849 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2849 Author: gscrivano Date: 2008-09-27 21:40:15 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Added classes for the new security implementation. Work in progress. Modified Paths: -------------- branches/myserver_sec_new/include/conf/security/Makefile.am branches/myserver_sec_new/include/conf/security/security_cache.h branches/myserver_sec_new/src/conf/security/Makefile.am branches/myserver_sec_new/src/conf/security/security_cache.cpp branches/myserver_sec_new/tests/Makefile.am Added Paths: ----------- branches/myserver_sec_new/include/conf/security/auth_domain.h branches/myserver_sec_new/include/conf/security/security.h branches/myserver_sec_new/include/conf/security/security_domain.h branches/myserver_sec_new/include/conf/security/security_manager.h branches/myserver_sec_new/include/conf/security/validator.h branches/myserver_sec_new/include/conf/security/validator_factory.h branches/myserver_sec_new/src/conf/security/auth_domain.cpp branches/myserver_sec_new/src/conf/security/security_domain.cpp branches/myserver_sec_new/src/conf/security/security_manager.cpp branches/myserver_sec_new/src/conf/security/validator.cpp branches/myserver_sec_new/src/conf/security/validator_factory.cpp branches/myserver_sec_new/tests/test_auth_domain.cpp branches/myserver_sec_new/tests/test_security_cache.cpp branches/myserver_sec_new/tests/test_security_domain.cpp branches/myserver_sec_new/tests/test_security_manager.cpp branches/myserver_sec_new/tests/test_validator.cpp branches/myserver_sec_new/tests/test_validator_factory.cpp Removed Paths: ------------- branches/myserver_sec_new/include/conf/security/security.h branches/myserver_sec_new/src/conf/security/security.cpp Modified: branches/myserver_sec_new/include/conf/security/Makefile.am =================================================================== --- branches/myserver_sec_new/include/conf/security/Makefile.am 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/include/conf/security/Makefile.am 2008-09-27 21:40:15 UTC (rev 2849) @@ -1,4 +1,4 @@ securityincludedir=$(includedir)/myserver/include/conf/security -securityinclude_HEADERS = security_cache.h security.h +securityinclude_HEADERS = auth_domain.h security_cache.h security_domain.h security_manager.h validator.h validator_factory.h SUBDIRS = Added: branches/myserver_sec_new/include/conf/security/auth_domain.h =================================================================== --- branches/myserver_sec_new/include/conf/security/auth_domain.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/auth_domain.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,42 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef AUTH_DOMAIN_H +#define AUTH_DOMAIN_H + +#include "stdafx.h" +#include + +#include + +using namespace std; + +struct SecurityToken; + +class AuthDomain : public SecurityDomain +{ +public: + AuthDomain (SecurityToken*); + virtual ~AuthDomain (); + virtual string *getValue (string &name); +protected: + string name; + SecurityToken *securityToken; +}; + +#endif Deleted: branches/myserver_sec_new/include/conf/security/security.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security.h 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/include/conf/security/security.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -1,121 +0,0 @@ -/* -*- mode: c++ -*- */ -/* -MyServer -Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef SECURITY_H -#define SECURITY_H - -#include "stdafx.h" -#include -#include -#include -#include - -#ifndef DO_NOT_USE_SSL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#include - -using namespace std; - -/*! - *Various permissions flags. - */ - -/*! Current user can read the file. */ -const u_long MYSERVER_PERMISSION_READ = (1<<0); - -/*! Current user can write to the file. */ -const u_long MYSERVER_PERMISSION_WRITE = (1<<1); - -/*! Current user can execute the file. */ -const u_long MYSERVER_PERMISSION_EXECUTE = (1<<2); - -/*! Current user can remove the file. */ -const u_long MYSERVER_PERMISSION_DELETE = (1<<3); - -/*! Current user can browse the directory content. */ -const u_long MYSERVER_PERMISSION_BROWSE = (1<<4); - -struct SecurityToken -{ - /*! User to check for. */ - const char* user; - - /*! Password provided by the user. */ - const char* password; - - /*! Directory that the user is in. */ - const char* directory; - - /*! System directory for the host. */ - const char* sysdirectory; - - /*! File that the user tried to access. */ - const char* filename; - - /*! - *Password that the user should provide to have access. - *This is used in authorization schemes like the HTTP digest, - *where the password is not sent in clear on the network. - */ - char *requiredPassword; - - /*! Permission mask that the user will have providing [neededPassword]. */ - int *providedMask; - - struct HttpThreadContext* td; - - /*! Authorization scheme to use. */ - char* authType; - - /*! Length for the [authType] allocated string. */ - int authTypeLen; - - /*! Throttling rate to use with specified user. */ - int throttlingRate; - - HashMap *otherValues; - - SecurityToken(); - void reset(); -}; - -class SecurityManager -{ -public: - SecurityManager(); - ~SecurityManager(); - int getErrorFileName(const char *sysDir, int error, string& out, - XmlParser* parser = 0); - int getPermissionMask(SecurityToken* st, XmlParser* parser = 0); -private: - XmlParser* getParser(const char *sysDir); - bool checkActions(HttpThreadContext* td, xmlNode *root); -}; -#endif Added: branches/myserver_sec_new/include/conf/security/security.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/security.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,2 @@ +//////KEEP THIS FILE TO DON'T BREAK OLD APIs +#include Modified: branches/myserver_sec_new/include/conf/security/security_cache.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_cache.h 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/include/conf/security/security_cache.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -18,7 +18,7 @@ #ifndef SECURITY_CACHE_H #define SECURITY_CACHE_H #include -#include +#include #include @@ -26,20 +26,24 @@ class SecurityCache { + public: SecurityCache(); ~SecurityCache(); void free(); void setMaxNodes(int); int getMaxNodes(); - XmlParser* getParser(const char* dir, const char* sys, bool useXpath = true); - int getSecurityFile(const char* file, const char* sys, string& out); - int getPermissionMask(SecurityToken* st); + + XmlParser* getParser(const string &dir, const string &sys, bool useXpath = true); + int getSecurityFile(const string &file, const string &sys, string &out); + + /////////OLD//////////////////////////////////// + int getPermissionMask(SecurityToken* st){return 0;} int getErrorFileName(const char *root, int error, - const char* sysdirectory, string& out); + const char* sysdirectory, string& out){return 0;} + private: - /*! Object used to handle security on the server. */ - SecurityManager sm; + /*! Store a list of opened files using a hash dictionary. */ HashMap dictionary; int limit; Added: branches/myserver_sec_new/include/conf/security/security_domain.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_domain.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/security_domain.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,40 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef SECURITY_DOMAIN_H +#define SECURITY_DOMAIN_H + +#include "stdafx.h" + +#include + +using namespace std; + +class SecurityDomain +{ +public: + SecurityDomain (); + SecurityDomain (string &name); + virtual ~SecurityDomain (); + virtual string *getValue (string &name); + const string& getName(){return name;} +protected: + string name; +}; + +#endif Added: branches/myserver_sec_new/include/conf/security/security_manager.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_manager.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/security_manager.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,134 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef SECURITY_MANAGER_H +#define SECURITY_MANAGER_H + +#include "stdafx.h" +#include +#include +#include +#include + +#ifndef DO_NOT_USE_SSL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include + +using namespace std; + +class SecurityDomain; +class ValidatorFactory; + + +/*! + *Define permissions flags. + */ +enum PERMISSION_MASK +{ + /*! Current user can read the file. */ + MYSERVER_PERMISSION_READ = (1<<0), + + /*! Current user can write to the file. */ + MYSERVER_PERMISSION_WRITE = (1<<1), + + /*! Current user can execute the file. */ + MYSERVER_PERMISSION_EXECUTE = (1<<2), + + /*! Current user can remove the file. */ + MYSERVER_PERMISSION_DELETE = (1<<3), + +/*! Current user can browse the directory content. */ + MYSERVER_PERMISSION_BROWSE = (1<<4) +}; + +struct SecurityToken +{ + SecurityToken(); + void reset(); + + /*! User to check for. */ + string user; + + /*! Password provided by the user. */ + string password; + + /*! Directory that the user is in. */ + string directory; + + /*! System directory for the host. */ + string sysdirectory; + + /*! Resource that the user tried to access. */ + string resource; + + /*! + *Password that the user should provide to have access. + *This is used in authorization schemes like the HTTP digest, + *where the password is not sent in clear on the network. + */ + string neededPassword; + + /*! + *Permission mask. If [password] is NULL then only the + *user is considered. + */ + int mask; + + HashMap values; + + /*! If it is true the security manager will use the cached values. */ + bool done; + + + ///////OLD NOT USED//////////// + char* requiredPassword; + const char* filename; + int *providedMask; + struct HttpThreadContext* td; + char* authType; + int authTypeLen; + int throttlingRate; +}; + +class SecurityManager +{ +public: + SecurityManager(ValidatorFactory*); + ~SecurityManager(); + + int getPermissionMask(SecurityToken* st, + list *domains, + string& validator); + +private: + ValidatorFactory *validatorFactory; +}; + +#endif Added: branches/myserver_sec_new/include/conf/security/validator.h =================================================================== --- branches/myserver_sec_new/include/conf/security/validator.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/validator.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,52 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef VALIDATOR_H +#define VALIDATOR_H + +#include "stdafx.h" +#include + +#include +#include + +#include +using namespace std; + + +class Validator +{ +public: + Validator (); + virtual ~Validator (); + + int getPermissionMask (SecurityToken* st, + list *domains); + + virtual int getPermissionMaskImpl (SecurityToken* st); + + + virtual string *getValue (string &name); +protected: + int initializeDomains (SecurityToken* st, + list *domains); + void clearDomains (); + HashMap hashedDomains; +}; + +#endif Added: branches/myserver_sec_new/include/conf/security/validator_factory.h =================================================================== --- branches/myserver_sec_new/include/conf/security/validator_factory.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/validator_factory.h 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,41 @@ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef VALIDATOR_FACTORY_H +#define VALIDATOR_FACTORY_H + +#include "stdafx.h" +#include +#include + +using namespace std; + +class Validator; + + +class ValidatorFactory +{ +public: + ValidatorFactory (); + virtual ~ValidatorFactory (); + Validator* getValidator (string &name); + Validator* addValidator (string &name, Validator* validator); + bool isValidatorPresent (string &name); +private: + HashMap validators; +}; +#endif Modified: branches/myserver_sec_new/src/conf/security/Makefile.am =================================================================== --- branches/myserver_sec_new/src/conf/security/Makefile.am 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/src/conf/security/Makefile.am 2008-09-27 21:40:15 UTC (rev 2849) @@ -1,5 +1,4 @@ lib_LIBRARIES = libsecurity.a -libsecurity_a_SOURCES = security_cache.cpp security.cpp +libsecurity_a_SOURCES = auth_domain.cpp security_cache.cpp security_domain.cpp security_manager.cpp validator.cpp validator_factory.cpp SUBDIRS = INCLUDES = $(all_includes) - Added: branches/myserver_sec_new/src/conf/security/auth_domain.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/auth_domain.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/auth_domain.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,52 @@ +/* +MyServer +Copyright (C) 2002-2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include +#include + + +AuthDomain::AuthDomain (SecurityToken *st) +{ + this->name.assign(""); + securityToken = st; +} + +AuthDomain::~AuthDomain() +{ + +} + +/*! + *\see SecurityDomain::getValue. + */ +string *AuthDomain::getValue (string &name) +{ + if (!name.compare ("user")) + return &(securityToken->user); + + if (!name.compare ("password")) + return &(securityToken->password); + + if (!name.compare ("directory")) + return &(securityToken->directory); + + if (!name.compare("sysdirectory")) + return &(securityToken->sysdirectory); + + return NULL; +} Deleted: branches/myserver_sec_new/src/conf/security/security.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security.cpp 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/src/conf/security/security.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -1,284 +0,0 @@ -/* -MyServer -Copyright (C) 2002-2008 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -using namespace std; - -/*! - *Create the object. - */ -SecurityToken::SecurityToken() -{ - reset(); -} - -/*! - *Reset every structure member. - */ -void SecurityToken::reset() -{ - user = 0; - password = 0; - directory = 0; - filename = 0; - requiredPassword = 0; - providedMask = 0; - authType = 0; - authTypeLen = 0; - throttlingRate = (int)-1; -} - - -/*! - *Get the error file for a page using the specified parser. - *Return 0 to use the default one. - *Return -1 on errors. - *Return other valus on success. - */ -int SecurityManager::getErrorFileName(const char* sysDir, - int error, - string &out, - XmlParser* parser) -{ - string evalString; - XmlXPathResult* xpathRes; - xmlNodeSetPtr nodes; - int ret; - - out.assign(""); - - if(parser == NULL || !parser->isXpathEnabled()) - return -1; - - evalString = "/SECURITY/ERROR[@ID=\'"; - evalString += error; - evalString += "']/@FILE"; - - xpathRes = parser->evaluateXpath(evalString); - nodes = xpathRes->getNodeSet(); - - if(nodes && nodes->nodeNr) - out.assign((const char*)nodes->nodeTab[0]->children->content); - - /* Return 1 if both it was found and well configured. */ - ret = nodes && nodes->nodeNr && out.length() ? 1 : 0; - - delete xpathRes; - return ret; - -} - - -/*! - *Get the permissions mask for the file FILENAME using the XML parser PARSER. - *The file DIRECTORY/security will be parsed. - *PROVIDEDMASK is the permission mask that the USER will have providing the - *REQUIREDPASSWORD password. - *Returns -1 on errors. - */ -int SecurityManager::getPermissionMask(SecurityToken *st, XmlParser* parser) -{ - xmlNodeSetPtr nodes; - xmlAttr* attr; - string evalString; - int permissions = 0; - const char* requiredPassword; - bool rightPassword = false; - auto_ptr itemRes; - auto_ptr userRes; - - if(parser == NULL || !parser->isXpathEnabled()) - return -1; - - - evalString = "/SECURITY/AUTH/@TYPE"; - - auto_ptrauthRes(parser->evaluateXpath(evalString)); - nodes = authRes.get()->getNodeSet(); - - if(nodes && nodes->nodeNr) - strncpy(st->authType,(const char*)nodes->nodeTab[0]->children->content, - st->authTypeLen); - - evalString = "/SECURITY/ITEM[@FILE=\'"; - evalString += st->filename; - evalString += "\']/USER[@NAME=\'"; - evalString += st->user; - evalString += "\']/."; - - auto_ptr itemUserRes(parser->evaluateXpath(evalString)); - - nodes = itemUserRes.get()->getNodeSet(); - - if(!nodes || !nodes->nodeNr) - { - evalString = "/SECURITY/ITEM[@FILE=\'"; - evalString += st->filename; - evalString += "\']/."; - - itemRes.reset(parser->evaluateXpath(evalString)); - - nodes = itemRes.get()->getNodeSet(); - - if(!nodes || !nodes->nodeNr) - { - evalString = "/SECURITY/USER[@NAME=\'"; - evalString += st->user; - evalString += "\']/."; - - userRes.reset(parser->evaluateXpath(evalString)); - - nodes = userRes.get()->getNodeSet(); - } - - } - - if(!nodes || !nodes->nodeNr) - return 0; - - for(attr = nodes->nodeTab[0]->properties; attr; attr = attr->next) - { - if(!strcmpi((const char*)attr->name, "READ") && - !strcmpi((const char*)attr->children->content, "TRUE")) - permissions |= MYSERVER_PERMISSION_READ; - - if(!strcmpi((const char*)attr->name, "WRITE") && - !strcmpi((const char*)attr->children->content, "TRUE")) - permissions |= MYSERVER_PERMISSION_WRITE; - - if(!strcmpi((const char*)attr->name, "EXECUTE") && - !strcmpi((const char*)attr->children->content, "TRUE")) - permissions |= MYSERVER_PERMISSION_EXECUTE; - - if(!strcmpi((const char*)attr->name, "BROWSE") && - !strcmpi((const char*)attr->children->content, "TRUE")) - permissions |= MYSERVER_PERMISSION_BROWSE; - - if(!strcmpi((const char*)attr->name, "PASS")) - { - requiredPassword = (const char*)attr->children->content; - rightPassword = !strcmp(st->password, requiredPassword); - } - } - - if(rightPassword) - { - for(attr = nodes->nodeTab[0]->properties; attr; attr = attr->next) - { - if(!strcmpi((const char*)attr->name, "THROTTLING_RATE")) - st->throttlingRate = atoi((const char*)attr->children->content); - } - } - - if(st->requiredPassword) - myserver_strlcpy(st->requiredPassword, requiredPassword, 32); - - if(st->providedMask) - *(st->providedMask) = permissions; - - if(!SecurityManager::checkActions(st->td, nodes->nodeTab[0] )) - return 0; - - - return rightPassword ? permissions : 0; -} - -/*! - *Check if the specified actions deny the access to the resource. - *\param td The Thread Context. - *\param root The root node with actions. - *\return true if the action allows the access to the resource. - *\return false if the action denies the access to the resource. - */ -bool SecurityManager::checkActions(HttpThreadContext* td, xmlNode *root) -{ - xmlNode* actionsNode = root; - - for( ; td && actionsNode; actionsNode = actionsNode->next) - { - xmlAttr *attr = actionsNode->properties; - int deny = 0; - regmatch_t pm; - const char* name = 0; - Regex value; - string* headerVal = 0; - - if(strcmpi((const char*)actionsNode->name, "ACTION")) - continue; - - if(actionsNode->children && actionsNode->children->content - && !strcmpi((const char*)actionsNode->children->content, "DENY")) - deny = 1; - - if(!deny) - continue; - - for( ; attr; attr = attr->next) - { - if(!strcmpi((const char*)attr->name, "NAME")) - name = (const char*) attr->children->content; - if(!strcmpi((const char*)attr->name, "VALUE")) - value.compile((const char*)attr->children->content, REG_EXTENDED); - } - - if(name) - headerVal = td->request.getValue(name, 0); - - if(!headerVal) - continue; - - /* - *If the regular expression matches the header value then deny the - *access. - */ - if(value.isCompiled() && !value.exec(headerVal->c_str(), 1,&pm, - REG_NOTEOL)) - return false; - } - - return true; - -} - -/*! - *Create the object. - */ -SecurityManager::SecurityManager() -{ - -} - -/*! - *Destroy the SecurityManager object. - */ -SecurityManager::~SecurityManager() -{ - -} Modified: branches/myserver_sec_new/src/conf/security/security_cache.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_cache.cpp 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/src/conf/security/security_cache.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include @@ -82,18 +82,20 @@ *\param sys The system directory. *\param out Output string where put the security file path. */ -int SecurityCache::getSecurityFile(const char* dir, const char* sys, +int SecurityCache::getSecurityFile(const string& dir, + const string& sys, string& out) { int found = 0; - string file(dir); string secFile; + string file(dir); + int i = file.length() - 1; - while(i && file[i] == '/') + while(i && dir[i] == '/') file.erase(i--, 1); - secFile.assign(file); + secFile.assign(dir); secFile.append("/security"); /* The security file exists in the directory. */ @@ -103,18 +105,11 @@ return 0; } - if(file.length() == 0) - { - out.assign(sys); - out.append("/security"); - return !FilesUtility::fileExists(out); - } - - + /* Go upper in the tree till we find a security file. */ - do + for(;;) { - if(!file.length()) + if(found || !file.length()) break; for(i = file.length() - 1; i; i--) @@ -124,10 +119,9 @@ break; } - /* *Top of the tree, check if the security file is present in the - *system directory, returns an error if it is not. + *system directory. Return an error if it is not. */ if(i == 0) { @@ -135,11 +129,12 @@ out.append("/security"); return !FilesUtility::fileExists(out); } + secFile.assign(file); secFile.append("/security"); + found = FilesUtility::fileExists(secFile); } - while(!(found = FilesUtility::fileExists(secFile))); out.assign(secFile); return 0; @@ -160,7 +155,9 @@ *\param sys The system directory. *\param useXpath Specify if XPath will be used on the file. */ -XmlParser* SecurityCache::getParser(const char* dir, const char* sys, bool useXpath) +XmlParser* SecurityCache::getParser(const string &dir, + const string &sys, + bool useXpath) { XmlParser* parser; string file; @@ -194,10 +191,11 @@ else { /*! - *Create the parser and append at the dictionary. + *Create the parser and add it to the dictionary. */ XmlParser* old; parser = new XmlParser(); + if(parser == NULL) { return NULL; @@ -222,48 +220,3 @@ return parser; } - - -/*! - *Get the permission mask for the specified file and user. If the security file to use - *is not loaded it will be loaded and added to the cache dictionary for faster future - *accesses. - */ -int SecurityCache::getPermissionMask(SecurityToken* st) -{ - XmlParser *parser; - - if(st->directory == 0) - return -1; - - if(st->filename == 0) - return -1; - - parser = getParser(st->directory, st->sysdirectory); - - if(parser == NULL) - return -1; - - return sm.getPermissionMask(st, parser); -} - -/*! - *Get the error file name from the security file. - */ -int SecurityCache::getErrorFileName(const char *directory, int error, - const char* sysdirectory, string& out) -{ - XmlParser *parser; - - out.assign(""); - - if(directory == 0) - return -1; - - parser = getParser(directory, sysdirectory); - - if(parser == NULL) - return -1; - - return sm.getErrorFileName(directory, error, out, parser); -} Added: branches/myserver_sec_new/src/conf/security/security_domain.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_domain.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/security_domain.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,44 @@ +/* +MyServer +Copyright (C) 2002-2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include + + +SecurityDomain::SecurityDomain () +{ + this->name.assign(""); +} + +SecurityDomain::SecurityDomain (string& name) +{ + this->name.assign(name); +} + + +SecurityDomain::~SecurityDomain() +{ + +} + +/*! + *Get the stored value for [name]. + */ +string *SecurityDomain::getValue (string &name) +{ + return NULL; +} Added: branches/myserver_sec_new/src/conf/security/security_manager.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_manager.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/security_manager.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,70 @@ +/* +MyServer +Copyright (C) 2002-2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include +#include +#include + +#include +#include +#include + +using namespace std; + +/*! + *Create the object. + */ +SecurityToken::SecurityToken () +{ + reset (); +} + +/*! + *Reset every structure member. + */ +void SecurityToken::reset () +{ + mask = 0; + done = false; +} + + +SecurityManager::SecurityManager (ValidatorFactory* vf) +{ + validatorFactory = vf; +} + +SecurityManager::~SecurityManager () +{ + +} + +/*! + *Get the permission mask for the requested resource. + */ +int SecurityManager::getPermissionMask (SecurityToken* st, + list *domains, + string& validator) +{ + Validator* v = validatorFactory->getValidator(validator); + + if (!v) + return 0; + + return v->getPermissionMask (st, domains); +} Added: branches/myserver_sec_new/src/conf/security/validator.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/validator.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/validator.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,127 @@ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include +#include + +Validator::Validator () +{ + +} + +Validator::~Validator () +{ + +} + +/*! + *Get the permission mask for the requested resource. + *Decorate getPermissionMaskImpl. + */ +int Validator::getPermissionMask (SecurityToken* st, + list *domains) +{ + int ret = initializeDomains (st, domains); + + if(ret) + return ret; + + ret = getPermissionMaskImpl (st); + + clearDomains (); + + return ret; +} + + +/*! + *Get the permission mask for the requested resource. + */ +int Validator::getPermissionMaskImpl (SecurityToken* st) +{ + return 0; +} + + + +/*! + *Initialize the domains. + */ +int Validator::initializeDomains (SecurityToken* st, + list *domains) +{ + string authName(""); + hashedDomains.put (authName, new AuthDomain(st)); + + if (domains) + { + for (list::iterator it = domains->begin (); it != domains->end (); it++) + { + SecurityDomain *domain = *it; + string name = domain->getName(); + hashedDomains.put (name, domain); + } + } + + return 0; +} + +/*! + *Clear the resources used by the domains. + */ +void Validator::clearDomains () +{ + HashMap::Iterator it = hashedDomains.begin(); + + for (;it != hashedDomains.end(); it++) + { + delete *it; + } + +} + +/*! + *Get the value for [name] in the form domain.variable. + *\param name Variable name. + *\return The value of the requested variable. + */ +string *Validator::getValue (string &name) +{ + string domain; + string var; + size_t pos = name.find ('.'); + SecurityDomain *securityDomain = NULL; + + if (pos != string::npos) + { + domain = name.substr (0, pos); + var = name.substr (pos + 1, string::npos); + } + else + { + domain.assign(""); + var = name; + } + + securityDomain = hashedDomains.get (domain); + + if (securityDomain) + return securityDomain->getValue(var); + + return NULL; +} Added: branches/myserver_sec_new/src/conf/security/validator_factory.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/validator_factory.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/validator_factory.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,67 @@ +/* +MyServer +Copyright (C) 2002-2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include +#include + +ValidatorFactory::ValidatorFactory () +{ + // validators +} + +ValidatorFactory::~ValidatorFactory () +{ + HashMap::Iterator it = validators.begin (); + + for (;it != validators.end (); it++) + { + delete *it; + } + + validators.clear (); +} + +/*! + *Return a validator given its name. + */ +Validator* ValidatorFactory::getValidator(string &name) +{ + return validators.get (name); +} + +/*! + *Add a new validator to the factory. + *\param name Validator name. + *\param validator The validator to add. + *\return The old validator registered with [name], in any. + */ +Validator* ValidatorFactory::addValidator(string &name, Validator* validator) +{ + return validators.put (name, validator); + +} + +/*! + *Check if the specified validator is present in the factory. + *\param name The validator name. + *\return a bool value to indicate if it is present or not. + */ +bool ValidatorFactory::isValidatorPresent (string &name) +{ + return getValidator (name) != NULL; +} Modified: branches/myserver_sec_new/tests/Makefile.am =================================================================== --- branches/myserver_sec_new/tests/Makefile.am 2008-09-27 20:08:53 UTC (rev 2848) +++ branches/myserver_sec_new/tests/Makefile.am 2008-09-27 21:40:15 UTC (rev 2849) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_base64.cpp test_cached_file.cpp test_cached_file_buffer.cpp test_cached_file_factory.cpp test_connection.cpp test_connections_scheduler.cpp test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp test_md5.cpp test_mem_buff.cpp test_mem_stream.cpp test_multicast.cpp test_mutex.cpp test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp test_semaphore.cpp test_thread.cpp test_utility.cpp test_log_manager.cpp test_log_stream_factory.cpp test_socket_stream_creator.cpp test_file_stream_creator.cpp test_file_stream.cpp +tests_suite_SOURCES = main.cpp test_connection.cpp test_ftp.cpp test_log_manager.cpp test_mutex.cpp test_security_domain.cpp test_validator.cpp test_auth_domain.cpp test_connections_scheduler.cpp test_gzip.cpp test_log_stream_factory.cpp test_pipe.cpp test_security_manager.cpp test_validator_factory.cpp test_base64.cpp test_file_stream.cpp test_hashmap.cpp test_md5.cpp test_recursive_mutex.cpp test_semaphore.cpp test_xml.cpp test_cached_file_buffer.cpp test_file_stream_creator.cpp test_homedir.cpp test_mem_buff.cpp test_regex.cpp test_socket_stream_creator.cpp test_cached_file.cpp test_files_utility.cpp test_http_request.cpp test_mem_stream.cpp test_safetime.cpp test_thread.cpp test_cached_file_factory.cpp test_filter_chain.cpp test_http_response.cpp test_multicast.cpp test_security_cache.cpp test_utility.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Added: branches/myserver_sec_new/tests/test_auth_domain.cpp =================================================================== --- branches/myserver_sec_new/tests/test_auth_domain.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_auth_domain.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,61 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +using namespace std; + +class TestAuthDomain : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestAuthDomain ); + CPPUNIT_TEST( testGetName ); + CPPUNIT_TEST_SUITE_END(); + + SecurityToken *secToken; + AuthDomain* authDomain; +public: + void setUp() + { + secToken = new SecurityToken(); + authDomain = new AuthDomain(secToken); + } + + void tearDown() + { + delete authDomain; + delete secToken; + } + + void testGetName() + { + CPPUNIT_ASSERT_EQUAL(authDomain->getName().compare(""), 0); + } + +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthDomain ); Added: branches/myserver_sec_new/tests/test_security_cache.cpp =================================================================== --- branches/myserver_sec_new/tests/test_security_cache.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_security_cache.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,84 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +using namespace std; + +class TestSecurityCache : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE ( TestSecurityCache ); + CPPUNIT_TEST ( testMaxNodes ); + CPPUNIT_TEST ( testGetParser ); + CPPUNIT_TEST ( testGetSecurityFile ); + CPPUNIT_TEST_SUITE_END (); + + SecurityCache *secCache; +public: + void setUp () + { + secCache = new SecurityCache (); + } + + void tearDown () + { + delete secCache; + } + + void testMaxNodes () + { + secCache->setMaxNodes (0); + CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 0); + + secCache->setMaxNodes (10); + CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 10); + + secCache->setMaxNodes (100); + CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 100); + } + + void testGetSecurityFile () + { + string file("foo/bar/not/exist/in/reality"); + string out; + + CPPUNIT_ASSERT(secCache->getSecurityFile (file, file, out)); + } + + + void testGetParser () + { + string dir("foo/bar/not/exist/in/reality"); + string file("baz"); + CPPUNIT_ASSERT_EQUAL(secCache->getParser (dir, dir, false), (XmlParser*)NULL); + } + + +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION ( TestSecurityCache ); Added: branches/myserver_sec_new/tests/test_security_domain.cpp =================================================================== --- branches/myserver_sec_new/tests/test_security_domain.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_security_domain.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,67 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +using namespace std; + + +class TestSecurityDomain : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestSecurityDomain ); + CPPUNIT_TEST( testGetValue ); + CPPUNIT_TEST( testGetName ); + CPPUNIT_TEST_SUITE_END(); + + SecurityDomain* securityDomain; +public: + void setUp() + { + securityDomain = new SecurityDomain(); + } + + void tearDown() + { + delete securityDomain; + } + + void testGetName() + { + string val("value"); + CPPUNIT_ASSERT_EQUAL(securityDomain->getName().compare(""), 0); + } + + void testGetValue() + { + string val("value"); + CPPUNIT_ASSERT_EQUAL(securityDomain->getValue(val), (string*)NULL); + } + +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestSecurityDomain ); Added: branches/myserver_sec_new/tests/test_security_manager.cpp =================================================================== --- branches/myserver_sec_new/tests/test_security_manager.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_security_manager.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,63 @@ +/* + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +using namespace std; + +class TestSecurityManager : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestSecurityManager ); + CPPUNIT_TEST( testGetPermissionMask ); + CPPUNIT_TEST_SUITE_END(); + + ValidatorFactory validatorFactory; + SecurityManager* securityManager; +public: + void setUp() + { + securityManager = new SecurityManager(&validatorFactory); + } + + void tearDown() + { + delete securityManager; + } + + void testGetPermissionMask() + { + string val("value"); + SecurityToken secToken; + string validator("xml"); + CPPUNIT_ASSERT_EQUAL(securityManager->getPermissionMask(&secToken, NULL, validator), 0); + + } +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestSecurityManager ); Added: branches/myserver_sec_new/tests/test_validator.cpp =================================================================== --- branches/myserver_sec_new/tests/test_validator.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_validator.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,61 @@ +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +using namespace std; + +class TestValidator : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestValidator ); + CPPUNIT_TEST( testGetPermissionMask ); + CPPUNIT_TEST( testGetPermissionMaskImpl ); + CPPUNIT_TEST( testGetValue ); + CPPUNIT_TEST_SUITE_END(); + + Validator* validator; +public: + void setUp() + { + validator = new Validator(); + } + + void tearDown() + { + delete validator; + } + + void testGetValue() + { + string val("value"); + CPPUNIT_ASSERT_EQUAL(validator->getValue(val), (string*)NULL); + + } + + void testGetPermissionMaskImpl() + { + string val("value"); + SecurityToken secToken; + CPPUNIT_ASSERT_EQUAL(validator->getPermissionMaskImpl(&secToken), 0); + + } + + void testGetPermissionMask() + { + string val("value"); + SecurityToken secToken; + CPPUNIT_ASSERT_EQUAL(validator->getPermissionMask(&secToken, NULL), 0); + + } +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestValidator ); Added: branches/myserver_sec_new/tests/test_validator_factory.cpp =================================================================== --- branches/myserver_sec_new/tests/test_validator_factory.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_validator_factory.cpp 2008-09-27 21:40:15 UTC (rev 2849) @@ -0,0 +1,71 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +using namespace std; + + +class TestValidatorFactory : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestValidatorFactory ); + CPPUNIT_TEST( testGetValidator ); + CPPUNIT_TEST( testAddValidator ); + CPPUNIT_TEST( testIsValidatorPresent ); + CPPUNIT_TEST_SUITE_END(); + + ValidatorFactory* factory; +public: + void setUp() + { + factory = new ValidatorFactory(); + } + + void tearDown() + { + delete factory; + } + + void testGetValidator() + { + string val("foo"); + CPPUNIT_ASSERT_EQUAL(factory->getValidator(val), (Validator*)NULL); + + } + + void testAddValidator() + { + string val("bar"); + Validator *validator = new Validator; + + Validator* old = factory->addValidator(val, validator); + + CPPUNIT_ASSERT_EQUAL(old, (Validator*)NULL); + CPPUNIT_ASSERT(factory->getValidator(val)); + } + + void testIsValidatorPresent() + { + string val("bar"); + Validator *validator = new Validator; + + + CPPUNIT_ASSERT_EQUAL(factory->isValidatorPresent(val), false); + + factory->addValidator(val, validator); + + CPPUNIT_ASSERT_EQUAL(factory->isValidatorPresent(val), true); + } +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestValidatorFactory ); From MAILER-DAEMON Sun Sep 28 08:50:03 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kjvit-0006Li-0j for mharc-myserver-commit@gnu.org; Sun, 28 Sep 2008 08:50:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kjviq-0006L4-J6 for myserver-commit@gnu.org; Sun, 28 Sep 2008 08:50:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kjvip-0006Ke-Df for myserver-commit@gnu.org; Sun, 28 Sep 2008 08:50:00 -0400 Received: from [199.232.76.173] (port=40827 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kjvip-0006Ka-7N for myserver-commit@gnu.org; Sun, 28 Sep 2008 08:49:59 -0400 Received: from savannah.gnu.org ([199.232.41.3]:36229 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kjvio-0003Qi-9m for myserver-commit@gnu.org; Sun, 28 Sep 2008 08:49:58 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kjvik-0004vW-QV for myserver-commit@gnu.org; Sun, 28 Sep 2008 12:49:54 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kjvik-0004vS-FY for myserver-commit@gnu.org; Sun, 28 Sep 2008 12:49:54 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 28 Sep 2008 12:49:54 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2850] Added `XmlValidator' class skeleton. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2008 12:50:01 -0000 Revision: 2850 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2850 Author: gscrivano Date: 2008-09-28 12:49:53 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Added `XmlValidator' class skeleton. Modified Paths: -------------- branches/myserver_sec_new/include/base/xml/xml_parser.h branches/myserver_sec_new/include/conf/security/Makefile.am branches/myserver_sec_new/include/conf/security/security_cache.h branches/myserver_sec_new/include/conf/security/security_manager.h branches/myserver_sec_new/include/conf/security/validator.h branches/myserver_sec_new/src/conf/security/Makefile.am branches/myserver_sec_new/src/conf/security/auth_domain.cpp branches/myserver_sec_new/src/conf/security/security_cache.cpp branches/myserver_sec_new/src/conf/security/security_manager.cpp branches/myserver_sec_new/src/conf/security/validator.cpp branches/myserver_sec_new/src/conf/security/validator_factory.cpp branches/myserver_sec_new/src/protocol/ftp/ftp.cpp branches/myserver_sec_new/src/protocol/http/http.cpp branches/myserver_sec_new/tests/Makefile.am branches/myserver_sec_new/tests/test_security_cache.cpp Added Paths: ----------- branches/myserver_sec_new/include/conf/security/xml_validator.h branches/myserver_sec_new/src/conf/security/xml_validator.cpp Modified: branches/myserver_sec_new/include/base/xml/xml_parser.h =================================================================== --- branches/myserver_sec_new/include/base/xml/xml_parser.h 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/include/base/xml/xml_parser.h 2008-09-28 12:49:53 UTC (rev 2850) @@ -54,58 +54,57 @@ class XmlParser { public: - static bool startXML(); + static bool startXML(); static bool cleanXML(); - XmlParser(); - ~XmlParser(); - xmlDocPtr getDoc(); - int open(const char* filename, bool useXpath = 0); - int open(string const &filename, bool useXpath = 0){return open(filename.c_str(), useXpath);}; - int openMemBuf(MemBuf &, bool useXpath = 0); + XmlParser(); + ~XmlParser(); + xmlDocPtr getDoc(); + int open(const char* filename, bool useXpath = 0); + int open(string const &filename, bool useXpath = 0){return open(filename.c_str(), useXpath);}; + int openMemBuf(MemBuf &, bool useXpath = 0); - char *getValue(const char* field); - char *getValue(string const &field){return getValue(field.c_str());}; - char *getAttr(const char* field, const char *attr); - int setValue(const char* field, const char *value); - int close(); + char *getValue(const char* field); + char *getValue(string const &field){return getValue(field.c_str());}; + char *getAttr(const char* field, const char *attr); + int setValue(const char* field, const char *value); + int close(); - int save(const char *filename,int *nbytes = 0); - int save(string const &filename,int *nbytes = 0){return save(filename.c_str(), nbytes);}; - int saveMemBuf(MemBuf &,int *nbytes = 0); + int save(const char *filename, int *nbytes = 0); + int save(string const &filename, int *nbytes = 0){return save(filename.c_str(), nbytes);}; + int saveMemBuf(MemBuf &, int *nbytes = 0); - void newfile(const char * root); - void newfile(string const &root){newfile(root.c_str());}; - void addChild(const char * name, const char * value); - void addChild(string const &name, string& value) + void newfile(const char * root); + void newfile(string const &root){newfile(root.c_str());}; + void addChild(const char * name, const char * value); + void addChild(string const &name, string& value) {addChild(name.c_str(), value.c_str());}; - void addGroup(const char * name); - void addGroup(string const &name) + void addGroup(const char * name); + void addGroup(string const &name) {addGroup(name.c_str());}; - void endGroup(); + void endGroup(); - void setAttr(const char * name, const char * value); + void setAttr(const char * name, const char * value); - void setAttr(string& name, string& value) - { - setAttr(name.c_str(), value.c_str()); - }; + void setAttr(string& name, string& value) + { + setAttr(name.c_str(), value.c_str()); + }; - void addLineFeed(); - time_t getLastModTime(); - + void addLineFeed(); + time_t getLastModTime(); + XmlXPathResult* evaluateXpath(string & path){return evaluateXpath(path.c_str());} XmlXPathResult* evaluateXpath(const char*); bool isXpathEnabled(){return useXpath;} private: xmlXPathContextPtr xpathCtx; bool useXpath; - xmlDocPtr doc; - string buffer; - xmlNodePtr cur; - xmlNodePtr prevCur; - xmlNodePtr lastNode; - time_t mtime; - + xmlDocPtr doc; + string buffer; + xmlNodePtr cur; + xmlNodePtr prevCur; + xmlNodePtr lastNode; + time_t mtime; }; #endif Modified: branches/myserver_sec_new/include/conf/security/Makefile.am =================================================================== --- branches/myserver_sec_new/include/conf/security/Makefile.am 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/include/conf/security/Makefile.am 2008-09-28 12:49:53 UTC (rev 2850) @@ -1,4 +1,4 @@ securityincludedir=$(includedir)/myserver/include/conf/security -securityinclude_HEADERS = auth_domain.h security_cache.h security_domain.h security_manager.h validator.h validator_factory.h +securityinclude_HEADERS = auth_domain.h security_cache.h security_domain.h security_manager.h validator.h validator_factory.h xml_validator.h SUBDIRS = Modified: branches/myserver_sec_new/include/conf/security/security_cache.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_cache.h 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/include/conf/security/security_cache.h 2008-09-28 12:49:53 UTC (rev 2850) @@ -19,6 +19,7 @@ #define SECURITY_CACHE_H #include #include +#include #include @@ -28,23 +29,25 @@ { public: - SecurityCache(); - ~SecurityCache(); - void free(); - void setMaxNodes(int); - int getMaxNodes(); + SecurityCache (); + ~SecurityCache (); + void free (); + void setMaxNodes (int); + int getMaxNodes (); - XmlParser* getParser(const string &dir, const string &sys, bool useXpath = true); - int getSecurityFile(const string &file, const string &sys, string &out); + XmlParser* getParser (const string &dir, const string &sys, bool useXpath = true, const char* secName = ".security.xml"); + int getSecurityFile (const string &file, const string &sys, string &out, const char* secName = ".security.xml"); - /////////OLD//////////////////////////////////// - int getPermissionMask(SecurityToken* st){return 0;} - int getErrorFileName(const char *root, int error, + /////////OLD NASTY AND DISGUSTING. TEMPORARY SOLUTION TO DON'T BREAK APIs//////////////////////////////////// + static class SecurityManager sm; + static class ValidatorFactory validatorFactory; + + int getPermissionMask (SecurityToken* st){string xml("xml"); return sm.getPermissionMask (st, NULL, xml);} + int getErrorFileName (const char *root, int error, const char* sysdirectory, string& out){return 0;} - private: - /*! Store a list of opened files using a hash dictionary. */ + /*! Store a list of opened files using a hash dictionary. */ HashMap dictionary; int limit; }; Modified: branches/myserver_sec_new/include/conf/security/security_manager.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_manager.h 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/include/conf/security/security_manager.h 2008-09-28 12:49:53 UTC (rev 2850) @@ -45,8 +45,9 @@ class SecurityDomain; class ValidatorFactory; +class Vhost; +class Server; - /*! *Define permissions flags. */ @@ -80,13 +81,13 @@ string password; /*! Directory that the user is in. */ - string directory; + string *directory; /*! System directory for the host. */ - string sysdirectory; + string *sysdirectory; /*! Resource that the user tried to access. */ - string resource; + string *resource; /*! *Password that the user should provide to have access. @@ -106,7 +107,13 @@ /*! If it is true the security manager will use the cached values. */ bool done; + /*! Server instance. */ + Server* server; + /*! VHost. */ + Vhost* vhost; + + ///////OLD NOT USED//////////// char* requiredPassword; const char* filename; Modified: branches/myserver_sec_new/include/conf/security/validator.h =================================================================== --- branches/myserver_sec_new/include/conf/security/validator.h 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/include/conf/security/validator.h 2008-09-28 12:49:53 UTC (rev 2850) @@ -41,7 +41,7 @@ virtual int getPermissionMaskImpl (SecurityToken* st); - virtual string *getValue (string &name); + string *getValue (string &name); protected: int initializeDomains (SecurityToken* st, list *domains); Added: branches/myserver_sec_new/include/conf/security/xml_validator.h =================================================================== --- branches/myserver_sec_new/include/conf/security/xml_validator.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/xml_validator.h 2008-09-28 12:49:53 UTC (rev 2850) @@ -0,0 +1,47 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef XML_VALIDATOR_H +#define XML_VALIDATOR_H + +#include "stdafx.h" +#include + +#include +#include +#include +#include +#include +#include +#include + +class XmlValidator : public Validator +{ +public: + XmlValidator (); + virtual ~XmlValidator (); + + virtual int getPermissionMaskImpl (SecurityToken *st); +private: + int computeXmlNode (xmlNodePtr node, SecurityToken *st); + SecurityCache* getCache(Server*); + SecurityCache *secCache; + Mutex cacheMutex; +}; + +#endif Modified: branches/myserver_sec_new/src/conf/security/Makefile.am =================================================================== --- branches/myserver_sec_new/src/conf/security/Makefile.am 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/conf/security/Makefile.am 2008-09-28 12:49:53 UTC (rev 2850) @@ -1,4 +1,4 @@ lib_LIBRARIES = libsecurity.a -libsecurity_a_SOURCES = auth_domain.cpp security_cache.cpp security_domain.cpp security_manager.cpp validator.cpp validator_factory.cpp +libsecurity_a_SOURCES = auth_domain.cpp security_cache.cpp security_domain.cpp security_manager.cpp validator.cpp validator_factory.cpp xml_validator.cpp SUBDIRS = INCLUDES = $(all_includes) Modified: branches/myserver_sec_new/src/conf/security/auth_domain.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/auth_domain.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/conf/security/auth_domain.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -43,10 +43,10 @@ return &(securityToken->password); if (!name.compare ("directory")) - return &(securityToken->directory); + return securityToken->directory; if (!name.compare("sysdirectory")) - return &(securityToken->sysdirectory); + return securityToken->sysdirectory; return NULL; } Modified: branches/myserver_sec_new/src/conf/security/security_cache.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_cache.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/conf/security/security_cache.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -24,22 +24,26 @@ using namespace std; + +ValidatorFactory SecurityCache::validatorFactory; +SecurityManager SecurityCache::sm(&SecurityCache::validatorFactory); + + /*! *Constructor for the SecurityCache object. */ -SecurityCache::SecurityCache() +SecurityCache::SecurityCache () { /*! *By default do not store more than 25 nodes. */ limit = 25; - } /*! *Destroy the security cache object. */ -SecurityCache::~SecurityCache() +SecurityCache::~SecurityCache () { free(); } @@ -47,11 +51,11 @@ /*! *free the memory used by the SecurityCache object. */ -void SecurityCache::free() +void SecurityCache::free () { HashMap::Iterator it = dictionary.begin(); - for (;it != dictionary.end(); it++) + for (;it != dictionary.end (); it++) { delete (*it); } @@ -61,11 +65,15 @@ /*! *Set a new limit on the nodes to keep in memory. + *\param newLimit Number of files to cache. it is adjusted + *to be >= 1. */ -void SecurityCache::setMaxNodes(int newLimit) +void SecurityCache::setMaxNodes (int newLimit) { + if (newLimit <= 0) + newLimit = 1; + /*! Remove all the additional nodes from the dictionary. */ - while(newLimit < dictionary.size()) { XmlParser* toremove = dictionary.remove(dictionary.begin()); @@ -81,10 +89,12 @@ *\param dir The directory we need a security parser for. *\param sys The system directory. *\param out Output string where put the security file path. + *\param secFileName The security file name. */ -int SecurityCache::getSecurityFile(const string& dir, - const string& sys, - string& out) +int SecurityCache::getSecurityFile (const string& dir, + const string& sys, + string& out, + const char* secFileName) { int found = 0; string secFile; @@ -96,7 +106,8 @@ file.erase(i--, 1); secFile.assign(dir); - secFile.append("/security"); + secFile.append("/"); + secFile.append(secFileName); /* The security file exists in the directory. */ if(FilesUtility::fileExists(secFile)) @@ -126,12 +137,14 @@ if(i == 0) { out.assign(sys); - out.append("/security"); + out.append("/"); + out.append(secFileName); return !FilesUtility::fileExists(out); } secFile.assign(file); - secFile.append("/security"); + secFile.append("/"); + secFile.append(secFileName); found = FilesUtility::fileExists(secFile); } @@ -154,35 +167,37 @@ *\param dir The path where start looking. *\param sys The system directory. *\param useXpath Specify if XPath will be used on the file. + *\param secFileName The security file name. */ -XmlParser* SecurityCache::getParser(const string &dir, - const string &sys, - bool useXpath) +XmlParser* SecurityCache::getParser (const string &dir, + const string &sys, + bool useXpath, + const char* secFileName) { XmlParser* parser; string file; - if(getSecurityFile(dir, sys, file)) + if (getSecurityFile (dir, sys, file, secFileName)) return NULL; - parser = dictionary.get(file); + parser = dictionary.get (file); /*! *If the parser is already present and satisfy XPath then use it. */ - if(parser && (!useXpath || parser->isXpathEnabled())) + if (parser && (!useXpath || parser->isXpathEnabled ())) { time_t fileModTime; /*! If the file was modified reload it. */ - fileModTime = FilesUtility::getLastModTime(file.c_str()); - if((fileModTime != static_cast(-1)) && - (parser->getLastModTime() != fileModTime)) + fileModTime = FilesUtility::getLastModTime (file.c_str ()); + if ((fileModTime != static_cast(-1)) && + (parser->getLastModTime () != fileModTime)) { - parser->close(); - if(parser->open(file.c_str(), useXpath) == -1) + parser->close (); + if(parser->open (file.c_str (), useXpath) == -1) { - dictionary.remove(file.c_str()); + dictionary.remove (file.c_str ()); return NULL; } @@ -194,28 +209,26 @@ *Create the parser and add it to the dictionary. */ XmlParser* old; - parser = new XmlParser(); + parser = new XmlParser (); - if(parser == NULL) + if (parser == NULL) { return NULL; } - if(dictionary.size() >= limit) + if (dictionary.size () >= limit) { - XmlParser* toremove = dictionary.remove(dictionary.begin()); - if(toremove) + XmlParser* toremove = dictionary.remove (dictionary.begin ()); + if (toremove) delete toremove; } - if(parser->open(file.c_str(), useXpath) == -1) + if (parser->open (file.c_str (), useXpath) == -1) return NULL; - old = dictionary.put(file, parser); - if(old) - { + old = dictionary.put (file, parser); + if (old) delete old; - } } return parser; Modified: branches/myserver_sec_new/src/conf/security/security_manager.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_manager.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/conf/security/security_manager.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -41,9 +41,15 @@ { mask = 0; done = false; + server = NULL; + vhost = NULL; + + directory = NULL; + sysdirectory = NULL; + resource = NULL; + } - SecurityManager::SecurityManager (ValidatorFactory* vf) { validatorFactory = vf; @@ -63,7 +69,13 @@ { Validator* v = validatorFactory->getValidator(validator); - if (!v) + if (v == NULL) + { + string xml ("xml"); + v = validatorFactory->getValidator (xml); + } + + if (v == NULL) return 0; return v->getPermissionMask (st, domains); Modified: branches/myserver_sec_new/src/conf/security/validator.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/validator.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/conf/security/validator.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -65,7 +65,7 @@ int Validator::initializeDomains (SecurityToken* st, list *domains) { - string authName(""); + string authName (""); hashedDomains.put (authName, new AuthDomain(st)); if (domains) @@ -121,7 +121,7 @@ securityDomain = hashedDomains.get (domain); if (securityDomain) - return securityDomain->getValue(var); + return securityDomain->getValue (var); return NULL; } Modified: branches/myserver_sec_new/src/conf/security/validator_factory.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/validator_factory.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/conf/security/validator_factory.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -18,10 +18,19 @@ #include #include +#include +#include + +using namespace std; + ValidatorFactory::ValidatorFactory () { - // validators + XmlValidator* xmlValidator = new XmlValidator; + string xml ("xml"); + + validators.put (xml, xmlValidator); + } ValidatorFactory::~ValidatorFactory () Added: branches/myserver_sec_new/src/conf/security/xml_validator.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/xml_validator.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/xml_validator.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -0,0 +1,91 @@ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include +#include + +XmlValidator::XmlValidator () +{ + secCache = NULL; +} + +XmlValidator::~XmlValidator () +{ + if (secCache != NULL) + { + secCache->free (); + delete secCache; + } +} + +/*! + *Get the security files cache. + */ +SecurityCache* XmlValidator::getCache(Server *server) +{ + if (secCache == NULL && server != NULL) + { + const char *data = server->getHashedData ("SECURITY_CACHE_NODES"); + secCache = new SecurityCache (); + if (data) + { + int nodes = atoi (data); + secCache->setMaxNodes (nodes); + } + } + + return secCache; +} + + +/*! + *\see XmlValidator#getPermissionMaskImpl. + */ +int XmlValidator::getPermissionMaskImpl (SecurityToken* st) +{ + const char *secName; + XmlParser* xmlFile; + SecurityCache *cache = getCache (st->server); + + if (cache == NULL) + return 0; + + secName = st->vhost ? st->vhost->getHashedData ("SECURITY_FILE_NAME") : NULL; + + if (secName == NULL) + secName = st->server ? st->server->getHashedData ("SECURITY_FILE_NAME") : NULL; + + if (secName == NULL) + secName = ".security.xml"; + + xmlFile = cache->getParser (*st->resource, *st->sysdirectory, false, secName); + + if (xmlFile == NULL) + return 0; + + + return computeXmlNode (xmlFile->getDoc ()->children, st); +} + +/*! + *Compute the current XML node. + */ +int XmlValidator::computeXmlNode (xmlNodePtr node, SecurityToken *st) +{ + return 0; +} Modified: branches/myserver_sec_new/src/protocol/ftp/ftp.cpp =================================================================== --- branches/myserver_sec_new/src/protocol/ftp/ftp.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/protocol/ftp/ftp.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -2399,8 +2399,8 @@ st.user = sUser.c_str(); st.password = sPass.c_str(); } - st.directory = sDir.c_str(); - st.sysdirectory = td.pConnection->host->getSystemRoot().c_str();//pFtpUserData->m_pDataConnection->host->getSystemRoot().c_str(); + st.directory = &sDir; + st.sysdirectory = (string*)&(td.pConnection->host->getSystemRoot());//pFtpUserData->m_pDataConnection->host->getSystemRoot().c_str(); st.authType = 0; st.filename = sFileName.c_str(); //st.providedMask = &mask; Modified: branches/myserver_sec_new/src/protocol/http/http.cpp =================================================================== --- branches/myserver_sec_new/src/protocol/http/http.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/src/protocol/http/http.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -352,6 +352,13 @@ char authType[16]; int providedMask; + st.server = Server::getInstance(); + st.resource = &filenamePath; + st.directory = &directory; + st.sysdirectory = &(td->vhostSys); + + st.vhost = td->connection->host; + try { st.authType = authType; @@ -418,8 +425,6 @@ { st.user = td->connection->getLogin(); st.password = td->connection->getPassword(); - st.directory = directory.c_str(); - st.sysdirectory = td->getVhostSys(); st.filename = file.c_str(); st.requiredPassword = ((HttpUserData*)td->connection->protocolBuffer)->requiredPassword; @@ -440,8 +445,6 @@ { st.user = "Guest"; st.password = ""; - st.directory = directory.c_str(); - st.sysdirectory = td->getVhostSys(); st.filename = file.c_str(); st.requiredPassword = 0; st.providedMask = 0; @@ -493,8 +496,6 @@ { st.user = "Guest"; st.password = ""; - st.directory = directory.c_str(); - st.sysdirectory = td->getVhostSys(); st.filename = file.c_str(); st.requiredPassword = 0; st.providedMask = 0; Modified: branches/myserver_sec_new/tests/Makefile.am =================================================================== --- branches/myserver_sec_new/tests/Makefile.am 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/tests/Makefile.am 2008-09-28 12:49:53 UTC (rev 2850) @@ -2,5 +2,5 @@ # bin_PROGRAMS = tests_suite -tests_suite_SOURCES = main.cpp test_connection.cpp test_ftp.cpp test_log_manager.cpp test_mutex.cpp test_security_domain.cpp test_validator.cpp test_auth_domain.cpp test_connections_scheduler.cpp test_gzip.cpp test_log_stream_factory.cpp test_pipe.cpp test_security_manager.cpp test_validator_factory.cpp test_base64.cpp test_file_stream.cpp test_hashmap.cpp test_md5.cpp test_recursive_mutex.cpp test_semaphore.cpp test_xml.cpp test_cached_file_buffer.cpp test_file_stream_creator.cpp test_homedir.cpp test_mem_buff.cpp test_regex.cpp test_socket_stream_creator.cpp test_cached_file.cpp test_files_utility.cpp test_http_request.cpp test_mem_stream.cpp test_safetime.cpp test_thread.cpp test_cached_file_factory.cpp test_filter_chain.cpp test_http_response.cpp test_multicast.cpp test_security_cache.cpp test_utility.cpp +tests_suite_SOURCES = main.cpp test_connection.cpp test_ftp.cpp test_log_manager.cpp test_mutex.cpp test_security_domain.cpp test_validator.cpp test_auth_domain.cpp test_connections_scheduler.cpp test_gzip.cpp test_log_stream_factory.cpp test_pipe.cpp test_security_manager.cpp test_validator_factory.cpp test_base64.cpp test_file_stream.cpp test_hashmap.cpp test_md5.cpp test_recursive_mutex.cpp test_semaphore.cpp test_xml.cpp test_cached_file_buffer.cpp test_file_stream_creator.cpp test_homedir.cpp test_mem_buff.cpp test_regex.cpp test_socket_stream_creator.cpp test_cached_file.cpp test_files_utility.cpp test_http_request.cpp test_mem_stream.cpp test_safetime.cpp test_thread.cpp test_cached_file_factory.cpp test_filter_chain.cpp test_http_response.cpp test_multicast.cpp test_security_cache.cpp test_utility.cpp test_xml_validator.cpp tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) Modified: branches/myserver_sec_new/tests/test_security_cache.cpp =================================================================== --- branches/myserver_sec_new/tests/test_security_cache.cpp 2008-09-27 21:40:15 UTC (rev 2849) +++ branches/myserver_sec_new/tests/test_security_cache.cpp 2008-09-28 12:49:53 UTC (rev 2850) @@ -51,9 +51,15 @@ void testMaxNodes () { + secCache->setMaxNodes (-10); + CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 1); + secCache->setMaxNodes (0); - CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 0); + CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 1); + secCache->setMaxNodes (1); + CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 1); + secCache->setMaxNodes (10); CPPUNIT_ASSERT_EQUAL (secCache->getMaxNodes (), 10); From MAILER-DAEMON Sun Sep 28 10:44:52 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjxW0-0003Fi-Hf for mharc-myserver-commit@gnu.org; Sun, 28 Sep 2008 10:44:52 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjxVy-0003EQ-8Z for myserver-commit@gnu.org; Sun, 28 Sep 2008 10:44:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjxVx-0003Dz-ED for myserver-commit@gnu.org; Sun, 28 Sep 2008 10:44:49 -0400 Received: from [199.232.76.173] (port=58291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjxVx-0003Dr-AU for myserver-commit@gnu.org; Sun, 28 Sep 2008 10:44:49 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54670 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjxVx-0003H8-34 for myserver-commit@gnu.org; Sun, 28 Sep 2008 10:44:49 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KjxVw-0004J7-5G for myserver-commit@gnu.org; Sun, 28 Sep 2008 14:44:48 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KjxVv-0004J3-SM for myserver-commit@gnu.org; Sun, 28 Sep 2008 14:44:48 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 28 Sep 2008 14:44:47 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2851] Added `XmlValidator' class test. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2008 14:44:50 -0000 Revision: 2851 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2851 Author: gscrivano Date: 2008-09-28 14:44:47 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Added `XmlValidator' class test. Modified Paths: -------------- branches/myserver_sec_new/include/conf/security/xml_validator.h branches/myserver_sec_new/src/conf/security/xml_validator.cpp Added Paths: ----------- branches/myserver_sec_new/tests/test_xml_validator.cpp Modified: branches/myserver_sec_new/include/conf/security/xml_validator.h =================================================================== --- branches/myserver_sec_new/include/conf/security/xml_validator.h 2008-09-28 12:49:53 UTC (rev 2850) +++ branches/myserver_sec_new/include/conf/security/xml_validator.h 2008-09-28 14:44:47 UTC (rev 2851) @@ -38,7 +38,7 @@ virtual int getPermissionMaskImpl (SecurityToken *st); private: - int computeXmlNode (xmlNodePtr node, SecurityToken *st); + int computeXmlNode (xmlNodePtr node, SecurityToken *st, int *cmd); SecurityCache* getCache(Server*); SecurityCache *secCache; Mutex cacheMutex; Modified: branches/myserver_sec_new/src/conf/security/xml_validator.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/xml_validator.cpp 2008-09-28 12:49:53 UTC (rev 2850) +++ branches/myserver_sec_new/src/conf/security/xml_validator.cpp 2008-09-28 14:44:47 UTC (rev 2851) @@ -78,14 +78,58 @@ if (xmlFile == NULL) return 0; + for (xmlNodePtr cur = xmlFile->getDoc ()->children; cur; cur = cur->next) + if (cur->type == XML_ELEMENT_NODE) + { + int cmd; - return computeXmlNode (xmlFile->getDoc ()->children, st); + computeXmlNode (cur, st, &cmd); + + return cmd; + } + + return 0; } /*! *Compute the current XML node. */ -int XmlValidator::computeXmlNode (xmlNodePtr node, SecurityToken *st) +int XmlValidator::computeXmlNode (xmlNodePtr node, SecurityToken *st, int *cmd) { + printf ("%s\n", node->name); + + if (node == NULL) + return 0; + + for (xmlNodePtr cur = node->children; cur; cur = cur->next) + if (cur->type == XML_ELEMENT_NODE) + { + if (!xmlStrcmp (cur->name, (const xmlChar *) "CONDITION")) + { + string name; + const xmlChar *value = ""; + xmlAttr *attrs = cur->properties; + + while (attrs) + { + if(!xmlStrcmp (attrs->name, (const xmlChar *)"name") && + attrs->children && attrs->children->content) + name.assign ((const char*)attrs->children->content); + + if(!xmlStrcmp (attrs->name, (const xmlChar *)"value") && + attrs->children && attrs->children->content) + value = attrs->children->content; + + attrs = attrs->next; + } + + string *storedValue = getValue (name); + + if (storedValue && storedValue->compare ((const char*)value) == 0) + computeXmlNode (cur, st, cmd); + + } + } + return 0; } Added: branches/myserver_sec_new/tests/test_xml_validator.cpp =================================================================== --- branches/myserver_sec_new/tests/test_xml_validator.cpp (rev 0) +++ branches/myserver_sec_new/tests/test_xml_validator.cpp 2008-09-28 14:44:47 UTC (rev 2851) @@ -0,0 +1,61 @@ +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +using namespace std; + +class TestXmlValidator : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( TestXmlValidator ); + CPPUNIT_TEST( testGetPermissionMask ); + CPPUNIT_TEST( testGetPermissionMaskImpl ); + CPPUNIT_TEST( testGetValue ); + CPPUNIT_TEST_SUITE_END(); + + XmlValidator* xmlValidator; +public: + void setUp() + { + xmlValidator = new XmlValidator(); + } + + void tearDown() + { + delete xmlValidator; + } + + void testGetValue() + { + string val("value"); + CPPUNIT_ASSERT_EQUAL(xmlValidator->getValue(val), (string*)NULL); + + } + + void testGetPermissionMaskImpl() + { + string val("value"); + SecurityToken secToken; + CPPUNIT_ASSERT_EQUAL(xmlValidator->getPermissionMaskImpl(&secToken), 0); + + } + + void testGetPermissionMask() + { + string val("value"); + SecurityToken secToken; + CPPUNIT_ASSERT_EQUAL(xmlValidator->getPermissionMask(&secToken, NULL), 0); + + } +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION( TestXmlValidator ); From MAILER-DAEMON Sun Sep 28 16:56:46 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kk3Ju-00057t-35 for mharc-myserver-commit@gnu.org; Sun, 28 Sep 2008 16:56:46 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kk3Js-00057g-Kb for myserver-commit@gnu.org; Sun, 28 Sep 2008 16:56:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kk3Jr-00057T-KO for myserver-commit@gnu.org; Sun, 28 Sep 2008 16:56:44 -0400 Received: from [199.232.76.173] (port=58011 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kk3Jr-00057Q-Dk for myserver-commit@gnu.org; Sun, 28 Sep 2008 16:56:43 -0400 Received: from savannah.gnu.org ([199.232.41.3]:41278 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kk3Jo-0004C3-KM for myserver-commit@gnu.org; Sun, 28 Sep 2008 16:56:42 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kk3Jk-0001cW-8s for myserver-commit@gnu.org; Sun, 28 Sep 2008 20:56:36 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kk3Jj-0001cS-UD for myserver-commit@gnu.org; Sun, 28 Sep 2008 20:56:36 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Sun, 28 Sep 2008 20:56:35 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2852] Added new `AuthMethod', `AuthMethodFactory' classes. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2008 20:56:44 -0000 Revision: 2852 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2852 Author: gscrivano Date: 2008-09-28 20:56:35 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Added new `AuthMethod', `AuthMethodFactory' classes. Modified Paths: -------------- branches/myserver_sec_new/include/base/xml/xml_parser.h branches/myserver_sec_new/include/conf/security/Makefile.am branches/myserver_sec_new/include/conf/security/security_cache.h branches/myserver_sec_new/include/conf/security/security_manager.h branches/myserver_sec_new/include/conf/security/validator.h branches/myserver_sec_new/include/conf/security/xml_validator.h branches/myserver_sec_new/src/conf/security/Makefile.am branches/myserver_sec_new/src/conf/security/security_cache.cpp branches/myserver_sec_new/src/conf/security/security_manager.cpp branches/myserver_sec_new/src/conf/security/validator.cpp branches/myserver_sec_new/src/conf/security/validator_factory.cpp branches/myserver_sec_new/src/conf/security/xml_validator.cpp branches/myserver_sec_new/src/protocol/http/http.cpp branches/myserver_sec_new/tests/test_security_manager.cpp branches/myserver_sec_new/tests/test_validator.cpp branches/myserver_sec_new/tests/test_xml_validator.cpp Added Paths: ----------- branches/myserver_sec_new/include/conf/security/auth_method.h branches/myserver_sec_new/include/conf/security/auth_method_factory.h branches/myserver_sec_new/src/conf/security/auth_method.cpp branches/myserver_sec_new/src/conf/security/auth_method_factory.cpp Modified: branches/myserver_sec_new/include/base/xml/xml_parser.h =================================================================== --- branches/myserver_sec_new/include/base/xml/xml_parser.h 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/include/base/xml/xml_parser.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -96,6 +96,7 @@ XmlXPathResult* evaluateXpath(string & path){return evaluateXpath(path.c_str());} XmlXPathResult* evaluateXpath(const char*); bool isXpathEnabled(){return useXpath;} + private: xmlXPathContextPtr xpathCtx; bool useXpath; Modified: branches/myserver_sec_new/include/conf/security/Makefile.am =================================================================== --- branches/myserver_sec_new/include/conf/security/Makefile.am 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/include/conf/security/Makefile.am 2008-09-28 20:56:35 UTC (rev 2852) @@ -1,4 +1,4 @@ securityincludedir=$(includedir)/myserver/include/conf/security -securityinclude_HEADERS = auth_domain.h security_cache.h security_domain.h security_manager.h validator.h validator_factory.h xml_validator.h +securityinclude_HEADERS = auth_domain.h auth_method.h auth_method_factory.h security_cache.h security_domain.h security_manager.h validator.h validator_factory.h xml_validator.h SUBDIRS = Added: branches/myserver_sec_new/include/conf/security/auth_method.h =================================================================== --- branches/myserver_sec_new/include/conf/security/auth_method.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/auth_method.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -0,0 +1,36 @@ +/* -*- mode: c++ -*- */ +/* +MyServer +Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef AUTH_METHOD_H +#define AUTH_METHOD_H + +#include "stdafx.h" +#include + +using namespace std; + +class AuthMethod +{ +public: + AuthMethod (); + virtual ~AuthMethod(); + + virtual int getPermissionMask (SecurityToken* st); +}; + +#endif Added: branches/myserver_sec_new/include/conf/security/auth_method_factory.h =================================================================== --- branches/myserver_sec_new/include/conf/security/auth_method_factory.h (rev 0) +++ branches/myserver_sec_new/include/conf/security/auth_method_factory.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -0,0 +1,41 @@ +/* +MyServer +Copyright (C) 2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef AUTH_METHOD_FACTORY_H +#define AUTH_METHOD_FACTORY_H + +#include "stdafx.h" +#include +#include + +using namespace std; + +class AuthMethod; + + +class AuthMethodFactory +{ +public: + AuthMethodFactory (); + virtual ~AuthMethodFactory (); + AuthMethod* getAuthMethod (string &name); + AuthMethod* addAuthMethod (string &name, AuthMethod* authMethod); + bool isAuthMethodPresent (string &name); +private: + HashMap authMethods; +}; +#endif Modified: branches/myserver_sec_new/include/conf/security/security_cache.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_cache.h 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/include/conf/security/security_cache.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -19,7 +19,12 @@ #define SECURITY_CACHE_H #include #include + +#include +#include #include +#include +#include #include @@ -40,9 +45,11 @@ /////////OLD NASTY AND DISGUSTING. TEMPORARY SOLUTION TO DON'T BREAK APIs//////////////////////////////////// static class SecurityManager sm; + static class AuthMethodFactory authMethodFactory; static class ValidatorFactory validatorFactory; - int getPermissionMask (SecurityToken* st){string xml("xml"); return sm.getPermissionMask (st, NULL, xml);} + int getPermissionMask (SecurityToken* st); + int getErrorFileName (const char *root, int error, const char* sysdirectory, string& out){return 0;} private: Modified: branches/myserver_sec_new/include/conf/security/security_manager.h =================================================================== --- branches/myserver_sec_new/include/conf/security/security_manager.h 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/include/conf/security/security_manager.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -25,25 +25,12 @@ #include #include -#ifndef DO_NOT_USE_SSL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - #include using namespace std; class SecurityDomain; +class AuthMethodFactory; class ValidatorFactory; class Vhost; class Server; @@ -90,18 +77,23 @@ string *resource; /*! + *Permission mask. + */ + int mask; + + /*! *Password that the user should provide to have access. *This is used in authorization schemes like the HTTP digest, *where the password is not sent in clear on the network. */ string neededPassword; - + /*! - *Permission mask. If [password] is NULL then only the - *user is considered. + *The obtained mask if password were correct. */ - int mask; + int providedMask; + HashMap values; /*! If it is true the security manager will use the cached values. */ @@ -117,7 +109,6 @@ ///////OLD NOT USED//////////// char* requiredPassword; const char* filename; - int *providedMask; struct HttpThreadContext* td; char* authType; int authTypeLen; @@ -127,15 +118,17 @@ class SecurityManager { public: - SecurityManager(ValidatorFactory*); + SecurityManager(ValidatorFactory*, AuthMethodFactory*); ~SecurityManager(); int getPermissionMask(SecurityToken* st, list *domains, - string& validator); + string& validator, + string& authMethod); private: ValidatorFactory *validatorFactory; + AuthMethodFactory *authMethodFactory; }; #endif Modified: branches/myserver_sec_new/include/conf/security/validator.h =================================================================== --- branches/myserver_sec_new/include/conf/security/validator.h 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/include/conf/security/validator.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -22,6 +22,7 @@ #include "stdafx.h" #include +#include #include #include @@ -36,17 +37,21 @@ virtual ~Validator (); int getPermissionMask (SecurityToken* st, - list *domains); + list *domains, + AuthMethod* authMethod); - virtual int getPermissionMaskImpl (SecurityToken* st); + virtual int getPermissionMaskImpl (SecurityToken* st, + HashMap *hashedDomains, + AuthMethod* authMethod); - string *getValue (string &name); + string *getValue (HashMap *hashedDomains, + string &name); protected: - int initializeDomains (SecurityToken* st, + int initializeDomains (HashMap *hashedDomains, + SecurityToken* st, list *domains); - void clearDomains (); - HashMap hashedDomains; + void clearDomains (HashMap *hashedDomains); }; #endif Modified: branches/myserver_sec_new/include/conf/security/xml_validator.h =================================================================== --- branches/myserver_sec_new/include/conf/security/xml_validator.h 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/include/conf/security/xml_validator.h 2008-09-28 20:56:35 UTC (rev 2852) @@ -26,20 +26,44 @@ #include #include #include -#include #include #include -class XmlValidator : public Validator +class SecurityCache; + +class XmlValidator : public Validator, public AuthMethod { public: XmlValidator (); virtual ~XmlValidator (); - virtual int getPermissionMaskImpl (SecurityToken *st); + using Validator::getPermissionMask; + + virtual int getPermissionMask (SecurityToken* st); + + virtual int getPermissionMaskImpl (SecurityToken* st, + HashMap *hashedDomains, + AuthMethod* authMethod); + private: - int computeXmlNode (xmlNodePtr node, SecurityToken *st, int *cmd); - SecurityCache* getCache(Server*); + XmlParser* getParser(SecurityToken* st); + bool doCondition (xmlNodePtr node, + HashMap *hashedDomains); + + void doReturn (xmlNodePtr node, + int *cmd, + HashMap *hashedDomains); + + void doDefine (xmlNodePtr node, + SecurityToken *st, + HashMap *hashedDomains); + + int computeXmlNode (xmlNodePtr node, + SecurityToken *st, + int *cmd, + HashMap *hashedDomains); + + SecurityCache *getCache(Server*); SecurityCache *secCache; Mutex cacheMutex; }; Modified: branches/myserver_sec_new/src/conf/security/Makefile.am =================================================================== --- branches/myserver_sec_new/src/conf/security/Makefile.am 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/conf/security/Makefile.am 2008-09-28 20:56:35 UTC (rev 2852) @@ -1,4 +1,4 @@ lib_LIBRARIES = libsecurity.a -libsecurity_a_SOURCES = auth_domain.cpp security_cache.cpp security_domain.cpp security_manager.cpp validator.cpp validator_factory.cpp xml_validator.cpp +libsecurity_a_SOURCES = auth_domain.cpp auth_method.cpp auth_method_factory.cpp security_cache.cpp security_domain.cpp security_manager.cpp validator.cpp validator_factory.cpp xml_validator.cpp SUBDIRS = INCLUDES = $(all_includes) Added: branches/myserver_sec_new/src/conf/security/auth_method.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/auth_method.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/auth_method.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -0,0 +1,38 @@ +/* +MyServer +Copyright (C) 2002-2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + + +#include + + +AuthMethod::AuthMethod () +{ + +} + +AuthMethod::~AuthMethod() +{ + +} + +/*! + *Get the permission mask for the specified user/password. + */ +int AuthMethod::getPermissionMask (SecurityToken* st) +{ + return 0; +} Added: branches/myserver_sec_new/src/conf/security/auth_method_factory.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/auth_method_factory.cpp (rev 0) +++ branches/myserver_sec_new/src/conf/security/auth_method_factory.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -0,0 +1,66 @@ +/* +MyServer +Copyright (C) 2002-2008 Free Software Foundation, Inc. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include + +#include + +using namespace std; + +AuthMethodFactory::AuthMethodFactory () +{ + // XmlAuthMethod* xmlAuthMethod = new XmlAuthMethod; + // string xml ("xml"); + + // authMethods.put (xml, xmlAuthMethod); +} + +AuthMethodFactory::~AuthMethodFactory () +{ + authMethods.clear (); +} + +/*! + *Return an AuthMethod given its name. + */ +AuthMethod* AuthMethodFactory::getAuthMethod(string &name) +{ + return authMethods.get (name); +} + +/*! + *Add a new AuthMethod to the factory. + *\param name AuthMethod name. + *\param authMethod The authMethod to add. + *\return The old authMethod registered with [name], in any. + */ +AuthMethod* AuthMethodFactory::addAuthMethod(string &name, AuthMethod* authMethod) +{ + return authMethods.put (name, authMethod); + +} + +/*! + *Check if the specified authMethod is present in the factory. + *\param name The authMethod name. + *\return a bool value to indicate if it is present or not. + */ +bool AuthMethodFactory::isAuthMethodPresent (string &name) +{ + return getAuthMethod (name) != NULL; +} Modified: branches/myserver_sec_new/src/conf/security/security_cache.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_cache.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/conf/security/security_cache.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -25,10 +25,24 @@ using namespace std; +AuthMethodFactory SecurityCache::authMethodFactory; ValidatorFactory SecurityCache::validatorFactory; -SecurityManager SecurityCache::sm(&SecurityCache::validatorFactory); +SecurityManager SecurityCache::sm(&SecurityCache::validatorFactory, &SecurityCache::authMethodFactory); - +int SecurityCache::getPermissionMask (SecurityToken* st) +{ + string xml("xml"); + if (!validatorFactory.isValidatorPresent (xml)) + { + XmlValidator*xmlV = new XmlValidator (); + + validatorFactory.addValidator (xml, xmlV); + authMethodFactory.addAuthMethod (xml, (AuthMethod*) xmlV); + } + return sm.getPermissionMask (st, NULL, xml, xml); +} +///////////////////////////////////////////////////////////////////////////////////// + /*! *Constructor for the SecurityCache object. */ @@ -205,7 +219,7 @@ } else { - /*! + /*! *Create the parser and add it to the dictionary. */ XmlParser* old; Modified: branches/myserver_sec_new/src/conf/security/security_manager.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/security_manager.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/conf/security/security_manager.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -50,9 +52,17 @@ } -SecurityManager::SecurityManager (ValidatorFactory* vf) +SecurityManager::SecurityManager (ValidatorFactory* vf, AuthMethodFactory* amf) { + /* + HashMap::Iterator it = validators.begin (); + + for (;it != validators.end (); it++) + { + delete *it; + }*/ validatorFactory = vf; + authMethodFactory = amf; } SecurityManager::~SecurityManager () @@ -65,18 +75,22 @@ */ int SecurityManager::getPermissionMask (SecurityToken* st, list *domains, - string& validator) + string &validator, + string &authMethod) { - Validator* v = validatorFactory->getValidator(validator); + string xml ("xml"); - if (v == NULL) - { - string xml ("xml"); + Validator *v = validatorFactory->getValidator (validator); + AuthMethod *am = authMethodFactory->getAuthMethod (authMethod); + + if (!v) v = validatorFactory->getValidator (xml); - } - if (v == NULL) + if (!am) + am = authMethodFactory->getAuthMethod (xml); + + if (!am || !v) return 0; - return v->getPermissionMask (st, domains); + return v->getPermissionMask (st, domains, am); } Modified: branches/myserver_sec_new/src/conf/security/validator.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/validator.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/conf/security/validator.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -34,17 +34,29 @@ *Decorate getPermissionMaskImpl. */ int Validator::getPermissionMask (SecurityToken* st, - list *domains) + list *domains, + AuthMethod* authMethod) { - int ret = initializeDomains (st, domains); + HashMap hashedDomains; + if (st->done) + return st->mask; + + int ret = initializeDomains (&hashedDomains, st, domains); + if(ret) return ret; - ret = getPermissionMaskImpl (st); + if (authMethod) + ret = authMethod->getPermissionMask (st); - clearDomains (); + if (!getPermissionMaskImpl (st, &hashedDomains, authMethod)) + ret = 0; + + clearDomains (&hashedDomains); + st->done = true; + return ret; } @@ -52,7 +64,9 @@ /*! *Get the permission mask for the requested resource. */ -int Validator::getPermissionMaskImpl (SecurityToken* st) +int Validator::getPermissionMaskImpl (SecurityToken* st, + HashMap *hashedDomains, + AuthMethod* authMethod) { return 0; } @@ -62,19 +76,21 @@ /*! *Initialize the domains. */ -int Validator::initializeDomains (SecurityToken* st, +int Validator::initializeDomains (HashMap *hashedDomains, + SecurityToken* st, list *domains) { - string authName (""); - hashedDomains.put (authName, new AuthDomain(st)); + string authName ("auth"); + hashedDomains->put (authName, new AuthDomain(st)); + if (domains) { for (list::iterator it = domains->begin (); it != domains->end (); it++) { SecurityDomain *domain = *it; - string name = domain->getName(); - hashedDomains.put (name, domain); + string name = domain->getName (); + hashedDomains->put (name, domain); } } @@ -84,11 +100,11 @@ /*! *Clear the resources used by the domains. */ -void Validator::clearDomains () +void Validator::clearDomains (HashMap *hashedDomains) { - HashMap::Iterator it = hashedDomains.begin(); + HashMap::Iterator it = hashedDomains->begin(); - for (;it != hashedDomains.end(); it++) + for (;it != hashedDomains->end(); it++) { delete *it; } @@ -97,10 +113,11 @@ /*! *Get the value for [name] in the form domain.variable. + *\param hashedDomains Registered security domains. *\param name Variable name. *\return The value of the requested variable. */ -string *Validator::getValue (string &name) +string *Validator::getValue (HashMap *hashedDomains, string &name) { string domain; string var; @@ -118,7 +135,7 @@ var = name; } - securityDomain = hashedDomains.get (domain); + securityDomain = hashedDomains->get (domain); if (securityDomain) return securityDomain->getValue (var); Modified: branches/myserver_sec_new/src/conf/security/validator_factory.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/validator_factory.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/conf/security/validator_factory.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -35,13 +35,6 @@ ValidatorFactory::~ValidatorFactory () { - HashMap::Iterator it = validators.begin (); - - for (;it != validators.end (); it++) - { - delete *it; - } - validators.clear (); } @@ -62,7 +55,6 @@ Validator* ValidatorFactory::addValidator(string &name, Validator* validator) { return validators.put (name, validator); - } /*! Modified: branches/myserver_sec_new/src/conf/security/xml_validator.cpp =================================================================== --- branches/myserver_sec_new/src/conf/security/xml_validator.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/conf/security/xml_validator.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -18,6 +18,7 @@ #include #include +#include XmlValidator::XmlValidator () { @@ -38,7 +39,7 @@ */ SecurityCache* XmlValidator::getCache(Server *server) { - if (secCache == NULL && server != NULL) + if (!secCache && server) { const char *data = server->getHashedData ("SECURITY_CACHE_NODES"); secCache = new SecurityCache (); @@ -52,84 +53,266 @@ return secCache; } - /*! - *\see XmlValidator#getPermissionMaskImpl. + *Get the XML parser to use. */ -int XmlValidator::getPermissionMaskImpl (SecurityToken* st) +XmlParser* XmlValidator::getParser(SecurityToken* st) { const char *secName; - XmlParser* xmlFile; + SecurityCache *cache = getCache (st->server); - if (cache == NULL) - return 0; + if (!cache) + return NULL; secName = st->vhost ? st->vhost->getHashedData ("SECURITY_FILE_NAME") : NULL; - if (secName == NULL) + if (!secName) secName = st->server ? st->server->getHashedData ("SECURITY_FILE_NAME") : NULL; - if (secName == NULL) + if (!secName) secName = ".security.xml"; - xmlFile = cache->getParser (*st->resource, *st->sysdirectory, false, secName); + return cache->getParser (*st->resource, *st->sysdirectory, false, secName); +} - if (xmlFile == NULL) +/*! + *\see AuthMethod#getPermissionMask. + */ +int XmlValidator::getPermissionMask (SecurityToken* st) +{ + xmlNodePtr root; + XmlParser* xmlFile = getParser (st); + + if (!xmlFile) return 0; for (xmlNodePtr cur = xmlFile->getDoc ()->children; cur; cur = cur->next) if (cur->type == XML_ELEMENT_NODE) { - int cmd; + for (xmlNodePtr curChild = cur->children; curChild; curChild = curChild->next) + if (curChild->type == XML_ELEMENT_NODE) + { + root = curChild; + break; + } + } - computeXmlNode (cur, st, &cmd); + for (xmlNodePtr cur = root; cur; cur = cur->next) + { + if (xmlStrcmp (cur->name, (const xmlChar *) "USER")) + continue; + + xmlAttr *attrs = cur->properties; + + const xmlChar* name; + const xmlChar* password; - return cmd; + int permissions = 0; + + while (attrs) + { + if (!xmlStrcmp (attrs->name, (const xmlChar *)"name") && + attrs->children && attrs->children->content) + name = attrs->children->content; + + if (!xmlStrcmp (attrs->name, (const xmlChar *)"password") && + attrs->children && attrs->children->content) + password = attrs->children->content; + + if (!xmlStrcmp (attrs->name, (const xmlChar *)"read") && + attrs->children && attrs->children->content && + !xmlStrcmp(attrs->children->content, (const xmlChar *) "YES")) + permissions |= MYSERVER_PERMISSION_READ; + + if (!xmlStrcmp (attrs->name, (const xmlChar *)"write") && + attrs->children && attrs->children->content && + !xmlStrcmp(attrs->children->content, (const xmlChar *) "YES")) + permissions |= MYSERVER_PERMISSION_WRITE; + + if (!xmlStrcmp (attrs->name, (const xmlChar *)"execute") && + attrs->children && attrs->children->content && + !xmlStrcmp(attrs->children->content, (const xmlChar *) "YES")) + permissions |= MYSERVER_PERMISSION_EXECUTE; + + if (!xmlStrcmp (attrs->name, (const xmlChar *)"browse") && + attrs->children && attrs->children->content && + !xmlStrcmp(attrs->children->content, (const xmlChar *) "YES")) + permissions |= MYSERVER_PERMISSION_BROWSE; + + attrs = attrs->next; } + if (xmlStrcmp (name, (const xmlChar *)st->user.c_str ())) + continue; + + st->providedMask = permissions; + + if (xmlStrcmp (password, (const xmlChar *)st->password.c_str ())) + st->mask = 0; + else + st->mask = permissions; + + return st->mask; + } + return 0; } + /*! - *Compute the current XML node. + *\see XmlValidator#getPermissionMaskImpl. */ -int XmlValidator::computeXmlNode (xmlNodePtr node, SecurityToken *st, int *cmd) +int XmlValidator::getPermissionMaskImpl (SecurityToken* st, + HashMap *hashedDomains, + AuthMethod* authMethod) { - printf ("%s\n", node->name); + XmlParser* xmlFile = getParser (st); - if (node == NULL) + if (!xmlFile) return 0; - for (xmlNodePtr cur = node->children; cur; cur = cur->next) + for (xmlNodePtr cur = xmlFile->getDoc ()->children; cur; cur = cur->next) if (cur->type == XML_ELEMENT_NODE) { - if (!xmlStrcmp (cur->name, (const xmlChar *) "CONDITION")) - { - string name; - const xmlChar *value = ""; - xmlAttr *attrs = cur->properties; + int cmd = 1; - while (attrs) - { - if(!xmlStrcmp (attrs->name, (const xmlChar *)"name") && - attrs->children && attrs->children->content) - name.assign ((const char*)attrs->children->content); - - if(!xmlStrcmp (attrs->name, (const xmlChar *)"value") && - attrs->children && attrs->children->content) - value = attrs->children->content; - - attrs = attrs->next; - } + computeXmlNode (cur, st, &cmd, hashedDomains); - string *storedValue = getValue (name); + return cmd; + } - if (storedValue && storedValue->compare ((const char*)value) == 0) - computeXmlNode (cur, st, cmd); + return 0; +} - } +/*! + *Compute the current XML node. + */ +int XmlValidator::computeXmlNode (xmlNodePtr node, + SecurityToken *st, + int *cmd, + HashMap *hashedDomains) +{ + if (!node) + return 0; + + for (xmlNodePtr cur = node->children; cur; cur = cur->next) + { + if (cur->type != XML_ELEMENT_NODE) + continue; + + if (!xmlStrcmp (cur->name, (const xmlChar *) "CONDITION")) + { + if (doCondition (cur, hashedDomains) && computeXmlNode (cur, st, cmd, hashedDomains)) + return 1; } + else if (!xmlStrcmp (cur->name, (const xmlChar *) "RETURN")) + { + doReturn (cur, cmd, hashedDomains); + return 1; + } + else if (!xmlStrcmp (cur->name, (const xmlChar *) "DEFINE")) + { + doDefine (cur, st, hashedDomains); + } + } return 0; } + +/*! + *Handle a CONDITION. + */ +bool XmlValidator::doCondition (xmlNodePtr node, HashMap *hashedDomains) +{ + string name; + const xmlChar *isNot = (const xmlChar*)""; + const xmlChar *value = (const xmlChar*)""; + xmlAttr *attrs = node->properties; + + while (attrs) + { + if(!xmlStrcmp (attrs->name, (const xmlChar *)"name") && + attrs->children && attrs->children->content) + name.assign ((const char*)attrs->children->content); + + if(!xmlStrcmp (attrs->name, (const xmlChar *)"value") && + attrs->children && attrs->children->content) + value = attrs->children->content; + + if(!xmlStrcmp (attrs->name, (const xmlChar *)"not") && + attrs->children && attrs->children->content) + isNot = attrs->children->content; + + attrs = attrs->next; + } + + string *storedValue = getValue (hashedDomains, name); + + if (!storedValue) + return false; + + bool eq = storedValue->compare ((const char*)value) == 0; + + if (!xmlStrcmp (isNot, (const xmlChar *) "yes")) + return !eq; + + return eq; +} + +/*! + *Handle a DEFINE. + */ +void XmlValidator::doDefine (xmlNodePtr node, SecurityToken *st, HashMap *hashedDomains) +{ + string name; + const xmlChar *value = (const xmlChar*)""; + xmlAttr *attrs = node->properties; + + while (attrs) + { + if(!xmlStrcmp (attrs->name, (const xmlChar *)"name") && + attrs->children && attrs->children->content) + name.assign ((const char*)attrs->children->content); + + if(!xmlStrcmp (attrs->name, (const xmlChar *)"value") && + attrs->children && attrs->children->content) + value = attrs->children->content; + + attrs = attrs->next; + } + + if (!value) + return; + + string *valStr = new string ((const char *)value); + + string *old = st->values.put (name, valStr); + + if (old) + delete old; +} + +/*! + *Handle a RETURN. + */ +void XmlValidator::doReturn (xmlNodePtr node, int *cmd, HashMap *hashedDomains) +{ + xmlAttr *attrs = node->properties; + + xmlChar *value = NULL; + + while (attrs) + { + if (!xmlStrcmp (attrs->name, (const xmlChar *)"value") && + attrs->children && attrs->children->content) + value = attrs->children->content; + + attrs = attrs->next; + } + + if (value && !xmlStrcmp (value, (const xmlChar *) "ALLOW")) + *cmd = 1; + else + *cmd = 0; +} Modified: branches/myserver_sec_new/src/protocol/http/http.cpp =================================================================== --- branches/myserver_sec_new/src/protocol/http/http.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/src/protocol/http/http.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -428,7 +428,6 @@ st.filename = file.c_str(); st.requiredPassword = ((HttpUserData*)td->connection->protocolBuffer)->requiredPassword; - st.providedMask = &providedMask; staticHttp.secCacheMutex.lock(); try { Modified: branches/myserver_sec_new/tests/test_security_manager.cpp =================================================================== --- branches/myserver_sec_new/tests/test_security_manager.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/tests/test_security_manager.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -24,6 +24,7 @@ #include #include +#include #include @@ -36,12 +37,13 @@ CPPUNIT_TEST( testGetPermissionMask ); CPPUNIT_TEST_SUITE_END(); + AuthMethodFactory authMethodFactory; ValidatorFactory validatorFactory; SecurityManager* securityManager; public: void setUp() { - securityManager = new SecurityManager(&validatorFactory); + securityManager = new SecurityManager(&validatorFactory, &authMethodFactory); } void tearDown() @@ -51,10 +53,9 @@ void testGetPermissionMask() { - string val("value"); SecurityToken secToken; - string validator("xml"); - CPPUNIT_ASSERT_EQUAL(securityManager->getPermissionMask(&secToken, NULL, validator), 0); + string xml("xml"); + CPPUNIT_ASSERT_EQUAL(securityManager->getPermissionMask(&secToken, NULL, xml, xml), 0); } }; Modified: branches/myserver_sec_new/tests/test_validator.cpp =================================================================== --- branches/myserver_sec_new/tests/test_validator.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/tests/test_validator.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -25,7 +25,7 @@ public: void setUp() { - validator = new Validator(); + validator = new Validator (); } void tearDown() @@ -33,26 +33,26 @@ delete validator; } - void testGetValue() + void testGetValue () { - string val("value"); - CPPUNIT_ASSERT_EQUAL(validator->getValue(val), (string*)NULL); - + string val ("value"); + HashMap hashedDomains; + CPPUNIT_ASSERT_EQUAL (validator->getValue (&hashedDomains, val), (string*)NULL); } - void testGetPermissionMaskImpl() + void testGetPermissionMaskImpl () { - string val("value"); + string val ("value"); SecurityToken secToken; - CPPUNIT_ASSERT_EQUAL(validator->getPermissionMaskImpl(&secToken), 0); + CPPUNIT_ASSERT_EQUAL (validator->getPermissionMaskImpl (&secToken, NULL, NULL), 0); } - void testGetPermissionMask() + void testGetPermissionMask () { - string val("value"); + string val ("value"); SecurityToken secToken; - CPPUNIT_ASSERT_EQUAL(validator->getPermissionMask(&secToken, NULL), 0); + CPPUNIT_ASSERT_EQUAL (validator->getPermissionMask (&secToken, NULL, NULL), 0); } }; Modified: branches/myserver_sec_new/tests/test_xml_validator.cpp =================================================================== --- branches/myserver_sec_new/tests/test_xml_validator.cpp 2008-09-28 14:44:47 UTC (rev 2851) +++ branches/myserver_sec_new/tests/test_xml_validator.cpp 2008-09-28 20:56:35 UTC (rev 2852) @@ -36,7 +36,9 @@ void testGetValue() { string val("value"); - CPPUNIT_ASSERT_EQUAL(xmlValidator->getValue(val), (string*)NULL); + HashMap hashedDomains; + + CPPUNIT_ASSERT_EQUAL(xmlValidator->getValue(&hashedDomains, val), (string*)NULL); } @@ -44,7 +46,7 @@ { string val("value"); SecurityToken secToken; - CPPUNIT_ASSERT_EQUAL(xmlValidator->getPermissionMaskImpl(&secToken), 0); + CPPUNIT_ASSERT_EQUAL(xmlValidator->getPermissionMaskImpl(&secToken, NULL, NULL), 0); } @@ -52,7 +54,7 @@ { string val("value"); SecurityToken secToken; - CPPUNIT_ASSERT_EQUAL(xmlValidator->getPermissionMask(&secToken, NULL), 0); + CPPUNIT_ASSERT_EQUAL(xmlValidator->getPermissionMask(&secToken, NULL, NULL), 0); } }; From MAILER-DAEMON Mon Sep 29 06:26:26 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KkFxR-0005r3-O4 for mharc-myserver-commit@gnu.org; Mon, 29 Sep 2008 06:26:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkFxN-0005pP-Bc for myserver-commit@gnu.org; Mon, 29 Sep 2008 06:26:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkFxK-0005oZ-Cf for myserver-commit@gnu.org; Mon, 29 Sep 2008 06:26:19 -0400 Received: from [199.232.76.173] (port=36392 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkFxJ-0005o5-N0 for myserver-commit@gnu.org; Mon, 29 Sep 2008 06:26:17 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43443 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkFxG-00063w-UV for myserver-commit@gnu.org; Mon, 29 Sep 2008 06:26:15 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KkFxF-0007LC-OR for myserver-commit@gnu.org; Mon, 29 Sep 2008 10:26:13 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KkFxF-0007L8-DF for myserver-commit@gnu.org; Mon, 29 Sep 2008 10:26:13 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Mon, 29 Sep 2008 10:26:13 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2853] Fixed a test that sometimes caused a block while running `tests_suite'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2008 10:26:23 -0000 Revision: 2853 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2853 Author: francesco_pipita Date: 2008-09-29 10:26:12 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Fixed a test that sometimes caused a block while running `tests_suite'. Modified Paths: -------------- trunk/myserver/tests/test_socket_stream_creator.cpp Modified: trunk/myserver/tests/test_socket_stream_creator.cpp =================================================================== --- trunk/myserver/tests/test_socket_stream_creator.cpp 2008-09-28 20:56:35 UTC (rev 2852) +++ trunk/myserver/tests/test_socket_stream_creator.cpp 2008-09-29 10:26:12 UTC (rev 2853) @@ -1,19 +1,19 @@ /* - MyServer - Copyright (C) 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + MyServer + Copyright (C) 2008 Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ #include #include @@ -44,7 +44,7 @@ void testCreation () { list filters; - LogStream* ls = ssc->create (ff, "foo:0", filters, 0); + LogStream* ls = ssc->create (ff, "127.0.0.1:0", filters, 0); CPPUNIT_ASSERT (!ls); } From MAILER-DAEMON Mon Sep 29 18:32:14 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KkRHq-0002XE-Gb for mharc-myserver-commit@gnu.org; Mon, 29 Sep 2008 18:32:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkRHo-0002WS-Hs for myserver-commit@gnu.org; Mon, 29 Sep 2008 18:32:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkRHm-0002VV-0p for myserver-commit@gnu.org; Mon, 29 Sep 2008 18:32:10 -0400 Received: from [199.232.76.173] (port=50926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkRHl-0002VA-MX for myserver-commit@gnu.org; Mon, 29 Sep 2008 18:32:09 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49049 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkRHU-0004L4-1I for myserver-commit@gnu.org; Mon, 29 Sep 2008 18:32:09 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KkRHT-0003zz-CS for myserver-commit@gnu.org; Mon, 29 Sep 2008 22:31:51 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KkRHT-0003zv-0I for myserver-commit@gnu.org; Mon, 29 Sep 2008 22:31:51 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Mon, 29 Sep 2008 22:31:51 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2854] Fixed a problem with the `DELETE_CONNECTION' return status in `ClientsThread'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2008 22:32:12 -0000 Revision: 2854 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2854 Author: gscrivano Date: 2008-09-29 22:31:49 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Fixed a problem with the `DELETE_CONNECTION' return status in `ClientsThread'. Modified Paths: -------------- trunk/myserver/include/server/server.h trunk/myserver/src/connections_scheduler/connections_scheduler.cpp trunk/myserver/src/server/server.cpp Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-29 10:26:12 UTC (rev 2853) +++ trunk/myserver/include/server/server.h 2008-09-29 22:31:49 UTC (rev 2854) @@ -150,6 +150,8 @@ ConnectionsScheduler* getConnectionsScheduler(){return &connectionsScheduler;} int deleteConnection(ConnectionPtr); + int notifyDeleteConnection(ConnectionPtr); + void increaseFreeThread(); void decreaseFreeThread(); Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-29 10:26:12 UTC (rev 2853) +++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-29 22:31:49 UTC (rev 2854) @@ -170,7 +170,8 @@ if(!connection->allowDelete()) return; - server->deleteConnection(connection); + server->notifyDeleteConnection(connection); + removeConnection(connection); } else if(event == EV_READ) Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-29 10:26:12 UTC (rev 2853) +++ trunk/myserver/src/server/server.cpp 2008-09-29 22:31:49 UTC (rev 2854) @@ -1482,11 +1482,24 @@ return newConnection; } + + /*! - *Get notified when a connection is closed. + *Delete a connection. */ int Server::deleteConnection(ConnectionPtr s) { + notifyDeleteConnection(s); + connectionsScheduler.removeConnection (s); + + return 0; +} + +/*! + *Get notified when a connection is closed. + */ +int Server::notifyDeleteConnection(ConnectionPtr s) +{ string msg("remove-connection"); vector*>* handlers; From MAILER-DAEMON Tue Sep 30 08:06:44 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kke04-0007Eu-F9 for mharc-myserver-commit@gnu.org; Tue, 30 Sep 2008 08:06:44 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kke02-0007BY-9y for myserver-commit@gnu.org; Tue, 30 Sep 2008 08:06:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kke00-00079d-2F for myserver-commit@gnu.org; Tue, 30 Sep 2008 08:06:40 -0400 Received: from [199.232.76.173] (port=35408 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kkdzz-00079P-Ri for myserver-commit@gnu.org; Tue, 30 Sep 2008 08:06:39 -0400 Received: from savannah.gnu.org ([199.232.41.3]:33738 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kkdzz-00080n-8d for myserver-commit@gnu.org; Tue, 30 Sep 2008 08:06:39 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kkdzy-0001Nv-4P for myserver-commit@gnu.org; Tue, 30 Sep 2008 12:06:38 +0000 Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kkdzx-0001Nr-SB for myserver-commit@gnu.org; Tue, 30 Sep 2008 12:06:38 +0000 MIME-Version: 1.0 Errors-To: francesco_pipita To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Francesco Pipita Message-Id: Date: Tue, 30 Sep 2008 12:06:37 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2855] Replaced nonexistent class `FtpParser' with `FtpProtocol'. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2008 12:06:42 -0000 Revision: 2855 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2855 Author: francesco_pipita Date: 2008-09-30 12:06:37 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Replaced nonexistent class `FtpParser' with `FtpProtocol'. Modified Paths: -------------- trunk/myserver/include/server/clients_thread.h Modified: trunk/myserver/include/server/clients_thread.h =================================================================== --- trunk/myserver/include/server/clients_thread.h 2008-09-29 22:31:49 UTC (rev 2854) +++ trunk/myserver/include/server/clients_thread.h 2008-09-30 12:06:37 UTC (rev 2855) @@ -25,7 +25,7 @@ #include -class FtpParser; +class FtpProtocol; class HttpProtocol; class HttpsProtocol; class ControlProtocol; @@ -96,7 +96,7 @@ u_long buffersize2; int isRunning(); int isStopped(); - FtpParser *ftpParser; + FtpProtocol *ftpParser; HttpProtocol* httpParser; HttpsProtocol* httpsParser; ControlProtocol *controlProtocolParser; From MAILER-DAEMON Tue Sep 30 15:43:23 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kkl7y-0004aY-Ss for mharc-myserver-commit@gnu.org; Tue, 30 Sep 2008 15:43:22 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kkl7x-0004aS-S2 for myserver-commit@gnu.org; Tue, 30 Sep 2008 15:43:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kkl7x-0004aG-0G for myserver-commit@gnu.org; Tue, 30 Sep 2008 15:43:21 -0400 Received: from [199.232.76.173] (port=44208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kkl7w-0004aD-S1 for myserver-commit@gnu.org; Tue, 30 Sep 2008 15:43:20 -0400 Received: from savannah.gnu.org ([199.232.41.3]:47468 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kkl7w-0005lY-GH for myserver-commit@gnu.org; Tue, 30 Sep 2008 15:43:20 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kkl7w-0006Ek-2x for myserver-commit@gnu.org; Tue, 30 Sep 2008 19:43:20 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kkl7v-0006Eg-QI for myserver-commit@gnu.org; Tue, 30 Sep 2008 19:43:19 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 30 Sep 2008 19:43:19 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2856] Don't use the connection after it is scheduled. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2008 19:43:22 -0000 Revision: 2856 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2856 Author: gscrivano Date: 2008-09-30 19:43:19 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Don't use the connection after it is scheduled. Modified Paths: -------------- trunk/myserver/src/server/clients_thread.cpp Modified: trunk/myserver/src/server/clients_thread.cpp =================================================================== --- trunk/myserver/src/server/clients_thread.cpp 2008-09-30 12:06:37 UTC (rev 2855) +++ trunk/myserver/src/server/clients_thread.cpp 2008-09-30 19:43:19 UTC (rev 2856) @@ -389,6 +389,8 @@ retcode = DELETE_CONNECTION; }; + c->setTimeout( getTicks() ); + /*! Delete the connection. */ if(retcode == DELETE_CONNECTION) { @@ -419,8 +421,6 @@ server->getConnectionsScheduler()->addReadyConnection(c); } - c->setTimeout( getTicks() ); - return 0; } From MAILER-DAEMON Tue Sep 30 16:33:18 2008 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KkluI-00056w-Ne for mharc-myserver-commit@gnu.org; Tue, 30 Sep 2008 16:33:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkluG-00056I-BN for myserver-commit@gnu.org; Tue, 30 Sep 2008 16:33:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkluE-00055a-Kn for myserver-commit@gnu.org; Tue, 30 Sep 2008 16:33:15 -0400 Received: from [199.232.76.173] (port=45168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkluE-00055X-HE for myserver-commit@gnu.org; Tue, 30 Sep 2008 16:33:14 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42909 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkluD-0005Yf-Qo for myserver-commit@gnu.org; Tue, 30 Sep 2008 16:33:14 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KkluD-0000hK-90 for myserver-commit@gnu.org; Tue, 30 Sep 2008 20:33:13 +0000 Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KkluC-0000hG-UQ for myserver-commit@gnu.org; Tue, 30 Sep 2008 20:33:13 +0000 MIME-Version: 1.0 Errors-To: gscrivano To: myserver-commit@gnu.org X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Giuseppe Scrivano Message-Id: Date: Tue, 30 Sep 2008 20:33:12 +0000 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [myserver-commit] [2857] Fixed some warning messages. X-BeenThere: myserver-commit@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: myserver-commit.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2008 20:33:16 -0000 Revision: 2857 http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2857 Author: gscrivano Date: 2008-09-30 20:33:12 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Fixed some warning messages. Modified Paths: -------------- trunk/myserver/include/log/stream/log_stream.h trunk/myserver/include/server/server.h trunk/myserver/src/base/files_cache/cached_file_buffer.cpp trunk/myserver/src/base/socket/ssl_socket.cpp trunk/myserver/src/connections_scheduler/connections_scheduler.cpp trunk/myserver/src/http_handler/http_dir/http_dir.cpp trunk/myserver/src/protocol/control/control_protocol.cpp trunk/myserver/src/protocol/ftp/ftp.cpp trunk/myserver/src/protocol/http/http.cpp trunk/myserver/src/server/server.cpp trunk/myserver/tests/main.cpp trunk/myserver/tests/test_base64.cpp trunk/myserver/tests/test_connections_scheduler.cpp trunk/myserver/tests/test_file_stream.cpp trunk/myserver/tests/test_files_utility.cpp trunk/myserver/tests/test_filter_chain.cpp trunk/myserver/tests/test_http_request.cpp trunk/myserver/tests/test_md5.cpp trunk/myserver/tests/test_mem_stream.cpp trunk/myserver/tests/test_mutex.cpp trunk/myserver/tests/test_thread.cpp trunk/myserver/tests/test_utility.cpp Modified: trunk/myserver/include/log/stream/log_stream.h =================================================================== --- trunk/myserver/include/log/stream/log_stream.h 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/include/log/stream/log_stream.h 2008-09-30 20:33:12 UTC (rev 2857) @@ -168,12 +168,6 @@ /*! - * Will be zero after a successful call to the close method. - */ - int isOpened; - - - /*! * A zero value means `never cycle'. A non-zero value establishes * the maximum size allowed for the LogStream's growth before * cycling it. @@ -181,6 +175,12 @@ u_long cycleLog; + /*! + * Will be zero after a successful call to the close method. + */ + int isOpened; + + FiltersChain* filtersChain; Modified: trunk/myserver/include/server/server.h =================================================================== --- trunk/myserver/include/server/server.h 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/include/server/server.h 2008-09-30 20:33:12 UTC (rev 2857) @@ -186,7 +186,6 @@ void *envString; VhostManager *vhostList; MimeManager *mimeManager; - ListenThreads listenThreads; HomeDir homeDir; HashMap hashedData; HashMap globalData; @@ -252,6 +251,7 @@ GenericPluginsManager genericPluginsManager; ProcessServerManager processServerManager; ConnectionsScheduler connectionsScheduler; + ListenThreads listenThreads; bool endServer; }; Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp =================================================================== --- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -123,7 +123,6 @@ */ CachedFileBuffer::CachedFileBuffer(const char* buffer, u_long size) { - u_long nbr; factoryToNotify = 0; refCounter = 0; Modified: trunk/myserver/src/base/socket/ssl_socket.cpp =================================================================== --- trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/base/socket/ssl_socket.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -273,15 +273,23 @@ #ifndef DO_NOT_USE_SSL if(sslConnection) { - do + for (;;) { - err = SSL_read(sslConnection, buffer, len); - }while((err <= 0) && - (SSL_get_error(sslConnection,err) == SSL_ERROR_WANT_X509_LOOKUP) - || (SSL_get_error(sslConnection,err) == SSL_ERROR_WANT_READ) - || (SSL_get_error(sslConnection,err) == SSL_ERROR_WANT_WRITE)); + int sslError; + err = SSL_read(sslConnection, buffer, len); - if(err <= 0) + if (err > 0) + break; + + sslError = SSL_get_error (sslConnection, err); + + if ((sslError != SSL_ERROR_WANT_X509_LOOKUP) && + (sslError != SSL_ERROR_WANT_READ) && + (sslError != SSL_ERROR_WANT_WRITE)) + break; + } + + if (err <= 0) return -1; else return err; Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp =================================================================== --- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -88,21 +88,6 @@ #endif } -static int -make_socket_nonblocking(socket_t fd) -{ - #ifdef WIN32 - { - unsigned long nonblocking = 1; - ioctlsocket(fd, FIONBIO, (unsigned long*) &nonblocking); - } - #else - if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) { - return -1; - } - #endif - return 0; -} /////////////////////////////////////////////////////////////////////////// #ifdef WIN32 @@ -352,8 +337,6 @@ */ void ConnectionsScheduler::initialize() { - static timeval tv = {1, 0}; - event_init(); dispatcherArg.terminated = true; @@ -383,9 +366,6 @@ return; } - //make_socket_nonblocking(dispatcherArg.fd[0]); - //make_socket_nonblocking(dispatcherArg.fd[1]); - event_set(&(dispatcherArg.loopEvent), dispatcherArg.fd[0], EV_READ | EV_TIMEOUT, eventLoopHandler, &dispatcherArg); @@ -550,8 +530,6 @@ if(ready[currentPriority].size()) { - FileHandle handle; - ret = ready[currentPriority].front(); ret->setScheduled(0); ready[currentPriority].pop(); Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp =================================================================== --- trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -182,7 +182,6 @@ int lastSlash = 0; bool useChunks = false; u_long sentData = 0; - int i; char fileTime[32]; char* bufferloop; const char* browseDirCSSpath; Modified: trunk/myserver/src/protocol/control/control_protocol.cpp =================================================================== --- trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/protocol/control/control_protocol.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -750,9 +750,6 @@ int ControlProtocol::killConnection(ConnectionPtr a, u_long id, File* out, char *b1, int bs1, ControlHeader& header) { - int ret = 0; - ConnectionPtr con; - if(id == 0) return -1; Modified: trunk/myserver/src/protocol/ftp/ftp.cpp =================================================================== --- trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/protocol/ftp/ftp.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -1796,7 +1796,7 @@ #ifdef NOT_WIN nlink_t nlink = 1; nlink = fd.getStatStruct()->st_nlink; - sprintf(nlinkStr, "%lu", nlink); + sprintf(nlinkStr, "%lu", (u_long) nlink); #endif char fdSizeStr[12]; @@ -1893,7 +1893,7 @@ #ifdef NOT_WIN nlink_t nlink = 1; nlink = fd.getStatStruct()->st_nlink; - sprintf(nlinkStr, "%lu", nlink); + sprintf(nlinkStr, "%lu", (u_long) nlink); #endif char fdSizeStr[12]; @@ -1996,7 +1996,7 @@ char *pIn = In.getBuffer(); char szReply[3]; - while ( pIn - In.getBuffer() < In.getLength() ) + while ( (u_int) (pIn - In.getBuffer()) < In.getLength() ) { if ( *pIn == '\377' ) { Modified: trunk/myserver/src/protocol/http/http.cpp =================================================================== --- trunk/myserver/src/protocol/http/http.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/protocol/http/http.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -709,14 +709,12 @@ */ string filename; int permissions; - int providedMask; string dirscan; int filenamePathLen; string data; int mimecmd; time_t lastMT; int ret; - char authType[16]; string tmpTime; string directory; string file; Modified: trunk/myserver/src/server/server.cpp =================================================================== --- trunk/myserver/src/server/server.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/src/server/server.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -289,7 +289,6 @@ void Server::start(string &mainConf, string &mimeConf, string &vhostConf, string &externPath, string &langPath) { int err = 0; - int ret; #ifdef WIN32 DWORD eventsCount, cNumRead; INPUT_RECORD irInBuf[128]; @@ -691,8 +690,6 @@ */ void Server::displayBoot() { - u_long i; - #ifdef CLEAR_BOOT_SCREEN if(logManager.getType() == LogManager::TYPE_CONSOLE ) Modified: trunk/myserver/tests/main.cpp =================================================================== --- trunk/myserver/tests/main.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/main.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -23,8 +23,6 @@ #include -char *versionOfSoftware = "MyServer"; - int main(int argc, char* argv[]) { bool xml = argc > 1 && !strcmp(argv[1], "xml"); Modified: trunk/myserver/tests/test_base64.cpp =================================================================== --- trunk/myserver/tests/test_base64.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_base64.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -59,7 +59,7 @@ CPPUNIT_ASSERT_EQUAL(strlen(input), strlen(decoded)); - for (int i = 0; i < strlen(decoded); i++) + for (unsigned int i = 0; i < strlen(decoded); i++) CPPUNIT_ASSERT_EQUAL(input[i], decoded[i]); } Modified: trunk/myserver/tests/test_connections_scheduler.cpp =================================================================== --- trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -88,6 +88,7 @@ virtual int visitConnection(ConnectionPtr conn, void* param) { arg = param; + return 0; } private: void *arg; @@ -126,7 +127,6 @@ void* arg = this; u_long max = 3; - u_long sum = 0; for(u_long i = 0; i < max; i++) { Modified: trunk/myserver/tests/test_file_stream.cpp =================================================================== --- trunk/myserver/tests/test_file_stream.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_file_stream.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -49,7 +49,7 @@ string message ("thisisaverylongmessage\n"); string message2 ("thisisanothermessage\n"); LogStream* ls = fsc->create (ff, "foo", filters, 10); - File* outStream = dynamic_cast(ls->getOutStream ()); + CPPUNIT_ASSERT (!ls->log (message)); CPPUNIT_ASSERT (!ls->log (message2)); ls->close (); Modified: trunk/myserver/tests/test_files_utility.cpp =================================================================== --- trunk/myserver/tests/test_files_utility.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_files_utility.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -82,7 +82,6 @@ void testSplitPath() { - char *path; char dir[256]; char file[256]; @@ -106,7 +105,6 @@ void testSplitPathLength() { - char *path; int dir; int file; Modified: trunk/myserver/tests/test_filter_chain.cpp =================================================================== --- trunk/myserver/tests/test_filter_chain.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_filter_chain.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -76,7 +76,7 @@ int i = nLength; while ( !fc->read(szTemp, 64, &nbw) && i > 0 ) { - strncpy(pBuff, szTemp, nbw>i?i:nbw); + strncpy(pBuff, szTemp, (int)nbw > i ? i : nbw); pBuff += nbw; i -= nbw; } Modified: trunk/myserver/tests/test_http_request.cpp =================================================================== --- trunk/myserver/tests/test_http_request.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_http_request.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -67,6 +67,7 @@ &header, &connection); + CPPUNIT_ASSERT_EQUAL(ret, 200); CPPUNIT_ASSERT(header.cmd.compare("GET") == 0); CPPUNIT_ASSERT(header.ver.compare("HTTP/1.1") == 0); CPPUNIT_ASSERT(header.uri.compare("/resource") == 0); Modified: trunk/myserver/tests/test_md5.cpp =================================================================== --- trunk/myserver/tests/test_md5.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_md5.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -44,7 +44,6 @@ void testHash() { - const char* hex_chars = "0123456789abcdef"; unsigned char out[33]; const unsigned char* msg = (unsigned char* ) "hello world!\n"; Modified: trunk/myserver/tests/test_mem_stream.cpp =================================================================== --- trunk/myserver/tests/test_mem_stream.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_mem_stream.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -66,11 +66,8 @@ void testAvailableToRead() { - u_long nbr; u_long size = addSomeData(stream); - char buffer[20]; - CPPUNIT_ASSERT_EQUAL(size, (u_long)stream->availableToRead()); } @@ -119,7 +116,7 @@ void testFlush() { u_long nbw; - u_long size = addSomeData(stream); + addSomeData(stream); int ret = stream->flush(&nbw); CPPUNIT_ASSERT(nbw >= 0); Modified: trunk/myserver/tests/test_mutex.cpp =================================================================== --- trunk/myserver/tests/test_mutex.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_mutex.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -52,6 +52,8 @@ arg->value++; arg->mutex->unlock(); } + + return NULL; } Modified: trunk/myserver/tests/test_thread.cpp =================================================================== --- trunk/myserver/tests/test_thread.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_thread.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -40,9 +40,9 @@ *arg *= *arg; + return NULL; } - #ifdef WIN32 #define ClientsThread_TYPE int unsigned int __stdcall test_terminate_thread(void* pParam) @@ -61,6 +61,8 @@ //Should never be here. *arg = 1; + + return NULL; } class TestThread : public CppUnit::TestFixture Modified: trunk/myserver/tests/test_utility.cpp =================================================================== --- trunk/myserver/tests/test_utility.cpp 2008-09-30 19:43:19 UTC (rev 2856) +++ trunk/myserver/tests/test_utility.cpp 2008-09-30 20:33:12 UTC (rev 2857) @@ -71,7 +71,7 @@ void testCWD() { char *buffer; - int bufferLen; + unsigned int bufferLen; setcwdBuffer();