From e864adeb9c619e598eb2caa36b71ec5d837173d4 Mon Sep 17 00:00:00 2001 From: zsxxsz Date: Wed, 28 May 2014 21:26:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=B8=E8=A7=84=E6=80=A7BUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=8A=E7=B1=BB=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了新加类 scan_dir 的一些问题; string 增加按行读数据功能; http_client/http_request 增加按行读数据功能 --- acl_cpp_vc2003.sln | 9 + acl_cpp_vc2008.sln | 70 +- acl_cpp_vc2012.sln | 18 + app/master_dispatch/server/master_dispatch.cf | 3 +- changes.txt | 3 + lib_acl/changes.txt | 4 + lib_acl/lib_acl_vc2003.vcproj | 1815 ++++++----------- lib_acl/src/stdlib/filedir/acl_scan_dir.c | 270 ++- lib_acl_cpp/changes.txt | 13 + .../include/acl_cpp/stdlib/scan_dir.hpp | 45 +- lib_acl_cpp/include/acl_cpp/stdlib/string.hpp | 193 +- lib_acl_cpp/lib_acl_cpp_vc2003.vcproj | 1241 ++++------- lib_acl_cpp/lib_acl_cpp_vc2008.vcproj | 20 + lib_acl_cpp/lib_acl_cpp_vc2010.vcxproj | 2 + .../lib_acl_cpp_vc2010.vcxproj.filters | 6 + lib_acl_cpp/lib_acl_cpp_vc2012.rc | 101 + lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj | 4 +- .../lib_acl_cpp_vc2012.vcxproj.filters | 12 +- lib_acl_cpp/resource_vc2012.h | 15 + lib_acl_cpp/samples/Makefile | 2 + lib_acl_cpp/samples/dircopy/main.cpp | 2 +- lib_acl_cpp/samples/http_request2/Makefile | 3 + lib_acl_cpp/samples/http_request2/main.cpp | 106 + lib_acl_cpp/samples/http_request2/valgrind.sh | 6 + .../http_request_manager.vcproj | 2 +- lib_acl_cpp/samples/http_servlet2/Makefile | 3 + .../samples/http_servlet2/http_servlet.cpp | 106 + .../samples/http_servlet2/http_servlet.h | 18 + .../samples/http_servlet2/http_servlet2.cf | 135 ++ .../http_servlet2/http_servlet2.vcproj | 289 +++ .../http_servlet2_vc2012.vcxproj | 203 ++ .../http_servlet2_vc2012.vcxproj.filters | 45 + lib_acl_cpp/samples/http_servlet2/main.cpp | 36 + .../samples/http_servlet2/master_service.cpp | 98 + .../samples/http_servlet2/master_service.h | 81 + lib_acl_cpp/samples/http_servlet2/stdafx.cpp | 8 + lib_acl_cpp/samples/http_servlet2/stdafx.h | 19 + lib_acl_cpp/samples/http_servlet2/valgrind.sh | 3 + lib_acl_cpp/samples/scan_dir/Makefile | 2 + lib_acl_cpp/samples/scan_dir/main.cpp | 139 ++ lib_acl_cpp/samples/scan_dir/scan_dir.vcproj | 240 +++ lib_acl_cpp/samples/scan_dir/scan_dir.vcxproj | 189 ++ .../samples/scan_dir/scan_dir_vc2008.vcproj | 365 ++++ .../samples/scan_dir/scan_dir_vc2012.vcxproj | 194 ++ lib_acl_cpp/samples/scan_dir/valgrind.sh | 3 + lib_acl_cpp/samples/string2/Makefile | 2 + lib_acl_cpp/samples/string2/main.cpp | 84 + lib_acl_cpp/samples/string2/string.vcproj | 240 +++ lib_acl_cpp/samples/string2/string.vcxproj | 189 ++ .../samples/string2/string_vc2008.vcproj | 365 ++++ .../samples/string2/string_vc2012.vcxproj | 194 ++ lib_acl_cpp/samples/string2/valgrind.sh | 3 + lib_acl_cpp/src/http/http_client.cpp | 63 +- lib_acl_cpp/src/stdlib/scan_dir.cpp | 66 +- lib_acl_cpp/src/stdlib/string.cpp | 483 +++-- lib_protocol/lib_protocol_vc2003.vcproj | 487 ++--- 56 files changed, 5464 insertions(+), 2853 deletions(-) create mode 100644 lib_acl_cpp/lib_acl_cpp_vc2012.rc create mode 100644 lib_acl_cpp/resource_vc2012.h create mode 100644 lib_acl_cpp/samples/http_request2/Makefile create mode 100644 lib_acl_cpp/samples/http_request2/main.cpp create mode 100644 lib_acl_cpp/samples/http_request2/valgrind.sh create mode 100644 lib_acl_cpp/samples/http_servlet2/Makefile create mode 100644 lib_acl_cpp/samples/http_servlet2/http_servlet.cpp create mode 100644 lib_acl_cpp/samples/http_servlet2/http_servlet.h create mode 100644 lib_acl_cpp/samples/http_servlet2/http_servlet2.cf create mode 100644 lib_acl_cpp/samples/http_servlet2/http_servlet2.vcproj create mode 100644 lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj create mode 100644 lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj.filters create mode 100644 lib_acl_cpp/samples/http_servlet2/main.cpp create mode 100644 lib_acl_cpp/samples/http_servlet2/master_service.cpp create mode 100644 lib_acl_cpp/samples/http_servlet2/master_service.h create mode 100644 lib_acl_cpp/samples/http_servlet2/stdafx.cpp create mode 100644 lib_acl_cpp/samples/http_servlet2/stdafx.h create mode 100644 lib_acl_cpp/samples/http_servlet2/valgrind.sh create mode 100644 lib_acl_cpp/samples/scan_dir/Makefile create mode 100644 lib_acl_cpp/samples/scan_dir/main.cpp create mode 100644 lib_acl_cpp/samples/scan_dir/scan_dir.vcproj create mode 100644 lib_acl_cpp/samples/scan_dir/scan_dir.vcxproj create mode 100644 lib_acl_cpp/samples/scan_dir/scan_dir_vc2008.vcproj create mode 100644 lib_acl_cpp/samples/scan_dir/scan_dir_vc2012.vcxproj create mode 100644 lib_acl_cpp/samples/scan_dir/valgrind.sh create mode 100644 lib_acl_cpp/samples/string2/Makefile create mode 100644 lib_acl_cpp/samples/string2/main.cpp create mode 100644 lib_acl_cpp/samples/string2/string.vcproj create mode 100644 lib_acl_cpp/samples/string2/string.vcxproj create mode 100644 lib_acl_cpp/samples/string2/string_vc2008.vcproj create mode 100644 lib_acl_cpp/samples/string2/string_vc2012.vcxproj create mode 100644 lib_acl_cpp/samples/string2/valgrind.sh diff --git a/acl_cpp_vc2003.sln b/acl_cpp_vc2003.sln index f70889626..7e14a982b 100644 --- a/acl_cpp_vc2003.sln +++ b/acl_cpp_vc2003.sln @@ -231,14 +231,20 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_acl", "lib_acl\lib_acl_vc2003.vcproj", "{B40213C2-507C-4C7F-A6E1-B850C9BDC27B}" ProjectSection(ProjectDependencies) = postProject EndProjectSection + ProjectSection(ProjectDependencies) = postProject + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_protocol", "lib_protocol\lib_protocol_vc2003.vcproj", "{FE724EF7-3763-4E78-BDF5-BCBC075719FD}" ProjectSection(ProjectDependencies) = postProject EndProjectSection + ProjectSection(ProjectDependencies) = postProject + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_acl_cpp", "lib_acl_cpp\lib_acl_cpp_vc2003.vcproj", "{6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC}" ProjectSection(ProjectDependencies) = postProject EndProjectSection + ProjectSection(ProjectDependencies) = postProject + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "singleton", "lib_acl_cpp\samples\singleton\singleton.vcproj", "{128791D9-6787-471C-9A0C-0DCAE53F4911}" ProjectSection(ProjectDependencies) = postProject @@ -361,6 +367,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json6", "lib_acl_cpp\sample EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "http_request_manager", "lib_acl_cpp\samples\http_request_manager\http_request_manager.vcproj", "{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}" ProjectSection(ProjectDependencies) = postProject + {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} + {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} + {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connect_manager", "lib_acl_cpp\samples\connect_manager\connect_manager.vcproj", "{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}" diff --git a/acl_cpp_vc2008.sln b/acl_cpp_vc2008.sln index bc3f5b67e..79784310c 100644 --- a/acl_cpp_vc2008.sln +++ b/acl_cpp_vc2008.sln @@ -1,5 +1,21 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{4FE55739-6D3E-4FA7-BC10-05AB84E3D721}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "aio", "aio", "{B8331BFA-4F66-41B8-9A0F-8B7617DC07B8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "http", "http", "{A5067909-CF04-464D-AE14-FF26459A91D2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "master", "master", "{760D6431-74CA-434F-AFAA-7816162F9821}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mime", "mime", "{A5249932-813D-4B64-9307-0EB5FC464705}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "db", "db", "{9FE233BA-6510-4A21-9CB4-C2FF448506A3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "stream", "stream", "{462CDA64-00AD-4468-B0CD-A24D8897BE04}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "thread", "thread", "{F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_protocol", "lib_protocol\lib_protocol_vc2008.vcproj", "{FE724EF7-3763-4E78-BDF5-BCBC075719FD}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acl_cpp_test", "lib_acl_cpp\samples\acl_cpp_test\acl_cpp_test_vc2008.vcproj", "{C8CED6EB-DCC8-4CEE-921F-3190C879B116}" @@ -377,22 +393,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "http_request_manager", "lib {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{4FE55739-6D3E-4FA7-BC10-05AB84E3D721}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "aio", "aio", "{B8331BFA-4F66-41B8-9A0F-8B7617DC07B8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "http", "http", "{A5067909-CF04-464D-AE14-FF26459A91D2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "master", "master", "{760D6431-74CA-434F-AFAA-7816162F9821}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mime", "mime", "{A5249932-813D-4B64-9307-0EB5FC464705}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "db", "db", "{9FE233BA-6510-4A21-9CB4-C2FF448506A3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "stream", "stream", "{462CDA64-00AD-4468-B0CD-A24D8897BE04}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "thread", "thread", "{F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connect_manager", "lib_acl_cpp\samples\connect_manager\connect_manager_vc2008.vcproj", "{F7B28783-B507-42D8-BB2B-4B61E2B49FB7}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} @@ -868,34 +868,35 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} - {1509DA30-29B0-4B73-921A-BBBD9E5608BE} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {A5067909-CF04-464D-AE14-FF26459A91D2} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {760D6431-74CA-434F-AFAA-7816162F9821} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {A5249932-813D-4B64-9307-0EB5FC464705} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {9FE233BA-6510-4A21-9CB4-C2FF448506A3} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {462CDA64-00AD-4468-B0CD-A24D8897BE04} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {C8CED6EB-DCC8-4CEE-921F-3190C879B116} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {1509DA30-29B0-4B73-921A-BBBD9E5608BE} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {840C2263-DF87-4FD2-8964-EF81B74695FE} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {5F4063AD-B591-4C64-ADEA-609968A83550} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {02B1C8C9-0B52-491D-89D3-8B37CE3A4FE9} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} - {462CDA64-00AD-4468-B0CD-A24D8897BE04} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {F37E8828-252D-4F3E-A5B6-E3770750042F} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} - {760D6431-74CA-434F-AFAA-7816162F9821} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {B8029C89-9870-4EE4-ADD0-E7852E0D1810} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {B320FF31-CC9A-41F7-B96D-7DA2FE0B45F2} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} - {A5249932-813D-4B64-9307-0EB5FC464705} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {90D013A0-4813-4BAB-8155-D175631A695E} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {128791D9-6787-471C-9A0C-0DCAE53F4911} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {C94BEF01-706C-49A7-9FF1-9D87FA5BB8E7} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} - {F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {143ED97E-1EC6-4821-A5FA-A6728B69273E} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {2DABFAD1-114B-4F96-9185-DC0C56A3662D} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {F6292B2C-2C57-40E1-805F-86D9FB1C3251} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} - {C8CED6EB-DCC8-4CEE-921F-3190C879B116} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {F7B28783-B507-42D8-BB2B-4B61E2B49FB7} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {9A04F86E-D4CB-45ED-9BB6-9939B9400B6F} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} {BE2DF8B2-2DCD-4F32-99B9-0B0CA24BFAD9} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} {956FA905-A77F-41FE-A4BE-C3BD3B5B3E83} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} {225D0BFA-64D7-4F8F-951E-36A494CF6178} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} {349F7822-A752-42F0-BB13-4A28497D68DF} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} {8CF882F1-3D3C-4233-BCA6-7F90E49B80BE} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} {ADE6F714-BD52-432D-AB86-62FA59AB6746} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} - {9A04F86E-D4CB-45ED-9BB6-9939B9400B6F} = {B8331BFA-4F66-41B8-9A0F-8B7617DC07B8} + {864A7341-756C-4BF9-A16F-059FDD972D79} = {A5067909-CF04-464D-AE14-FF26459A91D2} {A28B19ED-291C-47C8-BDD5-10BB038C371E} = {A5067909-CF04-464D-AE14-FF26459A91D2} {82B65DCB-D910-4B92-BFDF-15896A575861} = {A5067909-CF04-464D-AE14-FF26459A91D2} {BC32C5A1-CDE1-4872-9CE8-5F3A65D39680} = {A5067909-CF04-464D-AE14-FF26459A91D2} @@ -905,28 +906,27 @@ Global {5A189A92-9AF4-49FC-ABF4-8220A26E46D0} = {A5067909-CF04-464D-AE14-FF26459A91D2} {C0A7DB86-EF13-4A3E-9F34-8950521C9675} = {A5067909-CF04-464D-AE14-FF26459A91D2} {5E83EEF1-A13E-4B61-A8DA-8884113C84B4} = {A5067909-CF04-464D-AE14-FF26459A91D2} - {864A7341-756C-4BF9-A16F-059FDD972D79} = {A5067909-CF04-464D-AE14-FF26459A91D2} - {A804ECF6-59F0-4CCF-8D71-6E44CBCA2796} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} - {20013703-57CC-4821-BF24-129A12490435} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} - {DC7E75E5-FE42-4529-9D9A-19D240B8727B} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} - {82C00ED0-AEF5-4E5B-9581-1EA052CBEA01} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} - {7DA0AC89-62E4-4D02-9BC5-C32E6846E168} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} - {41FA5224-3315-4CDA-9C44-19085049F179} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} - {B14C93A6-DABE-48F9-A78C-C94049B69984} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} - {7680672C-4C9B-4BE8-8BAE-BB23B951AAA0} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} + {4B7C83E5-C34F-4C42-9A37-E5F33FBA2EA3} = {760D6431-74CA-434F-AFAA-7816162F9821} {30C232C9-8064-4C45-8030-696F367A1B66} = {760D6431-74CA-434F-AFAA-7816162F9821} {B7EE43F4-7541-48A7-A066-DA60A55E67ED} = {760D6431-74CA-434F-AFAA-7816162F9821} {FA0EEABF-CC21-4A99-89AA-D0379175E55A} = {760D6431-74CA-434F-AFAA-7816162F9821} {80F0213B-A053-4420-BAF9-4657AD8473DA} = {760D6431-74CA-434F-AFAA-7816162F9821} {1DD31312-7815-49A6-AD50-82205FA8C4A5} = {760D6431-74CA-434F-AFAA-7816162F9821} {FCF1825E-6A9C-4621-832C-D7FC6810707D} = {760D6431-74CA-434F-AFAA-7816162F9821} - {4B7C83E5-C34F-4C42-9A37-E5F33FBA2EA3} = {760D6431-74CA-434F-AFAA-7816162F9821} + {52AA7352-CE48-4F60-B92D-1EB16A79FE54} = {A5249932-813D-4B64-9307-0EB5FC464705} {19CB30E5-2672-4A8B-96FB-9C42970CCF69} = {A5249932-813D-4B64-9307-0EB5FC464705} {5DC79C83-9DE8-46B3-A172-8A4E3371878B} = {A5249932-813D-4B64-9307-0EB5FC464705} {1B51538E-859A-46FE-B423-592D79DEEF63} = {A5249932-813D-4B64-9307-0EB5FC464705} {503AFD46-DF2F-4D2B-8584-60AD2007D2BE} = {A5249932-813D-4B64-9307-0EB5FC464705} - {52AA7352-CE48-4F60-B92D-1EB16A79FE54} = {A5249932-813D-4B64-9307-0EB5FC464705} - {6319215C-021F-4439-A085-D1F35BF6E85A} = {F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F} + {82C00ED0-AEF5-4E5B-9581-1EA052CBEA01} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} + {A804ECF6-59F0-4CCF-8D71-6E44CBCA2796} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} + {20013703-57CC-4821-BF24-129A12490435} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} + {DC7E75E5-FE42-4529-9D9A-19D240B8727B} = {9FE233BA-6510-4A21-9CB4-C2FF448506A3} + {7680672C-4C9B-4BE8-8BAE-BB23B951AAA0} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} + {7DA0AC89-62E4-4D02-9BC5-C32E6846E168} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} + {41FA5224-3315-4CDA-9C44-19085049F179} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} + {B14C93A6-DABE-48F9-A78C-C94049B69984} = {462CDA64-00AD-4468-B0CD-A24D8897BE04} {5BE9D250-12FD-48D2-B918-035E079E5BD0} = {F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F} + {6319215C-021F-4439-A085-D1F35BF6E85A} = {F3E793C9-05F6-46CC-AFC1-6A3590AC2B4F} EndGlobalSection EndGlobal diff --git a/acl_cpp_vc2012.sln b/acl_cpp_vc2012.sln index ea0ce290b..82a18fef9 100644 --- a/acl_cpp_vc2012.sln +++ b/acl_cpp_vc2012.sln @@ -194,6 +194,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connect_manager", "lib_acl_ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dircopy", "lib_acl_cpp\samples\dircopy\dircopy_vc2012.vcxproj", "{98BB9F33-AFC3-4943-8855-4D253B87F8F1}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scan_dir", "lib_acl_cpp\samples\scan_dir\scan_dir_vc2012.vcxproj", "{8A5563B4-C546-46D0-9C64-D051CA29F164}" + ProjectSection(ProjectDependencies) = postProject + {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} + {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} + {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -543,6 +550,16 @@ Global {98BB9F33-AFC3-4943-8855-4D253B87F8F1}.Releasedll|Win32.Build.0 = Releasedll|Win32 {98BB9F33-AFC3-4943-8855-4D253B87F8F1}.Template|Win32.ActiveCfg = DebugDll|Win32 {98BB9F33-AFC3-4943-8855-4D253B87F8F1}.Template|Win32.Build.0 = DebugDll|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Debug|Win32.ActiveCfg = Debug|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Debug|Win32.Build.0 = Debug|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.DebugDll|Win32.ActiveCfg = DebugDll|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.DebugDll|Win32.Build.0 = DebugDll|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Release|Win32.ActiveCfg = Release|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Release|Win32.Build.0 = Release|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Releasedll|Win32.ActiveCfg = Releasedll|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Releasedll|Win32.Build.0 = Releasedll|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Template|Win32.ActiveCfg = DebugDll|Win32 + {8A5563B4-C546-46D0-9C64-D051CA29F164}.Template|Win32.Build.0 = DebugDll|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -564,6 +581,7 @@ Global {BE48C8C9-2F6D-450B-9D42-4666E9257C8A} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} {A76344E8-D8EF-4E0D-9A01-73DB25B5B76E} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} {98BB9F33-AFC3-4943-8855-4D253B87F8F1} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} + {8A5563B4-C546-46D0-9C64-D051CA29F164} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} {956FA905-A77F-41FE-A4BE-C3BD3B5B3E83} = {02535D96-1693-4AA3-B650-B22DC776FDC2} {225D0BFA-64D7-4F8F-951E-36A494CF6178} = {02535D96-1693-4AA3-B650-B22DC776FDC2} {ADE6F714-BD52-432D-AB86-62FA59AB6746} = {02535D96-1693-4AA3-B650-B22DC776FDC2} diff --git a/app/master_dispatch/server/master_dispatch.cf b/app/master_dispatch/server/master_dispatch.cf index 1854c529a..b1bc0c2ee 100644 --- a/app/master_dispatch/server/master_dispatch.cf +++ b/app/master_dispatch/server/master_dispatch.cf @@ -88,7 +88,7 @@ service master_dispatch { aio_thread_idle_limit = 60 # ʵĿͻIPַΧ - aio_access_allow = 127.0.0.1:255.255.255.255, 127.0.0.1:127.0.0.1 + aio_access_allow = all # acl_master ˳ʱֵ1ó򲻵Ӵϱ˳ aio_quick_abort = 1 @@ -102,4 +102,3 @@ service master_dispatch { # ǷͻӭϢ # send_banner = 0 } - diff --git a/changes.txt b/changes.txt index eb723817a..863823ef6 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,8 @@ ޸ʷб ------------------------------------------------------------------------ +70) 2014.5.27 +70.1) ˹ VC2003, VC2008, VC2010, VC2012 + 69) 2014.4.10 69.1) VC2008, VC2010, VC2012 ļнӷĿ¼ diff --git a/lib_acl/changes.txt b/lib_acl/changes.txt index a42cf2458..299dc780b 100644 --- a/lib_acl/changes.txt +++ b/lib_acl/changes.txt @@ -1,6 +1,10 @@ ޸ʷб ------------------------------------------------------------------------ +444) 2014.5.26 +444.1) acl_scan_dir.c: ˴룬ڷصĿ¼ַУĸ +'/' '\\' (win32)ԶȥβĿ¼ָ + 443) 2014.5.20 443.1) feature: acl_master Է root ûУҪļ(main.cf) limit_privilege = 0 diff --git a/lib_acl/lib_acl_vc2003.vcproj b/lib_acl/lib_acl_vc2003.vcproj index ffe9dd8c7..24c49af5a 100644 --- a/lib_acl/lib_acl_vc2003.vcproj +++ b/lib_acl/lib_acl_vc2003.vcproj @@ -1,46 +1,26 @@ + SccProjectName="" + SccLocalPath=""> + Name="Win32"/> - - - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + SuppressStartupBanner="TRUE" + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + SuppressStartupBanner="TRUE"/> - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + CompileAs="0"/> - - + Name="VCCustomBuildTool"/> + SuppressStartupBanner="TRUE"/> - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + TargetMachine="1"/> - - - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + + - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + TargetMachine="1"/> - - - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + + @@ -331,2057 +235,1602 @@ + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + RelativePath=".\src\acl_stdafx.c"> + Name="Release|Win32"> + UsePrecompiledHeader="1"/> + Name="Debug|Win32"> + UsePrecompiledHeader="1"/> + Name="ReleaseDll|Win32"> + UsePrecompiledHeader="1"/> + Name="DebugDll|Win32"> + UsePrecompiledHeader="1"/> + RelativePath=".\lib_acl.rc"> + RelativePath=".\StdAfx.h"> + Filter=""> + RelativePath=".\src\stdlib\acl_chunk_chain.c"> + RelativePath=".\src\stdlib\acl_debug.c"> + RelativePath=".\src\stdlib\acl_file.c"> + RelativePath=".\src\stdlib\acl_getopt.c"> + RelativePath=".\src\stdlib\acl_meter_time.c"> + RelativePath=".\src\stdlib\acl_msg.c"> + RelativePath=".\src\stdlib\acl_myflock.c"> + RelativePath=".\src\stdlib\acl_mylog.c"> + RelativePath=".\src\stdlib\acl_readline.c"> + RelativePath=".\src\stdlib\acl_vbuf.c"> + RelativePath=".\src\stdlib\acl_vbuf_print.c"> + RelativePath=".\src\stdlib\acl_vsprintf.c"> + RelativePath=".\src\stdlib\acl_vstream.c"> + RelativePath=".\src\stdlib\acl_vstream_popen.c"> + RelativePath=".\src\stdlib\acl_vstring.c"> + RelativePath=".\src\stdlib\acl_vstring_vstream.c"> + RelativePath=".\src\stdlib\charmap.h"> + RelativePath=".\src\stdlib\getopt.c"> + Filter=""> + RelativePath=".\src\stdlib\iostuff\acl_close_on_exec.c"> + RelativePath=".\src\stdlib\iostuff\acl_closefrom.c"> + RelativePath=".\src\stdlib\iostuff\acl_doze.c"> + RelativePath=".\src\stdlib\iostuff\acl_duplex_pipe.c"> + RelativePath=".\src\stdlib\iostuff\acl_fdtype.c"> + RelativePath=".\src\stdlib\iostuff\acl_non_blocking.c"> + RelativePath=".\src\stdlib\iostuff\acl_open_limit.c"> + RelativePath=".\src\stdlib\iostuff\acl_peekfd.c"> + RelativePath=".\src\stdlib\iostuff\acl_pipe.c"> + RelativePath=".\src\stdlib\iostuff\acl_read_wait.c"> + RelativePath=".\src\stdlib\iostuff\acl_readable.c"> + RelativePath=".\src\stdlib\iostuff\acl_timed_read.c"> + RelativePath=".\src\stdlib\iostuff\acl_timed_write.c"> + RelativePath=".\src\stdlib\iostuff\acl_write_buf.c"> + RelativePath=".\src\stdlib\iostuff\acl_write_wait.c"> + Filter=""> + RelativePath=".\src\stdlib\common\acl_argv.c"> + RelativePath=".\src\stdlib\common\acl_argv_split.c"> + RelativePath=".\src\stdlib\common\acl_array.c"> + RelativePath=".\src\stdlib\common\acl_binhash.c"> + RelativePath=".\src\stdlib\common\acl_btree.c"> + RelativePath=".\src\stdlib\common\acl_cache.c"> + RelativePath=".\src\stdlib\common\acl_cache2.c"> + RelativePath=".\src\stdlib\common\acl_dlink.c"> + RelativePath=".\src\stdlib\common\acl_fifo.c"> + RelativePath=".\src\stdlib\common\acl_hash.c"> + RelativePath=".\src\stdlib\common\acl_htable.c"> + RelativePath=".\src\stdlib\common\acl_iplink.c"> + RelativePath=".\src\stdlib\common\acl_ring.c"> + RelativePath=".\src\stdlib\common\acl_stack.c"> + RelativePath=".\src\stdlib\common\acl_token_tree.c"> + RelativePath=".\src\stdlib\common\avl.c"> + Filter=""> + RelativePath=".\src\stdlib\configure\acl_loadcfg.c"> + RelativePath=".\src\stdlib\configure\acl_xinetd_cfg.c"> + RelativePath=".\src\stdlib\configure\acl_xinetd_params.c"> + Filter=""> + RelativePath=".\src\stdlib\filedir\acl_dir.c"> + RelativePath=".\src\stdlib\filedir\acl_fhandle.c"> + RelativePath=".\src\stdlib\filedir\acl_make_dirs.c"> + RelativePath=".\src\stdlib\filedir\acl_sane_basename.c"> + RelativePath=".\src\stdlib\filedir\acl_scan_dir.c"> + RelativePath=".\src\stdlib\filedir\dir_sys_patch.h"> + Filter=""> + RelativePath=".\src\stdlib\sys\acl_dll.c"> + RelativePath=".\src\stdlib\sys\acl_env.c"> + RelativePath=".\src\stdlib\sys\acl_exec_command.c"> + RelativePath=".\src\stdlib\sys\acl_process.c"> + RelativePath=".\src\stdlib\sys\acl_safe_getenv.c"> + RelativePath=".\src\stdlib\sys\acl_sys_file.c"> + RelativePath=".\src\stdlib\sys\acl_sys_socket.c"> + RelativePath=".\src\stdlib\sys\acl_unsafe.c"> + RelativePath=".\src\stdlib\sys\gettimeofday.c"> + RelativePath=".\src\stdlib\sys\sleep.c"> + RelativePath=".\src\stdlib\sys\snprintf.c"> + Filter=""> + RelativePath=".\src\stdlib\sys\unix\acl_chroot_uid.c"> + RelativePath=".\src\stdlib\sys\unix\acl_mychown.c"> + RelativePath=".\src\stdlib\sys\unix\acl_open_lock.c"> + RelativePath=".\src\stdlib\sys\unix\acl_safe_open.c"> + RelativePath=".\src\stdlib\sys\unix\acl_sane_socketpair.c"> + RelativePath=".\src\stdlib\sys\unix\acl_set_eugid.c"> + RelativePath=".\src\stdlib\sys\unix\acl_set_ugid.c"> + RelativePath=".\src\stdlib\sys\unix\acl_timed_wait.c"> + RelativePath=".\src\stdlib\sys\unix\acl_transfer_fd.c"> + RelativePath=".\src\stdlib\sys\unix\acl_username.c"> + RelativePath=".\src\stdlib\sys\unix\acl_watchdog.c"> + RelativePath=".\src\stdlib\sys\unix\posix_signals.c"> + RelativePath=".\src\stdlib\sys\unix\posix_signals.h"> + Filter=""> + RelativePath=".\src\stdlib\string\acl_alldig.c"> + RelativePath=".\src\stdlib\string\acl_basename.c"> + RelativePath=".\src\stdlib\string\acl_concatenate.c"> + RelativePath=".\src\stdlib\string\acl_hex_code.c"> + RelativePath=".\src\stdlib\string\acl_mystring.c"> + RelativePath=".\src\stdlib\string\acl_split_at.c"> + RelativePath=".\src\stdlib\string\acl_split_nameval.c"> + RelativePath=".\src\stdlib\string\acl_str2time.c"> + RelativePath=".\src\stdlib\string\strcasecmp.c"> + RelativePath=".\src\stdlib\string\strcasestr.c"> + Filter=""> + RelativePath=".\src\stdlib\memory\acl_allocator.c"> + RelativePath=".\src\stdlib\memory\acl_dbuf_pool.c"> + RelativePath=".\src\stdlib\memory\acl_default_malloc.c"> + RelativePath=".\src\stdlib\memory\acl_malloc_glue.c"> + RelativePath=".\src\stdlib\memory\acl_mem_hook.c"> + RelativePath=".\src\stdlib\memory\acl_mem_slice.c"> + RelativePath=".\src\stdlib\memory\acl_mempool.c"> + RelativePath=".\src\stdlib\memory\acl_slice.c"> + RelativePath=".\src\stdlib\memory\allocator.h"> + RelativePath=".\src\stdlib\memory\malloc_vars.h"> + RelativePath=".\src\stdlib\memory\mem_pool.c"> + RelativePath=".\src\stdlib\memory\ring.h"> + RelativePath=".\src\stdlib\memory\squid_allocator.c"> + RelativePath=".\src\stdlib\memory\squid_allocator.h"> + RelativePath=".\src\stdlib\memory\squid_allocator_tools.c"> + RelativePath=".\src\stdlib\memory\vstring_pool.c"> + Filter=""> + RelativePath=".\src\stdlib\debug\acl_debug_malloc.c"> + RelativePath=".\src\stdlib\debug\debug_htable.c"> + RelativePath=".\src\stdlib\debug\htable.h"> + Filter=""> + RelativePath=".\src\net\acl_access.c"> + RelativePath=".\src\net\acl_host_port.c"> + RelativePath=".\src\net\acl_ifconf.c"> + RelativePath=".\src\net\acl_mask_addr.c"> + RelativePath=".\src\net\acl_sane_inet.c"> + RelativePath=".\src\net\acl_sane_socket.c"> + RelativePath=".\src\net\acl_tcp_ctl.c"> + RelativePath=".\src\net\acl_valid_hostname.c"> + RelativePath=".\src\net\acl_vstream_net.c"> + RelativePath=".\src\net\Ipifcons.h"> + RelativePath=".\src\net\IPTypes.h"> + Filter=""> + RelativePath=".\src\net\listen\acl_fifo_listen.c"> + RelativePath=".\src\net\listen\acl_inet_listen.c"> + RelativePath=".\src\net\listen\acl_sane_accept.c"> + RelativePath=".\src\net\listen\acl_unix_listen.c"> + Filter=""> + RelativePath=".\src\net\connect\acl_inet_connect.c"> + RelativePath=".\src\net\connect\acl_sane_connect.c"> + RelativePath=".\src\net\connect\acl_stream_connect.c"> + RelativePath=".\src\net\connect\acl_timed_connect.c"> + RelativePath=".\src\net\connect\acl_unix_connect.c"> + Filter=""> + RelativePath=".\src\net\dns\acl_dns.c"> + RelativePath=".\src\net\dns\acl_netdb.c"> + RelativePath=".\src\net\dns\acl_netdb_cache.c"> + RelativePath=".\src\net\dns\acl_res.c"> + RelativePath=".\src\net\dns\res_util.c"> + RelativePath=".\src\net\dns\rfc1035.c"> + RelativePath=".\src\net\dns\rfc1035.h"> + RelativePath=".\src\net\dns\util.h"> + Filter=""> + RelativePath=".\src\thread\acl_pthread.c"> + RelativePath=".\src\thread\acl_pthread_cond.c"> + RelativePath=".\src\thread\acl_pthread_mutex.c"> + RelativePath=".\src\thread\acl_pthread_pool.c"> + RelativePath=".\src\thread\acl_pthread_rwlock.c"> + RelativePath=".\src\thread\acl_sem.c"> + Filter=""> + RelativePath=".\src\msg\acl_aqueue.c"> + RelativePath=".\src\msg\acl_msgio.c"> + Filter=""> + RelativePath=".\src\xml\acl_xml.c"> + RelativePath=".\src\xml\acl_xml_parse.c"> + RelativePath=".\src\xml\acl_xml_util.c"> + Filter=""> + RelativePath=".\src\event\acl_events.c"> + RelativePath=".\src\event\acl_timer.c"> + RelativePath=".\src\event\events.c"> + RelativePath=".\src\event\events.h"> + RelativePath=".\src\event\events_alloc.c"> + RelativePath=".\src\event\events_define.h"> + RelativePath=".\src\event\events_devpoll.h"> + RelativePath=".\src\event\events_dog.c"> + RelativePath=".\src\event\events_dog.h"> + RelativePath=".\src\event\events_epoll.h"> + RelativePath=".\src\event\events_epoll_thr.c"> + RelativePath=".\src\event\events_fdtable.c"> + RelativePath=".\src\event\events_fdtable.h"> + RelativePath=".\src\event\events_iocp.c"> + RelativePath=".\src\event\events_iocp.h"> + RelativePath=".\src\event\events_kernel.c"> + RelativePath=".\src\event\events_kernel_thr.c"> + RelativePath=".\src\event\events_kqueue.h"> + RelativePath=".\src\event\events_poll.c"> + RelativePath=".\src\event\events_poll_thr.c"> + RelativePath=".\src\event\events_select.c"> + RelativePath=".\src\event\events_select_thr.c"> + RelativePath=".\src\event\events_timer.c"> + RelativePath=".\src\event\events_timer_thr.c"> + RelativePath=".\src\event\events_wmsg.c"> + RelativePath=".\src\event\events_wmsg.h"> + RelativePath=".\src\event\fdmap.c"> + RelativePath=".\src\event\fdmap.h"> + Filter=""> + RelativePath=".\src\ioctl\acl_ioctl.c"> + RelativePath=".\src\ioctl\ioctl_internal.h"> + RelativePath=".\src\ioctl\ioctl_proc.c"> + RelativePath=".\src\ioctl\ioctl_thr.c"> + Filter=""> + RelativePath=".\src\aio\acl_aio.c"> + RelativePath=".\src\aio\acl_aio_connect.c"> + RelativePath=".\src\aio\acl_aio_listen.c"> + RelativePath=".\src\aio\acl_aio_read.c"> + RelativePath=".\src\aio\acl_aio_stream.c"> + RelativePath=".\src\aio\acl_aio_write.c"> + RelativePath=".\src\aio\aio.h"> + RelativePath=".\src\aio\aio_callback.c"> + Filter=""> + RelativePath=".\src\db\acl_dbpool.c"> + RelativePath=".\src\db\acl_dbsql.c"> + Filter=""> + RelativePath=".\src\db\mysql\acl_dbmysql.c"> + RelativePath=".\src\db\mysql\acl_dbmysql.h"> + RelativePath=".\src\db\mysql\acl_dbpool_mysql.c"> + RelativePath=".\src\db\mysql\acl_dbpool_mysql.h"> + Filter=""> + RelativePath=".\src\db\memdb\acl_mdb.c"> + RelativePath=".\src\db\memdb\acl_mdt.c"> + RelativePath=".\src\db\memdb\acl_mdt_avl.c"> + RelativePath=".\src\db\memdb\acl_mdt_binhash.c"> + RelativePath=".\src\db\memdb\acl_mdt_hash.c"> + RelativePath=".\src\db\memdb\define.h"> + RelativePath=".\src\db\memdb\mdb_private.h"> + RelativePath=".\src\db\memdb\ring.h"> + RelativePath=".\src\db\memdb\struct.h"> + Filter=""> + RelativePath=".\src\db\null\acl_dbnull.c"> + RelativePath=".\src\db\null\acl_dbnull.h"> + RelativePath=".\src\db\null\acl_dbpool_null.c"> + RelativePath=".\src\db\null\acl_dbpool_null.h"> + Filter=""> + RelativePath=".\src\db\zdb\zdb.c"> + RelativePath=".\src\db\zdb\zdb_dat.c"> + RelativePath=".\src\db\zdb\zdb_dat_iter.c"> + RelativePath=".\src\db\zdb\zdb_dat_walk.c"> + RelativePath=".\src\db\zdb\zdb_io.c"> + RelativePath=".\src\db\zdb\zdb_key.c"> + RelativePath=".\src\db\zdb\zdb_key_walk.c"> + RelativePath=".\src\db\zdb\zdb_private.h"> + Filter=""> + RelativePath=".\src\unit_test\acl_test_cfg.c"> + RelativePath=".\src\unit_test\acl_test_cfg_general.c"> + RelativePath=".\src\unit_test\acl_test_inner.c"> + RelativePath=".\src\unit_test\acl_test_log.c"> + RelativePath=".\src\unit_test\acl_test_loop.c"> + RelativePath=".\src\unit_test\acl_test_misc.c"> + RelativePath=".\src\unit_test\acl_test_outer.c"> + RelativePath=".\src\unit_test\acl_test_runner.c"> + RelativePath=".\src\unit_test\acl_test_token.c"> + Filter=""> + RelativePath=".\src\master\master_flow.c"> + RelativePath=".\src\master\master_flow.h"> + RelativePath=".\src\master\master_params.c"> + RelativePath=".\src\master\master_params.h"> + RelativePath=".\src\master\master_proto.c"> + RelativePath=".\src\master\master_proto.h"> + RelativePath=".\src\master\master_vars.c"> + Filter=""> + RelativePath=".\src\master\template\acl_aio_app_main.c"> + RelativePath=".\src\master\template\acl_aio_server.c"> + RelativePath=".\src\master\template\acl_ioctl_app_main.c"> + RelativePath=".\src\master\template\acl_ioctl_server.c"> + RelativePath=".\src\master\template\acl_master_log.c"> + RelativePath=".\src\master\template\acl_multi_server.c"> + RelativePath=".\src\master\template\acl_single_server.c"> + RelativePath=".\src\master\template\acl_threads_server.c"> + RelativePath=".\src\master\template\acl_tmpl.c"> + RelativePath=".\src\master\template\acl_trigger_server.c"> + RelativePath=".\src\master\template\acl_udp_server.c"> + + + Filter=""> + RelativePath=".\src\master\framework\master.h"> + RelativePath=".\src\master\framework\master_avail.c"> + RelativePath=".\src\master\framework\master_conf.c"> + RelativePath=".\src\master\framework\master_ent.c"> + RelativePath=".\src\master\framework\master_listen.c"> + RelativePath=".\src\master\framework\master_pathname.c"> + RelativePath=".\src\master\framework\master_pathname.h"> + RelativePath=".\src\master\framework\master_service.c"> + RelativePath=".\src\master\framework\master_sig.c"> + RelativePath=".\src\master\framework\master_spawn.c"> + RelativePath=".\src\master\framework\master_status.c"> + RelativePath=".\src\master\framework\master_wakeup.c"> + Filter=""> + RelativePath=".\src\master\framework\trigger\fifo_trigger.c"> + RelativePath=".\src\master\framework\trigger\inet_trigger.c"> + RelativePath=".\src\master\framework\trigger\stream_trigger.c"> + RelativePath=".\src\master\framework\trigger\trigger.h"> + RelativePath=".\src\master\framework\trigger\unix_trigger.c"> + Filter=""> + RelativePath=".\src\master\daemon\master.c"> + Filter=""> + RelativePath=".\src\proctl\acl_proctl.c"> + RelativePath=".\src\proctl\proctl_child.c"> + RelativePath=".\src\proctl\proctl_internal.h"> + RelativePath=".\src\proctl\proctl_monitor.c"> + RelativePath=".\src\proctl\proctl_service.c"> + RelativePath=".\src\proctl\proctl_utils.c"> + Filter=""> + Filter=""> + RelativePath=".\src\init\acl_init.c"> + RelativePath=".\src\init\init.h"> + Filter=""> + RelativePath=".\src\private\private.h"> + RelativePath=".\src\private\private_array.c"> + RelativePath=".\src\private\private_array.h"> + RelativePath=".\src\private\private_fifo.c"> + RelativePath=".\src\private\private_fifo.h"> + RelativePath=".\src\private\private_global.h"> + RelativePath=".\src\private\private_vstream.c"> + RelativePath=".\src\private\private_vstream.h"> + RelativePath=".\src\private\sem.c"> + RelativePath=".\src\private\sem.h"> + RelativePath=".\src\private\thread.h"> + RelativePath=".\src\private\thread_mutex.c"> + Filter=""> + RelativePath=".\src\json\acl_json.c"> + RelativePath=".\src\json\acl_json_parse.c"> + RelativePath=".\src\json\acl_json_util.c"> + Filter=""> + RelativePath=".\src\code\acl_base64.c"> + RelativePath=".\src\code\acl_gbcode.c"> + RelativePath=".\src\code\acl_htmlcode.c"> + RelativePath=".\src\code\acl_urlcode.c"> + RelativePath=".\src\code\acl_vstring_base64.c"> + RelativePath=".\src\code\acl_xmlcode.c"> + RelativePath=".\src\code\gb_ft2jt.h"> + RelativePath=".\src\code\gb_jt2ft.h"> + RelativePath=".\src\code\html_charset.h"> + RelativePath=".\src\code\uni2utf8.c"> + RelativePath=".\src\code\uni2utf8.h"> + Filter="h;hpp;hxx;hm;inl"> + RelativePath=".\include\lib_acl.h"> + RelativePath=".\resource.h"> + Filter=""> + RelativePath=".\include\stdlib\acl_allocator.h"> + RelativePath=".\include\stdlib\acl_argv.h"> + RelativePath=".\include\stdlib\acl_array.h"> + RelativePath=".\include\stdlib\acl_binhash.h"> + RelativePath=".\include\stdlib\acl_bits_map.h"> + RelativePath=".\include\stdlib\acl_btree.h"> + RelativePath=".\include\stdlib\acl_cache.h"> + RelativePath=".\include\stdlib\acl_cache2.h"> + RelativePath=".\include\stdlib\acl_cfg_macro.h"> + RelativePath=".\include\stdlib\acl_chunk_chain.h"> + RelativePath=".\include\stdlib\acl_dbuf_pool.h"> + RelativePath=".\include\stdlib\acl_debug.h"> + RelativePath=".\include\stdlib\acl_debug_malloc.h"> + RelativePath=".\include\stdlib\acl_define.h"> + RelativePath=".\include\stdlib\acl_define_bsd.h"> + RelativePath=".\include\stdlib\acl_define_linux.h"> + RelativePath=".\include\stdlib\acl_define_macosx.h"> + RelativePath=".\include\stdlib\acl_define_sunx86.h"> + RelativePath=".\include\stdlib\acl_define_unix.h"> + RelativePath=".\include\stdlib\acl_define_win32.h"> + RelativePath=".\include\stdlib\acl_dir.h"> + RelativePath=".\include\stdlib\acl_dlink.h"> + RelativePath=".\include\stdlib\acl_dll.h"> + RelativePath=".\include\stdlib\acl_env.h"> + RelativePath=".\include\stdlib\acl_exec_command.h"> + RelativePath=".\include\stdlib\acl_fhandle.h"> + RelativePath=".\include\stdlib\acl_fifo.h"> + RelativePath=".\include\stdlib\acl_file.h"> + RelativePath=".\include\stdlib\acl_getopt.h"> + RelativePath=".\include\stdlib\acl_hash.h"> + RelativePath=".\include\stdlib\acl_hex_code.h"> + RelativePath=".\include\stdlib\acl_htable.h"> + RelativePath=".\include\stdlib\acl_iostuff.h"> + RelativePath=".\include\stdlib\acl_iplink.h"> + RelativePath=".\include\stdlib\acl_iterator.h"> + RelativePath=".\include\stdlib\acl_loadcfg.h"> + RelativePath=".\include\stdlib\acl_make_dirs.h"> + RelativePath=".\include\stdlib\acl_malloc.h"> + RelativePath=".\include\stdlib\acl_mem_hook.h"> + RelativePath=".\include\stdlib\acl_mem_slice.h"> + RelativePath=".\include\stdlib\acl_meter_time.h"> + RelativePath=".\include\stdlib\acl_msg.h"> + RelativePath=".\include\stdlib\acl_myflock.h"> + RelativePath=".\include\stdlib\acl_mylog.h"> + RelativePath=".\include\stdlib\acl_mymalloc.h"> + RelativePath=".\include\stdlib\acl_mystring.h"> + RelativePath=".\include\stdlib\acl_process.h"> + RelativePath=".\include\stdlib\acl_readline.h"> + RelativePath=".\include\stdlib\acl_ring.h"> + RelativePath=".\include\stdlib\acl_safe.h"> + RelativePath=".\include\stdlib\acl_sane_basename.h"> + RelativePath=".\include\stdlib\acl_scan_dir.h"> + RelativePath=".\include\stdlib\acl_slice.h"> + RelativePath=".\include\stdlib\acl_split_at.h"> + RelativePath=".\include\stdlib\acl_stack.h"> + RelativePath=".\include\stdlib\acl_stdlib.h"> + RelativePath=".\include\stdlib\acl_stringops.h"> + RelativePath=".\include\stdlib\acl_sys_patch.h"> + RelativePath=".\include\stdlib\acl_timeops.h"> + RelativePath=".\include\stdlib\acl_token_tree.h"> + RelativePath=".\include\stdlib\acl_vbuf.h"> + RelativePath=".\include\stdlib\acl_vbuf_print.h"> + RelativePath=".\include\stdlib\acl_vsprintf.h"> + RelativePath=".\include\stdlib\acl_vstream.h"> + RelativePath=".\include\stdlib\acl_vstream_popen.h"> + RelativePath=".\include\stdlib\acl_vstring.h"> + RelativePath=".\include\stdlib\acl_vstring_vstream.h"> + RelativePath=".\include\stdlib\acl_xinetd_cfg.h"> + RelativePath=".\include\stdlib\avl.h"> + RelativePath=".\include\stdlib\avl_impl.h"> + Filter=""> + RelativePath=".\include\stdlib\unix\acl_chroot_uid.h"> + RelativePath=".\include\stdlib\unix\acl_mychown.h"> + RelativePath=".\include\stdlib\unix\acl_open_lock.h"> + RelativePath=".\include\stdlib\unix\acl_safe_open.h"> + RelativePath=".\include\stdlib\unix\acl_sane_socketpair.h"> + RelativePath=".\include\stdlib\unix\acl_set_eugid.h"> + RelativePath=".\include\stdlib\unix\acl_set_ugid.h"> + RelativePath=".\include\stdlib\unix\acl_timed_wait.h"> + RelativePath=".\include\stdlib\unix\acl_transfer_fd.h"> + RelativePath=".\include\stdlib\unix\acl_unix.h"> + RelativePath=".\include\stdlib\unix\acl_username.h"> + RelativePath=".\include\stdlib\unix\acl_watchdog.h"> + Filter=""> + RelativePath=".\include\net\acl_access.h"> + RelativePath=".\include\net\acl_connect.h"> + RelativePath=".\include\net\acl_dns.h"> + RelativePath=".\include\net\acl_host_port.h"> + RelativePath=".\include\net\acl_ifconf.h"> + RelativePath=".\include\net\acl_listen.h"> + RelativePath=".\include\net\acl_mask_addr.h"> + RelativePath=".\include\net\acl_net.h"> + RelativePath=".\include\net\acl_netdb.h"> + RelativePath=".\include\net\acl_res.h"> + RelativePath=".\include\net\acl_sane_inet.h"> + RelativePath=".\include\net\acl_sane_socket.h"> + RelativePath=".\include\net\acl_tcp_ctl.h"> + RelativePath=".\include\net\acl_valid_hostname.h"> + RelativePath=".\include\net\acl_vstream_net.h"> + Filter=""> + RelativePath=".\include\thread\acl_pthread.h"> + RelativePath=".\include\thread\acl_pthread_pool.h"> + RelativePath=".\include\thread\acl_pthread_rwlock.h"> + RelativePath=".\include\thread\acl_sem.h"> + RelativePath=".\include\thread\acl_thread.h"> + Filter=""> + RelativePath=".\include\msg\acl_aqueue.h"> + RelativePath=".\include\msg\acl_msgio.h"> + Filter=""> + RelativePath=".\include\xml\acl_xml.h"> + Filter=""> + RelativePath=".\include\event\acl_events.h"> + RelativePath=".\include\event\acl_timer.h"> + Filter=""> + RelativePath=".\include\aio\acl_aio.h"> + Filter=""> + RelativePath=".\include\ioctl\acl_ioctl.h"> + RelativePath=".\include\ioctl\acl_spool.h"> + Filter=""> + RelativePath=".\include\db\acl_db.h"> + RelativePath=".\include\db\acl_dberr.h"> + RelativePath=".\include\db\acl_dbpool.h"> + RelativePath=".\include\db\acl_dbsql.h"> + RelativePath=".\include\db\acl_mdb.h"> + RelativePath=".\include\db\zdb.h"> + Filter=""> + RelativePath=".\include\unit_test\acl_test_global.h"> + RelativePath=".\include\unit_test\acl_test_macro.h"> + RelativePath=".\include\unit_test\acl_test_struct.h"> + RelativePath=".\include\unit_test\acl_test_var.h"> + RelativePath=".\include\unit_test\acl_unit_test.h"> + Filter=""> + RelativePath=".\include\code\acl_base64.h"> + RelativePath=".\include\code\acl_code.h"> + RelativePath=".\include\code\acl_gbcode.h"> + RelativePath=".\include\code\acl_htmlcode.h"> + RelativePath=".\include\code\acl_urlcode.h"> + RelativePath=".\include\code\acl_vstring_base64.h"> + RelativePath=".\include\code\acl_xmlcode.h"> + Filter=""> + RelativePath=".\include\master\acl_aio_params.h"> + RelativePath=".\include\master\acl_app_main.h"> + RelativePath=".\include\master\acl_ioctl_params.h"> + RelativePath=".\include\master\acl_master.h"> + RelativePath=".\include\master\acl_master_conf.h"> + RelativePath=".\include\master\acl_master_type.h"> + RelativePath=".\include\master\acl_multi_params.h"> + RelativePath=".\include\master\acl_server_api.h"> + RelativePath=".\include\master\acl_single_params.h"> + RelativePath=".\include\master\acl_threads_params.h"> + RelativePath=".\include\master\acl_trigger_params.h"> + RelativePath=".\include\master\acl_udp_params.h"> + Filter=""> + RelativePath=".\include\proctl\acl_proctl.h"> + Filter=""> + RelativePath=".\include\experiment\experiment.h"> + Filter=""> + RelativePath=".\include\init\acl_init.h"> + Filter=""> + RelativePath=".\include\json\acl_json.h"> + Filter=""> + RelativePath=".\changes.txt"> + RelativePath=".\todo.txt"> + RelativePath="Readme.txt"> diff --git a/lib_acl/src/stdlib/filedir/acl_scan_dir.c b/lib_acl/src/stdlib/filedir/acl_scan_dir.c index 2135061c6..265ea28e7 100644 --- a/lib_acl/src/stdlib/filedir/acl_scan_dir.c +++ b/lib_acl/src/stdlib/filedir/acl_scan_dir.c @@ -41,6 +41,10 @@ #include "dir_sys_patch.h" +#ifndef MAX_PATH +#define MAX_PATH 1024 +#endif + /* * The interface is based on an opaque structure, so we don't have to expose * the user to the guts. Subdirectory info sits in front of parent directory @@ -83,8 +87,8 @@ ACL_SCAN_DIR *acl_scan_dir_open(const char *path, int recursive) scan->nsize = 0; if (acl_scan_dir_push(scan, path) < 0) - return (NULL); - return (scan); + return NULL; + return scan; } /* acl_scan_dir_close - terminate directory scan */ @@ -98,9 +102,6 @@ void acl_scan_dir_close(ACL_SCAN_DIR *scan) void acl_scan_dir_reset(ACL_SCAN_DIR *scan) { - if (scan == NULL) - return; - scan->nfiles = 0; scan->ndirs = 0; scan->nsize = 0; @@ -112,8 +113,6 @@ void acl_scan_dir_ctl(ACL_SCAN_DIR *scan, int name, ...) { va_list ap; - if (scan == NULL) - return; va_start(ap, name); for (; name != ACL_SCAN_CTL_END; name = va_arg(ap, int)) { @@ -136,60 +135,49 @@ void acl_scan_dir_ctl(ACL_SCAN_DIR *scan, int name, ...) const char *acl_scan_dir_path(ACL_SCAN_DIR *scan) { - if (scan == NULL || scan->current == NULL) - return (NULL); - return (ACL_SCAN_DIR_PATH(scan)); + if (scan->current == NULL) + return NULL; + return ACL_SCAN_DIR_PATH(scan); } const char *acl_scan_dir_file(ACL_SCAN_DIR *scan) { - if (scan == NULL || scan->current == NULL) - return (NULL); + if (scan->current == NULL) + return NULL; - return (scan->file_name); + return scan->file_name; } int acl_scan_dir_ndirs(ACL_SCAN_DIR *scan) { - if (scan) - return (scan->ndirs); - else - return (-1); + return scan->ndirs; } int acl_scan_dir_nfiles(ACL_SCAN_DIR *scan) { - if (scan) - return (scan->nfiles); - else - return (-1); + return scan->nfiles; } acl_int64 acl_scan_dir_nsize(ACL_SCAN_DIR *scan) { - if (scan) - return (scan->nsize); - else - return (-1); + return scan->nsize; } int acl_scan_stat(ACL_SCAN_DIR *scan, struct acl_stat *sbuf) { - if (scan == NULL || scan->current == NULL || sbuf == NULL) - return (-1); + if (scan->current == NULL || sbuf == NULL) + return -1; memcpy(sbuf, &scan->current->sbuf, sizeof(struct acl_stat)); - return (0); + return 0; } int acl_scan_dir_end(ACL_SCAN_DIR *scan) { - if (scan == NULL) - return (-1); if (scan->current == NULL) - return (1); + return 1; else - return (0); + return 0; } /* acl_scan_dir_push - enter directory */ @@ -198,26 +186,41 @@ int acl_scan_dir_push(ACL_SCAN_DIR *scan, const char *path) const char *myname = "acl_scan_dir_push"; ACL_SCAN_INFO *info; + if (path == NULL || *path == 0) + acl_msg_fatal("%s(%d), %s: path null", + __FILE__, __LINE__, myname); + info = (ACL_SCAN_INFO *) acl_mymalloc(sizeof(*info)); - if (scan->current) { + if (scan->current) info->path = acl_concatenate(ACL_SCAN_DIR_PATH(scan), PATH_SEP_S, path, (char *) 0); - } else { - info->path = acl_mystrdup(path); + else { + size_t len = strlen(path); + const char *ptr = path + len - 1; + +#ifdef WIN32 + while (ptr > path && (*ptr == '/' || *ptr == '\\')) +#else + while (ptr > path && *ptr == '/') + ptr--; +#endif + len = ptr - path + 1; + info->path = (char*) acl_mymalloc(len + 1); + memcpy(info->path, path, len); + info->path[len] = 0; } if ((info->dir_name = opendir(info->path)) == 0) { - char tbuf[256]; acl_msg_error("%s(%d), %s: open directory(%s) error(%s)", __FILE__, __LINE__, myname, - info->path, acl_last_strerror(tbuf, sizeof(tbuf))); - return (-1); + info->path, acl_last_serror()); + return -1; } - if (acl_msg_verbose > 1) - acl_msg_info("%s: open %s", myname, info->path); + info->parent = scan->current; scan->current = info; - return (0); + + return 0; } /* acl_scan_dir_pop - leave directory */ @@ -229,50 +232,42 @@ ACL_SCAN_DIR *acl_scan_dir_pop(ACL_SCAN_DIR *scan) ACL_SCAN_INFO *parent; if (info == NULL) - return (NULL); + return NULL; + parent = info->parent; if (closedir(info->dir_name)) { - char tbuf[256]; acl_msg_fatal("%s(%d), %s: close directory(%s) error(%s)", __FILE__, __LINE__, myname, - info->path, acl_last_strerror(tbuf, sizeof(tbuf))); + info->path, acl_last_serror()); } - if (acl_msg_verbose > 1) - acl_msg_info("%s: close %s", myname, info->path); + acl_myfree(info->path); acl_myfree(info); scan->current = parent; - return (parent ? scan : NULL); + + return parent ? scan : NULL; } /* acl_scan_dir_next - find next entry */ const char *acl_scan_dir_next(ACL_SCAN_DIR *scan) { - const char *myname = "acl_scan_dir_next"; ACL_SCAN_INFO *info = scan->current; struct dirent *dp; #define STREQ(x,y) (strcmp((x),(y)) == 0) if (info == NULL) - return (NULL); + return NULL; while ((dp = readdir(info->dir_name)) != 0) { - if (STREQ(dp->d_name, ".") || STREQ(dp->d_name, "..")) { - if (acl_msg_verbose > 1) - acl_msg_info("%s: skip %s", - myname, dp->d_name); + if (STREQ(dp->d_name, ".") || STREQ(dp->d_name, "..")) continue; - } - if (acl_msg_verbose > 1) - acl_msg_info("%s: found %s", myname, dp->d_name); - - return (dp->d_name); + return dp->d_name; } - return (NULL); + return NULL; } /* acl_scan_dir_next_file - find next valid file */ @@ -281,40 +276,39 @@ const char *acl_scan_dir_next_file(ACL_SCAN_DIR *scan) { const char *myname = "acl_scan_dir_next_file"; const char *name; - char pathbuf[256]; + char pathbuf[MAX_PATH]; struct acl_stat sbuf; for (;;) { if ((name = acl_scan_dir_next(scan)) == NULL) { if (acl_scan_dir_pop(scan) == 0) - return (NULL); + return NULL; continue; } + snprintf(pathbuf, sizeof(pathbuf), "%s%c%s", ACL_SCAN_DIR_PATH(scan), PATH_SEP_C, name); + if (acl_stat(pathbuf, &sbuf) < 0) { - char tbuf[256]; acl_msg_error("%s(%d), %s: stat file(%s) error(%s)", __FILE__, __LINE__, myname, pathbuf, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (NULL); + acl_last_serror()); + return NULL; } memcpy(&scan->current->sbuf, &sbuf, sizeof(sbuf)); scan->nsize += sbuf.st_size; - if (S_ISDIR(sbuf.st_mode)) { - scan->ndirs++; - if (scan->recursive - && acl_scan_dir_push(scan, name) < 0) - { - return (NULL); - } - } else { + if (!S_ISDIR(sbuf.st_mode)) { scan->nfiles++; - return (name); + return name; } + + scan->ndirs++; + + if (scan->recursive && acl_scan_dir_push(scan, name) < 0) + return NULL; } } @@ -324,38 +318,37 @@ const char *acl_scan_dir_next_dir(ACL_SCAN_DIR *scan) { const char *myname = "acl_scan_dir_next_dir"; const char *name; - char pathbuf[256]; + char pathbuf[MAX_PATH]; struct acl_stat sbuf; for (;;) { if ((name = acl_scan_dir_next(scan)) == NULL) { if (acl_scan_dir_pop(scan) == 0) - return (NULL); + return NULL; continue; } snprintf(pathbuf, sizeof(pathbuf), "%s%c%s", ACL_SCAN_DIR_PATH(scan), PATH_SEP_C, name); if (acl_stat(pathbuf, &sbuf) < 0) { - char tbuf[256]; acl_msg_error("%s(%d), %s: stat file(%s) error(%s)", __FILE__, __LINE__, myname, pathbuf, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (NULL); + acl_last_serror()); + return NULL; } memcpy(&scan->current->sbuf, &sbuf, sizeof(sbuf)); scan->nsize += sbuf.st_size; - if (S_ISDIR(sbuf.st_mode)) { - scan->ndirs++; - if (scan->recursive - && acl_scan_dir_push(scan, name) < 0) - { - return (NULL); - } - return (name); - } + if (!S_ISDIR(sbuf.st_mode)) + continue; + + scan->ndirs++; + + if (scan->recursive && acl_scan_dir_push(scan, name) < 0) + return NULL; + else + return name; } } @@ -363,44 +356,41 @@ const char *acl_scan_dir_next_name(ACL_SCAN_DIR *scan, int *is_file) { const char *myname = "acl_scan_dir_next_name"; const char *name; - char pathbuf[256]; + char pathbuf[MAX_PATH]; struct acl_stat sbuf; for (;;) { if ((name = acl_scan_dir_next(scan)) == NULL) { if (acl_scan_dir_pop(scan) == 0) - return (NULL); + return NULL; continue; } snprintf(pathbuf, sizeof(pathbuf), "%s%c%s", ACL_SCAN_DIR_PATH(scan), PATH_SEP_C, name); if (acl_stat(pathbuf, &sbuf) < 0) { - char tbuf[256]; acl_msg_error("%s(%d), %s: stat file(%s) error(%s)", __FILE__, __LINE__, myname, pathbuf, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (NULL); + acl_last_serror()); + return NULL; } memcpy(&scan->current->sbuf, &sbuf, sizeof(sbuf)); scan->nsize += sbuf.st_size; - if (S_ISDIR(sbuf.st_mode)) { - scan->ndirs++; - if (scan->recursive - && acl_scan_dir_push(scan, name) < 0) - { - return (NULL); - } - if (is_file) - *is_file = 0; - return (name); - } else { + if (!S_ISDIR(sbuf.st_mode)) { if (is_file) *is_file = 1; - return (name); + return name; } + + scan->ndirs++; + + if (scan->recursive && acl_scan_dir_push(scan, name) < 0) + return NULL; + if (is_file) + *is_file = 0; + return name; } } @@ -408,12 +398,9 @@ acl_int64 acl_scan_dir_size2(ACL_SCAN_DIR *scan, int *nfile, int *ndir) { const char *myname = "acl_scan_dir_size2"; const char *name; - char pathbuf[256]; + char pathbuf[MAX_PATH]; struct acl_stat sbuf; - if (scan == NULL) - return (-1); - while (1) { if ((name = acl_scan_dir_next(scan)) == NULL) { if (acl_scan_dir_pop(scan) == NULL) @@ -423,10 +410,9 @@ acl_int64 acl_scan_dir_size2(ACL_SCAN_DIR *scan, int *nfile, int *ndir) snprintf(pathbuf, sizeof(pathbuf), "%s%c%s", ACL_SCAN_DIR_PATH(scan), PATH_SEP_C, name); if (acl_stat(pathbuf, &sbuf) < 0) { - char tbuf[256]; acl_msg_error("%s(%d), %s: stat file(%s) error(%s)", __FILE__, __LINE__, myname, pathbuf, - acl_last_strerror(tbuf, sizeof(tbuf))); + acl_last_serror()); break; } @@ -435,11 +421,8 @@ acl_int64 acl_scan_dir_size2(ACL_SCAN_DIR *scan, int *nfile, int *ndir) if (S_ISDIR(sbuf.st_mode)) { scan->ndirs++; scan->file_name[0] = 0; - if (scan->recursive - && acl_scan_dir_push(scan, name) < 0) - { + if (scan->recursive && acl_scan_dir_push(scan, name) < 0) break; - } } else { ACL_SAFE_STRNCPY(scan->file_name, name, sizeof(scan->file_name)); @@ -456,25 +439,34 @@ acl_int64 acl_scan_dir_size2(ACL_SCAN_DIR *scan, int *nfile, int *ndir) if (ndir) *ndir = scan->ndirs; - return (scan->nsize); + return scan->nsize; } acl_int64 acl_scan_dir_size(const char *pathname, int recursive, int *nfile, int *ndir) { + const char *myname = "acl_scan_dir_size"; ACL_SCAN_DIR *scan; acl_int64 size; - if (pathname == NULL || *pathname == 0) - return (-1); + if (pathname == NULL || *pathname == 0) { + acl_msg_error("%s(%d), %s: pathname null", + __FILE__, __LINE__, myname); + return -1; + } + scan = acl_scan_dir_open(pathname, recursive); - if (scan == NULL) - return (-1); + if (scan == NULL) { + acl_msg_error("%s(%d), %s: dir_open error: %s, path: %s", + __FILE__, __LINE__, myname, + acl_last_serror(), pathname); + return -1; + } size = acl_scan_dir_size2(scan, nfile, ndir); - acl_scan_dir_close(scan); - return (size); + + return size; } /* acl_scan_dir_rmall - remove all directoies and file in the dir */ @@ -483,7 +475,7 @@ acl_int64 acl_scan_dir_rm2(ACL_SCAN_DIR *scan, int *ndir, int *nfile) { const char *myname = "acl_scan_dir_rm2"; const char *name; - char path[256]; + char path[MAX_PATH]; struct acl_stat sbuf; for (;;) { @@ -513,33 +505,27 @@ acl_int64 acl_scan_dir_rm2(ACL_SCAN_DIR *scan, int *ndir, int *nfile) ACL_SCAN_DIR_PATH(scan), PATH_SEP_C, name); if (acl_stat(path, &sbuf) < 0) { - char tbuf[256]; acl_msg_error("%s(%d), %s: stat file(%s) error(%s)", __FILE__, __LINE__, myname, - path, acl_last_strerror(tbuf, sizeof(tbuf))); + path, acl_last_serror()); break; } if (S_ISDIR(sbuf.st_mode)) { scan->file_name[0] = 0; - if (scan->recursive - && acl_scan_dir_push(scan, name) < 0) - { + if (scan->recursive && acl_scan_dir_push(scan, name) < 0) break; - } - if (scan->scan_fn - && scan->scan_fn(scan, scan->scan_ctx) < 0) - { + if (scan->scan_fn && scan->scan_fn(scan, scan->scan_ctx) < 0) break; - } continue; - } else - ACL_SAFE_STRNCPY(scan->file_name, name, - sizeof(scan->file_name)); + } + + ACL_SAFE_STRNCPY(scan->file_name, name, sizeof(scan->file_name)); if (scan->scan_fn && scan->scan_fn(scan, scan->scan_ctx) < 0) break; scan->nfiles++; scan->nsize += sbuf.st_size; + SANE_UNLINK(path); } @@ -558,7 +544,6 @@ acl_int64 acl_scan_dir_rm(const char *pathname, int recursive, ACL_SCAN_DIR *scan; struct acl_stat sbuf; acl_int64 nsize; - char tbuf[256]; if (ndir) *ndir = 0; @@ -568,28 +553,29 @@ acl_int64 acl_scan_dir_rm(const char *pathname, int recursive, if (acl_stat(pathname, &sbuf) < 0) { acl_msg_error("%s(%d), %s: stat pathname(%s) error(%s)", __FILE__, __LINE__, myname, pathname, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (-1); + acl_last_serror()); + return -1; } if (S_ISDIR(sbuf.st_mode) == 0) { if (nfile) *nfile = 1; SANE_UNLINK(pathname); - return (1); + return 1; } scan = acl_scan_dir_open(pathname, recursive); if (scan == NULL) { acl_msg_error("%s(%d), %s: open path(%s) error(%s)", __FILE__, __LINE__, myname, - pathname, acl_last_strerror(tbuf, sizeof(tbuf))); - return (-1); + pathname, acl_last_serror()); + return -1; } acl_scan_dir_rm2(scan, ndir, nfile); nsize = scan->nsize; acl_scan_dir_close(scan); - return (nsize); + + return nsize; } diff --git a/lib_acl_cpp/changes.txt b/lib_acl_cpp/changes.txt index b62557b10..51cd20838 100644 --- a/lib_acl_cpp/changes.txt +++ b/lib_acl_cpp/changes.txt @@ -1,5 +1,18 @@ ޸ʷб ------------------------------------------------------------------------ +239) 2014.5.27 +239.1) bugfix: scan_dir е curr_path() ȫ·ʱ +239.2) feature: string scan_line/scan_move Ⱥӻȡ +ݣͬʱ޸ string::c_str(), string::length(), string::size()ʹܹ֮ + scan_xxx IJΪ + +238) 2014.5.26 +238.1) sample: samples/scan_dir ӵ acl::scan_dir + +237) 2014.5.23 +237.1) feature: string Ϊʹ÷㣬ȥ˶ֵе޶ const +237.2) bugfix: scan_dir е curr_path ѭ + 236) 2014.5.22 236.1) bufix: http_client Ĺ캯 http_client() ûж buf_ NULL http_client::reset ж buf_ reset ʱ˷Ƿָ diff --git a/lib_acl_cpp/include/acl_cpp/stdlib/scan_dir.hpp b/lib_acl_cpp/include/acl_cpp/stdlib/scan_dir.hpp index 7a3900ca3..fe85f9214 100644 --- a/lib_acl_cpp/include/acl_cpp/stdlib/scan_dir.hpp +++ b/lib_acl_cpp/include/acl_cpp/stdlib/scan_dir.hpp @@ -30,39 +30,41 @@ public: * ɨһļ(Ŀ¼Զ) open ָݹɨѡ * ( recursive = true)úݹɨĿ¼Ŀ¼ * @param full {bool} ǷҪļȫ· - * @return {const char*} NULL ʾɨ赽ļʾɨϻĿ¼ - * δ + * @return {const char*} NULL ʾɨ赽ļʾɨ + * Ŀ¼δ */ const char* next_file(bool full = false); /** - * ɨһĿ¼(ļ "." ".." ) open ָݹ - * ɨ( recursive = true)úݹɨĿ¼Ŀ¼ + * ɨһĿ¼(ļ "." ".." ) open ָ + * ݹɨ( recursive = true)úݹɨĿ¼ + * Ŀ¼ * @param full {bool} ǷҪĿ¼ȫ· - * @return {const char*} NULL ʾɨ赽Ŀ¼ʾɨϻĿ¼ - * δ + * @return {const char*} NULL ʾɨ赽Ŀ¼ʾɨ + * ϻĿ¼δ */ const char* next_dir(bool full = false); /** - * ɨһĿ¼ļ open ָݹɨ( resursive = true) - * úݹɨĿ¼Ŀ¼ļ - * @param full {bool} ǷҪĿ¼ļȫ·Ϊ true 򷵻ȫ· - * ֻļĿ¼Ҷ· - * @param is_file {bool*} ؽǿʱõַ洢ֵʾɨ赽Ƿ - * ļΪ true ΪļΪĿ¼ - * @return {const char*} NULL ʾɨ赽Ŀ¼ļʾɨ - * ϻĿ¼δ + * ɨһĿ¼ļ open ָݹɨ( resursive + * = true)úݹɨĿ¼Ŀ¼ļ + * @param full {bool} ǷҪĿ¼ļȫ·Ϊ true + * ȫ·ֻļĿ¼Ҷ· + * @param is_file {bool*} ؽǿʱõַ洢ֵʾɨ赽 + * ǷļΪ true ΪļΪĿ¼ + * @return {const char*} NULL ʾɨ赽Ŀ¼ļ + * ʾɨϻĿ¼δ */ const char* next(bool full = false, bool* is_file = NULL); /** - * õǰɨڵĿ¼· - * @param full {bool} Ϊ true ʱʾɨǰڵϵͳ·Ϊ - * ڳ open ʱij· + * õǰɨڵĿ¼·ص·β·ָ '/' + * '\\' (win32)·/home/zsx/᷵ /home/zsx + * ·Ϊ·/ '/' ᱣ WIN32 £ + * C:\Users\zsx · * @return {const char*} Ŀ¼ʱúطǿָ룬򷵻 NULL */ - const char* curr_path(bool full = false); + const char* curr_path(); /** * õǰɨɨļ @@ -137,6 +139,13 @@ public: int* nfiles = NULL, int* ndirs = NULL); #endif + /** + * õǰе· + * @param out {string&} 洢 + * @return {bool} Ƿɹõǰ· + */ + static bool get_cwd(string& out); + private: char* path_; ACL_SCAN_DIR* scan_; diff --git a/lib_acl_cpp/include/acl_cpp/stdlib/string.hpp b/lib_acl_cpp/include/acl_cpp/stdlib/string.hpp index e03137622..6e303fbe3 100644 --- a/lib_acl_cpp/include/acl_cpp/stdlib/string.hpp +++ b/lib_acl_cpp/include/acl_cpp/stdlib/string.hpp @@ -26,13 +26,15 @@ public: /** * 캯 - * @param s {const string&} Դַ󣬳ʼڲԶƸַ + * @param s {const string&} Դַ󣬳ʼڲԶ + * ַ */ string(const string& s); /** * 캯 - * @param s {const char*} ڲԶøַʼs \0 β + * @param s {const char*} ڲԶøַʼs + * \0 β */ string(const char* s); @@ -46,9 +48,10 @@ public: /** * ַΪƴģʽ - * @param bin {bool} ֵΪ true ʱַΪƴʽ - * ΪıʽֵΪ true ʱ򵱵 += int|int64|short|char - * << int|int64|short|char ʱ򰴶Ʒʽıʽ + * @param bin {bool} ֵΪ true ʱַΪƴ + * ʽΪıʽֵΪ true ʱ򵱵 += int|int64|short|char + * << int|int64|short|char ʱ򰴶Ʒʽı + * ʽ */ void set_bin(bool bin); @@ -59,15 +62,19 @@ public: bool get_bin() const; /** - * ַ±ָλõַΪϷֵڲ - * @param n {size_t} ָλãֵ >= 0 < ַ)Խ磬 + * ַ±ָλõַΪϷֵ + * ڲ + * @param n {size_t} ָλãֵ >= 0 < ַ)Խ + * * @return {char} ָλõַ */ char operator[](size_t n); /** - * ַ±ָλõַΪϷֵڲ - * @param n {int} ָλãֵ >= 0 < ַ)Խ磬 + * ַ±ָλõַΪϷֵ + * ڲ + * @param n {int} ָλãֵ >= 0 < ַ)Խ磬 + * * @return {char} ָλõַ */ char operator[](int n); @@ -75,40 +82,42 @@ public: /** * Ŀֵַ * @param s {const char*} Դַ - * @return {string&} صǰַãڶԸв + * @return {string&} صǰãڶԸв */ string& operator=(const char* s); /** * Ŀֵַ * @param s {const string&} Դַ - * @return {string&} صǰַãڶԸв + * @return {string&} صǰãڶԸв */ string& operator=(const string& s); /** * Ŀֵַ * @param s {const string*} Դַ - * @return {string&} صǰַãڶԸв + * @return {string&} صǰãڶԸв */ string& operator=(const string* s); #ifdef WIN32 /** * Ŀֵַ - * @param n {long long int} Դ 64 λųַĵǰ״̬Ϊ - * ģʽúԶƷʽֵַ󣬷ıʽֵ - * ַ󣻹ڶģʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * @param n {long long int} Դ 64 λųǰĵǰ״̬Ϊ + * ģʽúԶƷʽֵַ󣬷ı + * ʽֵַ󣻹ڶģʽıʽ京μ + * set_bin(bool) + * @return {string&} صǰֶãڶԸв */ string& operator=(__int64 n); /** * Ŀֵַ * @param n {unsinged long long int} Դ 64 λ޷ųַ - * ĵǰ״̬ΪģʽúԶƷʽֵַ󣬷ıʽ - * ֵַ󣻹ڶģʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * ĵǰ״̬ΪģʽúԶƷʽֵַ + * ıʽֵַ󣻹ڶģʽıʽ京 + * μ set_bin(bool) + * @return {string&} صǰãڶԸв */ string& operator=(unsigned __int64); #else @@ -118,37 +127,37 @@ public: /** * Ŀֵַ - * @param n {char} Դзַַĵǰ״̬Ϊģʽú - * ԶƷʽֵַ󣬷ıʽֵַ󣻹ڶģ - * ʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * @param n {char} Դзַַĵǰ״̬Ϊģʽ + * úԶƷʽֵַ󣬷ıʽֵ + * 󣻹ڶģʽıʽ京μ set_bin(bool) + * @return {string&} صǰãڶԸв */ string& operator=(char n); /** * Ŀֵַ - * @param n {char} Դ޷ַַĵǰ״̬Ϊģʽú - * ԶƷʽֵַ󣬷ıʽֵַ󣻹ڶģ - * ʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * @param n {char} Դ޷ַĵǰ״̬Ϊģʽú + * ԶƷʽֵַ󣬷ıʽֵַ + * ڶģʽıʽ京μ set_bin(bool) + * @return {string&} صǰãڶԸв */ string& operator=(unsigned char n); /** * Ŀֵַ - * @param n {char} Դзųַͣĵǰ״̬Ϊģʽú - * ԶƷʽֵַ󣬷ıʽֵַ󣻹ڶģ - * ʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * @param n {char} Դзųͣĵǰ״̬Ϊģʽú + * ԶƷʽֵַ󣬷ıʽֵַ + * ڶģʽıʽ京μ set_bin(bool) + * @return {string&} صǰãڶԸв */ string& operator=(long n); /** * Ŀֵַ - * @param n {char} Դ޷ųַͣĵǰ״̬Ϊģʽú - * ԶƷʽֵַ󣬷ıʽֵַ󣻹ڶģ - * ʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * @param n {char} Դ޷ųֶͣĵǰ״̬Ϊģʽ + * úԶƷʽֵַ󣬷ıʽֵ + * ַ󣻹ڶģʽıʽ京μ set_bin(bool) + * @return {string&} صǰֶãڶԸв */ string& operator=(unsigned long n); @@ -181,10 +190,10 @@ public: /** * Ŀֵַ - * @param n {char} Դ޷Ŷַͣĵǰ״̬Ϊģʽú - * ԶƷʽֵַ󣬷ıʽֵַ󣻹ڶģ - * ʽıʽ京μ set_bin(bool) - * @return {string&} صǰַãڶԸв + * @param n {char} Դ޷Ŷͣĵǰ״̬Ϊģʽ + * ԶƷʽֵַ󣬷ıʽֵַ + * 󣻹ڶģʽıʽ京μ set_bin(bool) + * @return {string&} صǰãڶԸв */ string& operator=(unsigned short n); @@ -587,11 +596,13 @@ public: int ncompare(const char* s, size_t len, bool case_sensitive = true) const; /** - * βǰȽϵǰĻǷĻͬ޶Ƚݳ + * βǰȽϵǰĻǷĻͬ + * ޶Ƚݳ * @param s {const void*} Ļַ * @param len {size_t} ptr Ļݳ * @param case_sensitive {bool} Ϊ true ʾִСд - * @return {int} 0ʾͬ > 0ǰ󻺳ݴݣ + * @return {int} 0ʾͬ + * > 0ǰ󻺳ݴݣ * < 0 ǰ󻺳С */ int rncompare(const char* s, size_t len, bool case_sensitive = true) const; @@ -607,58 +618,68 @@ public: * ַָڵǰ󻺳ʼλã± 0 ʼ * @param needle {const char*} Ҫҵзַ * @param case_sensitive {bool} Ϊ true ʾִСд - * @return {const char*} ַڻеʼλãֵΪָʾ + * @return {char*} ַڻеʼλãֵΪָʾ */ - const char* find(const char* needle, bool case_sensitive=true) const; + char* find(const char* needle, bool case_sensitive=true) const; /** * βǰַָڵǰ󻺳ʼλã± 0 ʼ * @param needle {const char*} Ҫҵзַ * @param case_sensitive {bool} Ϊ true ʾִСд - * @return {const char*} ַڻеʼλãֵΪָʾ + * @return {char*} ַڻеʼλãֵΪָʾ */ - const char* rfind(const char* needle, bool case_sensitive=true) const; + char* rfind(const char* needle, bool case_sensitive=true) const; /** * شӵǰַлָλ * @param npos {size_t} ±λãֵڵڵǰַݳʱ * 򷵻ַ󣻷ֵֵָλõַ - * @return {const string} ֵΪһĶ󣬲ҪͷţúЧ + * @return {string} ֵΪһĶ󣬲ҪͷţúЧ * ̫ܲ */ - const string left(size_t npos); + string left(size_t npos); /** * شӵǰַлָλҵ * @param npos {size_t} ±λãֵڵڵǰַݳʱ * 򷵻صַΪգֵֵָλõַ - * @return {const string} ֵΪһĶ󣬲ҪͷţúЧ - * ̫ܲ + * @return {const string} ֵΪһĶ󣬲Ҫͷţ + * Чʿ̫ܲ */ - const string right(size_t npos); + string right(size_t npos); /** * ǰĻݿһĿ껺 * @param buf {void*} Ŀ껺ַ * @param size {size_t} buf - * @param move {bool} ڿݺǷҪǰƶǰ - * ѿ + * @param move {bool} ڿݺǷҪǰƶ + * ǰѿ * @return {size_t} ؿʵֽ empty() == true ʱ򷵻 0 */ size_t scan_buf(void* buf, size_t size, bool move = false); /** - * ӵǰĻпһ("\r\n")Ŀ껺ڣݱ - * Ŀ껺ԴδݻᷢƶDZ - * @param out {string&} Ŀ껺 + * ӵǰĻпһ("\r\n")Ŀ껺ڣ + * Ŀ껺ԴδݻᷢƶDZ + * + * @param out {string&} Ŀ껺ڲԶոû * @param nonl {bool} صһǷȥβ "\r\n" "\n" - * @param n {size_t*} òΪǿָʱ洢ݳȣһ - * nonl Ϊ true ʱõַ洢 0 - * @param part_copy {bool} ǰûһʱǷȻ - * @return {bool} Ƿ񿽱һ + * @param n {size_t*} òΪǿָʱ洢ݳȣ + * һ nonl Ϊ true ʱõַ洢 0 + * @param move {bool} ڿݺǷҪǰƶ + * ǰѿ + * @return {bool} Ƿ񿽱һݣ false Ҫ + * empty() == true жϵǰǷ */ - bool scan_line(string& out, bool nonl = true, - size_t* n = NULL, bool part_copy = false); + bool scan_line(string& out, bool nonl = true, size_t* n = NULL, + bool move = false); + + /** + * ʹ scan_xxx ෽Իвʱδָ move ñ + * ʹʣǰƶײ + * @return {size_t} ƶֽ + */ + size_t scan_move(); /** * صǰ󻺳еһݵβַ @@ -726,24 +747,27 @@ public: /** * ǰ洢ַзָ * @param sep {const char*} зָʱķָ - * @return {const std::list&} list ʽķָ + * @return {std::list&} list ʽķָصĽҪ + * ͷţ˵ǰһڲָ */ - const std::list& split(const char* sep); + std::list& split(const char* sep); /** * ǰ洢ַзָ * @param sep {const char*} зָʱķָ - * @return {const std::vector&} vector ʽķָ + * @return {std::vector&} vector ʽķָصĽ + * Ҫͷţ˵ǰһڲָ */ - const std::vector& split2(const char* sep); + std::vector& split2(const char* sep); /** * '=' Ϊָǰ洢ַָ name/value ԣָʱԶ * ȥԴַʼβԼָ '=' ߵĿո TAB - * @return {const std::pair&} ǰ洢ַ - * Ϸָϸ name=valueʽ򷵻صĽַΪմ + * @return {std::pair&} ǰ洢ַ + * Ϸָϸ name=valueʽ򷵻صĽַΪմ, + * صĽҪͷţ˵ǰһڲַ */ - const std::pair& split_nameval(void); + std::pair& split_nameval(void); /** * ַǰĻ @@ -1012,43 +1036,44 @@ public: /** * 32 λзתΪַ棨ڲʹֲ߳̾ * @param n {int} 32 λз - * @return {const string&} ת + * @return {string&} תãڲһֲ߳̾ */ - static const string& parse_int(int n); + static string& parse_int(int n); /** * 32 λ޷תΪַ棨ڲʹֲ߳̾ * @param n {int} 32 λ޷ - * @return {const string&} ת + * @return {string&} תãڲһֲ߳̾ */ - static const string& parse_int(unsigned int n); + static string& parse_int(unsigned int n); #ifdef WIN32 - static const string& parse_int64(__int64 n); - static const string& parse_int64(unsigned __int64 n); + static string& parse_int64(__int64 n); + static string& parse_int64(unsigned __int64 n); #else /** * 64 λзתΪַ棨ڲʹֲ߳̾ * @param n {long long int} 64 λз - * @return {const string&} ת + * @return {string&} תãڲһֲ߳̾ */ - static const string& parse_int64(long long int n); + static string& parse_int64(long long int n); /** * 64 λ޷תΪַ棨ڲʹֲ߳̾ * @param n {unsigned long long int} 64 λ޷ - * @return {const string&} ת + * @return {string&} תãڲһֲ߳̾ */ - static const string& parse_int64(unsigned long long int n); + static string& parse_int64(unsigned long long int n); #endif private: - bool m_bin; + bool use_bin_; + ACL_VSTRING* vbf_; + char* scan_ptr_; + std::list* list_tmp_; + std::vector* vector_tmp_; + std::pair* pair_tmp_; + void init(size_t len); - ACL_VSTRING* m_pVbf; - const char* m_ptr; - std::list* m_psList; - std::vector* m_psList2; - std::pair* m_psPair; }; } // namespce acl diff --git a/lib_acl_cpp/lib_acl_cpp_vc2003.vcproj b/lib_acl_cpp/lib_acl_cpp_vc2003.vcproj index 91e5a25c8..966f78137 100644 --- a/lib_acl_cpp/lib_acl_cpp_vc2003.vcproj +++ b/lib_acl_cpp/lib_acl_cpp_vc2003.vcproj @@ -1,206 +1,134 @@ + Keyword="Win32Proj"> + Name="Win32"/> - - - - - - - + CharacterSet="2"> + WarnAsError="TRUE" + Detect64BitPortabilityProblems="FALSE" + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + OutputFile="$(OutDir)/$(ProjectName)_vc2003d.lib"/> - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + - - - - - + CharacterSet="2"> + Detect64BitPortabilityProblems="FALSE" + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + OutputFile="$(OutDir)/$(ProjectName)_vc2003.lib"/> - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + - - - - - + CharacterSet="2"> + WarnAsError="TRUE" + Detect64BitPortabilityProblems="FALSE" + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + TargetMachine="1"/> - - - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + + - - - - - + CharacterSet="2"> + WarnAsError="TRUE" + Detect64BitPortabilityProblems="FALSE" + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + TargetMachine="1"/> - - - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + + @@ -334,1255 +235,985 @@ + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + RelativePath=".\src\acl_cpp_init.cpp"> + RelativePath=".\src\acl_cpp_test.cpp"> + RelativePath=".\src\acl_stdafx.cpp"> + Name="Debug|Win32"> + UsePrecompiledHeader="1"/> + Name="Release|Win32"> + UsePrecompiledHeader="1"/> + Name="DebugDll|Win32"> + UsePrecompiledHeader="1"/> + Name="Releasedll|Win32"> + UsePrecompiledHeader="1"/> + RelativePath=".\src\acl_stdafx.hpp"> + Filter=""> + RelativePath=".\src\stream\aio_delay_free.cpp"> + RelativePath=".\src\stream\aio_fstream.cpp"> + RelativePath=".\src\stream\aio_handle.cpp"> + RelativePath=".\src\stream\aio_istream.cpp"> + RelativePath=".\src\stream\aio_listen_stream.cpp"> + RelativePath=".\src\stream\aio_ostream.cpp"> + RelativePath=".\src\stream\aio_socket_stream.cpp"> + RelativePath=".\src\stream\aio_stream.cpp"> + RelativePath=".\src\stream\aio_timer_callback.cpp"> + RelativePath=".\src\stream\aio_timer_delay_free.cpp"> + RelativePath=".\src\stream\aio_timer_delay_free.hpp"> + RelativePath=".\src\stream\fstream.cpp"> + RelativePath=".\src\stream\ifstream.cpp"> + RelativePath=".\src\stream\istream.cpp"> + RelativePath=".\src\stream\ofstream.cpp"> + RelativePath=".\src\stream\ostream.cpp"> + RelativePath=".\src\stream\server_socket.cpp"> + RelativePath=".\src\stream\socket_stream.cpp"> + RelativePath=".\src\stream\ssl_aio_stream.cpp"> + RelativePath=".\src\stream\stream.cpp"> + Filter=""> + RelativePath=".\src\stdlib\charset_conv.cpp"> + RelativePath=".\src\stdlib\dns_service.cpp"> + RelativePath=".\src\stdlib\escape.cpp"> + Name="Debug|Win32"> + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + Name="Release|Win32"> + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + Name="DebugDll|Win32"> + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + Name="Releasedll|Win32"> + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + RelativePath=".\src\stdlib\json.cpp"> + RelativePath=".\src\stdlib\locker.cpp"> + RelativePath=".\src\stdlib\log.cpp"> + RelativePath=".\src\stdlib\malloc.cpp"> + RelativePath=".\src\stdlib\md5.cpp"> + RelativePath=".\src\stdlib\pipe_stream.cpp"> + RelativePath=".\src\stdlib\scan_dir.cpp"> + RelativePath=".\src\stdlib\snprintf.cpp"> + RelativePath=".\src\stdlib\string.cpp"> + RelativePath=".\src\stdlib\thread.cpp"> + RelativePath=".\src\stdlib\thread_pool.cpp"> + RelativePath=".\src\stdlib\url_coder.cpp"> + RelativePath=".\src\stdlib\util.cpp"> + RelativePath=".\src\stdlib\xml.cpp"> + + + Filter=""> + RelativePath=".\src\stdlib\internal\win_iconv.cpp"> + RelativePath=".\src\stdlib\internal\win_iconv.hpp"> + Filter=""> + RelativePath=".\src\mime\mime.cpp"> + RelativePath=".\src\mime\mime_attach.cpp"> + RelativePath=".\src\mime\mime_base64.cpp"> + RelativePath=".\src\mime\mime_body.cpp"> + RelativePath=".\src\mime\mime_code.cpp"> + RelativePath=".\src\mime\mime_head.cpp"> + RelativePath=".\src\mime\mime_image.cpp"> + RelativePath=".\src\mime\mime_node.cpp"> + RelativePath=".\src\mime\mime_quoted_printable.cpp"> + RelativePath=".\src\mime\mime_uucode.cpp"> + RelativePath=".\src\mime\mime_xxcode.cpp"> + RelativePath=".\src\mime\rfc2047.cpp"> + RelativePath=".\src\mime\rfc822.cpp"> + Filter=""> + RelativePath=".\src\mime\internal\header_opts.cpp"> + RelativePath=".\src\mime\internal\header_opts.hpp"> + RelativePath=".\src\mime\internal\header_token.cpp"> + RelativePath=".\src\mime\internal\header_token.hpp"> + RelativePath=".\src\mime\internal\is_header.cpp"> + RelativePath=".\src\mime\internal\is_header.hpp"> + RelativePath=".\src\mime\internal\lex_822.hpp"> + RelativePath=".\src\mime\internal\mime_state.cpp"> + RelativePath=".\src\mime\internal\mime_state.hpp"> + RelativePath=".\src\mime\internal\mime_state_parse.cpp"> + RelativePath=".\src\mime\internal\quote_821_local.cpp"> + RelativePath=".\src\mime\internal\quote_821_local.hpp"> + RelativePath=".\src\mime\internal\quote_822_local.cpp"> + RelativePath=".\src\mime\internal\quote_822_local.hpp"> + RelativePath=".\src\mime\internal\quote_flags.hpp"> + RelativePath=".\src\mime\internal\rec_type.cpp"> + RelativePath=".\src\mime\internal\rec_type.hpp"> + RelativePath=".\src\mime\internal\tok822.hpp"> + RelativePath=".\src\mime\internal\tok822_find.cpp"> + RelativePath=".\src\mime\internal\tok822_node.cpp"> + RelativePath=".\src\mime\internal\tok822_parse.cpp"> + RelativePath=".\src\mime\internal\tok822_tree.cpp"> + RelativePath=".\src\mime\internal\trimblanks.cpp"> + RelativePath=".\src\mime\internal\trimblanks.hpp"> + Filter=""> + RelativePath=".\src\master\master_aio.cpp"> + RelativePath=".\src\master\master_base.cpp"> + RelativePath=".\src\master\master_conf.cpp"> + RelativePath=".\src\master\master_proc.cpp"> + RelativePath=".\src\master\master_threads.cpp"> + RelativePath=".\src\master\master_threads2.cpp"> + RelativePath=".\src\master\master_trigger.cpp"> + RelativePath=".\src\master\master_udp.cpp"> + Filter=""> + RelativePath=".\src\ipc\ipc_client.cpp"> + RelativePath=".\src\ipc\ipc_server.cpp"> + RelativePath=".\src\ipc\ipc_service.cpp"> + RelativePath=".\src\ipc\rpc.cpp"> + Filter=""> + RelativePath=".\src\http\http_client.cpp"> + RelativePath=".\src\http\http_ctype.cpp"> + RelativePath=".\src\http\http_download.cpp"> + RelativePath=".\src\http\http_header.cpp"> + RelativePath=".\src\http\http_mime.cpp"> + RelativePath=".\src\http\http_pipe.cpp"> + RelativePath=".\src\http\http_request.cpp"> + RelativePath=".\src\http\http_request_manager.cpp"> + RelativePath=".\src\http\http_request_pool.cpp"> + RelativePath=".\src\http\http_response.cpp"> + RelativePath=".\src\http\http_service.cpp"> + RelativePath=".\src\http\http_utils.cpp"> + RelativePath=".\src\http\HttpCookie.cpp"> + RelativePath=".\src\http\HttpServlet.cpp"> + RelativePath=".\src\http\HttpServletRequest.cpp"> + RelativePath=".\src\http\HttpServletResponse.cpp"> + RelativePath=".\src\http\HttpSession.cpp"> + Filter=""> + RelativePath=".\src\hsocket\hsclient.cpp"> + RelativePath=".\src\hsocket\hserror.cpp"> + RelativePath=".\src\hsocket\hspool.cpp"> + RelativePath=".\src\hsocket\hsproto.cpp"> + RelativePath=".\src\hsocket\hsrow.cpp"> + RelativePath=".\src\hsocket\hstable.cpp"> + Filter=""> + RelativePath=".\src\db\db_handle.cpp"> + RelativePath=".\src\db\db_mysql.cpp"> + RelativePath=".\src\db\db_pool.cpp"> + RelativePath=".\src\db\db_service.cpp"> + RelativePath=".\src\db\db_service_mysql.cpp"> + RelativePath=".\src\db\db_service_sqlite.cpp"> + RelativePath=".\src\db\db_sqlite.cpp"> + RelativePath=".\src\db\mysql_pool.cpp"> + RelativePath=".\src\db\sqlite_pool.cpp"> + Filter=""> + RelativePath=".\src\memcache\memcache.cpp"> + RelativePath=".\src\memcache\memcache_manager.cpp"> + RelativePath=".\src\memcache\memcache_pool.cpp"> + Filter=""> + RelativePath=".\src\redis\redis_client.cpp"> + Filter=""> + RelativePath=".\src\session\memcache_session.cpp"> + RelativePath=".\src\session\session.cpp"> + Filter=""> + RelativePath=".\src\beanstalk\beanstalk.cpp"> + RelativePath=".\src\beanstalk\beanstalk_pool.cpp"> + Filter=""> + RelativePath=".\src\queue\queue_file.cpp"> + RelativePath=".\src\queue\queue_manager.cpp"> + Filter=""> + RelativePath=".\src\connpool\connect_manager.cpp"> + RelativePath=".\src\connpool\connect_monitor.cpp"> + RelativePath=".\src\connpool\connect_pool.cpp"> + Filter=""> + RelativePath=".\src\event\event_timer.cpp"> + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + RelativePath=".\include\acl_cpp\acl_cpp_define.hpp"> + RelativePath=".\include\acl_cpp\acl_cpp_init.hpp"> + RelativePath=".\include\acl_cpp\acl_cpp_test.hpp"> + RelativePath=".\include\acl_cpp\lib_acl.hpp"> + RelativePath=".\resource_vc2003.h"> + Filter=""> + RelativePath=".\include\acl_cpp\stream\aio_delay_free.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_fstream.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_handle.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_istream.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_listen_stream.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_ostream.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_socket_stream.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_stream.hpp"> + RelativePath=".\include\acl_cpp\stream\aio_timer_callback.hpp"> + RelativePath=".\include\acl_cpp\stream\fstream.hpp"> + RelativePath=".\include\acl_cpp\stream\ifstream.hpp"> + RelativePath=".\include\acl_cpp\stream\istream.hpp"> + RelativePath=".\include\acl_cpp\stream\ofstream.hpp"> + RelativePath=".\include\acl_cpp\stream\ostream.hpp"> + RelativePath=".\include\acl_cpp\stream\server_socket.hpp"> + RelativePath=".\include\acl_cpp\stream\socket_stream.hpp"> + RelativePath=".\include\acl_cpp\stream\ssl_aio_stream.hpp"> + + + Filter=""> + RelativePath=".\include\acl_cpp\stdlib\charset_conv.hpp"> + RelativePath=".\include\acl_cpp\stdlib\dns_service.hpp"> + RelativePath=".\include\acl_cpp\stdlib\escape.hpp"> + RelativePath=".\include\acl_cpp\stdlib\final_tpl.hpp"> + RelativePath=".\include\acl_cpp\stdlib\json.hpp"> + RelativePath=".\include\acl_cpp\stdlib\locker.hpp"> + RelativePath=".\include\acl_cpp\stdlib\log.hpp"> + RelativePath=".\include\acl_cpp\stdlib\malloc.hpp"> + RelativePath=".\include\acl_cpp\stdlib\md5.hpp"> + RelativePath=".\include\acl_cpp\stdlib\noncopyable.hpp"> + RelativePath=".\include\acl_cpp\stdlib\pipe_stream.hpp"> + RelativePath=".\include\acl_cpp\stdlib\scan_dir.hpp"> + RelativePath=".\include\acl_cpp\stdlib\singleton.hpp"> + RelativePath=".\include\acl_cpp\stdlib\snprintf.hpp"> + RelativePath=".\include\acl_cpp\stdlib\string.hpp"> + RelativePath=".\include\acl_cpp\stdlib\thread.hpp"> + RelativePath=".\include\acl_cpp\stdlib\thread_pool.hpp"> + RelativePath=".\include\acl_cpp\stdlib\url_coder.hpp"> + RelativePath=".\include\acl_cpp\stdlib\util.hpp"> + RelativePath=".\include\acl_cpp\stdlib\vld.h"> + RelativePath=".\include\acl_cpp\stdlib\xml.hpp"> + + + Filter=""> + RelativePath=".\include\acl_cpp\mime\mime.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_attach.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_base64.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_body.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_code.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_define.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_head.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_image.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_node.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_quoted_printable.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_uucode.hpp"> + RelativePath=".\include\acl_cpp\mime\mime_xxcode.hpp"> + RelativePath=".\include\acl_cpp\mime\rfc2047.hpp"> + RelativePath=".\include\acl_cpp\mime\rfc822.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\master\master_aio.hpp"> + RelativePath=".\include\acl_cpp\master\master_base.hpp"> + RelativePath=".\include\acl_cpp\master\master_conf.hpp"> + RelativePath=".\include\acl_cpp\master\master_proc.hpp"> + RelativePath=".\include\acl_cpp\master\master_threads.hpp"> + RelativePath=".\include\acl_cpp\master\master_threads2.hpp"> + RelativePath=".\include\acl_cpp\master\master_trigger.hpp"> + RelativePath=".\include\acl_cpp\master\master_udp.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\ipc\ipc_client.hpp"> + RelativePath=".\include\acl_cpp\ipc\ipc_server.hpp"> + RelativePath=".\include\acl_cpp\ipc\ipc_service.hpp"> + RelativePath=".\include\acl_cpp\ipc\rpc.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\http\http_client.hpp"> + RelativePath=".\include\acl_cpp\http\http_ctype.hpp"> + RelativePath=".\include\acl_cpp\http\http_download.hpp"> + RelativePath=".\include\acl_cpp\http\http_header.hpp"> + RelativePath=".\include\acl_cpp\http\http_mime.hpp"> + RelativePath=".\include\acl_cpp\http\http_pipe.hpp"> + RelativePath=".\include\acl_cpp\http\http_request.hpp"> + RelativePath=".\include\acl_cpp\http\http_request_manager.hpp"> + RelativePath=".\include\acl_cpp\http\http_request_pool.h"> + RelativePath=".\include\acl_cpp\http\http_response.hpp"> + RelativePath=".\include\acl_cpp\http\http_service.hpp"> + RelativePath=".\include\acl_cpp\http\http_type.hpp"> + RelativePath=".\include\acl_cpp\http\http_utils.hpp"> + RelativePath=".\include\acl_cpp\http\HttpCookie.hpp"> + RelativePath=".\include\acl_cpp\http\HttpServlet.hpp"> + RelativePath=".\include\acl_cpp\http\HttpServletRequest.hpp"> + RelativePath=".\include\acl_cpp\http\HttpServletResponse.hpp"> + RelativePath=".\include\acl_cpp\http\HttpSession.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\hsocket\hsclient.hpp"> + RelativePath=".\include\acl_cpp\hsocket\hserror.hpp"> + RelativePath=".\include\acl_cpp\hsocket\hspool.hpp"> + RelativePath=".\include\acl_cpp\hsocket\hsproto.hpp"> + RelativePath=".\include\acl_cpp\hsocket\hsrow.hpp"> + RelativePath=".\include\acl_cpp\hsocket\hstable.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\db\db_handle.hpp"> + RelativePath=".\include\acl_cpp\db\db_mysql.hpp"> + RelativePath=".\include\acl_cpp\db\db_pool.hpp"> + RelativePath=".\include\acl_cpp\db\db_service.hpp"> + RelativePath=".\include\acl_cpp\db\db_service_mysql.hpp"> + RelativePath=".\include\acl_cpp\db\db_service_sqlite.hpp"> + RelativePath=".\include\acl_cpp\db\db_sqlite.hpp"> + RelativePath=".\include\acl_cpp\db\mysql_pool.hpp"> + RelativePath=".\include\acl_cpp\db\sqlite_pool.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\memcache\memcache.hpp"> + RelativePath=".\include\acl_cpp\memcache\memcache_manager.hpp"> + RelativePath=".\include\acl_cpp\memcache\memcache_pool.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\redis\redis_client.hpp"> + RelativePath=".\include\acl_cpp\redis\redis_key.hpp"> + RelativePath=".\include\acl_cpp\redis\redis_response.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\session\memcache_session.hpp"> + RelativePath=".\include\acl_cpp\session\session.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\beanstalk\beanstalk.hpp"> + RelativePath=".\include\acl_cpp\beanstalk\beanstalk_pool.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\queue\queue_file.hpp"> + RelativePath=".\include\acl_cpp\queue\queue_manager.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\connpool\connect_client.hpp"> + RelativePath=".\include\acl_cpp\connpool\connect_manager.hpp"> + RelativePath=".\include\acl_cpp\connpool\connect_monitor.hpp"> + RelativePath=".\include\acl_cpp\connpool\connect_pool.hpp"> + Filter=""> + RelativePath=".\include\acl_cpp\event\event_timer.hpp"> + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> + RelativePath=".\lib_acl_cpp_vc2003.rc"> + Filter=""> + RelativePath=".\changes.txt"> + RelativePath=".\ReadMe.txt"> diff --git a/lib_acl_cpp/lib_acl_cpp_vc2008.vcproj b/lib_acl_cpp/lib_acl_cpp_vc2008.vcproj index 5613475dd..bfe7a95d1 100644 --- a/lib_acl_cpp/lib_acl_cpp_vc2008.vcproj +++ b/lib_acl_cpp/lib_acl_cpp_vc2008.vcproj @@ -825,6 +825,10 @@ RelativePath=".\src\stdlib\pipe_stream.cpp" > + + @@ -964,6 +968,14 @@ RelativePath=".\src\acl_stdafx.hpp" > + + + + @@ -1355,6 +1367,10 @@ RelativePath=".\include\acl_cpp\stdlib\pipe_stream.hpp" > + + @@ -1478,6 +1494,10 @@ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > + + + @@ -410,6 +411,7 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y + diff --git a/lib_acl_cpp/lib_acl_cpp_vc2010.vcxproj.filters b/lib_acl_cpp/lib_acl_cpp_vc2010.vcxproj.filters index 78cddf454..b75384b55 100644 --- a/lib_acl_cpp/lib_acl_cpp_vc2010.vcxproj.filters +++ b/lib_acl_cpp/lib_acl_cpp_vc2010.vcxproj.filters @@ -370,6 +370,9 @@ src\connpool + + src\stdlib + @@ -759,6 +762,9 @@ include\connpool + + include\stdlib + diff --git a/lib_acl_cpp/lib_acl_cpp_vc2012.rc b/lib_acl_cpp/lib_acl_cpp_vc2012.rc new file mode 100644 index 000000000..7b3084d25 --- /dev/null +++ b/lib_acl_cpp/lib_acl_cpp_vc2012.rc @@ -0,0 +1,101 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource_vc2012.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Simplified, PRC) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource_vc2012.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,1,1,2 + PRODUCTVERSION 1,1,1,2 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x7L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080404b0" + BEGIN + VALUE "Comments", "ͨõC++" + VALUE "CompanyName", "zsx" + VALUE "FileDescription", "lib_acl_cpp " + VALUE "FileVersion", "1.1.1.2" + VALUE "InternalName", "lib_acl_cpp" + VALUE "LegalCopyright", "Ȩ (C) 2011" + VALUE "OriginalFilename", "lib_acl_cpp.lib" + VALUE "ProductName", " lib_acl_cpp " + VALUE "ProductVersion", "1.1.1.2" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x804, 1200 + END +END + +#endif // Chinese (Simplified, PRC) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj b/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj index c3788b1c4..e172313af 100644 --- a/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj +++ b/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj @@ -446,7 +446,7 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y - + @@ -468,7 +468,7 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y - + diff --git a/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj.filters b/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj.filters index 5b21fd91e..1d1b9218a 100644 --- a/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj.filters +++ b/lib_acl_cpp/lib_acl_cpp_vc2012.vcxproj.filters @@ -378,9 +378,6 @@ src - - include - src\mime\internal @@ -771,9 +768,9 @@ include\stdlib - - - + + include + @@ -884,4 +881,7 @@ {c81440c9-71a3-4a12-b078-f9845c634089} + + + \ No newline at end of file diff --git a/lib_acl_cpp/resource_vc2012.h b/lib_acl_cpp/resource_vc2012.h new file mode 100644 index 000000000..a43153608 --- /dev/null +++ b/lib_acl_cpp/resource_vc2012.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by lib_acl_cpp_vc2010.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/lib_acl_cpp/samples/Makefile b/lib_acl_cpp/samples/Makefile index c250d30a0..70a5d4edd 100644 --- a/lib_acl_cpp/samples/Makefile +++ b/lib_acl_cpp/samples/Makefile @@ -51,6 +51,7 @@ all: @(cd thread_client; make) @(cd http_request_manager; make) @(cd dircopy; make) + @(cd scan_dir; make) clean: @(cd string; make clean) @@ -105,3 +106,4 @@ clean: @(cd thread_client; make clean) @(cd http_request_manager; make clean) @(cd dircopy; make clean) + @(cd scan_dir; make clean) diff --git a/lib_acl_cpp/samples/dircopy/main.cpp b/lib_acl_cpp/samples/dircopy/main.cpp index 9bf735272..75a127f5f 100644 --- a/lib_acl_cpp/samples/dircopy/main.cpp +++ b/lib_acl_cpp/samples/dircopy/main.cpp @@ -332,7 +332,7 @@ int main(int argc, char* argv[]) do_copy(".", path_to); - logger_error("enter any key to exit"); + logger("enter any key to exit"); getchar(); return (0); diff --git a/lib_acl_cpp/samples/http_request2/Makefile b/lib_acl_cpp/samples/http_request2/Makefile new file mode 100644 index 000000000..8e13aaace --- /dev/null +++ b/lib_acl_cpp/samples/http_request2/Makefile @@ -0,0 +1,3 @@ +include ../Makefile.in +EXTLIBS = -lz +PROG = http_request diff --git a/lib_acl_cpp/samples/http_request2/main.cpp b/lib_acl_cpp/samples/http_request2/main.cpp new file mode 100644 index 000000000..cab0c0dc5 --- /dev/null +++ b/lib_acl_cpp/samples/http_request2/main.cpp @@ -0,0 +1,106 @@ +// http_servlet.cpp : ̨Ӧóڵ㡣 +// +#include +#include +#include "acl_cpp/lib_acl.hpp" + +using namespace acl; + +////////////////////////////////////////////////////////////////////////// + +class http_request_test +{ +public: + http_request_test(const char* server_addr, + const char* stype, const char* charset) + { + server_addr_= server_addr; + stype_ = stype; + charset_ = charset; + to_charset_ = "gb2312"; + } + + ~http_request_test() {} + + bool run(void) + { + http_request req(server_addr_); + + // HTTP ͷֶ + + string ctype("text/"); + ctype << stype_ << "; charset=" << charset_; + + http_header& hdr = req.request_header(); // ͷ + hdr.set_url("/"); + hdr.set_content_type(ctype); + + // HTTP + if (req.request(NULL, 0) == false) + { + logger_error("send http request to %s error", + server_addr_.c_str()); + return false; + } + + acl::string line; + + while (true) + { + if (req.body_gets(line) == false) + break; + printf(">>>[%s], len: %d\r\n", line.c_str(), + (int) line.size()); + line.clear(); + } + + if (req.body_gets(line)) + printf(">>last data: %s\r\n", line.c_str()); + + return true; + } + +private: + string server_addr_; // web ַ + string stype_; // ݵ + string charset_; // ļַ + string to_charset_; // ӦתΪַ +}; + +////////////////////////////////////////////////////////////////////////// + +static void usage(const char* procname) +{ + printf("usage: %s -h[help] -s server_addr\r\n", procname); +} + +int main(int argc, char* argv[]) +{ + int ch; + string server_addr("127.0.0.1:8888"); + string stype("html"), charset("gb2312"); + + while ((ch = getopt(argc, argv, "hs:")) > 0) + { + switch (ch) + { + case 'h': + usage(argv[0]); + return 0; + case 's': + server_addr = optarg; + break; + default: + usage(argv[0]); + return 0; + } + } + + // ʼ + log::stdout_open(true); + http_request_test test(server_addr, stype, charset); + test.run(); + + return 0; +} + diff --git a/lib_acl_cpp/samples/http_request2/valgrind.sh b/lib_acl_cpp/samples/http_request2/valgrind.sh new file mode 100644 index 000000000..a8ba02ba0 --- /dev/null +++ b/lib_acl_cpp/samples/http_request2/valgrind.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +#valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./http_request -f xml.txt -t xml +valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./http_request -f xml_utf8.txt -t xml -c utf-8 +#valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./http_request -f json.txt -t json +#valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./http_request -f json_utf8.txt -t json -c utf-8 diff --git a/lib_acl_cpp/samples/http_request_manager/http_request_manager.vcproj b/lib_acl_cpp/samples/http_request_manager/http_request_manager.vcproj index bb0810785..d866fa617 100644 --- a/lib_acl_cpp/samples/http_request_manager/http_request_manager.vcproj +++ b/lib_acl_cpp/samples/http_request_manager/http_request_manager.vcproj @@ -172,7 +172,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir)\ /Y Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;VC2003;ACL_CPP_DLL" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;VC2003;ACL_CPP_DLL;ACL_DLL;HTTP_DLL" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" diff --git a/lib_acl_cpp/samples/http_servlet2/Makefile b/lib_acl_cpp/samples/http_servlet2/Makefile new file mode 100644 index 000000000..e28615140 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/Makefile @@ -0,0 +1,3 @@ +include ../Makefile.in +EXTLIBS = -lz +PROG = http_servlet2 diff --git a/lib_acl_cpp/samples/http_servlet2/http_servlet.cpp b/lib_acl_cpp/samples/http_servlet2/http_servlet.cpp new file mode 100644 index 000000000..adf26d3af --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/http_servlet.cpp @@ -0,0 +1,106 @@ +#include "stdafx.h" +#include "http_servlet.h" + +http_servlet::http_servlet(void) +{ + +} + +http_servlet::~http_servlet(void) +{ + +} + +bool http_servlet::doError(acl::HttpServletRequest&, acl::HttpServletResponse&) +{ + return false; +} + +bool http_servlet::doUnknown(acl::HttpServletRequest&, + acl::HttpServletResponse& res) +{ + res.setStatus(400); + res.setContentType("text/html; charset="); + // http Ӧͷ + if (res.sendHeader() == false) + return false; + // http Ӧ + acl::string buf("\r\n"); + (void) res.getOutputStream().write(buf); + return false; +} + +bool http_servlet::doGet(acl::HttpServletRequest& req, + acl::HttpServletResponse& res) +{ + return doPost(req, res); +} + +bool http_servlet::doPost(acl::HttpServletRequest& req, + acl::HttpServletResponse& res) +{ + bool keep_alive = req.isKeepAlive(); + + res.setContentType("text/html; charset=utf-8") // Ӧַ + .setKeepAlive(keep_alive) // Ƿ񱣳ֳ + .setChunkedTransferEncoding(true); // chunked ģʽ + + // http Ӧ + + if (res.write("first line\r\nsecond line\r\nthird line\r\n\r\n") == false) + { + logger_error("write error!"); + return false; + } + + for (int i = 0; i < 10; i++) + { + if (res.write("hello") == false) + { + logger_error("write error!"); + return false; + } + if (res.write(" ") == false) + { + logger_error("write error!"); + return false; + } + if (res.write("world") == false) + { + logger_error("write error!"); + return false; + } + if (res.write("\r\n") == false) + { + logger_error("write error!"); + return false; + } + } + + for (int j = 0; j < 10; j++) + { + for (int i = 0; i < 10; i++) + { + if (res.write("X") == false) + { + logger_error("write error!"); + return false; + } + } + + if (res.write("\r\n") == false) + { + logger_error("write error!"); + return false; + } + } + + // һвд \r\n + if (res.write("Bye") == false) + { + logger_error("write error!"); + return false; + } + + return res.write(NULL, 0) && keep_alive; +} diff --git a/lib_acl_cpp/samples/http_servlet2/http_servlet.h b/lib_acl_cpp/samples/http_servlet2/http_servlet.h new file mode 100644 index 000000000..0d158f9ae --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/http_servlet.h @@ -0,0 +1,18 @@ +#pragma once + +class http_servlet : public acl::HttpServlet +{ +public: + http_servlet(); + ~http_servlet(); + +protected: + virtual bool doError(acl::HttpServletRequest&, + acl::HttpServletResponse& res); + virtual bool doUnknown(acl::HttpServletRequest&, + acl::HttpServletResponse& res); + virtual bool doGet(acl::HttpServletRequest& req, + acl::HttpServletResponse& res); + virtual bool doPost(acl::HttpServletRequest& req, + acl::HttpServletResponse& res); +}; diff --git a/lib_acl_cpp/samples/http_servlet2/http_servlet2.cf b/lib_acl_cpp/samples/http_servlet2/http_servlet2.cf new file mode 100644 index 000000000..7c4cc58c9 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/http_servlet2.cf @@ -0,0 +1,135 @@ + +service http_servlet2 { +# Ƿֹ + master_disable = no +# ַ˿ں +# for master_type = inet +# master_service = 127.0.0.1:5001 +# for master_type = unix +# master_service = echo.sock +# for master_type = sock + master_service = 127.0.0.1:5001, 5002, :5003, echo.sock, echo2.sock + +# Ϊ׽ӿ +# master_service = aio_echo.sock +# +# master_type = inet +# master_type = unix + master_type = sock + +# ӽ쳣˳ʱֵǿգӽ쳣˳Ϣ֪ͨ÷ +# master_notify_addr = 127.0.0.1:5801 +# ʼ֪ͨ +# master_notify_recipients = zhengshuxin@hotmail.com + +# ǷӳٽܿͻӣΪ0ʾرոùܣ0ʾ򿪴˹ +# ҴֵӳٽӵijʱֵֵʱͻȻûзݣ +# ϵͳϵͳֱӹرո +# master_defer_accept = 0 +# Ƿֻ˽з, Ϊ y, ׽ӿڴ {install_path}/var/log/private/ Ŀ¼, +# Ϊ n, ׽ӿڴ {install_path}/var/log/public/ Ŀ¼, + master_private = n + master_unpriv = n +# ǷҪ chroot: n -- no, y -- yes + master_chroot = n +# ÿ೤ʱ䴥һΣλΪ( trigger ģʽЧ) + master_wakeup = - +# + master_maxproc = 1 +# Ԥֵô master_maxproc +# master_prefork = 0 +# ̳ + master_command = http_servlet2 +# ־¼ļ + master_log = {install_path}/var/log/http_servlet2 +# ־ʽʽtag:level; tag:level; tab:level, 磺all:1; 101:2 +# master_debug = +# ֻΪ: -u [Ƿijͨû] +# master_args = +# ݸӽ̵Ļ, ͨ getenv("SERVICE_ENV") ôֵ +# master_env = mempool_limit:512000000 +# master_env = logme:FALSE, priority:E_LOG_INFO, action:E_LOG_PER_DAY, flush:sync_flush, imit_size:512,\ +# sync_action:E_LOG_SEM, sem_name:/tmp/ioctl_echo.sem + +# ӽʵʱÿؿƶӽڽʱǷ acl_master ϢԼ״̬ +# master_status_notify = 1 +# Ƿ core ļ +# ioctl_enable_core = 1 +# ÿʵֵʵ˳ + ioctl_use_limit = 100 +# ÿʵĿгʱʱ䣬ֵʵ˳ + ioctl_idle_limit = 120 +# ¼PIDλ(ڶʵ˵û) + ioctl_pid_dir = {install_path}/var/pid +# ʱڵ· + ioctl_queue_dir = {install_path}/var +# дʱʱ, λΪ + ioctl_rw_timeout = 120 +# ĻС + ioctl_buf_size = 8192 +# ÿ accept ʱѭյ + ioctl_max_accept = 25 +# ڲdz͵£ 10 / ʱҿֵ(Ϊ1) +# Լ¼ѭ, Ӷֹ select ϵʱӰٶ +# ioctl_enable_dog = 1 +# ʱû + ioctl_owner = root + +# select ѭʱʱ +# λΪ + ioctl_delay_sec = 1 +# λΪ΢ + ioctl_delay_usec = 500 + +# ¼ѭķʽ: select(default), poll, kernel(epoll/devpoll/kqueue) + ioctl_event_mode = kernel +# ¼пʱ() +# ioctl_check_inter = 100 +# master_dispatch ӷֿ󣬸ָ master_dispatch +# ׽ӿڵȫ·ӽ̾ͿԴ master_dispatch ÿͻ +# ioctl_dispatch_addr = {install_path}/var/private/dispatch.sock +# ioctl_dispatch_addr Ʊ̷ǰ master_dispatch ķʶϢ +# ioctl_dispatch_type = default + +# ̳߳ص߳ + ioctl_max_threads = 250 +# ̳߳й̵߳ȴʱ() +# ioctl_schedule_wait = 50 +# ߳ȵʱڴֵ()Ǿ־ +# ioctl_schedule_warn = 100 +# ̴߳ӵ˷ֵǾ־Ϊ 0 ڲֻеӵ߳ 10 ʱű +# ioctl_qlen_warn = 0 +# ̵߳ĶջռСλΪֽڣ0ʾʹϵͳȱʡֵ + ioctl_stacksize = 0 +# udserver ĿͻIPַΧ + ioctl_access_allow = 127.0.0.1:255.255.255.255, 127.0.0.1:127.0.0.1 + +# acl_master ˳ʱֵ1ó򲻵Ӵϱ˳ + ioctl_quick_abort = 1 + +############################################################################ +# ӦԼѡ + +# mysql ַ +# mysql_dbaddr = /tmp/mysql.sock +# mysql_dbaddr = 10.0.250.199:3306 +# mysql ݿӳصֵ +# mysql_dbmax = 200 +# ping mysql ӵļʱ, Ϊλ +# mysql_dbping = 10 +# mysql ӿеʱ, Ϊλ +# mysql_dbtimeout = 30 + +# ݿ +# mysql_dbname = ioctl_db +# ݿû +# mysql_dbuser = ioctl_user +# ݿû +# mysql_dbpass = 111111 + +# Ƿǰڴ״̬Ϣ +# debug_mem = 1 +# Ƿһ߳Ӷ +# loop_read = 1 +} + diff --git a/lib_acl_cpp/samples/http_servlet2/http_servlet2.vcproj b/lib_acl_cpp/samples/http_servlet2/http_servlet2.vcproj new file mode 100644 index 000000000..c173e53ed --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/http_servlet2.vcproj @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj b/lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj new file mode 100644 index 000000000..3c50977a3 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj @@ -0,0 +1,203 @@ + + + + + DebugDll + Win32 + + + Debug + Win32 + + + ReleaseDll + Win32 + + + Release + Win32 + + + + {58FE3581-C997-4BD5-9AC6-AEEB54A43D2C} + Win32Proj + http_servlet2 + + + + Application + v110 + MultiByte + + + Application + v110 + MultiByte + + + Application + v110 + MultiByte + + + Application + v110 + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>11.0.50727.1 + + + Debug\ + Debug\ + true + + + Release\ + Release\ + false + + + $(Configuration)\ + $(Configuration)\ + false + + + $(Configuration)\ + $(Configuration)\ + true + + + + Disabled + ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + + + lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies) + $(OutDir)http_servlet2.exe + ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)http_servlet2.pdb + Console + MachineX86 + false + + + + + ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Use + Level3 + ProgramDatabase + + + lib_acl_cpp_vc2012.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;%(AdditionalDependencies) + $(OutDir)http_servlet2.exe + ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + + + ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + Level3 + ProgramDatabase + + + lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) + $(OutDir)http_servlet2.exe + ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + copy ..\..\..\dist\lib\win32\lib_acl.dll $(OutDir) /Y +copy ..\..\..\dist\lib\win32\lib_acl_cpp.dll $(OutDir) /Y +copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y + + + + + Disabled + ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + Level3 + EditAndContinue + + + lib_acl_cpp_d.lib;lib_acl_d.lib;lib_protocol_d.lib;%(AdditionalDependencies) + $(OutDir)http_servlet2.exe + ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)http_servlet2.pdb + Console + MachineX86 + + + copy ..\..\..\dist\lib\win32\lib_acl_d.dll $(OutDir) /Y +copy ..\..\..\dist\lib\win32\lib_acl_cpp.dll $(OutDir) /Y +copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj.filters b/lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj.filters new file mode 100644 index 000000000..5deb1307a --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/http_servlet2_vc2012.vcxproj.filters @@ -0,0 +1,45 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + + + + diff --git a/lib_acl_cpp/samples/http_servlet2/main.cpp b/lib_acl_cpp/samples/http_servlet2/main.cpp new file mode 100644 index 000000000..0d05395f7 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/main.cpp @@ -0,0 +1,36 @@ +#include "stdafx.h" +#include "master_service.h" + +int main(int argc, char* argv[]) +{ + // ʼ acl + acl::acl_cpp_init(); + + master_service& ms = acl::singleton2::get_instance(); + + // ò + ms.set_cfg_int(var_conf_int_tab); + ms.set_cfg_int64(var_conf_int64_tab); + ms.set_cfg_str(var_conf_str_tab); + ms.set_cfg_bool(var_conf_bool_tab); + + // ʼ + + if (argc >= 2 && strcmp(argv[1], "alone") == 0) + { + acl::log::stdout_open(true); // ־׼ + const char* addr = "127.0.0.1:8888"; + printf("listen on: %s\r\n", addr); + if (argc >= 3) + ms.run_alone(addr, argv[2], 5); // зʽ + else + ms.run_alone(addr, NULL, 5); // зʽ + + printf("Enter any key to exit now\r\n"); + getchar(); + } + else + ms.run_daemon(argc, argv); // acl_master ģʽ + + return 0; +} diff --git a/lib_acl_cpp/samples/http_servlet2/master_service.cpp b/lib_acl_cpp/samples/http_servlet2/master_service.cpp new file mode 100644 index 000000000..b3de88ae1 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/master_service.cpp @@ -0,0 +1,98 @@ +#include "stdafx.h" +#include "http_servlet.h" +#include "master_service.h" + +//////////////////////////////////////////////////////////////////////////////// +// + +char *var_cfg_str; +acl::master_str_tbl var_conf_str_tab[] = { + { "str", "test_msg", &var_cfg_str }, + + { 0, 0, 0 } +}; + +int var_cfg_bool; +acl::master_bool_tbl var_conf_bool_tab[] = { + { "bool", 1, &var_cfg_bool }, + + { 0, 0, 0 } +}; + +int var_cfg_int; +acl::master_int_tbl var_conf_int_tab[] = { + { "int", 120, &var_cfg_int, 0, 0 }, + + { 0, 0 , 0 , 0, 0 } +}; + +long long int var_cfg_int64; +acl::master_int64_tbl var_conf_int64_tab[] = { + { "int64", 120, &var_cfg_int64, 0, 0 }, + + { 0, 0 , 0 , 0, 0 } +}; + +//////////////////////////////////////////////////////////////////////////////// + +master_service::master_service() +{ +} + +master_service::~master_service() +{ +} + +bool master_service::thread_on_read(acl::socket_stream* conn) +{ + http_servlet* servlet = (http_servlet*) conn->get_ctx(); + if (servlet == NULL) + logger_fatal("servlet null!"); + + return servlet->doRun("127.0.0.1:11211", conn); +} + +bool master_service::thread_on_accept(acl::socket_stream* conn) +{ + logger("connect from %s, fd: %d", conn->get_peer(true), + conn->sock_handle()); + conn->set_rw_timeout(5); + + http_servlet* servlet = new http_servlet(); + conn->set_ctx(servlet); + + return true; +} + +bool master_service::thread_on_timeout(acl::socket_stream* conn) +{ + logger("read timeout from %s, fd: %d", conn->get_peer(), + conn->sock_handle()); + return false; +} + +void master_service::thread_on_close(acl::socket_stream* conn) +{ + logger("disconnect from %s, fd: %d", conn->get_peer(), + conn->sock_handle()); + + http_servlet* servlet = (http_servlet*) conn->get_ctx(); + if (servlet) + delete servlet; +} + +void master_service::thread_on_init() +{ +} + +void master_service::thread_on_exit() +{ +} + +void master_service::proc_on_init() +{ +} + +void master_service::proc_on_exit() +{ +} diff --git a/lib_acl_cpp/samples/http_servlet2/master_service.h b/lib_acl_cpp/samples/http_servlet2/master_service.h new file mode 100644 index 000000000..b377f9031 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/master_service.h @@ -0,0 +1,81 @@ +#pragma once + +//////////////////////////////////////////////////////////////////////////////// +// + +extern char *var_cfg_str; +extern acl::master_str_tbl var_conf_str_tab[]; + +extern int var_cfg_bool; +extern acl::master_bool_tbl var_conf_bool_tab[]; + +extern int var_cfg_int; +extern acl::master_int_tbl var_conf_int_tab[]; + +extern long long int var_cfg_int64; +extern acl::master_int64_tbl var_conf_int64_tab[]; + +//////////////////////////////////////////////////////////////////////////////// + +//class acl::socket_stream; + +class master_service : public acl::master_threads +{ +public: + master_service(); + ~master_service(); + +protected: + /** + * 麯ijͻݿɶرջʱô˺ + * @param stream {socket_stream*} + * @return {bool} false ʾغҪرӣ + * ʾҪֳӣӦӦ÷ false + */ + virtual bool thread_on_read(acl::socket_stream* stream); + + /** + * ̳߳еij̻߳һʱĻص + * һЩʼ + * @param stream {socket_stream*} + * @return {bool} false ʾҪرӣ + * ؽٴ thread_main + */ + virtual bool thread_on_accept(acl::socket_stream* stream); + + /** + * ijӵ IO дʱʱĻصú true ʾȴһ + * дϣرո + * @param stream {socket_stream*} + * @return {bool} false ʾҪرӣ + * ؽٴ thread_main + */ + virtual bool thread_on_timeout(acl::socket_stream* stream); + + /** + * ij̰߳󶨵ӹرʱĻص + * @param stream {socket_stream*} + */ + virtual void thread_on_close(acl::socket_stream* stream); + + /** + * ̳߳һ̱߳ʱĻص + */ + virtual void thread_on_init(); + + /** + * ̳߳һ߳˳ʱĻص + */ + virtual void thread_on_exit(); + + /** + * лûݺõĻص˺ʱ + * ȨΪͨ޼ + */ + virtual void proc_on_init(); + + /** + * ˳ǰõĻص + */ + virtual void proc_on_exit(); +}; diff --git a/lib_acl_cpp/samples/http_servlet2/stdafx.cpp b/lib_acl_cpp/samples/http_servlet2/stdafx.cpp new file mode 100644 index 000000000..3a8a20e11 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// master_threads.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H +//κĸͷļڴļ diff --git a/lib_acl_cpp/samples/http_servlet2/stdafx.h b/lib_acl_cpp/samples/http_servlet2/stdafx.h new file mode 100644 index 000000000..70b092839 --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/stdafx.h @@ -0,0 +1,19 @@ +// stdafx.h : ׼ϵͳļİļ +// dzõĵĿضİļ +// + +#pragma once + + +//#include +//#include + +// TODO: ڴ˴óҪĸͷļ + +#include "acl_cpp/lib_acl.hpp" +#include "lib_acl.h" + +#ifdef WIN32 +#define snprintf _snprintf +#endif + diff --git a/lib_acl_cpp/samples/http_servlet2/valgrind.sh b/lib_acl_cpp/samples/http_servlet2/valgrind.sh new file mode 100644 index 000000000..99de93a4a --- /dev/null +++ b/lib_acl_cpp/samples/http_servlet2/valgrind.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +valgrind --tool=memcheck --leak-check=yes -v ./http_servlet2 alone http_servlet2.cf diff --git a/lib_acl_cpp/samples/scan_dir/Makefile b/lib_acl_cpp/samples/scan_dir/Makefile new file mode 100644 index 000000000..0c26358de --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/Makefile @@ -0,0 +1,2 @@ +include ../Makefile.in +PROG = scan_dir diff --git a/lib_acl_cpp/samples/scan_dir/main.cpp b/lib_acl_cpp/samples/scan_dir/main.cpp new file mode 100644 index 000000000..2cecfb1f6 --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/main.cpp @@ -0,0 +1,139 @@ +#include +#include "lib_acl.h" +#include "acl_cpp/lib_acl.hpp" + +static void ls_file(acl::scan_dir& scan, const char* path, bool recursive, + bool fullpath) +{ + if (scan.open(path, recursive) == false) + { + logger_error("open path: %s error: %s", + path, acl::last_serror()); + return; + } + + int nfiles = 0; + const char* filename; + + while ((filename = scan.next_file(fullpath)) != NULL) + { + logger("filename: %s, path: %s", filename, scan.curr_path()); + nfiles++; + } + + logger("==========================================================="); + logger("total file count: %d", nfiles); +} + +static void ls_dir(acl::scan_dir& scan, const char* path, bool recursive, + bool fullpath) +{ + if (scan.open(path, recursive) == false) + { + logger_error("open path: %s error: %s", + path, acl::last_serror()); + return; + } + + int ndirs = 0; + const char* dirname; + + while ((dirname = scan.next_dir(fullpath)) != NULL) + { + logger("dirname: %s, path: %s", dirname, scan.curr_path()); + ndirs++; + } + + logger("==========================================================="); + logger("total dir count: %d", ndirs); +} + +static void ls_all(acl::scan_dir& scan, const char* path, bool recursive, + bool fullpath) +{ + if (scan.open(path, recursive) == false) + { + logger_error("open path: %s error: %s", + path, acl::last_serror()); + return; + } + + int ndirs = 0, nfiles = 0; + const char* name; + bool is_file; + + while ((name = scan.next(fullpath, &is_file)) != NULL) + { + logger("%s: %s, path: %s", is_file ? "filename" : "dirname", + name, scan.curr_path()); + if (is_file) + nfiles++; + else + ndirs++; + } + + logger("==========================================================="); + logger("total dir count: %d, file count: %d", ndirs, nfiles); +} + +static void usage(const char* procname) +{ + logger("usage: %s -h [help] -d path -t type[dir|file|all] " + "-r [if recursive, default: false] " + "-a [if get fullpath, default: false]", procname); +} + +int main(int argc, char* argv[]) +{ + int ch; + bool recursive = false, fullpath = false; + acl::string path, mode; + acl::log::stdout_open(true); + + while ((ch = getopt(argc, argv, "hd:t:ra")) > 0) + { + switch (ch) + { + case 'h': + usage(argv[0]); + return 0; + case 'd': + path = optarg; + break; + case 't': + mode = optarg; + break; + case 'r': + recursive = true; + break; + case 'a': + fullpath = true; + break; + default: + break; + } + } + + if (path.empty()) + { + usage(argv[0]); + return 1; + } + + acl::scan_dir scan; + + if (mode == "dir") + ls_dir(scan, path, recursive, fullpath); + else if (mode == "file") + ls_file(scan, path, recursive, fullpath); + else + ls_all(scan, path, recursive, fullpath); + +#ifdef WIN32 + logger("==========================================================="); + logger("enter any key to exit"); + getchar(); +#endif + + return (0); +} diff --git a/lib_acl_cpp/samples/scan_dir/scan_dir.vcproj b/lib_acl_cpp/samples/scan_dir/scan_dir.vcproj new file mode 100644 index 000000000..ef07661b2 --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/scan_dir.vcproj @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/scan_dir/scan_dir.vcxproj b/lib_acl_cpp/samples/scan_dir/scan_dir.vcxproj new file mode 100644 index 000000000..ce4d77c41 --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/scan_dir.vcxproj @@ -0,0 +1,189 @@ + + + + + DebugDll + Win32 + + + Debug + Win32 + + + Releasedll + Win32 + + + Release + Win32 + + + + {7680672C-4C9B-4BE8-8BAE-BB23B951AAA0} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + false + $(Configuration)\ + $(Configuration)\ + true + $(Configuration)\ + $(Configuration)\ + true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ws2_32.lib;lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)scan_dir.pdb + Console + MachineX86 + + + + + + + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ws2_32.lib;wsock32.lib;lib_acl_vc2010.lib;lib_acl_cpp_vc2010.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)scan_dir.pdb + Console + MachineX86 + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)scan_dir.pdb + Console + MachineX86 + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/scan_dir/scan_dir_vc2008.vcproj b/lib_acl_cpp/samples/scan_dir/scan_dir_vc2008.vcproj new file mode 100644 index 000000000..116cec151 --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/scan_dir_vc2008.vcproj @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/scan_dir/scan_dir_vc2012.vcxproj b/lib_acl_cpp/samples/scan_dir/scan_dir_vc2012.vcxproj new file mode 100644 index 000000000..18520dfe0 --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/scan_dir_vc2012.vcxproj @@ -0,0 +1,194 @@ + + + + + DebugDll + Win32 + + + Debug + Win32 + + + Releasedll + Win32 + + + Release + Win32 + + + + {8A5563B4-C546-46D0-9C64-D051CA29F164} + Win32Proj + scan_dir + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + false + $(Configuration)\ + $(Configuration)\ + true + $(Configuration)\ + $(Configuration)\ + true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ws2_32.lib;lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)scan_dir.pdb + Console + MachineX86 + + + + + + + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)scan_dir.pdb + Console + MachineX86 + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)scan_dir.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)scan_dir.pdb + Console + MachineX86 + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/scan_dir/valgrind.sh b/lib_acl_cpp/samples/scan_dir/valgrind.sh new file mode 100644 index 000000000..9c5486396 --- /dev/null +++ b/lib_acl_cpp/samples/scan_dir/valgrind.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +valgrind --tool=memcheck --leak-check=yes -v ./scan_dir -d ../../../lib_acl/src -r -t all -a diff --git a/lib_acl_cpp/samples/string2/Makefile b/lib_acl_cpp/samples/string2/Makefile new file mode 100644 index 000000000..3589772ff --- /dev/null +++ b/lib_acl_cpp/samples/string2/Makefile @@ -0,0 +1,2 @@ +include ../Makefile.in +PROG = string diff --git a/lib_acl_cpp/samples/string2/main.cpp b/lib_acl_cpp/samples/string2/main.cpp new file mode 100644 index 000000000..eef898ed4 --- /dev/null +++ b/lib_acl_cpp/samples/string2/main.cpp @@ -0,0 +1,84 @@ +#include "lib_acl.h" +#include "acl_cpp/stream/ofstream.hpp" +#include "acl_cpp/stdlib/string.hpp" +#include +#include + +////////////////////////////////////////////////////////////////////////// + +static void test_main(bool move) +{ + acl::string s("hello world!\r\n" + "you're welcome\r\n" + "what's your name\r\n" + "happy new year"); + acl::string line; + + while (true) + { + if (s.scan_line(line, true, NULL) == true) + { + printf(">>line: %s, rest len: %d\r\n", + line.c_str(), (int) s.length()); + line.clear(); + + if (move) + s.scan_move(); + } + else + { + if (s.empty()) + break; + + printf(">>last: %s, len: %d\r\n", + s.c_str(), (int) s.length()); + + acl_assert(strlen(s.c_str()) == s.length()); + + if (move) + s.scan_move(); + + printf("=======================================\r\n"); + printf(">>string len: %d, buf len: %d, buf: \r\n%s\r\n", + (int) s.length(), (int) strlen((char*) s.buf()), + (char*) s.buf()); + printf("=======================================\r\n"); + + break; + } + } +} + +static void usage(const char* procname) +{ + printf("usage: %s -h [help] -m [move buf after scan]\r\n", procname); +} + +int main(int argc, char *argv[]) +{ + int ch; + bool move = false; + + while ((ch = getopt(argc, argv, "hm")) > 0) + { + switch (ch) + { + case 'h': + usage(argv[0]); + return 0; + case 'm': + move = true; + break; + default: + break; + } + } + + test_main(move); + +#ifdef WIN32 + printf("enter any key to exit\r\n"); + getchar(); +#endif + return (0); +} diff --git a/lib_acl_cpp/samples/string2/string.vcproj b/lib_acl_cpp/samples/string2/string.vcproj new file mode 100644 index 000000000..b5284cfe7 --- /dev/null +++ b/lib_acl_cpp/samples/string2/string.vcproj @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/string2/string.vcxproj b/lib_acl_cpp/samples/string2/string.vcxproj new file mode 100644 index 000000000..8d7b32357 --- /dev/null +++ b/lib_acl_cpp/samples/string2/string.vcxproj @@ -0,0 +1,189 @@ + + + + + DebugDll + Win32 + + + Debug + Win32 + + + Releasedll + Win32 + + + Release + Win32 + + + + {C94BEF01-706C-49A7-9FF1-9D87FA5BB8E7} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + false + $(Configuration)\ + $(Configuration)\ + true + $(Configuration)\ + $(Configuration)\ + true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)string.pdb + Console + MachineX86 + + + + + + + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ws2_32.lib;wsock32.lib;lib_acl_vc2010.lib;lib_acl_cpp_vc2010.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)string.pdb + Console + MachineX86 + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)string.pdb + Console + MachineX86 + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib_acl_cpp/samples/string2/string_vc2008.vcproj b/lib_acl_cpp/samples/string2/string_vc2008.vcproj new file mode 100644 index 000000000..81db307fe --- /dev/null +++ b/lib_acl_cpp/samples/string2/string_vc2008.vcproj @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_acl_cpp/samples/string2/string_vc2012.vcxproj b/lib_acl_cpp/samples/string2/string_vc2012.vcxproj new file mode 100644 index 000000000..d0a1787a3 --- /dev/null +++ b/lib_acl_cpp/samples/string2/string_vc2012.vcxproj @@ -0,0 +1,194 @@ + + + + + DebugDll + Win32 + + + Debug + Win32 + + + Releasedll + Win32 + + + Release + Win32 + + + + {C94BEF01-706C-49A7-9FF1-9D87FA5BB8E7} + Win32Proj + string + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + false + $(Configuration)\ + $(Configuration)\ + true + $(Configuration)\ + $(Configuration)\ + true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)string.pdb + Console + MachineX86 + + + + + + + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)string.pdb + Console + MachineX86 + + + + + Disabled + ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)string.exe + ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + true + $(OutDir)string.pdb + Console + MachineX86 + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib_acl_cpp/samples/string2/valgrind.sh b/lib_acl_cpp/samples/string2/valgrind.sh new file mode 100644 index 000000000..f3893e758 --- /dev/null +++ b/lib_acl_cpp/samples/string2/valgrind.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./string diff --git a/lib_acl_cpp/src/http/http_client.cpp b/lib_acl_cpp/src/http/http_client.cpp index 42efa0665..095ff0aad 100644 --- a/lib_acl_cpp/src/http/http_client.cpp +++ b/lib_acl_cpp/src/http/http_client.cpp @@ -708,32 +708,73 @@ bool http_client::body_gets(string& out, bool nonl /* = true */, size_t* size /* = NULL */) { if (buf_ == NULL) - buf_ = new string(1024); + buf_ = new string(4096); size_t len, size_saved = out.length(); - while (true) + // жǷѾ HTTP + if (body_finish_) { - if (!buf_->empty() && buf_->scan_line(out, nonl, &len, true)) + if (buf_->empty()) + { + if (size) + *size = 0; + return false; + } + + // ݷǿʱȳԴлȡһ + if (buf_->scan_line(out, nonl, &len) == true) { if (size) *size = out.length() - size_saved; return true; } + // ܶ HTTP 򽫶 + // ڵݶĿ껺 + out.append(buf_); + buf_->clear(); + + if (size) + *size = out.length() - size_saved; + + return true; + } + + // HTTP 壬Դжȡһ + + len = 0; + + while (true) + { + if (!buf_->empty()) + { + if (buf_->scan_line(out, nonl, &len) == true) + { + if (size) + *size = out.length() - size_saved; + return true; + } + + // Ϊ˼´ѭʱ scan_line ַҴ + // еȿĿ껺 + + len += buf_->length(); + out.append(buf_); + buf_->clear(); + } + if (body_finish_) { if (size) - *size = out.length() - size_saved; - return false; + *size = len; + return len > 0 ? true : false; } - if (read_body(*buf_, false) <= 0 && buf_->empty()) - { - if (size) - *size = out.length() - size_saved; - return false; - } + if (read_body(*buf_, false) <= 0) + body_finish_ = true; + else + body_finish_ = false; } } diff --git a/lib_acl_cpp/src/stdlib/scan_dir.cpp b/lib_acl_cpp/src/stdlib/scan_dir.cpp index 228f9eb32..4ea64900b 100644 --- a/lib_acl_cpp/src/stdlib/scan_dir.cpp +++ b/lib_acl_cpp/src/stdlib/scan_dir.cpp @@ -72,13 +72,22 @@ const char* scan_dir::next_file(bool full /* = false */) if (!full) return file; - const char* path = curr_path(true); + const char* path = curr_path(); if (path == NULL) return NULL; if (file_buf_ == NULL) file_buf_ = NEW string(256); + + +#ifdef WIN32 file_buf_->format("%s%c%s", path, PATH_SEP_C, file); +#else + if (*path == '/' && *(path + 1) == 0) + file_buf_->format("%s%s", path, file); + else + file_buf_->format("%s%c%s", path, PATH_SEP_C, file); +#endif return file_buf_->c_str(); } @@ -94,13 +103,21 @@ const char* scan_dir::next_dir(bool full /* = false */) if (!full) return dir; - const char* path = curr_path(true); + const char* path = curr_path(); if (path == NULL) return NULL; if (file_buf_ == NULL) file_buf_ = NEW string(256); + +#ifdef WIN32 file_buf_->format("%s%c%s", path, PATH_SEP_C, dir); +#else + if (*path == '/' && *(path + 1) == 0) + file_buf_->format("%s%s", path, dir); + else + file_buf_->format("%s%c%s", path, PATH_SEP_C, dir); +#endif return file_buf_->c_str(); } @@ -114,33 +131,42 @@ const char* scan_dir::next(bool full /* = false */, bool* is_file /* = NULL */) const char* name = acl_scan_dir_next_name(scan_, &res); if (name == NULL || *name == 0) return NULL; + if (is_file) *is_file = res ? true : false; if (!full) return name; - const char* path = curr_path(true); + const char* path = curr_path(); if (path == NULL) return NULL; if (file_buf_ == NULL) file_buf_ = NEW string(256); + + +#ifdef WIN32 file_buf_->format("%s%c%s", path, PATH_SEP_C, name); +#else + if (*path == '/' && *(path + 1) == 0) + file_buf_->format("%s%s", path, name); + else + file_buf_->format("%s%c%s", path, PATH_SEP_C, name); +#endif return file_buf_->c_str(); } -const char* scan_dir::curr_path(bool full /* = false */) +const char* scan_dir::curr_path() { if (scan_ == NULL) return NULL; - const char* rpath = acl_scan_dir_path(scan_); + return acl_scan_dir_path(scan_); +} - if (rpath == NULL || *rpath == 0) - return rpath; - if (!full) - return rpath; +bool scan_dir::get_cwd(string& out) +{ #ifndef MAX_PATH #define MAX_PATH 1024 @@ -148,23 +174,24 @@ const char* scan_dir::curr_path(bool full /* = false */) char buf[MAX_PATH]; #ifdef WIN32 - if (GetCurrentDirectory(MAX_PATH, buf) == 0) + if (::GetCurrentDirectory(MAX_PATH, buf) == 0) { logger_error("can't get process path: %s", last_serror()); - return NULL; + return false; } #else - if (getcwd(buf, sizeof(buf)) == NULL) + if (::getcwd(buf, sizeof(buf)) == NULL) { logger_error("can't get process path: %s", last_serror()); - return NULL; + return false; } #endif // WIN32 // xxx: can this happen ? if (buf[0] == 0) - return NULL; + return false; + // ȥβ '/' char* end = buf + strlen(buf) - 1; while (end > buf) { @@ -175,13 +202,12 @@ const char* scan_dir::curr_path(bool full /* = false */) if (*end == '/') end--; #endif + else + break; } - if (path_buf_ == NULL) - path_buf_ = NEW string(256); - path_buf_->format("%s%c%s", buf, PATH_SEP_C, rpath); - - return path_buf_->c_str(); + out = buf; + return true; } const char* scan_dir::curr_file(bool full /* = false */) @@ -194,7 +220,7 @@ const char* scan_dir::curr_file(bool full /* = false */) if (!full) return ptr; - const char* path = curr_path(true); + const char* path = curr_path(); if (path == NULL) return NULL; diff --git a/lib_acl_cpp/src/stdlib/string.cpp b/lib_acl_cpp/src/stdlib/string.cpp index d345d14da..c99f13f3c 100644 --- a/lib_acl_cpp/src/stdlib/string.cpp +++ b/lib_acl_cpp/src/stdlib/string.cpp @@ -22,98 +22,98 @@ void string::init(size_t len) { if (len < 1) len = 1; - m_pVbf = ALLOC(len); - m_psList = NULL; - m_psList2 = NULL; - m_psPair = NULL; - m_ptr = NULL; + vbf_ = ALLOC(len); + list_tmp_ = NULL; + vector_tmp_ = NULL; + pair_tmp_ = NULL; + scan_ptr_ = NULL; } string::string(size_t len /* = 64 */, bool bin /* = false */) -: m_bin(bin) +: use_bin_(bin) { init(len); } -string::string(const string& s) : m_bin(false) +string::string(const string& s) : use_bin_(false) { init(s.length() + 1); - MCP(m_pVbf, STR(s.m_pVbf), LEN(s.m_pVbf)); - TERM(m_pVbf); + MCP(vbf_, STR(s.vbf_), LEN(s.vbf_)); + TERM(vbf_); } -string::string(const char* s) : m_bin(false) +string::string(const char* s) : use_bin_(false) { size_t len = strlen(s); init(len + 1); - MCP(m_pVbf, s, len); - TERM(m_pVbf); + MCP(vbf_, s, len); + TERM(vbf_); } -string::string(const void* s, size_t n) : m_bin(false) +string::string(const void* s, size_t n) : use_bin_(false) { init(n + 1); if (n > 0) - MCP(m_pVbf, (const char*) s, n); - TERM(m_pVbf); + MCP(vbf_, (const char*) s, n); + TERM(vbf_); } string::~string() { - FREE(m_pVbf); - if (m_psList) - delete m_psList; - if (m_psList2) - delete m_psList2; - if (m_psPair) - delete m_psPair; + FREE(vbf_); + if (list_tmp_) + delete list_tmp_; + if (vector_tmp_) + delete vector_tmp_; + if (pair_tmp_) + delete pair_tmp_; } void string::set_bin(bool bin) { - m_bin = bin; + use_bin_ = bin; } bool string::get_bin() const { - return m_bin; + return use_bin_; } char string::operator [](size_t n) { - acl_assert(n < LEN(m_pVbf)); - return AT(m_pVbf, n); + acl_assert(n < LEN(vbf_)); + return AT(vbf_, n); } char string::operator [](int n) { - acl_assert(n < (int) LEN(m_pVbf) && n >= 0); - return AT(m_pVbf, n); + acl_assert(n < (int) LEN(vbf_) && n >= 0); + return AT(vbf_, n); } string& string::operator =(const char* s) { - SCP(m_pVbf, s); + SCP(vbf_, s); return *this; } string& string::operator =(const string& s) { - MCP(m_pVbf, STR(s.m_pVbf), LEN(s.m_pVbf)); - TERM(m_pVbf); + MCP(vbf_, STR(s.vbf_), LEN(s.vbf_)); + TERM(vbf_); return *this; } string& string::operator =(const string* s) { - MCP(m_pVbf, STR(s->m_pVbf), LEN(s->m_pVbf)); - TERM(m_pVbf); + MCP(vbf_, STR(s->vbf_), LEN(s->vbf_)); + TERM(vbf_); return *this; } string& string::operator =(acl_int64 n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -124,7 +124,7 @@ string& string::operator =(acl_int64 n) string& string::operator =(acl_uint64 n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -135,7 +135,7 @@ string& string::operator =(acl_uint64 n) string& string::operator =(long n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -146,7 +146,7 @@ string& string::operator =(long n) string& string::operator =(unsigned long n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -157,7 +157,7 @@ string& string::operator =(unsigned long n) string& string::operator =(int n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -168,7 +168,7 @@ string& string::operator =(int n) string& string::operator =(unsigned int n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -179,7 +179,7 @@ string& string::operator =(unsigned int n) string& string::operator =(short n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -190,7 +190,7 @@ string& string::operator =(short n) string& string::operator =(unsigned short n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -201,7 +201,7 @@ string& string::operator =(unsigned short n) string& string::operator =(char n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return *this; @@ -212,7 +212,7 @@ string& string::operator =(char n) string& string::operator =(unsigned char n) { - if (m_bin) + if (use_bin_) { copy(&n, sizeof(n)); return (*this); @@ -223,27 +223,27 @@ string& string::operator =(unsigned char n) string& string::operator +=(const char* s) { - SCAT(m_pVbf, s); + SCAT(vbf_, s); return *this; } string& string::operator +=(const string& s) { - MCAT(m_pVbf, STR(s.m_pVbf), LEN(s.m_pVbf)); - TERM(m_pVbf); + MCAT(vbf_, STR(s.vbf_), LEN(s.vbf_)); + TERM(vbf_); return *this; } string& string::operator +=(const string* s) { - MCAT(m_pVbf, STR(s->m_pVbf), LEN(s->m_pVbf)); - TERM(m_pVbf); + MCAT(vbf_, STR(s->vbf_), LEN(s->vbf_)); + TERM(vbf_); return *this; } string& string::operator +=(acl_int64 n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -254,7 +254,7 @@ string& string::operator +=(acl_int64 n) string& string::operator +=(acl_uint64 n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -265,7 +265,7 @@ string& string::operator +=(acl_uint64 n) string& string::operator +=(long n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -276,7 +276,7 @@ string& string::operator +=(long n) string& string::operator +=(unsigned long n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -287,7 +287,7 @@ string& string::operator +=(unsigned long n) string& string::operator +=(int n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -298,7 +298,7 @@ string& string::operator +=(int n) string& string::operator +=(unsigned int n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -309,7 +309,7 @@ string& string::operator +=(unsigned int n) string& string::operator +=(short n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -320,7 +320,7 @@ string& string::operator +=(short n) string& string::operator +=(unsigned short n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -331,7 +331,7 @@ string& string::operator +=(unsigned short n) string& string::operator +=(unsigned char n) { - if (m_bin) + if (use_bin_) { append(&n, sizeof(n)); return *this; @@ -431,10 +431,11 @@ string& string::push_back(char ch) char* string::buf_end() { - if (m_ptr == NULL) - m_ptr = STR(m_pVbf); - char *pEnd = acl_vstring_end(m_pVbf); - if (m_ptr >= pEnd) { + if (scan_ptr_ == NULL) + scan_ptr_ = STR(vbf_); + char *pEnd = acl_vstring_end(vbf_); + if (scan_ptr_ >= pEnd) + { if (!empty()) clear(); return NULL; @@ -443,7 +444,7 @@ char* string::buf_end() } bool string::scan_line(string& out, bool nonl /* = true */, - size_t* n /* = NULL */, bool part_copy /* = false */) + size_t* n /* = NULL */, bool move /* = false */) { if (n) *n = 0; @@ -452,48 +453,55 @@ bool string::scan_line(string& out, bool nonl /* = true */, if (pEnd == NULL) return false; - size_t len = pEnd - m_ptr; - char *ln = (char*) memchr(m_ptr, '\n', len); - if (ln != NULL) + size_t len = pEnd - scan_ptr_; + char *ln = (char*) memchr(scan_ptr_, '\n', len); + if (ln == NULL) + return false; + + char *next = ln + 1; + len = ln - scan_ptr_ + 1; + + if (nonl) { - len = ln - m_ptr + 1; - size_t len_saved = len; - if (nonl) + ln--; + len--; + if (ln >= scan_ptr_ && *ln == '\r') { ln--; len--; - if (ln >= m_ptr && *ln == '\r') - { - ln--; - len--; - } - if (len > 0) - out.append(m_ptr, len); + } + if (len > 0) + out.append(scan_ptr_, len); + } + else + out.append(scan_ptr_, len); + + if (move) + { + if (pEnd > next) + { + acl_vstring_memmove(vbf_, next, pEnd - next); + TERM(vbf_); + scan_ptr_ = STR(vbf_); } else - out.append(m_ptr, len); - - acl_vstring_memmove(m_pVbf, m_ptr, len_saved); - m_ptr = STR(m_pVbf); - if (n) - *n = len; - return true; + clear(); + } + else + { + if (next >= pEnd) + clear(); + else + scan_ptr_ = next; } - if (!part_copy) - return false; - - // ע˴ʹڲָ m_ptr STR(m_pVbf) Ҫԭǣ֮ǰе - // scan_buf IJûҪƶָ룬ΪֹظݣԴ˴ʹڲ - // ڴָ m_ptr - out.append(m_ptr, len); - clear(); if (n) *n = len; - return false; + + return true; } -size_t string::scan_buf(void* pbuf, size_t n, bool move /* false */) +size_t string::scan_buf(void* pbuf, size_t n, bool move /* = false */) { if (pbuf == NULL || n == 0) return 0; @@ -502,17 +510,38 @@ size_t string::scan_buf(void* pbuf, size_t n, bool move /* false */) if (pEnd == NULL) return 0; - size_t len = pEnd - m_ptr; + size_t len = pEnd - scan_ptr_; if (len > n) len = n; - memcpy(pbuf, m_ptr, len); + memcpy(pbuf, scan_ptr_, len); if (move) { - acl_vstring_memmove(m_pVbf, m_ptr, len); - m_ptr = STR(m_pVbf); + acl_vstring_memmove(vbf_, scan_ptr_, len); + TERM(vbf_); + scan_ptr_ = STR(vbf_); } else - m_ptr += len; + scan_ptr_ += len; + return len; +} + +size_t string::scan_move() +{ + if (scan_ptr_ == NULL) + return 0; + + char *pEnd = acl_vstring_end(vbf_); + if (scan_ptr_ >= pEnd) + { + clear(); + return 0; + } + + size_t len = pEnd - scan_ptr_; + acl_vstring_memmove(vbf_, scan_ptr_, len); + TERM(vbf_); + scan_ptr_ = STR(vbf_); + return len; } @@ -596,10 +625,10 @@ bool string::operator !=(const char* s) const bool string::operator <(const string& s) const { - size_t nLeft = LEN(m_pVbf); - size_t nRight = LEN(s.m_pVbf); + size_t nLeft = LEN(vbf_); + size_t nRight = LEN(s.vbf_); size_t n = nLeft > nRight ? nLeft : nRight; - int ret = memcmp(STR(m_pVbf), STR(s.m_pVbf), n); + int ret = memcmp(STR(vbf_), STR(s.vbf_), n); if (ret < 0) return true; else if (ret > 0) @@ -611,10 +640,10 @@ bool string::operator <(const string& s) const bool string::operator >(const string& s) const { - size_t nLeft = LEN(m_pVbf); - size_t nRight = LEN(s.m_pVbf); + size_t nLeft = LEN(vbf_); + size_t nRight = LEN(s.vbf_); size_t n = nLeft > nRight ? nLeft : nRight; - int ret = memcmp(STR(m_pVbf), STR(s.m_pVbf), n); + int ret = memcmp(STR(vbf_), STR(s.vbf_), n); if (ret > 0) return true; else if (ret < 0) @@ -626,34 +655,34 @@ bool string::operator >(const string& s) const string::operator const char *() const { - return STR(m_pVbf); + return STR(vbf_); } string::operator const void *() const { - return (void*) STR(m_pVbf); + return (void*) STR(vbf_); } int string::compare(const string& s) const { - size_t n = LEN(m_pVbf) > LEN(s.m_pVbf) ? LEN(s.m_pVbf) : LEN(m_pVbf); + size_t n = LEN(vbf_) > LEN(s.vbf_) ? LEN(s.vbf_) : LEN(vbf_); int ret; - ret = memcmp(STR(m_pVbf), STR(s.m_pVbf), n); + ret = memcmp(STR(vbf_), STR(s.vbf_), n); if (ret != 0) return ret; - return (int) (LEN(m_pVbf) - LEN(s.m_pVbf)); + return (int) (LEN(vbf_) - LEN(s.vbf_)); } int string::compare(const string* s) const { - size_t n = LEN(m_pVbf) > LEN(s->m_pVbf) ? LEN(s->m_pVbf) : LEN(m_pVbf); + size_t n = LEN(vbf_) > LEN(s->vbf_) ? LEN(s->vbf_) : LEN(vbf_); int ret; - ret = memcmp(STR(m_pVbf), STR(s->m_pVbf), n); + ret = memcmp(STR(vbf_), STR(s->vbf_), n); if (ret != 0) return ret; - return (int) (LEN(m_pVbf) - LEN(s->m_pVbf)); + return (int) (LEN(vbf_) - LEN(s->vbf_)); } int string::compare(const char* s, bool case_sensitive) const @@ -661,189 +690,193 @@ int string::compare(const char* s, bool case_sensitive) const if (case_sensitive) return compare((const void*) s, (size_t) strlen(s)); else - return acl_strcasecmp(STR(m_pVbf), s); + return acl_strcasecmp(STR(vbf_), s); } int string::compare(const void* ptr, size_t len) const { - size_t n = LEN(m_pVbf) > len ? len : LEN(m_pVbf); + size_t n = LEN(vbf_) > len ? len : LEN(vbf_); int ret; - ret = memcmp(STR(m_pVbf), ptr, n); + ret = memcmp(STR(vbf_), ptr, n); if (ret != 0) return ret; - return (int) (LEN(m_pVbf) - len); + return (int) (LEN(vbf_) - len); } int string::ncompare(const char* s, size_t len, bool case_sensitive/* =true */) const { if (case_sensitive) - return strncmp(STR(m_pVbf), s, len); + return strncmp(STR(vbf_), s, len); else - return acl_strncasecmp(STR(m_pVbf), s, len); + return acl_strncasecmp(STR(vbf_), s, len); } int string::rncompare(const char* s, size_t len, bool case_sensitive/* =true */) const { if (case_sensitive) - return acl_strrncmp(STR(m_pVbf), s, len); + return acl_strrncmp(STR(vbf_), s, len); else - return acl_strrncasecmp(STR(m_pVbf), s, len); + return acl_strrncasecmp(STR(vbf_), s, len); } char* string::c_str() const { - return STR(m_pVbf); + if (scan_ptr_) + return scan_ptr_; + return STR(vbf_); } void* string::buf() const { - return STR(m_pVbf); + return STR(vbf_); } size_t string::length() const { - return LEN(m_pVbf); + if (scan_ptr_) + return LEN(vbf_) - (scan_ptr_ - STR(vbf_)); + return LEN(vbf_); } size_t string::size() const { - return LEN(m_pVbf); + return length(); } size_t string::capacity() const { - return ACL_VSTRING_SIZE(m_pVbf); + return ACL_VSTRING_SIZE(vbf_); } string& string::set_offset(size_t n) { - RSET(m_pVbf); - ACL_VSTRING_SPACE(m_pVbf, (int) n); - ACL_VSTRING_AT_OFFSET(m_pVbf, (int) n); - TERM(m_pVbf); + RSET(vbf_); + ACL_VSTRING_SPACE(vbf_, (int) n); + ACL_VSTRING_AT_OFFSET(vbf_, (int) n); + TERM(vbf_); return *this; } string& string::space(size_t n) { - ACL_VSTRING_SPACE(m_pVbf, (int) n); + ACL_VSTRING_SPACE(vbf_, (int) n); return *this; } bool string::empty() const { - return LEN(m_pVbf) > 0 ? false : true; + return LEN(vbf_) > 0 ? false : true; } ACL_VSTRING* string::vstring() const { - return m_pVbf; + return vbf_; } int string::find(char ch) const { - char *ptr = acl_vstring_memchr(m_pVbf, ch); + char *ptr = acl_vstring_memchr(vbf_, ch); if (ptr == NULL) return -1; - return (int)(ptr - STR(m_pVbf)); + return (int)(ptr - STR(vbf_)); } -const char* string::find(const char* needle, bool case_sensitive) const +char* string::find(const char* needle, bool case_sensitive) const { if (case_sensitive) - return acl_vstring_strstr(m_pVbf, needle); + return acl_vstring_strstr(vbf_, needle); else - return acl_vstring_strcasestr(m_pVbf, needle); + return acl_vstring_strcasestr(vbf_, needle); } -const char* string::rfind(const char* needle, bool case_sensitive) const +char* string::rfind(const char* needle, bool case_sensitive) const { if (case_sensitive) - return acl_vstring_rstrstr(m_pVbf, needle); + return acl_vstring_rstrstr(vbf_, needle); else - return acl_vstring_rstrcasestr(m_pVbf, needle); + return acl_vstring_rstrcasestr(vbf_, needle); } -const string string::left(size_t npos) +string string::left(size_t npos) { - if (npos >= LEN(m_pVbf)) + if (npos >= LEN(vbf_)) return *this; - return string(STR(m_pVbf), npos); + return string(STR(vbf_), npos); } -const string string::right(size_t npos) +string string::right(size_t npos) { npos++; - if (npos >= LEN(m_pVbf)) + if (npos >= LEN(vbf_)) return string(1); - size_t nLeft = LEN(m_pVbf) - npos; - return string(STR(m_pVbf) + npos, nLeft); + size_t nLeft = LEN(vbf_) - npos; + return string(STR(vbf_) + npos, nLeft); } -const std::list& string::split(const char* sep) +std::list& string::split(const char* sep) { - ACL_ARGV *argv = acl_argv_split(STR(m_pVbf), sep); + ACL_ARGV *argv = acl_argv_split(STR(vbf_), sep); ACL_ITER it; - if (m_psList == NULL) - m_psList = NEW std::list; + if (list_tmp_ == NULL) + list_tmp_ = NEW std::list; else - m_psList->clear(); + list_tmp_->clear(); acl_foreach(it, argv) { char* ptr = (char*) it.data; - m_psList->push_back(ptr); + list_tmp_->push_back(ptr); } acl_argv_free(argv); - return *m_psList; + return *list_tmp_; } -const std::vector& string::split2(const char* sep) +std::vector& string::split2(const char* sep) { - ACL_ARGV *argv = acl_argv_split(STR(m_pVbf), sep); + ACL_ARGV *argv = acl_argv_split(STR(vbf_), sep); ACL_ITER it; - if (m_psList2 == NULL) - m_psList2 = NEW std::vector; + if (vector_tmp_ == NULL) + vector_tmp_ = NEW std::vector; else - m_psList2->clear(); + vector_tmp_->clear(); acl_foreach(it, argv) { char* ptr = (char*) it.data; - m_psList2->push_back(ptr); + vector_tmp_->push_back(ptr); } acl_argv_free(argv); - return *m_psList2; + return *vector_tmp_; } -const std::pair& string::split_nameval() +std::pair& string::split_nameval() { char *name, *value; - if (m_psPair == NULL) - m_psPair = NEW std::pair; + if (pair_tmp_ == NULL) + pair_tmp_ = NEW std::pair; - if (acl_split_nameval(STR(m_pVbf), &name, &value) != NULL) { - m_psPair->first = ""; - m_psPair->second = ""; - return *m_psPair; + if (acl_split_nameval(STR(vbf_), &name, &value) != NULL) { + pair_tmp_->first = ""; + pair_tmp_->second = ""; + return *pair_tmp_; } - m_psPair->first = name; - m_psPair->second = value; - return *m_psPair; + pair_tmp_->first = name; + pair_tmp_->second = value; + return *pair_tmp_; } string& string::copy(const char* ptr) { - SCP(m_pVbf, ptr); + SCP(vbf_, ptr); return *this; } string& string::copy(const void* ptr, size_t len) { - MCP(m_pVbf, (const char*) ptr, len); - TERM(m_pVbf); + MCP(vbf_, (const char*) ptr, len); + TERM(vbf_); return *this; } @@ -854,7 +887,7 @@ string& string::memmove(const char* ptr) string& string::memmove(const char* ptr, size_t len) { - acl_vstring_memmove(m_pVbf, ptr, len); + acl_vstring_memmove(vbf_, ptr, len); return *this; } @@ -870,33 +903,33 @@ string& string::append(const string* s) string& string::append(const char* ptr) { - SCAT(m_pVbf, ptr); + SCAT(vbf_, ptr); return *this; } string& string::append(const void* ptr, size_t len) { - MCAT(m_pVbf, (const char*) ptr, len); - TERM(m_pVbf); + MCAT(vbf_, (const char*) ptr, len); + TERM(vbf_); return *this; } string& string::prepend(const char* s) { - acl_vstring_prepend(m_pVbf, s, strlen(s)); + acl_vstring_prepend(vbf_, s, strlen(s)); return *this; } string& string::prepend(const void* ptr, size_t len) { - acl_vstring_prepend(m_pVbf, (const char*) ptr, len); + acl_vstring_prepend(vbf_, (const char*) ptr, len); return *this; } string& string::insert(size_t start, const void* ptr, size_t len) { - acl_vstring_insert(m_pVbf, start, (const char*) ptr, len); + acl_vstring_insert(vbf_, start, (const char*) ptr, len); return *this; } @@ -912,7 +945,7 @@ string& string::format(const char* fmt, ...) string& string::vformat(const char* fmt, va_list ap) { - acl_vstring_vsprintf(m_pVbf, fmt, ap); + acl_vstring_vsprintf(vbf_, fmt, ap); return *this; } @@ -928,14 +961,14 @@ string& string::format_append(const char* fmt, ...) string& string::vformat_append(const char* fmt, va_list ap) { - acl_vstring_vsprintf_append(m_pVbf, fmt, ap); + acl_vstring_vsprintf_append(vbf_, fmt, ap); return *this; } string& string::replace(char from, char to) { - char* ptr = STR(m_pVbf); - size_t i, n = LEN(m_pVbf); + char* ptr = STR(vbf_); + size_t i, n = LEN(vbf_); for (i = 0; i < n; i++) { if (*ptr == from) @@ -948,14 +981,14 @@ string& string::replace(char from, char to) string& string::truncate(size_t n) { - acl_vstring_truncate(m_pVbf, n); - TERM(m_pVbf); + acl_vstring_truncate(vbf_, n); + TERM(vbf_); return *this; } string& string::strip(const char* needle, bool each /* false */) { - char* src = STR(m_pVbf); + char* src = STR(vbf_); char* ptr; ACL_VSTRING* pVbf = NULL; @@ -976,14 +1009,14 @@ string& string::strip(const char* needle, bool each /* false */) } // дʱ if (pVbf == NULL) - pVbf = acl_vstring_alloc(LEN(m_pVbf)); + pVbf = acl_vstring_alloc(LEN(vbf_)); SCAT(pVbf, ptr); } if (pVbf != NULL) { - FREE(m_pVbf); - m_pVbf = pVbf; + FREE(vbf_); + vbf_ = pVbf; } return *this; } @@ -1002,7 +1035,7 @@ string& string::strip(const char* needle, bool each /* false */) // дʱӳٷ if (pVbf == NULL) - pVbf = acl_vstring_alloc(LEN(m_pVbf)); + pVbf = acl_vstring_alloc(LEN(vbf_)); n = ptr - src; MCP(pVbf, src, n); TERM(pVbf); @@ -1011,16 +1044,16 @@ string& string::strip(const char* needle, bool each /* false */) if (pVbf != NULL) { - FREE(m_pVbf); - m_pVbf = pVbf; + FREE(vbf_); + vbf_ = pVbf; } return *this; } string& string::trim_left_space() { - char* pBegin = STR(m_pVbf); - char* pEnd = acl_vstring_end(m_pVbf); + char* pBegin = STR(vbf_); + char* pEnd = acl_vstring_end(vbf_); if (pEnd == pBegin) return *this; @@ -1033,14 +1066,14 @@ string& string::trim_left_space() if (pBegin == pEnd) clear(); else if (n > 0) - acl_vstring_memmove(m_pVbf, pBegin, LEN(m_pVbf) - n); + acl_vstring_memmove(vbf_, pBegin, LEN(vbf_) - n); return *this; } string& string::trim_right_space() { - char* pBegin = STR(m_pVbf); - char* pEnd = acl_vstring_end(m_pVbf); + char* pBegin = STR(vbf_); + char* pEnd = acl_vstring_end(vbf_); if (pEnd == pBegin) return *this; pEnd--; @@ -1051,7 +1084,7 @@ string& string::trim_right_space() n++; } - size_t len = LEN(m_pVbf); + size_t len = LEN(vbf_); if (n > 0) { len -= n; @@ -1067,8 +1100,8 @@ string& string::trim_space() string& string::trim_left_line() { - char* pBegin = STR(m_pVbf); - char* pEnd = acl_vstring_end(m_pVbf); + char* pBegin = STR(vbf_); + char* pEnd = acl_vstring_end(vbf_); if (pEnd == pBegin) return *this; @@ -1092,14 +1125,14 @@ string& string::trim_left_line() if (pBegin == pEnd) clear(); else if (n > 0) - acl_vstring_memmove(m_pVbf, pBegin, LEN(m_pVbf) - n); + acl_vstring_memmove(vbf_, pBegin, LEN(vbf_) - n); return *this; } string& string::trim_right_line() { - char* pBegin = STR(m_pVbf); - char* pEnd = acl_vstring_end(m_pVbf); + char* pBegin = STR(vbf_); + char* pEnd = acl_vstring_end(vbf_); if (pEnd == pBegin) return *this; pEnd--; @@ -1115,7 +1148,7 @@ string& string::trim_right_line() } } - size_t len = LEN(m_pVbf); + size_t len = LEN(vbf_); if (n > 0) { len -= n; @@ -1131,21 +1164,21 @@ string& string::trim_line() string& string::clear(void) { - RSET(m_pVbf); - TERM(m_pVbf); - m_ptr = NULL; + RSET(vbf_); + TERM(vbf_); + scan_ptr_ = NULL; return *this; } string& string::lower() { - acl_lowercase(STR(m_pVbf)); + acl_lowercase(STR(vbf_)); return *this; } string& string::upper() { - acl_uppercase(STR(m_pVbf)); + acl_uppercase(STR(vbf_)); return *this; } @@ -1157,14 +1190,14 @@ string& string::base64_encode(void) size_t n = (dlen * 4) / 3; ACL_VSTRING *s = ALLOC(n) ; acl_vstring_base64_encode(s, c_str(), (int) dlen); - FREE(m_pVbf); - m_pVbf = s; + FREE(vbf_); + vbf_ = s; return *this; } string& string::base64_encode(const void* ptr, size_t len) { - acl_vstring_base64_encode(m_pVbf, (const char*) ptr, (int) len); + acl_vstring_base64_encode(vbf_, (const char*) ptr, (int) len); return *this; } @@ -1177,27 +1210,27 @@ string& string::base64_decode(void) ACL_VSTRING *s = ALLOC(n) ; if (acl_vstring_base64_decode(s, c_str(), (int) dlen) == NULL) RSET(s); - FREE(m_pVbf); - m_pVbf = s; + FREE(vbf_); + vbf_ = s; return *this; } string& string::base64_decode(const char* s) { - if (acl_vstring_base64_decode(m_pVbf, + if (acl_vstring_base64_decode(vbf_, s, (int) strlen(s)) == NULL) { - RSET(m_pVbf); + RSET(vbf_); } return *this; } string& string::base64_decode(const void* ptr, size_t len) { - if (acl_vstring_base64_decode(m_pVbf, + if (acl_vstring_base64_decode(vbf_, (const char*) ptr, (int) len) == NULL) { - RSET(m_pVbf); + RSET(vbf_); } return *this; } @@ -1221,13 +1254,13 @@ string& string::url_decode(const char* s) string& string::hex_encode(const void* s, size_t len) { - (void) acl_hex_encode(m_pVbf, (const char*) s, (int) len); + (void) acl_hex_encode(vbf_, (const char*) s, (int) len); return *this; } string& string::hex_decode(const char* s, size_t len) { - (void) acl_hex_decode(m_pVbf, s, (int) len); + (void) acl_hex_decode(vbf_, s, (int) len); return *this; } @@ -1278,28 +1311,28 @@ static string& get_buf(void) return *s; } -const string& string::parse_int(int n) +string& string::parse_int(int n) { string& s = get_buf(); s.format("%d", n); return s; } -const string& string::parse_int(unsigned int n) +string& string::parse_int(unsigned int n) { string& s = get_buf(); s.format("%u", n); return s; } -const string& string::parse_int64(acl_int64 n) +string& string::parse_int64(acl_int64 n) { string& s = get_buf(); s.format("%lld", n); return s; } -const string& string::parse_int64(acl_uint64 n) +string& string::parse_int64(acl_uint64 n) { string& s = get_buf(); s.format("%llu", n); diff --git a/lib_protocol/lib_protocol_vc2003.vcproj b/lib_protocol/lib_protocol_vc2003.vcproj index 09fa074cc..f81438194 100644 --- a/lib_protocol/lib_protocol_vc2003.vcproj +++ b/lib_protocol/lib_protocol_vc2003.vcproj @@ -1,116 +1,73 @@ + Keyword="Win32Proj"> + Name="Win32"/> - - - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + CompileAs="0"/> - - + Name="VCCustomBuildTool"/> + OutputFile="$(ProjectName)_vc2003d.lib"/> - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + OutputFile="$(ProjectName)_vc2003.lib"/> - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + TargetMachine="1"/> - - - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + + - - - - - + DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat;*.map;*.pch;$(TargetPath)"> + DebugInformationFormat="3"/> - - + Name="VCCustomBuildTool"/> + TargetMachine="1"/> - - - - - + Name="VCMIDLTool"/> + CommandLine="copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y +copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y +copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y +"/> + + + + + + + + @@ -319,241 +221,190 @@ + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> + RelativePath=".\lib_protocol.rc"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + RelativePath=".\src\proto_snprintf.c"> + RelativePath=".\src\StdAfx.c"> + Name="Debug|Win32"> + UsePrecompiledHeader="1"/> + Name="Release|Win32"> + UsePrecompiledHeader="1"/> + Name="ReleaseDll|Win32"> + UsePrecompiledHeader="1"/> + Name="DebugDll|Win32"> + UsePrecompiledHeader="1"/> + RelativePath=".\src\StdAfx.h"> + Filter=""> + RelativePath=".\src\http\http.h"> + RelativePath=".\src\http\http_chat_async.c"> + RelativePath=".\src\http\http_chat_sync.c"> + RelativePath=".\src\http\http_hdr.c"> + RelativePath=".\src\http\http_hdr_build.c"> + RelativePath=".\src\http\http_hdr_req.c"> + RelativePath=".\src\http\http_hdr_res.c"> + RelativePath=".\src\http\http_init.c"> + RelativePath=".\src\http\http_req.c"> + RelativePath=".\src\http\http_res.c"> + RelativePath=".\src\http\http_rfc1123.c"> + RelativePath=".\src\http\http_status.c"> + RelativePath=".\src\http\http_tmpl.c"> + RelativePath=".\src\http\http_util.c"> + Filter=""> + RelativePath=".\src\icmp\icmp_chat.c"> + RelativePath=".\src\icmp\icmp_chat_aio.c"> + RelativePath=".\src\icmp\icmp_chat_sio.c"> + RelativePath=".\src\icmp\icmp_host.c"> + RelativePath=".\src\icmp\icmp_ping.c"> + RelativePath=".\src\icmp\icmp_pkt.c"> + RelativePath=".\src\icmp\icmp_private.h"> + RelativePath=".\src\icmp\icmp_stat.c"> + RelativePath=".\src\icmp\icmp_stream.c"> + RelativePath=".\src\icmp\icmp_struct.h"> + RelativePath=".\src\icmp\icmp_timer.c"> + Filter=""> + RelativePath=".\src\smtp\smtp_client.c"> + Filter=""> + RelativePath=".\changes.txt"> + Filter=""> + RelativePath=".\include\lib_protocol.h"> + Filter=""> + RelativePath=".\include\http\lib_http.h"> + RelativePath=".\include\http\lib_http_status.h"> + RelativePath=".\include\http\lib_http_struct.h"> + RelativePath=".\include\http\lib_http_util.h"> + Filter=""> + RelativePath=".\include\icmp\lib_icmp.h"> + RelativePath=".\include\icmp\lib_icmp_type.h"> + Filter=""> + RelativePath=".\include\smtp\smtp_client.h"> + RelativePath=".\ReadMe.txt"> + RelativePath=".\resource.h">