From d8fd96aee8d3227ab89a4071466aadd3f12d818e Mon Sep 17 00:00:00 2001 From: zsxxsz Date: Sun, 7 Dec 2014 23:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=B7=A5=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acl_cpp_vc2003.sln | 20 +- acl_cpp_vc2008.sln | 38 +++- acl_cpp_vc2010.sln | 6 +- acl_cpp_vc2012.sln | 50 ++++- changes.txt | 3 + lib_acl/changes.txt | 19 ++ lib_acl/include/stdlib/acl_iostuff.h | 2 +- lib_acl/include/stdlib/unix/acl_trace.h | 5 +- lib_acl/include/thread/acl_pthread_pool.h | 7 + lib_acl/samples/zdb/zdb_vc2012.vcxproj | 192 ++++++++++++++++ .../src/master/template/acl_threads_server.c | 42 ++-- lib_acl/src/stdlib/acl_msg.c | 33 ++- lib_acl/src/stdlib/acl_vstream.c | 212 ++++++++++-------- lib_acl/src/stdlib/iostuff/acl_read_wait.c | 169 +++++++------- lib_acl/src/stdlib/iostuff/acl_readable.c | 87 +++++-- lib_acl/src/stdlib/iostuff/acl_timed_read.c | 18 +- lib_acl/src/stdlib/iostuff/acl_timed_write.c | 23 +- lib_acl/src/stdlib/iostuff/acl_write_wait.c | 176 +++++++-------- .../src/stdlib/memory/acl_default_malloc.c | 6 - lib_acl/src/stdlib/sys/unix/acl_trace.c | 10 +- lib_acl/src/thread/acl_pthread_pool.c | 5 + lib_acl_cpp/changes.txt | 8 + .../include/acl_cpp/stream/polarssl_io.hpp | 24 +- lib_acl_cpp/samples/Makefile | 26 +-- lib_acl_cpp/samples/Makefile.in | 12 +- .../samples/aio/aio_server_ssl/main.cpp | 29 +-- .../samples/aio/ssl_aio_client/Makefile | 4 + .../samples/{ => aio}/ssl_aio_client/main.cpp | 0 .../ssl_aio_client/ssl_aio_client.vcproj | 16 +- .../ssl_aio_client_vc2008.vcproj | 16 +- .../{ => aio}/ssl_aio_client/valgrind.sh | 0 lib_acl_cpp/samples/charset/stdafx.cpp | 8 + lib_acl_cpp/samples/charset/stdafx.h | 12 + lib_acl_cpp/samples/dircopy/main.cpp | 8 +- lib_acl_cpp/samples/fstream/Makefile | 1 + lib_acl_cpp/samples/fstream/stdafx.cpp | 8 + lib_acl_cpp/samples/fstream/stdafx.h | 12 + lib_acl_cpp/samples/https_client/Makefile | 5 - lib_acl_cpp/samples/https_server/Makefile | 3 - lib_acl_cpp/samples/https_server/mm263com.key | 0 .../samples/https_server/mm263com1.crt | 0 lib_acl_cpp/samples/master/Makefile | 25 +++ .../samples/master/master_aio/Makefile | 3 + .../{ => master}/master_aio/ReadMe.txt | 0 .../{ => master}/master_aio/master_aio.cf | 0 .../{ => master}/master_aio/master_aio.cpp | 0 .../{ => master}/master_aio/master_aio.vcproj | 16 +- .../master_aio/master_aio_vc2008.vcproj | 16 +- .../master_aio/master_aio_vc2012.vcxproj | 18 +- .../{ => master}/master_aio/stdafx.cpp | 0 .../master_aio}/stdafx.h | 0 .../{ => master}/master_aio/valgrind.sh | 0 .../samples/master/master_http_aio/Makefile | 4 + .../master_http_aio/http_client.cpp | 0 .../master_http_aio/http_client.h | 0 .../{ => master}/master_http_aio/main.cpp | 0 .../master_http_aio/master_http_aio.cf | 0 .../master_http_aio/master_service.cpp | 0 .../master_http_aio/master_service.h | 0 .../master_http_aio}/stdafx.cpp | 0 .../master_http_aio}/stdafx.h | 0 .../{ => master}/master_http_rpc/Makefile | 3 +- .../{ => master}/master_http_rpc/gc_timer.cpp | 0 .../{ => master}/master_http_rpc/gc_timer.h | 0 .../{ => master}/master_http_rpc/global.h | 0 .../master_http_rpc/http_client.cpp | 0 .../master_http_rpc/http_client.h | 0 .../{ => master}/master_http_rpc/http_rpc.cpp | 0 .../{ => master}/master_http_rpc/http_rpc.h | 0 .../{ => master}/master_http_rpc/main.cpp | 0 .../master_http_rpc/master_http_rpc.cf | 0 .../master_http_rpc/master_service.cpp | 0 .../master_http_rpc/master_service.h | 0 .../master_http_rpc/rpc_manager.cpp | 0 .../master_http_rpc/rpc_manager.h | 0 .../master_http_rpc/rpc_stats.cpp | 0 .../{ => master}/master_http_rpc/rpc_stats.h | 0 .../master_http_rpc/rpc_timer.cpp | 0 .../{ => master}/master_http_rpc/rpc_timer.h | 0 .../master_http_rpc}/stdafx.cpp | 0 .../{ => master}/master_http_rpc/stdafx.h | 0 .../{ => master}/master_http_threads/Makefile | 3 +- .../master_http_threads}/main.cpp | 0 .../master_http_threads.cf | 0 .../master_http_threads/master_service.cpp | 0 .../master_http_threads/master_service.h | 0 .../master_http_threads}/stdafx.cpp | 0 .../{ => master}/master_http_threads/stdafx.h | 0 .../master_http_threads2/Makefile | 3 +- .../master_http_threads2}/main.cpp | 0 .../master_http_threads2.cf | 0 .../master_http_threads2/master_service.cpp | 0 .../master_http_threads2/master_service.h | 0 .../master_http_threads2/stdafx.cpp | 0 .../master_http_threads2}/stdafx.h | 0 .../samples/master/master_proc/Makefile | 3 + .../{ => master}/master_proc/ReadMe.txt | 0 .../{ => master}/master_proc/master_proc.cpp | 0 .../master_proc/master_proc.vcproj | 16 +- .../master_proc/master_proc_vc2008.vcproj | 16 +- .../{ => master}/master_proc/single_echo.cf | 0 .../{ => master}/master_proc/stdafx.cpp | 0 .../master_proc}/stdafx.h | 0 .../{ => master}/master_proc/valgrind.sh | 0 .../samples/master/master_threads/Makefile | 3 + .../{ => master}/master_threads/ReadMe.txt | 0 .../master_threads/master_threads.cf | 0 .../master_threads/master_threads.cpp | 0 .../master_threads/master_threads.vcproj | 16 +- .../master_threads_vc2008.vcproj | 16 +- .../master_threads}/stdafx.cpp | 0 .../master_threads}/stdafx.h | 0 .../{ => master}/master_threads/valgrind.sh | 0 .../samples/master/master_trigger/Makefile | 3 + .../{ => master}/master_trigger/ReadMe.txt | 0 .../master_trigger/master_trigger.cpp | 0 .../master_trigger/master_trigger.vcproj | 16 +- .../master_trigger_vc2008.vcproj | 16 +- .../{ => master}/master_trigger/stdafx.cpp | 0 .../master_trigger}/stdafx.h | 0 .../{ => master}/master_trigger/trigger.cf | 0 .../{ => master}/master_trigger/valgrind.sh | 0 .../samples/master/master_udp/Makefile | 3 + .../master_udp}/Makefile.in | 0 .../samples/{ => master}/master_udp/main.cpp | 0 .../master_udp/master_service.cpp | 0 .../master_udp}/master_service.h | 0 .../{ => master}/master_udp/master_udp.cf | 0 .../{ => master}/master_udp/master_udp.vcproj | 16 +- .../master_udp/master_udp_vc2008.vcproj | 16 +- .../master_udp/master_udp_vc2012.vcxproj | 30 +-- .../master_udp_vc2012.vcxproj.filters | 0 .../master_udp}/stdafx.cpp | 0 .../master_udp}/stdafx.h | 0 .../master/master_udp_threads/Makefile | 3 + .../{ => master}/master_udp_threads/main.cpp | 0 .../master_udp_threads/master_service.cpp | 0 .../master_udp_threads}/master_service.h | 0 .../master_udp_threads/master_udp_threads.cf | 0 .../master_udp_threads/master_udp_threads.sln | 0 .../master_udp_threads.vcproj | 28 +-- .../master_udp_threads_vc2008.vcproj | 20 +- .../master_udp_threads_vc2012.sln | 0 .../master_udp_threads_vc2012.vcxproj | 28 +-- .../master_udp_threads_vc2012.vcxproj.filters | 0 .../master_udp_threads}/stdafx.cpp | 0 .../master_udp_threads}/stdafx.h | 0 .../master_udp_threads/valgrind.sh | 0 lib_acl_cpp/samples/master_aio/Makefile | 2 - lib_acl_cpp/samples/master_http_aio/Makefile | 3 - lib_acl_cpp/samples/master_proc/Makefile | 2 - lib_acl_cpp/samples/master_threads/Makefile | 2 - lib_acl_cpp/samples/master_trigger/Makefile | 2 - lib_acl_cpp/samples/master_udp/Makefile | 2 - lib_acl_cpp/samples/master_udp/Makefile.in | 104 --------- .../samples/master_udp_threads/Makefile | 2 - lib_acl_cpp/samples/mime/Makefile | 22 +- lib_acl_cpp/samples/mime/mime/Makefile | 10 + .../samples/mime/{ => mime}/ReadMe.txt | 0 .../samples/mime/{ => mime}/email12.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/mime.cpp | 0 .../samples/mime/{ => mime}/mime.vcproj | 16 +- .../samples/mime/{ => mime}/mime.vcxproj | 18 +- .../samples/mime/{ => mime}/mime_nest.in | 0 .../mime/{ => mime}/mime_vc2008.vcproj | 16 +- .../mime/{ => mime}/mime_vc2012.vcxproj | 18 +- .../mime/{ => mime}/pipeline_string.cpp | 0 .../samples/mime/{ => mime}/pipeline_string.h | 0 .../samples/mime/{ => mime}/stdafx.cpp | 0 lib_acl_cpp/samples/mime/{ => mime}/stdafx.h | 0 lib_acl_cpp/samples/mime/{ => mime}/test1.eml | 0 .../samples/mime/{ => mime}/test10.eml | 0 .../samples/mime/{ => mime}/test11.eml | 0 .../samples/mime/{ => mime}/test12.eml | 0 .../samples/mime/{ => mime}/test13.eml | 0 .../samples/mime/{ => mime}/test14.eml | 0 .../samples/mime/{ => mime}/test15.eml | 0 .../samples/mime/{ => mime}/test16.eml | 0 .../samples/mime/{ => mime}/test17.eml | 0 .../samples/mime/{ => mime}/test18.eml | 0 .../samples/mime/{ => mime}/test19.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test2.eml | 0 .../samples/mime/{ => mime}/test21.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test3.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test4.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test5.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test6.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test7.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test8.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/test9.eml | 0 lib_acl_cpp/samples/mime/{ => mime}/utf.eml | 0 .../samples/mime/{ => mime}/valgrind.sh | 0 lib_acl_cpp/samples/mime/{ => mime}/vld.dll | Bin lib_acl_cpp/samples/mime/mime_base64/Makefile | 3 + .../{ => mime}/mime_base64/base64_decode.txt | 0 .../{ => mime}/mime_base64/base64_encode.txt | 0 .../samples/{ => mime}/mime_base64/main.cpp | 0 .../{ => mime}/mime_base64/mime_base64.vcproj | 16 +- .../mime_base64/mime_base64.vcxproj | 18 +- .../mime_base64/mime_base64_vc2008.vcproj | 16 +- .../mime_base64/mime_base64_vc2012.vcxproj | 18 +- .../{ => mime}/mime_base64/valgrind.sh | 0 lib_acl_cpp/samples/mime/mime_qp/Makefile | 3 + .../samples/{ => mime}/mime_qp/main.cpp | 0 .../samples/{ => mime}/mime_qp/mime_qp.vcproj | 16 +- .../{ => mime}/mime_qp/mime_qp.vcxproj | 18 +- .../{ => mime}/mime_qp/mime_qp_vc2008.vcproj | 16 +- .../{ => mime}/mime_qp/mime_qp_vc2012.vcxproj | 18 +- .../samples/{ => mime}/mime_qp/out.txt | 0 .../samples/{ => mime}/mime_qp/valgrind.sh | 0 lib_acl_cpp/samples/mime/mime_xxcode/Makefile | 3 + .../samples/{ => mime}/mime_xxcode/main.cpp | 0 lib_acl_cpp/samples/mime_base64/Makefile | 2 - lib_acl_cpp/samples/mime_qp/Makefile | 2 - lib_acl_cpp/samples/mime_xxcode/Makefile | 2 - lib_acl_cpp/samples/socket_stream/stdafx.h | 2 +- lib_acl_cpp/samples/ssl/Makefile | 13 ++ lib_acl_cpp/samples/ssl/https_client/Makefile | 6 + .../{ => ssl}/https_client/https_client.cpp | 0 .../{ => ssl}/https_client/https_client.h | 0 .../samples/{ => ssl}/https_client/main.cpp | 0 .../samples/{ => ssl}/https_client/stdafx.cpp | 0 .../samples/{ => ssl}/https_client/stdafx.h | 0 .../{ => ssl}/https_client/valgrind.sh | 0 lib_acl_cpp/samples/ssl/https_server/Makefile | 4 + .../{ => ssl}/https_server/http_servlet.cpp | 0 .../{ => ssl}/https_server/http_servlet.h | 0 .../{ => ssl}/https_server/https_server.cf | 0 .../samples/{ => ssl}/https_server/main.cpp | 0 .../{ => ssl}/https_server/master_service.cpp | 0 .../{ => ssl}/https_server/master_service.h | 0 .../samples/{ => ssl}/https_server/stdafx.cpp | 0 .../samples/{ => ssl}/https_server/stdafx.h | 0 .../{ => ssl}/https_server/valgrind.sh | 0 lib_acl_cpp/samples/ssl/ssl_client/Makefile | 4 + .../samples/{ => ssl}/ssl_client/ReadMe.txt | 0 .../{ => ssl}/ssl_client/ssl_client.cpp | 0 .../{ => ssl}/ssl_client/ssl_client.vcproj | 16 +- .../ssl_client/ssl_client_vc2008.vcproj | 16 +- .../ssl_client/ssl_client_vc2012.vcxproj | 18 +- .../ssl_client_vc2012.vcxproj.filters | 0 .../samples/{ => ssl}/ssl_client/stdafx.cpp | 0 .../{ssl_server => ssl/ssl_client}/stdafx.h | 0 .../samples/{ => ssl}/ssl_client/valgrind.sh | 0 lib_acl_cpp/samples/ssl/ssl_client2/Makefile | 4 + .../samples/ssl/ssl_client2/ssl_client.cpp | 116 ++++++++++ .../samples/ssl/ssl_client2/stdafx.cpp | 8 + .../{ssl_client => ssl/ssl_client2}/stdafx.h | 0 .../samples/ssl/ssl_client2/valgrind.sh | 3 + lib_acl_cpp/samples/ssl/ssl_server/Makefile | 4 + .../samples/{ => ssl}/ssl_server/ReadMe.txt | 0 .../{ => ssl}/ssl_server/ssl_server.cpp | 0 .../{ => ssl}/ssl_server/ssl_server.vcproj | 16 +- .../ssl_server/ssl_server_vc2008.vcproj | 20 +- .../ssl_server/ssl_server_vc2012.vcxproj | 18 +- .../ssl_server_vc2012.vcxproj.filters | 0 .../samples/{ => ssl}/ssl_server/stdafx.cpp | 0 lib_acl_cpp/samples/ssl/ssl_server/stdafx.h | 10 + .../samples/{ => ssl}/ssl_server/valgrind.sh | 0 lib_acl_cpp/samples/ssl/ssl_server2/Makefile | 4 + lib_acl_cpp/samples/ssl/ssl_server2/main.cpp | 36 +++ .../ssl/ssl_server2/master_service.cpp | 196 ++++++++++++++++ .../samples/ssl/ssl_server2/master_service.h | 84 +++++++ .../samples/ssl/ssl_server2/ssl_server.cf | 118 ++++++++++ .../samples/ssl/ssl_server2/stdafx.cpp | 8 + lib_acl_cpp/samples/ssl/ssl_server2/stdafx.h | 19 ++ lib_acl_cpp/samples/ssl_aio_client/Makefile | 3 - lib_acl_cpp/samples/ssl_client/Makefile | 3 - lib_acl_cpp/samples/ssl_server/Makefile | 3 - lib_acl_cpp/src/stream/istream.cpp | 32 ++- lib_acl_cpp/src/stream/polarssl_io.cpp | 55 ++++- 271 files changed, 1952 insertions(+), 912 deletions(-) create mode 100644 lib_acl/samples/zdb/zdb_vc2012.vcxproj create mode 100644 lib_acl_cpp/samples/aio/ssl_aio_client/Makefile rename lib_acl_cpp/samples/{ => aio}/ssl_aio_client/main.cpp (100%) rename lib_acl_cpp/samples/{ => aio}/ssl_aio_client/ssl_aio_client.vcproj (87%) rename lib_acl_cpp/samples/{ => aio}/ssl_aio_client/ssl_aio_client_vc2008.vcproj (88%) rename lib_acl_cpp/samples/{ => aio}/ssl_aio_client/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/charset/stdafx.cpp create mode 100644 lib_acl_cpp/samples/charset/stdafx.h create mode 100644 lib_acl_cpp/samples/fstream/stdafx.cpp create mode 100644 lib_acl_cpp/samples/fstream/stdafx.h delete mode 100644 lib_acl_cpp/samples/https_client/Makefile delete mode 100644 lib_acl_cpp/samples/https_server/Makefile delete mode 100644 lib_acl_cpp/samples/https_server/mm263com.key delete mode 100644 lib_acl_cpp/samples/https_server/mm263com1.crt create mode 100644 lib_acl_cpp/samples/master/Makefile create mode 100644 lib_acl_cpp/samples/master/master_aio/Makefile rename lib_acl_cpp/samples/{ => master}/master_aio/ReadMe.txt (100%) rename lib_acl_cpp/samples/{ => master}/master_aio/master_aio.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_aio/master_aio.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_aio/master_aio.vcproj (88%) rename lib_acl_cpp/samples/{ => master}/master_aio/master_aio_vc2008.vcproj (89%) rename lib_acl_cpp/samples/{ => master}/master_aio/master_aio_vc2012.vcxproj (89%) rename lib_acl_cpp/samples/{ => master}/master_aio/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_trigger => master/master_aio}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_aio/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/master/master_http_aio/Makefile rename lib_acl_cpp/samples/{ => master}/master_http_aio/http_client.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_aio/http_client.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_aio/main.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_aio/master_http_aio.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_http_aio/master_service.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_aio/master_service.h (100%) rename lib_acl_cpp/samples/{master_udp_threads => master/master_http_aio}/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_http_threads2 => master/master_http_aio}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/Makefile (84%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/gc_timer.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/gc_timer.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/global.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/http_client.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/http_client.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/http_rpc.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/http_rpc.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/main.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/master_http_rpc.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/master_service.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/master_service.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/rpc_manager.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/rpc_manager.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/rpc_stats.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/rpc_stats.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/rpc_timer.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/rpc_timer.h (100%) rename lib_acl_cpp/samples/{master_udp => master/master_http_rpc}/stdafx.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_rpc/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads/Makefile (84%) rename lib_acl_cpp/samples/{master_http_threads2 => master/master_http_threads}/main.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads/master_http_threads.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads/master_service.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads/master_service.h (100%) rename lib_acl_cpp/samples/{master_threads => master/master_http_threads}/stdafx.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads2/Makefile (77%) rename lib_acl_cpp/samples/{master_http_threads => master/master_http_threads2}/main.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads2/master_http_threads2.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads2/master_service.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads2/master_service.h (100%) rename lib_acl_cpp/samples/{ => master}/master_http_threads2/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_http_aio => master/master_http_threads2}/stdafx.h (100%) create mode 100644 lib_acl_cpp/samples/master/master_proc/Makefile rename lib_acl_cpp/samples/{ => master}/master_proc/ReadMe.txt (100%) rename lib_acl_cpp/samples/{ => master}/master_proc/master_proc.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_proc/master_proc.vcproj (88%) rename lib_acl_cpp/samples/{ => master}/master_proc/master_proc_vc2008.vcproj (89%) rename lib_acl_cpp/samples/{ => master}/master_proc/single_echo.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_proc/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_threads => master/master_proc}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_proc/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/master/master_threads/Makefile rename lib_acl_cpp/samples/{ => master}/master_threads/ReadMe.txt (100%) rename lib_acl_cpp/samples/{ => master}/master_threads/master_threads.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_threads/master_threads.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_threads/master_threads.vcproj (88%) rename lib_acl_cpp/samples/{ => master}/master_threads/master_threads_vc2008.vcproj (89%) rename lib_acl_cpp/samples/{master_http_threads => master/master_threads}/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_proc => master/master_threads}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_threads/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/master/master_trigger/Makefile rename lib_acl_cpp/samples/{ => master}/master_trigger/ReadMe.txt (100%) rename lib_acl_cpp/samples/{ => master}/master_trigger/master_trigger.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_trigger/master_trigger.vcproj (88%) rename lib_acl_cpp/samples/{ => master}/master_trigger/master_trigger_vc2008.vcproj (89%) rename lib_acl_cpp/samples/{ => master}/master_trigger/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_aio => master/master_trigger}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_trigger/trigger.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_trigger/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/master/master_udp/Makefile rename lib_acl_cpp/samples/{master_udp_threads => master/master_udp}/Makefile.in (100%) rename lib_acl_cpp/samples/{ => master}/master_udp/main.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_udp/master_service.cpp (100%) rename lib_acl_cpp/samples/{master_udp_threads => master/master_udp}/master_service.h (100%) rename lib_acl_cpp/samples/{ => master}/master_udp/master_udp.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_udp/master_udp.vcproj (88%) rename lib_acl_cpp/samples/{ => master}/master_udp/master_udp_vc2008.vcproj (88%) rename lib_acl_cpp/samples/{ => master}/master_udp/master_udp_vc2012.vcxproj (84%) rename lib_acl_cpp/samples/{ => master}/master_udp/master_udp_vc2012.vcxproj.filters (100%) rename lib_acl_cpp/samples/{master_http_rpc => master/master_udp}/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_udp_threads => master/master_udp}/stdafx.h (100%) create mode 100644 lib_acl_cpp/samples/master/master_udp_threads/Makefile rename lib_acl_cpp/samples/{ => master}/master_udp_threads/main.cpp (100%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_service.cpp (100%) rename lib_acl_cpp/samples/{master_udp => master/master_udp_threads}/master_service.h (100%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads.cf (100%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads.sln (100%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads.vcproj (83%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads_vc2008.vcproj (84%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads_vc2012.sln (100%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads_vc2012.vcxproj (84%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/master_udp_threads_vc2012.vcxproj.filters (100%) rename lib_acl_cpp/samples/{master_http_aio => master/master_udp_threads}/stdafx.cpp (100%) rename lib_acl_cpp/samples/{master_udp => master/master_udp_threads}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => master}/master_udp_threads/valgrind.sh (100%) delete mode 100644 lib_acl_cpp/samples/master_aio/Makefile delete mode 100644 lib_acl_cpp/samples/master_http_aio/Makefile delete mode 100644 lib_acl_cpp/samples/master_proc/Makefile delete mode 100644 lib_acl_cpp/samples/master_threads/Makefile delete mode 100644 lib_acl_cpp/samples/master_trigger/Makefile delete mode 100644 lib_acl_cpp/samples/master_udp/Makefile delete mode 100644 lib_acl_cpp/samples/master_udp/Makefile.in delete mode 100644 lib_acl_cpp/samples/master_udp_threads/Makefile create mode 100644 lib_acl_cpp/samples/mime/mime/Makefile rename lib_acl_cpp/samples/mime/{ => mime}/ReadMe.txt (100%) rename lib_acl_cpp/samples/mime/{ => mime}/email12.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/mime.cpp (100%) rename lib_acl_cpp/samples/mime/{ => mime}/mime.vcproj (87%) rename lib_acl_cpp/samples/mime/{ => mime}/mime.vcxproj (89%) rename lib_acl_cpp/samples/mime/{ => mime}/mime_nest.in (100%) rename lib_acl_cpp/samples/mime/{ => mime}/mime_vc2008.vcproj (88%) rename lib_acl_cpp/samples/mime/{ => mime}/mime_vc2012.vcxproj (89%) rename lib_acl_cpp/samples/mime/{ => mime}/pipeline_string.cpp (100%) rename lib_acl_cpp/samples/mime/{ => mime}/pipeline_string.h (100%) rename lib_acl_cpp/samples/mime/{ => mime}/stdafx.cpp (100%) rename lib_acl_cpp/samples/mime/{ => mime}/stdafx.h (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test1.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test10.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test11.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test12.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test13.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test14.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test15.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test16.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test17.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test18.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test19.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test2.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test21.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test3.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test4.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test5.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test6.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test7.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test8.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/test9.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/utf.eml (100%) rename lib_acl_cpp/samples/mime/{ => mime}/valgrind.sh (100%) rename lib_acl_cpp/samples/mime/{ => mime}/vld.dll (100%) create mode 100644 lib_acl_cpp/samples/mime/mime_base64/Makefile rename lib_acl_cpp/samples/{ => mime}/mime_base64/base64_decode.txt (100%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/base64_encode.txt (100%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/main.cpp (100%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/mime_base64.vcproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/mime_base64.vcxproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/mime_base64_vc2008.vcproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/mime_base64_vc2012.vcxproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_base64/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/mime/mime_qp/Makefile rename lib_acl_cpp/samples/{ => mime}/mime_qp/main.cpp (100%) rename lib_acl_cpp/samples/{ => mime}/mime_qp/mime_qp.vcproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_qp/mime_qp.vcxproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_qp/mime_qp_vc2008.vcproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_qp/mime_qp_vc2012.vcxproj (89%) rename lib_acl_cpp/samples/{ => mime}/mime_qp/out.txt (100%) rename lib_acl_cpp/samples/{ => mime}/mime_qp/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/mime/mime_xxcode/Makefile rename lib_acl_cpp/samples/{ => mime}/mime_xxcode/main.cpp (100%) delete mode 100644 lib_acl_cpp/samples/mime_base64/Makefile delete mode 100644 lib_acl_cpp/samples/mime_qp/Makefile delete mode 100644 lib_acl_cpp/samples/mime_xxcode/Makefile create mode 100644 lib_acl_cpp/samples/ssl/Makefile create mode 100644 lib_acl_cpp/samples/ssl/https_client/Makefile rename lib_acl_cpp/samples/{ => ssl}/https_client/https_client.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_client/https_client.h (100%) rename lib_acl_cpp/samples/{ => ssl}/https_client/main.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_client/stdafx.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_client/stdafx.h (100%) rename lib_acl_cpp/samples/{ => ssl}/https_client/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/ssl/https_server/Makefile rename lib_acl_cpp/samples/{ => ssl}/https_server/http_servlet.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/http_servlet.h (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/https_server.cf (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/main.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/master_service.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/master_service.h (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/stdafx.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/stdafx.h (100%) rename lib_acl_cpp/samples/{ => ssl}/https_server/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/ssl/ssl_client/Makefile rename lib_acl_cpp/samples/{ => ssl}/ssl_client/ReadMe.txt (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/ssl_client.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/ssl_client.vcproj (88%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/ssl_client_vc2008.vcproj (88%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/ssl_client_vc2012.vcxproj (88%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/ssl_client_vc2012.vcxproj.filters (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/stdafx.cpp (100%) rename lib_acl_cpp/samples/{ssl_server => ssl/ssl_client}/stdafx.h (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_client/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/ssl/ssl_client2/Makefile create mode 100644 lib_acl_cpp/samples/ssl/ssl_client2/ssl_client.cpp create mode 100644 lib_acl_cpp/samples/ssl/ssl_client2/stdafx.cpp rename lib_acl_cpp/samples/{ssl_client => ssl/ssl_client2}/stdafx.h (100%) create mode 100644 lib_acl_cpp/samples/ssl/ssl_client2/valgrind.sh create mode 100644 lib_acl_cpp/samples/ssl/ssl_server/Makefile rename lib_acl_cpp/samples/{ => ssl}/ssl_server/ReadMe.txt (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_server/ssl_server.cpp (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_server/ssl_server.vcproj (88%) rename lib_acl_cpp/samples/{ => ssl}/ssl_server/ssl_server_vc2008.vcproj (88%) rename lib_acl_cpp/samples/{ => ssl}/ssl_server/ssl_server_vc2012.vcxproj (88%) rename lib_acl_cpp/samples/{ => ssl}/ssl_server/ssl_server_vc2012.vcxproj.filters (100%) rename lib_acl_cpp/samples/{ => ssl}/ssl_server/stdafx.cpp (100%) create mode 100644 lib_acl_cpp/samples/ssl/ssl_server/stdafx.h rename lib_acl_cpp/samples/{ => ssl}/ssl_server/valgrind.sh (100%) create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/Makefile create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/main.cpp create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/master_service.cpp create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/master_service.h create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/ssl_server.cf create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/stdafx.cpp create mode 100644 lib_acl_cpp/samples/ssl/ssl_server2/stdafx.h delete mode 100644 lib_acl_cpp/samples/ssl_aio_client/Makefile delete mode 100644 lib_acl_cpp/samples/ssl_client/Makefile delete mode 100644 lib_acl_cpp/samples/ssl_server/Makefile diff --git a/acl_cpp_vc2003.sln b/acl_cpp_vc2003.sln index 774c1fb67..d25eeb940 100644 --- a/acl_cpp_vc2003.sln +++ b/acl_cpp_vc2003.sln @@ -5,7 +5,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "socket_stream", "lib_acl_cp {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime.vcproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime\mime.vcproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -22,12 +22,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fstream", "lib_acl_cpp\samp {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_base64", "lib_acl_cpp\samples\mime_base64\mime_base64.vcproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_base64", "lib_acl_cpp\samples\mime\mime_base64\mime_base64.vcproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_qp", "lib_acl_cpp\samples\mime_qp\mime_qp.vcproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_qp", "lib_acl_cpp\samples\mime\mime_qp\mime_qp.vcproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} EndProjectSection @@ -94,14 +94,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HttpClient", "lib_acl_cpp\s {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_client", "lib_acl_cpp\samples\ssl_client\ssl_client.vcproj", "{B14C93A6-DABE-48F9-A78C-C94049B69984}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_client", "lib_acl_cpp\samples\ssl\ssl_client\ssl_client.vcproj", "{B14C93A6-DABE-48F9-A78C-C94049B69984}" 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}") = "ssl_aio_client", "lib_acl_cpp\samples\ssl_aio_client\ssl_aio_client.vcproj", "{8CF882F1-3D3C-4233-BCA6-7F90E49B80BE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_aio_client", "lib_acl_cpp\samples\aio\ssl_aio_client\ssl_aio_client.vcproj", "{8CF882F1-3D3C-4233-BCA6-7F90E49B80BE}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -139,24 +139,24 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql", "lib_acl_cpp\sample {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_threads", "lib_acl_cpp\samples\master_threads\master_threads.vcproj", "{FA0EEABF-CC21-4A99-89AA-D0379175E55A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_threads", "lib_acl_cpp\samples\master\master_threads\master_threads.vcproj", "{FA0EEABF-CC21-4A99-89AA-D0379175E55A}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio", "lib_acl_cpp\samples\master_aio\master_aio.vcproj", "{4B7C83E5-C34F-4C42-9A37-E5F33FBA2EA3}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio", "lib_acl_cpp\samples\master\master_aio\master_aio.vcproj", "{4B7C83E5-C34F-4C42-9A37-E5F33FBA2EA3}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_trigger", "lib_acl_cpp\samples\master_trigger\master_trigger.vcproj", "{80F0213B-A053-4420-BAF9-4657AD8473DA}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_trigger", "lib_acl_cpp\samples\master\master_trigger\master_trigger.vcproj", "{80F0213B-A053-4420-BAF9-4657AD8473DA}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_proc", "lib_acl_cpp\samples\master_proc\master_proc.vcproj", "{B7EE43F4-7541-48A7-A066-DA60A55E67ED}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_proc", "lib_acl_cpp\samples\master\master_proc\master_proc.vcproj", "{B7EE43F4-7541-48A7-A066-DA60A55E67ED}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -276,7 +276,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcache_pool", "lib_acl_cp {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_udp", "lib_acl_cpp\samples\master_udp\master_udp.vcproj", "{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_udp", "lib_acl_cpp\samples\master\master_udp\master_udp.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} diff --git a/acl_cpp_vc2008.sln b/acl_cpp_vc2008.sln index cf8cf2e53..d72bb670c 100644 --- a/acl_cpp_vc2008.sln +++ b/acl_cpp_vc2008.sln @@ -165,7 +165,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HttpClient", "lib_acl_cpp\s {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio", "lib_acl_cpp\samples\master_aio\master_aio_vc2008.vcproj", "{4B7C83E5-C34F-4C42-9A37-E5F33FBA2EA3}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio", "lib_acl_cpp\samples\master\master_aio\master_aio_vc2008.vcproj", "{4B7C83E5-C34F-4C42-9A37-E5F33FBA2EA3}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -179,35 +179,35 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio_proxy", "lib_acl {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_proc", "lib_acl_cpp\samples\master_proc\master_proc_vc2008.vcproj", "{B7EE43F4-7541-48A7-A066-DA60A55E67ED}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_proc", "lib_acl_cpp\samples\master\master_proc\master_proc_vc2008.vcproj", "{B7EE43F4-7541-48A7-A066-DA60A55E67ED}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "master_threads", "lib_acl_cpp\samples\master_threads\master_threads_vc2008.vcproj", "{FA0EEABF-CC21-4A99-89AA-D0379175E55A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_threads", "lib_acl_cpp\samples\master\master_threads\master_threads_vc2008.vcproj", "{FA0EEABF-CC21-4A99-89AA-D0379175E55A}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "master_trigger", "lib_acl_cpp\samples\master_trigger\master_trigger_vc2008.vcproj", "{80F0213B-A053-4420-BAF9-4657AD8473DA}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_trigger", "lib_acl_cpp\samples\master\master_trigger\master_trigger_vc2008.vcproj", "{80F0213B-A053-4420-BAF9-4657AD8473DA}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "master_udp", "lib_acl_cpp\samples\master_udp\master_udp_vc2008.vcproj", "{1DD31312-7815-49A6-AD50-82205FA8C4A5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_udp", "lib_acl_cpp\samples\master\master_udp\master_udp_vc2008.vcproj", "{1DD31312-7815-49A6-AD50-82205FA8C4A5}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "master_udp_threads", "lib_acl_cpp\samples\master_udp_threads\master_udp_threads_vc2008.vcproj", "{FCF1825E-6A9C-4621-832C-D7FC6810707D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_udp_threads", "lib_acl_cpp\samples\master\master_udp_threads\master_udp_threads_vc2008.vcproj", "{FCF1825E-6A9C-4621-832C-D7FC6810707D}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -228,21 +228,21 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcache_pool", "lib_acl_cp {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime_vc2008.vcproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime\mime_vc2008.vcproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "mime_base64", "lib_acl_cpp\samples\mime_base64\mime_base64_vc2008.vcproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_base64", "lib_acl_cpp\samples\mime\mime_base64\mime_base64_vc2008.vcproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "mime_qp", "lib_acl_cpp\samples\mime_qp\mime_qp_vc2008.vcproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_qp", "lib_acl_cpp\samples\mime\mime_qp\mime_qp_vc2008.vcproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -312,14 +312,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite", "lib_acl_cpp\sampl {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_aio_client", "lib_acl_cpp\samples\ssl_aio_client\ssl_aio_client_vc2008.vcproj", "{8CF882F1-3D3C-4233-BCA6-7F90E49B80BE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_aio_client", "lib_acl_cpp\samples\aio\ssl_aio_client\ssl_aio_client_vc2008.vcproj", "{8CF882F1-3D3C-4233-BCA6-7F90E49B80BE}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {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}") = "ssl_client", "lib_acl_cpp\samples\ssl_client\ssl_client_vc2008.vcproj", "{B14C93A6-DABE-48F9-A78C-C94049B69984}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_client", "lib_acl_cpp\samples\ssl\ssl_client\ssl_client_vc2008.vcproj", "{B14C93A6-DABE-48F9-A78C-C94049B69984}" ProjectSection(ProjectDependencies) = postProject {64BF4D83-53BB-4045-8522-9FF9F73B14D4} = {64BF4D83-53BB-4045-8522-9FF9F73B14D4} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -437,6 +437,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blank_line", "lib_acl_cpp\s {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ssl", "ssl", "{9C63E67F-F150-4B95-B578-12E6BD066191}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_server", "lib_acl_cpp\samples\ssl\ssl_server\ssl_server_vc2008.vcproj", "{FEBEA70A-A560-4B26-8101-71190CCE2DB2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -939,6 +943,14 @@ Global {7EC4EF89-6523-44A8-9DCE-672FEAE82A7C}.Release|Win32.Build.0 = Release|Win32 {7EC4EF89-6523-44A8-9DCE-672FEAE82A7C}.Releasedll|Win32.ActiveCfg = Releasedll|Win32 {7EC4EF89-6523-44A8-9DCE-672FEAE82A7C}.Releasedll|Win32.Build.0 = Releasedll|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.Debug|Win32.ActiveCfg = Debug|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.Debug|Win32.Build.0 = Debug|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.DebugDll|Win32.ActiveCfg = DebugDll|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.DebugDll|Win32.Build.0 = DebugDll|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.Release|Win32.ActiveCfg = Release|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.Release|Win32.Build.0 = Release|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.Releasedll|Win32.ActiveCfg = ReleaseDll|Win32 + {FEBEA70A-A560-4B26-8101-71190CCE2DB2}.Releasedll|Win32.Build.0 = ReleaseDll|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -966,6 +978,7 @@ Global {F6292B2C-2C57-40E1-805F-86D9FB1C3251} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {F7B28783-B507-42D8-BB2B-4B61E2B49FB7} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} {E6FFFC99-AF28-4DD2-ACCF-7003498DF653} = {4FE55739-6D3E-4FA7-BC10-05AB84E3D721} + {9C63E67F-F150-4B95-B578-12E6BD066191} = {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} @@ -1004,12 +1017,13 @@ Global {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} {C94BEF01-706C-49A7-9FF1-9D87FA5BB8E7} = {E6FFFC99-AF28-4DD2-ACCF-7003498DF653} {3538D216-868E-4F9A-BC88-57A1A8F757F9} = {E6FFFC99-AF28-4DD2-ACCF-7003498DF653} {3FC3D573-2A24-42F6-927F-5E4631CF48C8} = {E6FFFC99-AF28-4DD2-ACCF-7003498DF653} {7EC4EF89-6523-44A8-9DCE-672FEAE82A7C} = {E6FFFC99-AF28-4DD2-ACCF-7003498DF653} + {B14C93A6-DABE-48F9-A78C-C94049B69984} = {9C63E67F-F150-4B95-B578-12E6BD066191} + {FEBEA70A-A560-4B26-8101-71190CCE2DB2} = {9C63E67F-F150-4B95-B578-12E6BD066191} EndGlobalSection EndGlobal diff --git a/acl_cpp_vc2010.sln b/acl_cpp_vc2010.sln index 7e2a6dd98..86e0b3263 100644 --- a/acl_cpp_vc2010.sln +++ b/acl_cpp_vc2010.sln @@ -7,7 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "socket_stream", "lib_acl_cp {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime.vcxproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime\mime.vcxproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} EndProjectSection @@ -26,14 +26,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fstream", "lib_acl_cpp\samp {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_base64", "lib_acl_cpp\samples\mime_base64\mime_base64.vcxproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_base64", "lib_acl_cpp\samples\mime\mime_base64\mime_base64.vcxproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" 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}") = "mime_qp", "lib_acl_cpp\samples\mime_qp\mime_qp.vcxproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_qp", "lib_acl_cpp\samples\mime\mime_qp\mime_qp.vcxproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} diff --git a/acl_cpp_vc2012.sln b/acl_cpp_vc2012.sln index 62e760068..44bec431f 100644 --- a/acl_cpp_vc2012.sln +++ b/acl_cpp_vc2012.sln @@ -65,20 +65,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "md5", "lib_acl_cpp\samples\ {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime_vc2012.vcxproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "lib_acl_cpp\samples\mime\mime\mime_vc2012.vcxproj", "{52AA7352-CE48-4F60-B92D-1EB16A79FE54}" 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}") = "mime_base64", "lib_acl_cpp\samples\mime_base64\mime_base64_vc2012.vcxproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_base64", "lib_acl_cpp\samples\mime\mime_base64\mime_base64_vc2012.vcxproj", "{19CB30E5-2672-4A8B-96FB-9C42970CCF69}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_qp", "lib_acl_cpp\samples\mime_qp\mime_qp_vc2012.vcxproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime_qp", "lib_acl_cpp\samples\mime\mime_qp\mime_qp_vc2012.vcxproj", "{5DC79C83-9DE8-46B3-A172-8A4E3371878B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rfc2047", "lib_acl_cpp\samples\rfc2047\rfc2047_vc2012.vcxproj", "{503AFD46-DF2F-4D2B-8584-60AD2007D2BE}" ProjectSection(ProjectDependencies) = postProject @@ -126,7 +126,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcache_pool", "lib_acl_cp {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_udp", "lib_acl_cpp\samples\master_udp\master_udp_vc2012.vcxproj", "{DE0F9993-7821-4659-B1C2-3A24DE292E87}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_udp", "lib_acl_cpp\samples\master\master_udp\master_udp_vc2012.vcxproj", "{DE0F9993-7821-4659-B1C2-3A24DE292E87}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -163,14 +163,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "http_request_manager", "lib {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio", "lib_acl_cpp\samples\master_aio\master_aio_vc2012.vcxproj", "{946DAF94-90C7-44F9-B24B-6B8F105A84EF}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master_aio", "lib_acl_cpp\samples\master\master_aio\master_aio_vc2012.vcxproj", "{946DAF94-90C7-44F9-B24B-6B8F105A84EF}" 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("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{324E7B70-E11C-4A39-A11F-4BB2A8E70064}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples_acl_cpp", "samples_acl_cpp", "{324E7B70-E11C-4A39-A11F-4BB2A8E70064}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "aio", "aio", "{02535D96-1693-4AA3-B650-B22DC776FDC2}" EndProject @@ -187,6 +187,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connect_manager", "lib_acl_cpp\samples\connect_manager\connect_manager_vc2012.vcxproj", "{A76344E8-D8EF-4E0D-9A01-73DB25B5B76E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dircopy", "lib_acl_cpp\samples\dircopy\dircopy_vc2012.vcxproj", "{98BB9F33-AFC3-4943-8855-4D253B87F8F1}" + 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}") = "scan_dir", "lib_acl_cpp\samples\scan_dir\scan_dir_vc2012.vcxproj", "{8A5563B4-C546-46D0-9C64-D051CA29F164}" ProjectSection(ProjectDependencies) = postProject @@ -219,14 +224,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_upload", "lib_acl_cpp\s {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_client", "lib_acl_cpp\samples\ssl_client\ssl_client_vc2012.vcxproj", "{B14C93A6-DABE-48F9-A78C-C94049B69984}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_client", "lib_acl_cpp\samples\ssl\ssl_client\ssl_client_vc2012.vcxproj", "{B14C93A6-DABE-48F9-A78C-C94049B69984}" 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}") = "ssl_server", "lib_acl_cpp\samples\ssl_server\ssl_server_vc2012.vcxproj", "{B8ADBED2-0FFC-49F7-A8AE-A42CE262166D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl_server", "lib_acl_cpp\samples\ssl\ssl_server\ssl_server_vc2012.vcxproj", "{B8ADBED2-0FFC-49F7-A8AE-A42CE262166D}" ProjectSection(ProjectDependencies) = postProject {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B} @@ -251,6 +256,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blank_line", "lib_acl_cpp\s {FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ssl", "ssl", "{3A25DC67-2832-4912-8FD5-66E499E38F11}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zdb", "lib_acl\samples\zdb\zdb_vc2012.vcxproj", "{640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples_acl", "samples_acl", "{267F658E-44AF-4080-8577-EFCE99A5E030}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples_protocol", "samples_protocol", "{7C54A0C9-3817-4BBC-BF52-4FA941FD3C69}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -925,6 +938,21 @@ Global {DEDE0B8A-35C5-4674-A10A-BF6544F6A885}.Template|Win32.ActiveCfg = DebugDll|Win32 {DEDE0B8A-35C5-4674-A10A-BF6544F6A885}.Template|Win32.Build.0 = DebugDll|Win32 {DEDE0B8A-35C5-4674-A10A-BF6544F6A885}.Template|x64.ActiveCfg = DebugDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Debug|Win32.ActiveCfg = Debug|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Debug|Win32.Build.0 = Debug|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Debug|x64.ActiveCfg = Debug|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.DebugDll|Win32.ActiveCfg = DebugDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.DebugDll|Win32.Build.0 = DebugDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.DebugDll|x64.ActiveCfg = DebugDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Release|Win32.ActiveCfg = Release|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Release|Win32.Build.0 = Release|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Release|x64.ActiveCfg = Release|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Releasedll|Win32.ActiveCfg = ReleaseDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Releasedll|Win32.Build.0 = ReleaseDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Releasedll|x64.ActiveCfg = ReleaseDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Template|Win32.ActiveCfg = DebugDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Template|Win32.Build.0 = DebugDll|Win32 + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34}.Template|x64.ActiveCfg = DebugDll|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -946,6 +974,7 @@ Global {A76344E8-D8EF-4E0D-9A01-73DB25B5B76E} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} {2AAD256A-E891-4CFA-BA5F-70DDA2CC63AE} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} {06493E1B-DA69-4471-AF4C-6890A6D0F6EE} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} + {3A25DC67-2832-4912-8FD5-66E499E38F11} = {324E7B70-E11C-4A39-A11F-4BB2A8E70064} {FB676B5A-D82C-45CB-9E1F-F3793419DDA9} = {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} @@ -954,8 +983,6 @@ Global {BE2DF8B2-2DCD-4F32-99B9-0B0CA24BFAD9} = {02535D96-1693-4AA3-B650-B22DC776FDC2} {41FA5224-3315-4CDA-9C44-19085049F179} = {716AA69D-C8D2-4274-8207-A384FC20EAF0} {7680672C-4C9B-4BE8-8BAE-BB23B951AAA0} = {716AA69D-C8D2-4274-8207-A384FC20EAF0} - {B14C93A6-DABE-48F9-A78C-C94049B69984} = {716AA69D-C8D2-4274-8207-A384FC20EAF0} - {B8ADBED2-0FFC-49F7-A8AE-A42CE262166D} = {716AA69D-C8D2-4274-8207-A384FC20EAF0} {C0A7DB86-EF13-4A3E-9F34-8950521C9675} = {F1ABE59F-D95A-4CD5-92A2-6A1622E63BAB} {58FE3581-C997-4BD5-9AC6-AEEB54A43D2C} = {F1ABE59F-D95A-4CD5-92A2-6A1622E63BAB} {312366B1-8882-4491-94F6-E105A19C63EF} = {F1ABE59F-D95A-4CD5-92A2-6A1622E63BAB} @@ -977,7 +1004,10 @@ Global {D7CCE1AD-6E3E-49C0-BED7-4AEBB79AC9DE} = {06493E1B-DA69-4471-AF4C-6890A6D0F6EE} {0FD53805-522C-4A04-938A-F05C1553828B} = {06493E1B-DA69-4471-AF4C-6890A6D0F6EE} {DEDE0B8A-35C5-4674-A10A-BF6544F6A885} = {06493E1B-DA69-4471-AF4C-6890A6D0F6EE} + {B8ADBED2-0FFC-49F7-A8AE-A42CE262166D} = {3A25DC67-2832-4912-8FD5-66E499E38F11} + {B14C93A6-DABE-48F9-A78C-C94049B69984} = {3A25DC67-2832-4912-8FD5-66E499E38F11} {D1F030D1-36F7-4440-9801-42E31E767A52} = {FB676B5A-D82C-45CB-9E1F-F3793419DDA9} {2495A6D4-777F-48BF-99C0-702E4A11FD23} = {FB676B5A-D82C-45CB-9E1F-F3793419DDA9} + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34} = {267F658E-44AF-4080-8577-EFCE99A5E030} EndGlobalSection EndGlobal diff --git a/changes.txt b/changes.txt index c6f337156..97800b165 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,8 @@ ÐÞ¸ÄÀúÊ·ÁÐ±í£º ------------------------------------------------------------------------ +77) 2014.12.1 +77.1) ÕûÀí¹¤³Ì£¬½«Àý×Ó°´¹¦ÄܽøÐзÖÀà + 76) 2014.11.30 76.1) ½« samples Ŀ¼ÏµÄʾÀý·Ö±ðÒƶ¯ÖÁ lib_acl ¼° lib_protocol Ŀ¼Ï diff --git a/lib_acl/changes.txt b/lib_acl/changes.txt index f3eb6d5af..662f00c8e 100644 --- a/lib_acl/changes.txt +++ b/lib_acl/changes.txt @@ -1,6 +1,25 @@ ÐÞ¸ÄÀúÊ·ÁÐ±í£º ------------------------------------------------------------------------ +473) 2014.12.6 +473.1) feature: acl_msg.c ÖÐµÄ acl_msg_error/warn/fatal/panic Ö§³Ö¼Ç¼º¯Êýµ÷ÓöÑÕ» + +472) 2014.12.5 +472.1) feature: acl_vstream.c ÖÐÑ­»·Ð´º¯Êý(loop_writen)Ö§³Ö³¬Ê±Ð´¹¦ÄÜ£¬¼´µ±ÉèÖÃÁË +д³¬Ê±ºó£¬»á¼ì²éÿ´ÎдºóµÄÊý¾Ý³¤¶ÈÊÇ·ñСÓÚÒªÇóµÄд³¤¶È£¬Èç¹ûСÓÚÔò½øÈëд³¬Ê±µÈ´ý£»Í¬Ê±¸ÃÑ­»· +дº¯ÊýÖ§³ÖÒÔ 64KB Ϊµ¥Î»Ð´Êý¾Ý +472.2) feature: acl_threads_server.c ÍêÉÆÁËÁ¬½ÓʹÓÃÊý×Ô¶¯Í˳ö»úÖÆ +472.3) feature: acl_threads_server.c µ±²ÉÓà TCP Á¬½Ó·Ö·¢·½Ê½Ê±£¬Ôö¼ÓÁ˻㱨¸ø·Ö·¢Æ÷ +µÄÐÅÏ¢×ֶΣ¬ÒÔ±ãÓÚ·Ö·¢Æ÷¸ù¾ÝÕâЩ×ֶξö¶¨·Ö·¢µÄ²ßÂÔ + +471) 2014.12.4 +471.1) performance: acl_vstream.c ÓÅ»¯Á˶Á (__sys_read) µÄÐÔÄÜ +471.2) bugfix: acl_vstream.c ÔÚдʱÓпÉÄÜ»áÔì³ÉËÀÑ­»· + +470) 2014.12.2 +470.1) bugfix: acl_vstream.c Öк¯Êý __sys_read µÄ±ê־λ sys_read_ready Öà 0 +Ó¦¸ÃÔÚ read_fn/fread_fn º¯Êý·µ»Øºó + 469) 2014.11.30 469.1) bugfix: acl_aio_read.c ÖÐµÄ reactor IO ·½Ê½µÄº¯Êý acl_aio_enable_read ÄÚ²¿ÔÚijÖÖÇé¿öÏÂÓпÉÄܲ»»á´¥·¢¶Á»Øµ÷¹ý³Ì diff --git a/lib_acl/include/stdlib/acl_iostuff.h b/lib_acl/include/stdlib/acl_iostuff.h index 596934645..1bb8090a1 100644 --- a/lib_acl/include/stdlib/acl_iostuff.h +++ b/lib_acl/include/stdlib/acl_iostuff.h @@ -53,7 +53,7 @@ ACL_API void acl_doze(unsigned delay); /** * ij¸öÃèÊö·ûÊÇ·ñ¿É¶Á * @param fd {ACL_SOCKET} ÃèÊö·û -* @return {int} 0: ²»¿É¶Á; != 0: ¿É¶Á +* @return {int} 0: ²»¿É¶Á; -1: ³ö´í£¬ 1£º¿É¶Á */ ACL_API int acl_readable(ACL_SOCKET fd); diff --git a/lib_acl/include/stdlib/unix/acl_trace.h b/lib_acl/include/stdlib/unix/acl_trace.h index d19288f16..f28095079 100644 --- a/lib_acl/include/stdlib/unix/acl_trace.h +++ b/lib_acl/include/stdlib/unix/acl_trace.h @@ -9,13 +9,12 @@ extern "C" { * ½«µ±Ç°º¯ÊýµÄ¶ÑÕ»Êä³öÖÁÖ¸¶¨ÎļþÖÐ * @param filepath {const char*} Ä¿±êÎļþÃû */ -void acl_dump_strace(const char *filepath); -#define acl_dump_trace acl_dump_strace +void acl_trace_save(const char *filepath); /** * ½«µ±Ç°º¯ÊýµÄ¶ÑÕ»Êä³öÖÁÈÕÖ¾ÖÐ */ -void acl_log_strace(void); +void acl_trace_info(void); #ifdef __cplusplus } diff --git a/lib_acl/include/thread/acl_pthread_pool.h b/lib_acl/include/thread/acl_pthread_pool.h index 411f214a2..d6e14b0ce 100644 --- a/lib_acl/include/thread/acl_pthread_pool.h +++ b/lib_acl/include/thread/acl_pthread_pool.h @@ -191,6 +191,13 @@ ACL_API int acl_pthread_pool_add_dispatch(void *dispatch_arg, ACL_API int acl_pthread_pool_dispatch(void *dispatch_arg, void (*run_fn)(void *), void *run_arg); +/** + * »ñµÃµ±Ç°Ï̳߳صÄ×î´óÏß³ÌÊýÏÞÖÆ + * @param thr_pool {acl_pthread_pool_t*} Ï̳߳ضÔÏ󣬲»ÄÜΪ¿Õ + * @return {int} ×î´óÏß³ÌÊýÏÞÖÆÖµ + */ +ACL_API int acl_pthread_pool_limit(acl_pthread_pool_t *thr_pool); + /** * »ñµÃµ±Ç°Ï̳߳ØÖеÄÏß³ÌÊý * @param thr_pool {acl_pthread_pool_t*} Ï̳߳ضÔÏ󣬲»ÄÜΪ¿Õ diff --git a/lib_acl/samples/zdb/zdb_vc2012.vcxproj b/lib_acl/samples/zdb/zdb_vc2012.vcxproj new file mode 100644 index 000000000..1bd84d79a --- /dev/null +++ b/lib_acl/samples/zdb/zdb_vc2012.vcxproj @@ -0,0 +1,192 @@ + + + + + DebugDll + Win32 + + + Debug + Win32 + + + ReleaseDll + Win32 + + + Release + Win32 + + + + {640ABB35-FBD3-4D34-A382-9ED8CF3FCE34} + Win32Proj + zdb + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + false + $(Configuration)\ + $(Configuration)\ + true + $(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ws2_32.lib;%(AdditionalDependencies) + $(OutDir)zdb.exe + %(AdditionalLibraryDirectories) + true + $(OutDir)zdb.pdb + Console + MachineX86 + + + + + ..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ws2_32.lib;wsock32.lib;%(AdditionalDependencies) + $(OutDir)zdb.exe + true + Console + true + true + MachineX86 + + + + + Disabled + ..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + ws2_32.lib;%(AdditionalDependencies) + $(OutDir)zdb.exe + %(AdditionalLibraryDirectories) + true + $(OutDir)zdb.pdb + Console + MachineX86 + + + + + ..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + ws2_32.lib;wsock32.lib;%(AdditionalDependencies) + $(OutDir)zdb.exe + true + Console + true + true + MachineX86 + + + + + {b40213c2-507c-4c7f-a6e1-b850c9bdc27b} + false + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib_acl/src/master/template/acl_threads_server.c b/lib_acl/src/master/template/acl_threads_server.c index 496fc575e..406c4f1bf 100644 --- a/lib_acl/src/master/template/acl_threads_server.c +++ b/lib_acl/src/master/template/acl_threads_server.c @@ -310,6 +310,7 @@ static void server_exit(void) if (__server_onexit) __server_onexit(__service_ctx); + acl_msg_info("---- SERVER EXIT NOW ----"); exit(0); } @@ -344,13 +345,13 @@ static void server_exiting(int type acl_unused, ACL_EVENT *event, void *ctx) acl_msg_info("%s: master disconnect -- exiting, " "clinet: %d, threads: %d", myname, n, nthreads); server_exit(); - } else if (acl_var_threads_quick_abort) { + } else if (__aborting && acl_var_threads_quick_abort) { acl_msg_info("%s: master disconnect -- quick exiting, " "client: %d, threads: %d", myname, n, nthreads); server_exit(); } else { - acl_msg_info("%s: master disconnect -- waiting exiting, " - "client: %d, threads: %d", myname, n, nthreads); + acl_msg_info("%s: waiting exiting, client: %d, threads: %d", + myname, n, nthreads); acl_event_request_timer(event, server_exiting, ctx, 1000000, 0); } } @@ -389,23 +390,21 @@ static void server_abort(int event_type acl_unused, ACL_EVENT *event, server_exiting(event_type, event, ctx); } -static void server_use_timer(int type acl_unused, - ACL_EVENT *event, void *ctx) +static void server_use_timer(int type, ACL_EVENT *event, void *ctx) { - int n; + const char *myname = "server_use_timer"; - n = get_client_count(); + if (acl_var_threads_use_limit <= 0) + acl_msg_fatal("%s: invalid acl_var_threads_use_limit: %d", + myname, acl_var_threads_use_limit); - if (n > 0 || __use_count < acl_var_threads_use_limit) { + if (__use_count >= acl_var_threads_use_limit) { + acl_msg_info("%s: use limit reached(%d, %d) -- exiting", + myname, __use_count, acl_var_threads_use_limit); + server_exiting(type, event, ctx); + } else acl_event_request_timer(event, server_use_timer, ctx, (acl_int64) __use_limit_delay * 1000000, 0); - return; - } - - if (acl_msg_verbose) - acl_msg_info("use limit -- exiting"); - - server_exit(); } typedef struct { @@ -839,7 +838,6 @@ static ACL_VSTREAM *__dispatch_conn = NULL; static int dispatch_report(void) { const char *myname = "dispatch_report"; - int n; char buf[256]; if (__dispatch_conn == NULL) { @@ -848,10 +846,14 @@ static int dispatch_report(void) return -1; } - n = get_client_count(); - snprintf(buf, sizeof(buf), "count=%d&used=%d&pid=%u&type=%s\r\n", - n, __use_count, (unsigned) getpid(), - acl_var_threads_dispatch_type); + snprintf(buf, sizeof(buf), "count=%d&used=%d&pid=%u&type=%s" + "&max_threads=%d&curr_threads=%d&busy_threads=%d&qlen=%d\r\n", + get_client_count(), __use_count, (unsigned) getpid(), + acl_var_threads_dispatch_type, + acl_pthread_pool_limit(__threads), + acl_pthread_pool_size(__threads), + acl_pthread_pool_busy(__threads), + acl_pthread_pool_qlen(__threads)); if (acl_vstream_writen(__dispatch_conn, buf, strlen(buf)) == ACL_VSTREAM_EOF) diff --git a/lib_acl/src/stdlib/acl_msg.c b/lib_acl/src/stdlib/acl_msg.c index 16dc5a769..4b26d3110 100644 --- a/lib_acl/src/stdlib/acl_msg.c +++ b/lib_acl/src/stdlib/acl_msg.c @@ -88,6 +88,7 @@ void acl_msg_open2(ACL_VSTREAM *fp, const char *info_pre) } else { acl_log_fp_set(fp, info_pre); } + __log_open_flag = 1; } @@ -185,6 +186,7 @@ void acl_msg_info2(const char *fmt, va_list ap) printf("\r\n"); } } + void acl_msg_warn(const char *fmt,...) { va_list ap; @@ -211,7 +213,9 @@ void acl_msg_warn(const char *fmt,...) } va_end (ap); + acl_trace_info(); } + void acl_msg_warn2(const char *fmt, va_list ap) { if (__pre_write_fn) @@ -231,7 +235,10 @@ void acl_msg_warn2(const char *fmt, va_list ap) vprintf(fmt, ap); printf("\r\n"); } + + acl_trace_info(); } + void acl_msg_error(const char *fmt,...) { va_list ap; @@ -257,7 +264,9 @@ void acl_msg_error(const char *fmt,...) } va_end (ap); + acl_trace_info(); } + void acl_msg_error2(const char *fmt, va_list ap) { if (__pre_write_fn) @@ -277,7 +286,10 @@ void acl_msg_error2(const char *fmt, va_list ap) vprintf(fmt, ap); printf("\r\n"); } + + acl_trace_info(); } + void acl_msg_fatal(const char *fmt,...) { va_list ap; @@ -304,7 +316,7 @@ void acl_msg_fatal(const char *fmt,...) } va_end (ap); - acl_log_strace(); + acl_trace_info(); acl_close_log(); acl_assert(0); } @@ -328,7 +340,8 @@ void acl_msg_fatal2(const char *fmt, va_list ap) vprintf(fmt, ap); printf("\r\n"); } - acl_log_strace(); + + acl_trace_info(); acl_close_log(); acl_assert(0); } @@ -356,7 +369,7 @@ void acl_msg_fatal_status(int status, const char *fmt,...) } va_end (ap); - acl_log_strace(); + acl_trace_info(); acl_close_log(); acl_assert(0); } @@ -379,7 +392,7 @@ void acl_msg_fatal_status2(int status, const char *fmt, va_list ap) printf("\r\n"); } - acl_log_strace(); + acl_trace_info(); acl_close_log(); acl_assert(0); } @@ -409,8 +422,7 @@ void acl_msg_panic(const char *fmt,...) } va_end (ap); - - acl_log_strace(); + acl_trace_info(); acl_close_log(); acl_assert(0); } @@ -435,7 +447,7 @@ void acl_msg_panic2(const char *fmt, va_list ap) printf("\r\n"); } - acl_log_strace(); + acl_trace_info(); acl_close_log(); acl_assert(0); } @@ -534,14 +546,15 @@ const char *acl_last_serror(void) int acl_last_error(void) { +#ifdef WIN32 int error; -#ifdef WIN32 error = WSAGetLastError(); WSASetLastError(error); -#endif - error = errno; return error; +#else + return errno; +#endif } void acl_set_error(int errnum) diff --git a/lib_acl/src/stdlib/acl_vstream.c b/lib_acl/src/stdlib/acl_vstream.c index f1c5babbb..de3039018 100644 --- a/lib_acl/src/stdlib/acl_vstream.c +++ b/lib_acl/src/stdlib/acl_vstream.c @@ -52,7 +52,7 @@ static unsigned char __vstream_stdin_buf[ACL_VSTREAM_BUFSIZE]; static unsigned char __vstream_stdout_buf[ACL_VSTREAM_BUFSIZE]; static unsigned char __vstream_stderr_buf[ACL_VSTREAM_BUFSIZE]; -static int __sys_getc(ACL_VSTREAM *fp); +static int read_char(ACL_VSTREAM *fp); ACL_VSTREAM acl_vstream_fstd[] = { { @@ -93,7 +93,7 @@ ACL_VSTREAM acl_vstream_fstd[] = { NULL, /* path */ NULL, /* context */ NULL, /* close_handle_lnk */ - __sys_getc, /* sys_getc */ + read_char, /* sys_getc */ acl_socket_read, /* read_fn */ NULL, /* write_fn */ NULL, /* writev_fn */ @@ -150,7 +150,7 @@ ACL_VSTREAM acl_vstream_fstd[] = { NULL, /* path */ NULL, /* context */ NULL, /* close_handle_lnk */ - __sys_getc, /* sys_getc */ + read_char, /* sys_getc */ NULL, /* read_fn */ acl_socket_write, /* write_fn */ acl_socket_writev, /* writev_fn */ @@ -206,7 +206,7 @@ ACL_VSTREAM acl_vstream_fstd[] = { NULL, /* path */ NULL, /* context */ NULL, /* close_handle_lnk */ - __sys_getc, /* sys_getc */ + read_char, /* sys_getc */ NULL, /* read_fn */ acl_socket_write, /* write_fn */ acl_socket_writev, /* writev_fn */ @@ -250,9 +250,10 @@ void acl_vstream_init() #endif } -static int __sys_read(ACL_VSTREAM *in, void *buf, size_t size) +static int sys_read(ACL_VSTREAM *in, void *buf, size_t size) { - int read_cnt; + const char *myname = "sys_read"; + int read_cnt, nagain = 0; if (in->type == ACL_VSTREAM_TYPE_FILE) { if (ACL_VSTREAM_FILE(in) == ACL_FILE_INVALID) { @@ -273,19 +274,24 @@ AGAIN: /* Çå³ýϵͳ´íÎóºÅ */ acl_set_error(0); - /* Çå³ý¿É¶Á±ê־λ */ - in->sys_read_ready = 0; - if (in->type == ACL_VSTREAM_TYPE_FILE) { read_cnt = in->fread_fn(ACL_VSTREAM_FILE(in), buf, size, - in->rw_timeout, in, in->context); + in->sys_read_ready ? 0 : in->rw_timeout, + in, in->context); if (in->read_cnt > 0) in->sys_offset += in->read_cnt; } else { + /* Èç¹ûÓÉʼþÒýÇæÉèÖÃÁËÌ×½Ó×ÖÓÐÊý¾Ý¿É¶Á£¬Ôò½«³¬Ê±Ê±¼äÉè 0£¬ + * ÕâÑù¿ÉÒÔ¼õÉÙÒ»´Î¶Ô¶Á³¬Ê±µÄµ÷Óà + */ read_cnt = in->read_fn(ACL_VSTREAM_SOCK(in), buf, size, - in->rw_timeout, in, in->context); + in->sys_read_ready ? 0 : in->rw_timeout, + in, in->context); } + /* Çå³ý¿É¶Á±ê־λ */ + in->sys_read_ready = 0; + if (read_cnt > 0) { in->read_ptr = in->read_buf; in->flag &= ~ACL_VSTREAM_FLAG_BAD; @@ -305,12 +311,24 @@ AGAIN: in->errnum = acl_last_error(); - if (in->errnum == ACL_EINTR) - goto AGAIN; - else if (in->errnum == ACL_ETIMEDOUT) { + if (in->errnum == ACL_EINTR) { + if (nagain++ < 5) + goto AGAIN; + + acl_msg_error("%s(%d), %s: nagain: %d too much, fd: %d", + __FILE__, __LINE__, myname, nagain, + in->type == ACL_VSTREAM_TYPE_FILE ? + (int) ACL_VSTREAM_FILE(in) : ACL_VSTREAM_SOCK(in)); + } else if (in->errnum == ACL_ETIMEDOUT) { in->flag |= ACL_VSTREAM_FLAG_TIMEOUT; SAFE_COPY(in->errbuf, "read timeout"); - } else if (in->errnum != ACL_EWOULDBLOCK && in->errnum != ACL_EAGAIN) { + } +#if ACL_EWOULDBLOCK == ACL_EAGAIN + else if (in->errnum != ACL_EWOULDBLOCK) +#else + else if (in->errnum != ACL_EWOULDBLOCK && in->errnum != ACL_EAGAIN) +#endif + { in->flag |= ACL_VSTREAM_FLAG_ERR; acl_strerror(in->errnum, in->errbuf, sizeof(in->errbuf)); } @@ -318,9 +336,9 @@ AGAIN: return -1; } -static int __vstream_read(ACL_VSTREAM *fp) +static int read_once(ACL_VSTREAM *fp) { - fp->read_cnt = __sys_read(fp, fp->read_buf, (size_t) fp->read_buf_len); + fp->read_cnt = sys_read(fp, fp->read_buf, (size_t) fp->read_buf_len); if (fp->read_cnt < 0) { fp->read_cnt = 0; @@ -329,9 +347,9 @@ static int __vstream_read(ACL_VSTREAM *fp) return fp->read_cnt; } -static int __sys_getc(ACL_VSTREAM *fp) +static int read_char(ACL_VSTREAM *fp) { - fp->read_cnt = __vstream_read(fp); + fp->read_cnt = read_once(fp); if (fp->read_cnt <= 0) return ACL_VSTREAM_EOF; else @@ -342,7 +360,7 @@ int acl_vstream_getc(ACL_VSTREAM *fp) { if (fp == NULL) return ACL_VSTREAM_EOF; - if (fp->read_cnt <= 0 && __vstream_read(fp) <= 0) + if (fp->read_cnt <= 0 && read_once(fp) <= 0) return ACL_VSTREAM_EOF; fp->read_cnt--; @@ -412,7 +430,7 @@ int acl_vstream_nonb_readn(ACL_VSTREAM *fp, char *buf, int size) fp->rw_timeout = 0; fp->errnum = 0; - read_cnt = __vstream_read(fp); + read_cnt = read_once(fp); fp->rw_timeout = rw_timeout; @@ -710,22 +728,22 @@ int acl_vstream_gets(ACL_VSTREAM *fp, void *vptr, size_t maxlen) int acl_vstream_readtags(ACL_VSTREAM *fp, void *vptr, size_t maxlen, const char *tag, size_t taglen) { - int n, ch, flag_match = 0; + int n, ch, matched = 0; unsigned char *ptr; - const unsigned char *ptr_haystack; - const unsigned char *ptr_needle, *ptr_needle_end; + const unsigned char *haystack; + const unsigned char *needle, *needle_end; if (fp == NULL || vptr == NULL || maxlen <= 0 || tag == NULL || taglen <= 0) return ACL_VSTREAM_EOF; - ptr_needle_end = (const unsigned char *) tag; + needle_end = (const unsigned char *) tag; while(1) { taglen--; if (taglen == 0) break; - ptr_needle_end++; + needle_end++; } ptr = (unsigned char *) vptr; @@ -748,29 +766,29 @@ int acl_vstream_readtags(ACL_VSTREAM *fp, void *vptr, size_t maxlen, } *ptr = ch; - if (ch == *ptr_needle_end) { - ptr_haystack = ptr - 1; - ptr_needle = ptr_needle_end - 1; - flag_match = 0; + if (ch == *needle_end) { + haystack = ptr - 1; + needle = needle_end - 1; + matched = 0; while(1) { /* ÒѾ­³É¹¦±È½ÏÍê±Ï(Æ¥Åä) */ - if (ptr_needle < (const unsigned char *) tag) { - flag_match = 1; + if (needle < (const unsigned char *) tag) { + matched = 1; break; } /* Ô­×Ö·û´®ÓÃÍê¶øÆ¥Åä´®»¹Ã»ÓбȽÏÍê(²»Æ¥Åä) */ - if (ptr_haystack < (unsigned char *) vptr) + if (haystack < (unsigned char *) vptr) break; /* ²»ÏàµÈ(²»Æ¥Åä) */ - if (*ptr_haystack != *ptr_needle) + if (*haystack != *needle) break; - ptr_haystack--; - ptr_needle--; + haystack--; + needle--; } } ptr++; - if (flag_match) { + if (matched) { fp->flag |= ACL_VSTREAM_FLAG_TAGYES; fp->flag &= ~ACL_VSTREAM_FLAG_TAGNO; break; @@ -855,7 +873,7 @@ int acl_vstream_readn(ACL_VSTREAM *fp, void *buf, size_t size) if (size_saved < (size_t) fp->read_buf_len / 4) { while (size > 0) { - if (__vstream_read(fp) <= 0) + if (read_once(fp) <= 0) return ACL_VSTREAM_EOF; n = acl_vstream_bfcp_some(fp, ptr, size); ptr += n; @@ -863,7 +881,7 @@ int acl_vstream_readn(ACL_VSTREAM *fp, void *buf, size_t size) } } else { while (size > 0) { - n = __sys_read(fp, ptr, size); + n = sys_read(fp, ptr, size); if (n <= 0) return ACL_VSTREAM_EOF; size -= n; @@ -892,7 +910,7 @@ int acl_vstream_read(ACL_VSTREAM *fp, void *buf, size_t size) /* fp->read_cnt == 0 */ else { - int read_cnt = __sys_read(fp, buf, size); + int read_cnt = sys_read(fp, buf, size); return read_cnt <= 0 ? ACL_VSTREAM_EOF : read_cnt; } } @@ -969,7 +987,7 @@ int acl_vstream_gets_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready) */ if (fp->sys_read_ready) { - if (__vstream_read(fp) <= 0) { + if (read_once(fp) <= 0) { n = LEN(buf) - n; return n > 0 ? n : ACL_VSTREAM_EOF; } @@ -1036,7 +1054,7 @@ int acl_vstream_gets_nonl_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready) */ if (fp->sys_read_ready) { - if (__vstream_read(fp) <= 0) { + if (read_once(fp) <= 0) { n = LEN(buf) - n; return n > 0 ? n : ACL_VSTREAM_EOF; @@ -1100,7 +1118,7 @@ int acl_vstream_readn_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, */ if (fp->sys_read_ready) { - if (__vstream_read(fp) <= 0) { + if (read_once(fp) <= 0) { int n = cnt_saved - cnt; return n > 0 ? n : ACL_VSTREAM_EOF; } @@ -1148,7 +1166,7 @@ int acl_vstream_read_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf) */ if (fp->sys_read_ready) { - if (__vstream_read(fp) <= 0) { + if (read_once(fp) <= 0) { n = LEN(buf) - n; return n > 0 ? n : ACL_VSTREAM_EOF; } @@ -1174,7 +1192,7 @@ int acl_vstream_can_read(ACL_VSTREAM *fp) else if (fp->sys_read_ready == 0) return 0; else if ((fp->flag & ACL_VSTREAM_FLAG_PREREAD) != 0) { - if (__vstream_read(fp) <= 0) + if (read_once(fp) <= 0) return ACL_VSTREAM_EOF; else return 1; @@ -1183,9 +1201,9 @@ int acl_vstream_can_read(ACL_VSTREAM *fp) return 1; } -static int __vstream_write(ACL_VSTREAM *fp, const void *vptr, int dlen) +static int write_once(ACL_VSTREAM *fp, const void *vptr, int dlen) { - const char *myname = "__vstream_write"; + const char *myname = "write_once"; int n, neintr = 0; if (fp == NULL || vptr == NULL || dlen <= 0) { @@ -1219,6 +1237,9 @@ static int __vstream_write(ACL_VSTREAM *fp, const void *vptr, int dlen) TAG_AGAIN: + /* Çå³ýϵͳ´íÎóºÅ */ + acl_set_error(0); + if (fp->type == ACL_VSTREAM_TYPE_FILE) { if ((fp->oflags & O_APPEND)) { #ifdef WIN32 @@ -1264,7 +1285,7 @@ TAG_AGAIN: fp->rw_timeout, fp, fp->context); } - if (n >= 0) { + if (n > 0) { fp->total_write_cnt += n; return n; } @@ -1295,9 +1316,9 @@ TAG_AGAIN: return ACL_VSTREAM_EOF; } -static int __vstream_writev(ACL_VSTREAM *fp, const struct iovec *vec, int count) +static int writev_once(ACL_VSTREAM *fp, const struct iovec *vec, int count) { - const char *myname = "__vstream_writev"; + const char *myname = "writev_once"; int n, neintr = 0; if (fp == NULL || vec == NULL || count <= 0) { @@ -1382,7 +1403,7 @@ TAG_AGAIN: fp->rw_timeout, fp, fp->context); } - if (n >= 0) { + if (n > 0) { fp->total_write_cnt += n; return n; } @@ -1396,7 +1417,11 @@ TAG_AGAIN: goto TAG_AGAIN; } +#if ACL_EAGAIN == ACL_EWOULDBLOCK + if (fp->errnum == ACL_EAGAIN) +#else if (fp->errnum == ACL_EAGAIN || fp->errnum == ACL_EWOULDBLOCK) +#endif acl_set_error(ACL_EAGAIN); else fp->flag |= ACL_VSTREAM_FLAG_ERR; @@ -1410,7 +1435,7 @@ int acl_vstream_write(ACL_VSTREAM *fp, const void *vptr, int dlen) if (acl_vstream_fflush(fp) == ACL_VSTREAM_EOF) return ACL_VSTREAM_EOF; } - return __vstream_write(fp, vptr, dlen); + return write_once(fp, vptr, dlen); } int acl_vstream_writev(ACL_VSTREAM *fp, const struct iovec *vec, int count) @@ -1419,7 +1444,7 @@ int acl_vstream_writev(ACL_VSTREAM *fp, const struct iovec *vec, int count) if (acl_vstream_fflush(fp) == ACL_VSTREAM_EOF) return ACL_VSTREAM_EOF; } - return __vstream_writev(fp, vec, count); + return writev_once(fp, vec, count); } int acl_vstream_writevn(ACL_VSTREAM *fp, const struct iovec *vec, int count) @@ -1445,7 +1470,7 @@ int acl_vstream_writevn(ACL_VSTREAM *fp, const struct iovec *vec, int count) dlen = 0; while (1) { - n = __vstream_writev(fp, vect, count); + n = writev_once(fp, vect, count); if (n == ACL_VSTREAM_EOF) { acl_myfree(vect); return ACL_VSTREAM_EOF; @@ -1588,25 +1613,42 @@ int acl_vstream_puts(const char *s) return acl_vstream_fputs(s, ACL_VSTREAM_OUT); } -static int __loop_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen) +static int loop_writen(ACL_VSTREAM *fp, const void *vptr, size_t size) { - const unsigned char *ptr; - int n; + const char *myname = "loop_writen"; + const unsigned char *ptr = (const unsigned char *) vptr; + int once_dlen = 64 * 1024 * 1024; /* xxx: ÒÔ 64KB Ϊµ¥Î»Ð´ */ + int nleft = (int) size, n, len; + time_t begin, end; + ACL_SOCKET fd = ACL_VSTREAM_SOCK(fp); - ptr = (const unsigned char *) vptr; - while (dlen > 0) { - n = __vstream_write(fp, ptr, dlen); - if (n <= 0) { - if (acl_last_error() == ACL_EINTR - || acl_last_error() == ACL_EAGAIN) - { - continue; - } + while (nleft > 0) { + len = nleft > once_dlen ? once_dlen : nleft; + n = write_once(fp, ptr, len); + if (n < 0) return ACL_VSTREAM_EOF; - } - dlen -= n; + nleft -= n; ptr += n; + + if (n == len || fp->writev_fn == NULL || fp->rw_timeout <= 0) + continue; + + /* ¶ÔÓÚÌ×½Ó¿Úд²Ù×÷£¬Èç¹ûÒ»´ÎÐÔдûÓÐдÍ꣬¿ÉÄÜÊÇϵͳд»º³åÇøÂú£¬ + * ÐèÒª¼ì²â³¬Ê±Ð´ + */ + begin = time(NULL); + + if (acl_write_wait(fd, fp->rw_timeout) == 0) + continue; + + end = time(NULL); + acl_msg_error("%s(%d), %s: acl_write_wait error," + "size: %d, nleft: %d, peer: %s, fd: %d," + " timeout: %d, cost: %ld", __FILE__, __LINE__, + myname, (int) size, nleft, ACL_VSTREAM_PEER(fp), fd, + fp->rw_timeout, end - begin); + return ACL_VSTREAM_EOF; } return ptr - (const unsigned char *) vptr; @@ -1621,7 +1663,7 @@ int acl_vstream_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen) if (acl_vstream_fflush(fp) == ACL_VSTREAM_EOF) return ACL_VSTREAM_EOF; } - return __loop_writen(fp, vptr, dlen); + return loop_writen(fp, vptr, dlen); } int acl_vstream_buffed_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen) @@ -1637,7 +1679,7 @@ int acl_vstream_buffed_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen) if (dlen >= (size_t) fp->wbuf_size) { if (acl_vstream_fflush(fp) == ACL_VSTREAM_EOF) return ACL_VSTREAM_EOF; - else if (__loop_writen(fp, vptr, dlen) == ACL_VSTREAM_EOF) + else if (loop_writen(fp, vptr, dlen) == ACL_VSTREAM_EOF) return ACL_VSTREAM_EOF; else return dlen; @@ -1804,36 +1846,22 @@ void acl_vstream_buffed_space(ACL_VSTREAM *fp) int acl_vstream_fflush(ACL_VSTREAM *fp) { const char *myname = "acl_vstream_fflush"; - unsigned char *ptr; int n; if (fp == NULL) { acl_msg_error("%s(%d): fp null", myname, __LINE__); return ACL_VSTREAM_EOF; - } else if (fp->wbuf == NULL || fp->wbuf_dlen == 0) + } else if (fp->wbuf == NULL || fp->wbuf_dlen <= 0) return 0; - ptr = fp->wbuf; - while (fp->wbuf_dlen > 0) { - n = __vstream_write(fp, ptr, (int) fp->wbuf_dlen); - if (n <= 0) { - if (acl_last_error() == ACL_EINTR - || acl_last_error() == ACL_EAGAIN) - { - continue; - } - return ACL_VSTREAM_EOF; - } - + n = loop_writen(fp, fp->wbuf, fp->wbuf_dlen); + if (n > 0) { fp->wbuf_dlen -= n; - ptr += n; + if (fp->wbuf_dlen < 0) + acl_msg_fatal("%s(%d): wbuf_dlen(%d) < 0", + myname, __LINE__, fp->wbuf_dlen); } - - if (fp->wbuf_dlen < 0) - acl_msg_fatal("%s(%d): wbuf_dlen(%d) < 0", - myname, __LINE__, (int) fp->wbuf_dlen); - - return ptr - fp->wbuf; + return n; } int acl_vstream_peekfd(ACL_VSTREAM *fp) @@ -1935,7 +1963,7 @@ ACL_VSTREAM *acl_vstream_fdopen(ACL_SOCKET fd, unsigned int oflags, if (rw_timeo > 0) fp->rw_timeout = rw_timeo; - fp->sys_getc = __sys_getc; + fp->sys_getc = read_char; if (fdtype == ACL_VSTREAM_TYPE_FILE) { fp->fread_fn = acl_file_read; fp->fwrite_fn = acl_file_write; diff --git a/lib_acl/src/stdlib/iostuff/acl_read_wait.c b/lib_acl/src/stdlib/iostuff/acl_read_wait.c index 1c7f02faa..79c2285e0 100644 --- a/lib_acl/src/stdlib/iostuff/acl_read_wait.c +++ b/lib_acl/src/stdlib/iostuff/acl_read_wait.c @@ -22,114 +22,107 @@ #include "stdlib/acl_iostuff.h" #include "../../init/init.h" -static int select_read_wait(ACL_SOCKET fd, int timeout) -{ - fd_set read_fds; - fd_set except_fds; - struct timeval tv; - struct timeval *tp; -#ifdef WIN32 - int errnum; -#endif - -#ifdef ACL_UNIX - /* - * Sanity checks. - */ - if (FD_SETSIZE <= (unsigned) fd) - acl_msg_panic("descriptor %d does not fit FD_SETSIZE %d", - fd, FD_SETSIZE); -#endif - - /* - * Guard the write() with select() so we do not depend on alarm() and on - * signal() handlers. Restart the select when interrupted by some signal. - * Some select() implementations may reduce the time to wait when - * interrupted, which is exactly what we want. - */ - FD_ZERO(&read_fds); - FD_SET(fd, &read_fds); - FD_ZERO(&except_fds); - FD_SET(fd, &except_fds); - if (timeout >= 0) { - tv.tv_usec = 0; - tv.tv_sec = timeout; - tp = &tv; - } else { - tp = 0; - } - - for (;;) { - switch (select(fd + 1, (fd_set *) &read_fds, (fd_set *) 0, &except_fds, tp)) { - case -1: -#ifdef WIN32 - errnum = WSAGetLastError(); - if (errnum != WSAEINPROGRESS && errnum != WSAEWOULDBLOCK) { - acl_msg_error("select error"); - return (-1); - } -#else - if (acl_last_error() != ACL_EINTR) { - char tbuf[256]; - acl_msg_error("%s(%d): select error(%s)", - __FILE__, __LINE__, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (-1); - } -#endif - continue; - case 0: - acl_set_error(ACL_ETIMEDOUT); - return (-1); - default: - return (0); - } - } -} - #ifdef ACL_UNIX -#include -static int poll_read_wait(ACL_SOCKET fd, int timeout) +int acl_read_wait(ACL_SOCKET fd, int timeout) { - const char *myname = "poll_read_wait"; + const char *myname = "acl_read_wait"; struct pollfd fds; int delay = timeout * 1000; fds.events = POLLIN | POLLHUP | POLLERR; fds.fd = fd; + acl_set_error(0); + for (;;) { switch (poll(&fds, 1, delay)) { case -1: - if (acl_last_error() != ACL_EINTR) { - char tbuf[256]; - acl_msg_error("%s: poll error(%s)", myname, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (-1); - } - continue; + if (acl_last_error() == ACL_EINTR) + continue; + + acl_msg_error("%s(%d), %s: poll error(%s), fd: %d", + __FILE__, __LINE__, myname, + acl_last_serror(), (int) fd); + return -1; case 0: acl_set_error(ACL_ETIMEDOUT); - return (-1); + return -1; default: - if ((fds.revents & (POLLHUP | POLLERR)) - || !(fds.revents & POLLIN)) - { - return (-1); - } - return (0); + if (fds.revents & (POLLHUP | POLLERR)) + return -1; + else if ((fds.revents & POLLIN)) + return 0; + else + return -1; } } } -#endif + +#else int acl_read_wait(ACL_SOCKET fd, int timeout) { -#ifdef ACL_UNIX - if (__acl_var_use_poll) - return (poll_read_wait(fd, timeout)); -#endif + const char *myname = "acl_read_wait"; + fd_set rfds, xfds; + struct timeval tv; + struct timeval *tp; + int errnum; - return (select_read_wait(fd, timeout)); + /* + * Sanity checks. + */ + if (FD_SETSIZE <= (unsigned) fd) + acl_msg_fatal("%s(%d), %s: descriptor %d does not fit " + "FD_SETSIZE %d", __FILE__, __LINE__, myname, + (int) fd, FD_SETSIZE); + + /* + * Guard the write() with select() so we do not depend on alarm() + * and on signal() handlers. Restart the select when interrupted + * by some signal. Some select() implementations may reduce the + * time to wait when interrupted, which is exactly what we want. + */ + FD_ZERO(&rfds); + FD_SET(fd, &rfds); + FD_ZERO(&xfds); + FD_SET(fd, &xfds); + + if (timeout >= 0) { + tv.tv_usec = 0; + tv.tv_sec = timeout; + tp = &tv; + } else + tp = 0; + + acl_set_error(0); + + for (;;) { + switch (select(fd + 1, &rfds, (fd_set *) 0, &xfds, tp)) { + case -1: + errnum = acl_last_error(); +#ifdef WIN32 + if (errnum == WSAEINPROGRESS + || errnum == WSAEWOULDBLOCK + || errnum == ACL_EINTR) + { + continue; + } +#else + if (errnum == ACL_EINTR) + continue; +#endif + acl_msg_error("%s(%d), %s: select error(%s), fd: %d", + __FILE__, __LINE__, myname, + acl_last_serror(), (int) fd); + return -1; + case 0: + acl_set_error(ACL_ETIMEDOUT); + return -1; + default: + return 0; + } + } } + +#endif diff --git a/lib_acl/src/stdlib/iostuff/acl_readable.c b/lib_acl/src/stdlib/iostuff/acl_readable.c index edeca20f1..9cd0b74e5 100644 --- a/lib_acl/src/stdlib/iostuff/acl_readable.c +++ b/lib_acl/src/stdlib/iostuff/acl_readable.c @@ -14,6 +14,7 @@ #ifdef ACL_UNIX # include +# include #endif #include @@ -28,45 +29,99 @@ /* acl_readable - see if file descriptor is readable */ +#ifdef ACL_UNIX + int acl_readable(ACL_SOCKET fd) { + const char *myname = "poll_read_wait"; + struct pollfd fds; + int delay = 0; + + fds.events = POLLIN | POLLHUP | POLLERR; + fds.fd = fd; + + acl_set_error(0); + + for (;;) { + switch (poll(&fds, 1, delay)) { + case -1: + if (acl_last_error() == ACL_EINTR) + continue; + + acl_msg_error("%s(%d), %s: poll error(%s), fd: %d", + __FILE__, __LINE__, myname, + acl_last_serror(), (int) fd); + return -1; + case 0: + return 0; + default: + if (fds.revents & (POLLHUP | POLLERR)) + return -1; + else if ((fds.revents & POLLIN)) + return 1; + else + return 0; + } + } +} + +#else + +int acl_readable(ACL_SOCKET fd) +{ + const char *myname = "acl_readable"; struct timeval tv; - fd_set read_fds; - fd_set except_fds; + fd_set rfds, xfds; + int errnum; /* * Sanity checks. */ if ((unsigned) fd >= FD_SETSIZE) - acl_msg_fatal("fd %d does not fit in FD_SETSIZE", fd); + acl_msg_fatal("%s(%d), %s: fd %d does not fit in " + "FD_SETSIZE: %d", __FILE__, __LINE__, myname, + (int) fd, FD_SETSIZE); /* * Initialize. */ - FD_ZERO(&read_fds); - FD_SET(fd, &read_fds); - FD_ZERO(&except_fds); - FD_SET(fd, &except_fds); + FD_ZERO(&rfds); + FD_SET(fd, &rfds); + FD_ZERO(&xfds); + FD_SET(fd, &xfds); tv.tv_sec = 0; tv.tv_usec = 0; + acl_set_error(0); + /* * Loop until we have an authoritative answer. */ for (;;) { - switch (select(fd + 1, &read_fds, - (fd_set *) 0, &except_fds, &tv)) { + switch (select(fd + 1, &rfds, (fd_set *) 0, &xfds, &tv)) { case -1: - if (acl_last_error() != ACL_EINTR) { - char tbuf[256]; - acl_msg_fatal("select: %s", acl_last_strerror(tbuf, sizeof(tbuf))); + errnum = acl_last_error(); +#ifdef WIN32 + if (errnum == WSAEINPROGRESS + || errnum == WSAEWOULDBLOCK + || errnum == ACL_EINTR) + { + continue; } - continue; - default: - return (FD_ISSET(fd, &read_fds)); +#else + if (errnum == ACL_EINTR) + continue; +#endif + acl_msg_error("%s(%d), %s: select error(%s), fd: %d", + __FILE__, __LINE__, myname, + acl_last_serror(), (int) fd); + return -1; case 0: - return (0); + return 0; + default: + return FD_ISSET(fd, &rfds); } } } +#endif diff --git a/lib_acl/src/stdlib/iostuff/acl_timed_read.c b/lib_acl/src/stdlib/iostuff/acl_timed_read.c index 31f10dcbd..5da873361 100644 --- a/lib_acl/src/stdlib/iostuff/acl_timed_read.c +++ b/lib_acl/src/stdlib/iostuff/acl_timed_read.c @@ -26,25 +26,23 @@ /* acl_timed_read - read with deadline */ int acl_timed_read(ACL_SOCKET fd, void *buf, unsigned len, - int timeout, void *unused_context acl_unused) + int timeout, void *context acl_unused) { int ret; /* - * Wait for a limited amount of time for something to happen. If nothing - * happens, report an ETIMEDOUT error. + * Wait for a limited amount of time for something to happen. + * If nothing happens, report an ETIMEDOUT error. * - * XXX Solaris 8 read() fails with EAGAIN after read-select() returns - * success. + * XXX Solaris 8 read() fails with EAGAIN after read-select() + * returns success. */ for (;;) { - if (timeout > 0 && - acl_read_wait(fd, timeout) < 0) - { + if (timeout > 0 && acl_read_wait(fd, timeout) < 0) return -1; - } ret = acl_socket_read(fd, buf, len, 0, NULL, NULL); - if (ret < 0 && timeout > 0 && acl_last_error() == ACL_EAGAIN) { + if (ret < 0 && timeout > 0 && acl_last_error() == ACL_EAGAIN) + { acl_msg_warn("read() returns EAGAIN on" " a readable file descriptor!"); acl_msg_warn("pausing to avoid going into" diff --git a/lib_acl/src/stdlib/iostuff/acl_timed_write.c b/lib_acl/src/stdlib/iostuff/acl_timed_write.c index 77ec4da7d..458099912 100644 --- a/lib_acl/src/stdlib/iostuff/acl_timed_write.c +++ b/lib_acl/src/stdlib/iostuff/acl_timed_write.c @@ -26,28 +26,29 @@ /* acl_timed_write - write with deadline */ int acl_timed_write(ACL_SOCKET fd, void *buf, unsigned len, - int timeout, void *unused_context acl_unused) + int timeout, void *context acl_unused) { int ret; /* - * Wait for a limited amount of time for something to happen. If nothing - * happens, report an ETIMEDOUT error. + * Wait for a limited amount of time for something to happen. + * If nothing happens, report an ETIMEDOUT error. * - * XXX Solaris 8 read() fails with EAGAIN after read-select() returns - * success. The code below exists just in case their write implementation - * is equally broken. + * XXX Solaris 8 read() fails with EAGAIN after read-select() + * returns success. The code below exists just in case their + * write implementation is equally broken. * - * This condition may also be found on systems where select() returns - * success on pipes with less than PIPE_BUF bytes of space, and with - * badly designed software where multiple writers are fighting for access - * to the same resource. + * This condition may also be found on systems where select() + * returns success on pipes with less than PIPE_BUF bytes of + * space, and with badly designed software where multiple writers + * are fighting for access to the same resource. */ for (;;) { if (timeout > 0 && acl_write_wait(fd, timeout) < 0) return -1; ret = acl_socket_write(fd, buf, len, 0, NULL, NULL); - if (ret < 0 && timeout > 0 && acl_last_error() == ACL_EAGAIN) { + if (ret < 0 && timeout > 0 && acl_last_error() == ACL_EAGAIN) + { acl_msg_warn("write() returns EAGAIN on" " a writable file descriptor!"); acl_msg_warn("pausing to avoid going into" diff --git a/lib_acl/src/stdlib/iostuff/acl_write_wait.c b/lib_acl/src/stdlib/iostuff/acl_write_wait.c index 15dad720e..329a84743 100644 --- a/lib_acl/src/stdlib/iostuff/acl_write_wait.c +++ b/lib_acl/src/stdlib/iostuff/acl_write_wait.c @@ -23,117 +23,113 @@ #include "stdlib/acl_iostuff.h" #include "../../init/init.h" -static int select_write_wait(ACL_SOCKET fd, int timeout) -{ - const char *myname = "select_write_wait"; - fd_set write_fds; - fd_set except_fds; - struct timeval tv; - struct timeval *tp; - char buf[256]; -#ifdef WIN32 - int errnum; -#endif - -#ifdef ACL_UNIX - /* - * Sanity checks. - */ - if (FD_SETSIZE <= (unsigned) fd) - acl_msg_panic("%s, %s(%d): descriptor %d does not fit FD_SETSIZE %d", - myname, __FILE__, __LINE__, fd, FD_SETSIZE); -#endif - - /* - * Guard the write() with select() so we do not depend on alarm() and on - * signal() handlers. Restart the select when interrupted by some signal. - * Some select() implementations may reduce the time to wait when - * interrupted, which is exactly what we want. - */ - FD_ZERO(&write_fds); - FD_SET(fd, &write_fds); - FD_ZERO(&except_fds); - FD_SET(fd, &except_fds); - if (timeout >= 0) { - tv.tv_usec = 0; - tv.tv_sec = timeout; - tp = &tv; - } else { - tp = 0; - } - - for (;;) { - switch (select(fd + 1, (fd_set *) 0, &write_fds, &except_fds, tp)) { - case -1: -#ifdef WIN32 - errnum = WSAGetLastError(); - if (errnum != WSAEINPROGRESS && errnum != WSAEWOULDBLOCK) { - acl_msg_error("%s, %s(%d): select error(%s), fd(%d)", - myname, __FILE__, __LINE__, - acl_last_strerror(buf, sizeof(buf)), fd); - return (-1); - } -#else - if (acl_last_error() != ACL_EINTR) { - acl_msg_error("%s, %s(%d): select error(%s), fd(%d)", - myname, __FILE__, __LINE__, - acl_last_strerror(buf, sizeof(buf)), fd); - return (-1); - } -#endif - continue; - case 0: - acl_set_error(ACL_ETIMEDOUT); - return (-1); - default: - return (0); - } - } -} - #ifdef ACL_UNIX -#include -static int poll_write_wait(ACL_SOCKET fd, int timeout) +int acl_write_wait(ACL_SOCKET fd, int timeout) { - const char *myname = "poll_write_wait"; + const char *myname = "acl_write_wait"; struct pollfd fds; int delay = timeout * 1000; fds.events = POLLOUT | POLLHUP | POLLERR; fds.fd = fd; + acl_set_error(0); + for (;;) { switch (poll(&fds, 1, delay)) { case -1: - if (acl_last_error() != ACL_EINTR) { - char tbuf[256]; - acl_msg_error("%s: poll error(%s)", myname, - acl_last_strerror(tbuf, sizeof(tbuf))); - return (-1); - } - continue; + if (acl_last_error() == ACL_EINTR) + continue; + acl_msg_error("%s(%d), %s: poll error(%s), fd: %d", + __FILE__, __LINE__, myname, + acl_last_serror(), (int) fd); + return -1; case 0: acl_set_error(ACL_ETIMEDOUT); - return (-1); + return -1; default: - if ((fds.revents & (POLLHUP | POLLERR)) - || !(fds.revents & POLLOUT)) - { - return (-1); + if ((fds.revents & (POLLHUP | POLLERR))) { + acl_msg_error("%s(%d), %s: fd: %d," + "POLLHUP: %s, POLLERR: %s", + __FILE__, __LINE__, myname, fd, + fds.revents & POLLHUP ? "yes" : "no", + fds.revents & POLLERR ? "yes" : "no"); + return -1; } - return (0); + if (fds.revents & POLLOUT) + return 0; + acl_msg_error("%s(%d), %s: unknown error, fd: %d", + __FILE__, __LINE__, myname, fd); + return -1; } } } -#endif + +#else int acl_write_wait(ACL_SOCKET fd, int timeout) { -#ifdef ACL_UNIX - if (__acl_var_use_poll) - return (poll_write_wait(fd, timeout)); -#endif + const char *myname = "acl_write_wait"; + fd_set wfds, xfds; + struct timeval tv; + struct timeval *tp; + int errnum; - return (select_write_wait(fd, timeout)); + /* + * Sanity checks. + */ + if (FD_SETSIZE <= (unsigned) fd) + acl_msg_fatal("%s, %s(%d): descriptor %d does not fit " + "FD_SETSIZE %d", myname, __FILE__, __LINE__, + (int) fd, FD_SETSIZE); + + /* + * Guard the write() with select() so we do not depend on alarm() + * and on signal() handlers. Restart the select when interrupted + * by some signal. Some select() implementations may reduce the time + * to wait when interrupted, which is exactly what we want. + */ + FD_ZERO(&wfds); + FD_SET(fd, &wfds); + FD_ZERO(&xfds); + FD_SET(fd, &xfds); + + if (timeout >= 0) { + tv.tv_usec = 0; + tv.tv_sec = timeout; + tp = &tv; + } else + tp = 0; + + acl_set_error(0); + + for (;;) { + switch (select(fd + 1, (fd_set *) 0, &wfds, &xfds, tp)) { + case -1: + errnum = acl_last_error(); +#ifdef WIN32 + if (errnum == WSAEINPROGRESS + || errnum == WSAEWOULDBLOCK + || errnum == ACL_EINTR) + { + continue; + } +#else + if (errnum == ACL_EINTR) + continue; +#endif + acl_msg_error("%s, %s(%d): select error(%s), fd(%d)", + myname, __FILE__, __LINE__, + acl_last_serror(), (int) fd); + return -1; + case 0: + acl_set_error(ACL_ETIMEDOUT); + return -1; + default: + return 0; + } + } } + +#endif diff --git a/lib_acl/src/stdlib/memory/acl_default_malloc.c b/lib_acl/src/stdlib/memory/acl_default_malloc.c index 439eb3bec..3fab3cae6 100644 --- a/lib_acl/src/stdlib/memory/acl_default_malloc.c +++ b/lib_acl/src/stdlib/memory/acl_default_malloc.c @@ -19,7 +19,6 @@ #include "stdlib/acl_msg.h" #include "stdlib/acl_malloc.h" -#include "stdlib/unix/acl_trace.h" #endif @@ -174,21 +173,18 @@ void *acl_default_malloc(const char *filename, int line, size_t len) acl_msg_fatal("%s(%d): new_len(%d) <= 0", myname, __LINE__, (int) new_len); else if (new_len >= __malloc_limit) { - acl_log_strace(); acl_msg_warn("%s(%d): new_len(%d) too large", myname, __LINE__, (int) new_len); } #ifdef _USE_GLIB if ((real_ptr = (MBLOCK *) g_malloc(new_len)) == 0) { - acl_log_strace(); acl_msg_error("%s(%d)->%s: new_len: %d, g_malloc error(%s)", pname, line, myname, (int) new_len, strerror(errno)); return 0; } #else if ((real_ptr = (MBLOCK *) malloc(new_len)) == 0) { - acl_log_strace(); acl_msg_error("%s(%d)->%s: malloc: insufficient memory: %s, " "new_len: %d", pname, line, myname, strerror(errno), (int) new_len); @@ -245,7 +241,6 @@ void *acl_default_realloc(const char *filename, int line, acl_msg_fatal("%s(%d): new_len(%d) <= 0", myname, __LINE__, (int) new_len); else if (new_len >= __malloc_limit) { - acl_log_strace(); acl_msg_warn("%s(%d): new_len(%d) too large", myname, __LINE__, (int) new_len); } @@ -283,7 +278,6 @@ void acl_default_free(const char *filename, int line, void *ptr) pname = __FILENAME_UNKNOWN; if (ptr == NULL) { - acl_log_strace(); acl_msg_error("%s(%d)->%s: ptr null", pname, line, myname); return; } diff --git a/lib_acl/src/stdlib/sys/unix/acl_trace.c b/lib_acl/src/stdlib/sys/unix/acl_trace.c index c26b8fd43..b899aae59 100644 --- a/lib_acl/src/stdlib/sys/unix/acl_trace.c +++ b/lib_acl/src/stdlib/sys/unix/acl_trace.c @@ -12,9 +12,9 @@ #include #include -void acl_dump_trace(const char *filepath) +void acl_trace_save(const char *filepath) { - const char *myname = "acl_dump_trace"; + const char *myname = "acl_trace_save"; int fd; void *buffer[1000]; size_t n; @@ -34,7 +34,7 @@ void acl_dump_trace(const char *filepath) close(fd); } -void acl_log_strace(void) +void acl_trace_info(void) { void *buffer[1000]; size_t n, i; @@ -50,11 +50,11 @@ void acl_log_strace(void) #else -void acl_dump_trace(const char *filepath acl_unused) +void acl_trace_save(const char *filepath acl_unused) { } -void acl_log_strace(void) +void acl_trace_info(void) { } diff --git a/lib_acl/src/thread/acl_pthread_pool.c b/lib_acl/src/thread/acl_pthread_pool.c index 08252735b..da1204ae7 100644 --- a/lib_acl/src/thread/acl_pthread_pool.c +++ b/lib_acl/src/thread/acl_pthread_pool.c @@ -1474,6 +1474,11 @@ int acl_pthread_pool_dispatch(void *dispatch_arg, return 0; } +int acl_pthread_pool_limit(acl_pthread_pool_t *thr_pool) +{ + return thr_pool->parallelism; +} + int acl_pthread_pool_size(acl_pthread_pool_t *thr_pool) { const char *myname = "acl_pthread_pool_size"; diff --git a/lib_acl_cpp/changes.txt b/lib_acl_cpp/changes.txt index 5187045ee..2bd00114a 100644 --- a/lib_acl_cpp/changes.txt +++ b/lib_acl_cpp/changes.txt @@ -1,6 +1,14 @@ ÐÞ¸ÄÀúÊ·ÁÐ±í£º ------------------------------------------------------------------------ +266) 2014.12.2 +266.1) bugfix: polarssl_io ÀàÔÚ·Ç×èÈûģʽÏÂÓпÉÄÜ»á×èÈûÔÚ IO ÉÏ + +265) 2014.12.1 +265.1) bugfix: istream ÀàÖÐµÄ xxx_peek º¯ÊýÔÚ¶Á³ö´íʱûÓÐÅÐ¶Ï errno Ϊ ACL_EWOULDBLOCK +µÄÇé¿ö£¬ÔÚ·Ç×èÈû·½Ê½Ï£¬µ±¶Á·µ»Ø -1 ÇÒ errno Ϊ ACL_EWOULDBLOCK ʱ²¢²»±íʾ¶Á³ö´í +265.2) feature: polarssl_io ÀàÍêÉÆÁË·Ç×èÈû IO ¹ý³Ì + 264) 2014.11.29 264.1) feature: stream_setup ÀàÏÖÔÚ¿ÉÒÔÖ§³Ö aio_stream ·Ç×èÈûÁ÷ÁË 264.2) feature: polarssl_io ÀàÔö¼ÓÁËÖ§³Ö·Ç×èÈû IO µÄ·½·¨ diff --git a/lib_acl_cpp/include/acl_cpp/stream/polarssl_io.hpp b/lib_acl_cpp/include/acl_cpp/stream/polarssl_io.hpp index af59b1748..358d0927b 100644 --- a/lib_acl_cpp/include/acl_cpp/stream/polarssl_io.hpp +++ b/lib_acl_cpp/include/acl_cpp/stream/polarssl_io.hpp @@ -7,13 +7,12 @@ struct ACL_VSTREAM; namespace acl { -class stream; class polarssl_conf; /** - * stream Á÷¶ÔÏóµ×²ã IO ´¦Àí¹ý³ÌµÄ´¦ÀíÀ࣬¸ÃÀà¶ÔÏóÖеĶÁдµÄ¹ý³Ì½«»áÌæ´ú - * stream Á÷¶ÔÏóÖРĬÈϵĵײã IO ¹ý³Ì£»¸ÃÀà¶ÔÏó±ØÐëÊǶ¯Ì¬´´½¨µÄ(¼´Îª¶Ñ¶ÔÏó)£¬ - * stream Á÷¶ÔÏóͨ¹ýµ÷Óñ¾Àà¶ÔÏóµÄ destroy()¡¡·½·¨Êͷű¾Àà¶ÔÏó + * stream/aio_stream Á÷¶ÔÏóµ×²ã IO ´¦Àí¹ý³ÌµÄ´¦ÀíÀ࣬¸ÃÀà¶ÔÏóÖеĶÁдµÄ¹ý³Ì½«»áÌæ´ú + * stream/aio_stream Á÷¶ÔÏóÖРĬÈϵĵײã IO ¹ý³Ì£»¸ÃÀà¶ÔÏó±ØÐëÊǶ¯Ì¬´´½¨µÄ(¼´Îª¶Ñ¶ÔÏó)£¬ + * stream/aio_stream Á÷¶ÔÏóͨ¹ýµ÷Óñ¾Àà¶ÔÏóµÄ destroy()¡¡·½·¨Êͷű¾Àà¶ÔÏó */ class ACL_CPP_API polarssl_io : public stream_hook { @@ -51,6 +50,23 @@ public: return handshake_ok_; } + /** + * ÉèÖÃÌ×½Ó×ÖΪ×èÈûģʽ/·Ç×èÈûģʽ + * @param yes {bool} µ±Îª false ʱÔòÉèΪ×èÈûģʽ£¬·ñÔòÉèΪ·Ç×èÈûģʽ + * @return {polarssl_io&} + */ + polarssl_io& set_non_blocking(bool yes); + + /** + * Åжϵ±Ç°ÉèÖÃµÄ SSL IO ÊÇ·ñ×èÈûģʽ»¹ÊÇ·Ç×èÈûģʽ + * @return {bool} ·µ»Ø true Ôò±íʾΪ·Ç×èÈûģʽ£¬·ñÔòΪ×èÈûģʽ + */ + bool is_non_blocking(void) const + { + return non_block_; + } + + /** * ¼ì²é¶Ô·½Ö¤ÊéÊÇ·ñÓÐЧ£¨Ò»°ã²»±Øµ÷Óô˺¯Êý£© * @return {bool} diff --git a/lib_acl_cpp/samples/Makefile b/lib_acl_cpp/samples/Makefile index c2b0fbb82..eb603838d 100644 --- a/lib_acl_cpp/samples/Makefile +++ b/lib_acl_cpp/samples/Makefile @@ -5,9 +5,6 @@ all: @(cd json; make) @(cd mime; make) @(cd socket_stream; make) - @(cd mime_base64; make) - @(cd mime_xxcode; make) - @(cd mime_qp; make) @(cd charset; make) @(cd rfc2047; make) @(cd rfc822; make) @@ -31,15 +28,7 @@ all: @(cd md5; make) @(cd http_server; make) @(cd beanstalk; make) - @(cd master_http_rpc; make) - @(cd master_http_aio; make) - @(cd master_http_threads; make) - @(cd master_trigger; make) - @(cd master_aio; make) - @(cd master_proc; make) - @(cd master_threads; make) - @(cd master_udp; make) - @(cd master_udp_threads; make) + @(cd master; make) @(cd master_aio_proxy; make) @(cd benchmark; make) @(cd fs_benchmark; make) @@ -62,9 +51,6 @@ clean: @(cd json; make clean) @(cd mime; make clean) @(cd socket_stream; make clean) - @(cd mime_base64; make clean) - @(cd mime_xxcode; make clean) - @(cd mime_qp; make clean) @(cd charset; make clean) @(cd rfc2047; make clean) @(cd rfc822; make clean) @@ -88,21 +74,13 @@ clean: @(cd md5; make clean) @(cd http_server; make clean) @(cd beanstalk; make clean) - @(cd master_http_rpc; make clean) - @(cd master_http_aio; make clean) - @(cd master_http_threads; make clean) - @(cd master_trigger; make clean) - @(cd master_aio; make clean) - @(cd master_proc; make clean) - @(cd master_threads; make clean) + @(cd master; make clean) @(cd master_aio_proxy; make clean) @(cd benchmark; make clean) @(cd fs_benchmark; make clean) @(cd http_request_pool; make clean) @(cd memcache_pool; make clean) @(cd udp_client;make clean) - @(cd master_udp; make clean) - @(cd master_udp_threads; make clean) @(cd thread; make clean) @(cd thread_pool; make clean) @(cd thread_client; make clean) diff --git a/lib_acl_cpp/samples/Makefile.in b/lib_acl_cpp/samples/Makefile.in index 8881fa8b6..58e9b70a7 100644 --- a/lib_acl_cpp/samples/Makefile.in +++ b/lib_acl_cpp/samples/Makefile.in @@ -72,13 +72,19 @@ endif ########################################################### BASE_PATH = - ifneq ($(base_path),) BASE_PATH = $(base_path) else BASE_PATH = ../.. endif +UTIL_PATH = +ifneq ($(util_path),) + UTIL_PATH = $(util_path) +else + UTIL_PATH = .. +endif + CFLAGS += -I. -I$(BASE_PATH)/include -I$(BASE_PATH)/../lib_acl/include -I$(BASE_PATH)/../lib_protocol/include EXTLIBS = LDFLAGS = -L$(BASE_PATH)/lib -l_acl_cpp -L$(BASE_PATH)/../lib_protocol/lib -l_protocol -L$(BASE_PATH)/../lib_acl/lib -l_acl \ @@ -90,12 +96,14 @@ LINK = $(CC) $(OBJ) $(LDFLAGS) OBJ_PATH = . #Project's objs +#UTIL = $(wildcard $(UTIL_PATH)/*.cpp) SRC = $(wildcard *.cpp) $(UTIL) +#SRC = $(wildcard *.cpp) OBJ = $(patsubst %.cpp, $(OBJ_PATH)/%.o, $(notdir $(SRC))) $(OBJ_PATH)/%.o: %.cpp $(COMPILE) $< -o $@ -$(OBJ_PATH)/%.o: ../%.cpp +$(OBJ_PATH)/%.o: $(UTIL_PATH)/%.cpp $(COMPILE) $< -o $@ .PHONY = all clean diff --git a/lib_acl_cpp/samples/aio/aio_server_ssl/main.cpp b/lib_acl_cpp/samples/aio/aio_server_ssl/main.cpp index bde609918..bfa145bcd 100644 --- a/lib_acl_cpp/samples/aio/aio_server_ssl/main.cpp +++ b/lib_acl_cpp/samples/aio/aio_server_ssl/main.cpp @@ -25,7 +25,7 @@ public: timer_reader(int delay) { delay_ = delay; - std::cout << "timer_reader init, delay: " << delay << std::endl; + printf("timer_reader init, delay: %d\r\n", delay); } ~timer_reader() @@ -35,15 +35,14 @@ public: // aio_timer_reader µÄ×ÓÀà±ØÐëÖØÔØ destroy ·½·¨ void destroy() { - std::cout << "timer_reader delete, delay: " << delay_ << std::endl; + printf("timer_reader delete, delay: %d\r\n", delay_); delete this; } // ÖØÔØ»ùÀà»Øµ÷·½·¨ virtual void timer_callback(unsigned int id) { - std::cout << "timer_reader(" << id - << "): timer_callback, delay: " << delay_ << std::endl; + printf("timer_reader(%d): delay: %d\r\n", id, delay_); // µ÷ÓûùÀàµÄ´¦Àí¹ý³Ì aio_timer_reader::timer_callback(id); @@ -62,7 +61,7 @@ public: timer_writer(int delay) { delay_ = delay; - std::cout << "timer_writer init, delay: " << delay << std::endl; + printf("timer_writer init, delay: %d\r\n", delay); } ~timer_writer() @@ -72,15 +71,15 @@ public: // aio_timer_reader µÄ×ÓÀà±ØÐëÖØÔØ destroy ·½·¨ void destroy() { - std::cout << "timer_writer delete, delay: " << delay_ << std::endl; + printf("timer_writer delete, delay: %d\r\n", delay_); delete this; } // ÖØÔØ»ùÀà»Øµ÷·½·¨ virtual void timer_callback(unsigned int id) { - std::cout << "timer_writer(" << id << "): timer_callback, delay: " - << delay_ << std::endl; + printf("timer_writer(%d): timer_callback, delay: %d\r\n", + id, delay_); // µ÷ÓûùÀàµÄ´¦Àí¹ý³Ì aio_timer_writer::timer_callback(id); @@ -104,7 +103,7 @@ public: ~io_callback() { - std::cout << "delete io_callback now ..." << std::endl; + printf("delete io_callback now ...\r\n"); } /** @@ -128,14 +127,10 @@ public: // ³¢ÊÔ½øÐÐ SSL ÎÕÊÖ if (hook->handshake() == false) { - std::cout << "ssl handshake failed" << std::endl; + printf("ssl handshake failed\r\n"); return false; } - std::cout << ">>>handshake: " - << (hook->handshake_ok() ? "ok": "wait") - << "<<<" << std::endl; - // Èç¹û SSL ÎÕÊÖÒѾ­³É¹¦£¬Ôò¿ªÊ¼°´ÐжÁÊý¾Ý if (hook->handshake_ok()) { @@ -161,9 +156,9 @@ public: bool read_callback(char* data, int len) { i_++; - if (i_ < 10) - std::cout << ">>gets(i:" << i_ << "): " - << data << std::endl; + //if (i_ < 10) + // std::cout << ">>gets(i:" << i_ << "): " + // << data << std::endl; // Èç¹ûÔ¶³Ì¿Í»§¶ËÏ£ÍûÍ˳ö£¬Ôò¹Ø±ÕÖ® if (strncasecmp(data, "quit", 4) == 0) diff --git a/lib_acl_cpp/samples/aio/ssl_aio_client/Makefile b/lib_acl_cpp/samples/aio/ssl_aio_client/Makefile new file mode 100644 index 000000000..4a488fc7c --- /dev/null +++ b/lib_acl_cpp/samples/aio/ssl_aio_client/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = ssl_aio_client +EXTLIBS += -lpolarssl diff --git a/lib_acl_cpp/samples/ssl_aio_client/main.cpp b/lib_acl_cpp/samples/aio/ssl_aio_client/main.cpp similarity index 100% rename from lib_acl_cpp/samples/ssl_aio_client/main.cpp rename to lib_acl_cpp/samples/aio/ssl_aio_client/main.cpp diff --git a/lib_acl_cpp/samples/ssl_aio_client/ssl_aio_client.vcproj b/lib_acl_cpp/samples/aio/ssl_aio_client/ssl_aio_client.vcproj similarity index 87% rename from lib_acl_cpp/samples/ssl_aio_client/ssl_aio_client.vcproj rename to lib_acl_cpp/samples/aio/ssl_aio_client/ssl_aio_client.vcproj index 4ecdea0ad..b8dd50439 100644 --- a/lib_acl_cpp/samples/ssl_aio_client/ssl_aio_client.vcproj +++ b/lib_acl_cpp/samples/aio/ssl_aio_client/ssl_aio_client.vcproj @@ -19,7 +19,7 @@ +//#include + +// TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÒªÇóµÄ¸½¼ÓÍ·Îļþ +#include "acl_cpp/lib_acl.hpp" diff --git a/lib_acl_cpp/samples/dircopy/main.cpp b/lib_acl_cpp/samples/dircopy/main.cpp index e990e16c1..273f08812 100644 --- a/lib_acl_cpp/samples/dircopy/main.cpp +++ b/lib_acl_cpp/samples/dircopy/main.cpp @@ -60,6 +60,9 @@ static bool copy_file(acl::ifstream& in, const acl::string& to_path, return false; } + logger("copying from file: %s, to file: %s", in.file_path(), + to_filepath.c_str()); + char buf[4096]; int ret; acl_int64 nread = 0; @@ -192,9 +195,10 @@ static bool cmp_copy(acl::scan_dir& scan, const char* name, if (memcmp(from_buf, to_buf, to_len) != 0) { to_fp.close(); - printf("string not equal\r\n"); + logger("string not equal, from: %s, to: %s", + from_fp.file_path(), to_filepath.c_str()); return copy_file(from_fp, to_pathbuf, - from_filepath, ncopied); + to_filepath, ncopied); } } } diff --git a/lib_acl_cpp/samples/fstream/Makefile b/lib_acl_cpp/samples/fstream/Makefile index 677bfa1c1..7e70d4e7b 100644 --- a/lib_acl_cpp/samples/fstream/Makefile +++ b/lib_acl_cpp/samples/fstream/Makefile @@ -1,2 +1,3 @@ +util_path = .. include ../Makefile.in PROG = fstream diff --git a/lib_acl_cpp/samples/fstream/stdafx.cpp b/lib_acl_cpp/samples/fstream/stdafx.cpp new file mode 100644 index 000000000..c69804ef5 --- /dev/null +++ b/lib_acl_cpp/samples/fstream/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : Ö»°üÀ¨±ê×¼°üº¬ÎļþµÄÔ´Îļþ +// xml.pch ½«³ÉΪԤ±àÒëÍ· +// stdafx.obj ½«°üº¬Ô¤±àÒëÀàÐÍÐÅÏ¢ + +#include "stdafx.h" + +// TODO: ÔÚ STDAFX.H ÖÐ +//ÒýÓÃÈκÎËùÐèµÄ¸½¼ÓÍ·Îļþ£¬¶ø²»ÊÇÔÚ´ËÎļþÖÐÒýÓà diff --git a/lib_acl_cpp/samples/fstream/stdafx.h b/lib_acl_cpp/samples/fstream/stdafx.h new file mode 100644 index 000000000..ed1c81481 --- /dev/null +++ b/lib_acl_cpp/samples/fstream/stdafx.h @@ -0,0 +1,12 @@ +// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬ +// »òÊdz£Óõ«²»³£¸ü¸ÄµÄÏîÄ¿Ìض¨µÄ°üº¬Îļþ +// + +#pragma once + +// +//#include +//#include + +// TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÒªÇóµÄ¸½¼ÓÍ·Îļþ +#include "acl_cpp/lib_acl.hpp" diff --git a/lib_acl_cpp/samples/https_client/Makefile b/lib_acl_cpp/samples/https_client/Makefile deleted file mode 100644 index 910f47e83..000000000 --- a/lib_acl_cpp/samples/https_client/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -UTIL = $(wildcard ../*.cpp) -PROG = https_client -include ../Makefile.in -CFLAGS += -I../ -EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/https_server/Makefile b/lib_acl_cpp/samples/https_server/Makefile deleted file mode 100644 index dd7915281..000000000 --- a/lib_acl_cpp/samples/https_server/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -include ../Makefile.in -PROG = https_server -EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/https_server/mm263com.key b/lib_acl_cpp/samples/https_server/mm263com.key deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib_acl_cpp/samples/https_server/mm263com1.crt b/lib_acl_cpp/samples/https_server/mm263com1.crt deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib_acl_cpp/samples/master/Makefile b/lib_acl_cpp/samples/master/Makefile new file mode 100644 index 000000000..a12b61fb4 --- /dev/null +++ b/lib_acl_cpp/samples/master/Makefile @@ -0,0 +1,25 @@ +.PHONY = all clean + +all: + @(cd master_http_aio; make) + @(cd master_http_threads; make) + @(cd master_proc; make) + @(cd master_trigger; make) + @(cd master_udp_threads; make) + @(cd master_aio; make) + @(cd master_http_rpc; make) + @(cd master_http_threads2; make) + @(cd master_threads; make) + @(cd master_udp; make) + +clean: + @(cd master_http_aio; make clean) + @(cd master_http_threads; make clean) + @(cd master_proc; make clean) + @(cd master_trigger; make clean) + @(cd master_udp_threads; make clean) + @(cd master_aio; make clean) + @(cd master_http_rpc; make clean) + @(cd master_http_threads2; make clean) + @(cd master_threads; make clean) + @(cd master_udp; make clean) diff --git a/lib_acl_cpp/samples/master/master_aio/Makefile b/lib_acl_cpp/samples/master/master_aio/Makefile new file mode 100644 index 000000000..f0201e568 --- /dev/null +++ b/lib_acl_cpp/samples/master/master_aio/Makefile @@ -0,0 +1,3 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = master_aio diff --git a/lib_acl_cpp/samples/master_aio/ReadMe.txt b/lib_acl_cpp/samples/master/master_aio/ReadMe.txt similarity index 100% rename from lib_acl_cpp/samples/master_aio/ReadMe.txt rename to lib_acl_cpp/samples/master/master_aio/ReadMe.txt diff --git a/lib_acl_cpp/samples/master_aio/master_aio.cf b/lib_acl_cpp/samples/master/master_aio/master_aio.cf similarity index 100% rename from lib_acl_cpp/samples/master_aio/master_aio.cf rename to lib_acl_cpp/samples/master/master_aio/master_aio.cf diff --git a/lib_acl_cpp/samples/master_aio/master_aio.cpp b/lib_acl_cpp/samples/master/master_aio/master_aio.cpp similarity index 100% rename from lib_acl_cpp/samples/master_aio/master_aio.cpp rename to lib_acl_cpp/samples/master/master_aio/master_aio.cpp diff --git a/lib_acl_cpp/samples/master_aio/master_aio.vcproj b/lib_acl_cpp/samples/master/master_aio/master_aio.vcproj similarity index 88% rename from lib_acl_cpp/samples/master_aio/master_aio.vcproj rename to lib_acl_cpp/samples/master/master_aio/master_aio.vcproj index bff727328..627d49f38 100644 --- a/lib_acl_cpp/samples/master_aio/master_aio.vcproj +++ b/lib_acl_cpp/samples/master/master_aio/master_aio.vcproj @@ -19,7 +19,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -102,7 +102,7 @@ lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies) $(OutDir)master_aio.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)master_aio.pdb Console @@ -111,7 +111,7 @@ - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded Use @@ -121,7 +121,7 @@ lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies) $(OutDir)master_aio.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -132,7 +132,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;ACL_CPP_DLL;%(PreprocessorDefinitions) true EnableFastChecks @@ -143,7 +143,7 @@ $(OutDir)master_aio.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)master_aio.pdb Console @@ -157,7 +157,7 @@ - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -166,7 +166,7 @@ $(OutDir)master_aio.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -197,4 +197,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/master_aio/stdafx.cpp b/lib_acl_cpp/samples/master/master_aio/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_aio/stdafx.cpp rename to lib_acl_cpp/samples/master/master_aio/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_trigger/stdafx.h b/lib_acl_cpp/samples/master/master_aio/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_trigger/stdafx.h rename to lib_acl_cpp/samples/master/master_aio/stdafx.h diff --git a/lib_acl_cpp/samples/master_aio/valgrind.sh b/lib_acl_cpp/samples/master/master_aio/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/master_aio/valgrind.sh rename to lib_acl_cpp/samples/master/master_aio/valgrind.sh diff --git a/lib_acl_cpp/samples/master/master_http_aio/Makefile b/lib_acl_cpp/samples/master/master_http_aio/Makefile new file mode 100644 index 000000000..7bc3c8bd0 --- /dev/null +++ b/lib_acl_cpp/samples/master/master_http_aio/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +EXTLIBS = -lz +PROG = master_http_aio diff --git a/lib_acl_cpp/samples/master_http_aio/http_client.cpp b/lib_acl_cpp/samples/master/master_http_aio/http_client.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/http_client.cpp rename to lib_acl_cpp/samples/master/master_http_aio/http_client.cpp diff --git a/lib_acl_cpp/samples/master_http_aio/http_client.h b/lib_acl_cpp/samples/master/master_http_aio/http_client.h similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/http_client.h rename to lib_acl_cpp/samples/master/master_http_aio/http_client.h diff --git a/lib_acl_cpp/samples/master_http_aio/main.cpp b/lib_acl_cpp/samples/master/master_http_aio/main.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/main.cpp rename to lib_acl_cpp/samples/master/master_http_aio/main.cpp diff --git a/lib_acl_cpp/samples/master_http_aio/master_http_aio.cf b/lib_acl_cpp/samples/master/master_http_aio/master_http_aio.cf similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/master_http_aio.cf rename to lib_acl_cpp/samples/master/master_http_aio/master_http_aio.cf diff --git a/lib_acl_cpp/samples/master_http_aio/master_service.cpp b/lib_acl_cpp/samples/master/master_http_aio/master_service.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/master_service.cpp rename to lib_acl_cpp/samples/master/master_http_aio/master_service.cpp diff --git a/lib_acl_cpp/samples/master_http_aio/master_service.h b/lib_acl_cpp/samples/master/master_http_aio/master_service.h similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/master_service.h rename to lib_acl_cpp/samples/master/master_http_aio/master_service.h diff --git a/lib_acl_cpp/samples/master_udp_threads/stdafx.cpp b/lib_acl_cpp/samples/master/master_http_aio/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/stdafx.cpp rename to lib_acl_cpp/samples/master/master_http_aio/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_http_threads2/stdafx.h b/lib_acl_cpp/samples/master/master_http_aio/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_http_threads2/stdafx.h rename to lib_acl_cpp/samples/master/master_http_aio/stdafx.h diff --git a/lib_acl_cpp/samples/master_http_rpc/Makefile b/lib_acl_cpp/samples/master/master_http_rpc/Makefile similarity index 84% rename from lib_acl_cpp/samples/master_http_rpc/Makefile rename to lib_acl_cpp/samples/master/master_http_rpc/Makefile index 431d4dd12..244b42ee2 100644 --- a/lib_acl_cpp/samples/master_http_rpc/Makefile +++ b/lib_acl_cpp/samples/master/master_http_rpc/Makefile @@ -1,4 +1,5 @@ -include ../Makefile.in +base_path = ../../.. +include ../../Makefile.in #EXTLIBS = -lz -liconv #Path for SunOS ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS) diff --git a/lib_acl_cpp/samples/master_http_rpc/gc_timer.cpp b/lib_acl_cpp/samples/master/master_http_rpc/gc_timer.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/gc_timer.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/gc_timer.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/gc_timer.h b/lib_acl_cpp/samples/master/master_http_rpc/gc_timer.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/gc_timer.h rename to lib_acl_cpp/samples/master/master_http_rpc/gc_timer.h diff --git a/lib_acl_cpp/samples/master_http_rpc/global.h b/lib_acl_cpp/samples/master/master_http_rpc/global.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/global.h rename to lib_acl_cpp/samples/master/master_http_rpc/global.h diff --git a/lib_acl_cpp/samples/master_http_rpc/http_client.cpp b/lib_acl_cpp/samples/master/master_http_rpc/http_client.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/http_client.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/http_client.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/http_client.h b/lib_acl_cpp/samples/master/master_http_rpc/http_client.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/http_client.h rename to lib_acl_cpp/samples/master/master_http_rpc/http_client.h diff --git a/lib_acl_cpp/samples/master_http_rpc/http_rpc.cpp b/lib_acl_cpp/samples/master/master_http_rpc/http_rpc.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/http_rpc.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/http_rpc.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/http_rpc.h b/lib_acl_cpp/samples/master/master_http_rpc/http_rpc.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/http_rpc.h rename to lib_acl_cpp/samples/master/master_http_rpc/http_rpc.h diff --git a/lib_acl_cpp/samples/master_http_rpc/main.cpp b/lib_acl_cpp/samples/master/master_http_rpc/main.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/main.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/main.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/master_http_rpc.cf b/lib_acl_cpp/samples/master/master_http_rpc/master_http_rpc.cf similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/master_http_rpc.cf rename to lib_acl_cpp/samples/master/master_http_rpc/master_http_rpc.cf diff --git a/lib_acl_cpp/samples/master_http_rpc/master_service.cpp b/lib_acl_cpp/samples/master/master_http_rpc/master_service.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/master_service.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/master_service.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/master_service.h b/lib_acl_cpp/samples/master/master_http_rpc/master_service.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/master_service.h rename to lib_acl_cpp/samples/master/master_http_rpc/master_service.h diff --git a/lib_acl_cpp/samples/master_http_rpc/rpc_manager.cpp b/lib_acl_cpp/samples/master/master_http_rpc/rpc_manager.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/rpc_manager.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/rpc_manager.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/rpc_manager.h b/lib_acl_cpp/samples/master/master_http_rpc/rpc_manager.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/rpc_manager.h rename to lib_acl_cpp/samples/master/master_http_rpc/rpc_manager.h diff --git a/lib_acl_cpp/samples/master_http_rpc/rpc_stats.cpp b/lib_acl_cpp/samples/master/master_http_rpc/rpc_stats.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/rpc_stats.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/rpc_stats.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/rpc_stats.h b/lib_acl_cpp/samples/master/master_http_rpc/rpc_stats.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/rpc_stats.h rename to lib_acl_cpp/samples/master/master_http_rpc/rpc_stats.h diff --git a/lib_acl_cpp/samples/master_http_rpc/rpc_timer.cpp b/lib_acl_cpp/samples/master/master_http_rpc/rpc_timer.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/rpc_timer.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/rpc_timer.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/rpc_timer.h b/lib_acl_cpp/samples/master/master_http_rpc/rpc_timer.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/rpc_timer.h rename to lib_acl_cpp/samples/master/master_http_rpc/rpc_timer.h diff --git a/lib_acl_cpp/samples/master_udp/stdafx.cpp b/lib_acl_cpp/samples/master/master_http_rpc/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_udp/stdafx.cpp rename to lib_acl_cpp/samples/master/master_http_rpc/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_http_rpc/stdafx.h b/lib_acl_cpp/samples/master/master_http_rpc/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/stdafx.h rename to lib_acl_cpp/samples/master/master_http_rpc/stdafx.h diff --git a/lib_acl_cpp/samples/master_http_threads/Makefile b/lib_acl_cpp/samples/master/master_http_threads/Makefile similarity index 84% rename from lib_acl_cpp/samples/master_http_threads/Makefile rename to lib_acl_cpp/samples/master/master_http_threads/Makefile index 8f9bcff56..622234ed3 100644 --- a/lib_acl_cpp/samples/master_http_threads/Makefile +++ b/lib_acl_cpp/samples/master/master_http_threads/Makefile @@ -1,4 +1,5 @@ -include ../Makefile.in +base_path = ../../.. +include ../../Makefile.in #EXTLIBS = -lz -liconv #Path for SunOS ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS) diff --git a/lib_acl_cpp/samples/master_http_threads2/main.cpp b/lib_acl_cpp/samples/master/master_http_threads/main.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_threads2/main.cpp rename to lib_acl_cpp/samples/master/master_http_threads/main.cpp diff --git a/lib_acl_cpp/samples/master_http_threads/master_http_threads.cf b/lib_acl_cpp/samples/master/master_http_threads/master_http_threads.cf similarity index 100% rename from lib_acl_cpp/samples/master_http_threads/master_http_threads.cf rename to lib_acl_cpp/samples/master/master_http_threads/master_http_threads.cf diff --git a/lib_acl_cpp/samples/master_http_threads/master_service.cpp b/lib_acl_cpp/samples/master/master_http_threads/master_service.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_threads/master_service.cpp rename to lib_acl_cpp/samples/master/master_http_threads/master_service.cpp diff --git a/lib_acl_cpp/samples/master_http_threads/master_service.h b/lib_acl_cpp/samples/master/master_http_threads/master_service.h similarity index 100% rename from lib_acl_cpp/samples/master_http_threads/master_service.h rename to lib_acl_cpp/samples/master/master_http_threads/master_service.h diff --git a/lib_acl_cpp/samples/master_threads/stdafx.cpp b/lib_acl_cpp/samples/master/master_http_threads/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_threads/stdafx.cpp rename to lib_acl_cpp/samples/master/master_http_threads/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_http_threads/stdafx.h b/lib_acl_cpp/samples/master/master_http_threads/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_http_threads/stdafx.h rename to lib_acl_cpp/samples/master/master_http_threads/stdafx.h diff --git a/lib_acl_cpp/samples/master_http_threads2/Makefile b/lib_acl_cpp/samples/master/master_http_threads2/Makefile similarity index 77% rename from lib_acl_cpp/samples/master_http_threads2/Makefile rename to lib_acl_cpp/samples/master/master_http_threads2/Makefile index 30aee2bf0..8b09df828 100644 --- a/lib_acl_cpp/samples/master_http_threads2/Makefile +++ b/lib_acl_cpp/samples/master/master_http_threads2/Makefile @@ -1,4 +1,5 @@ -include ../Makefile.in +base_path = ../../.. +include ../../Makefile.in #EXTLIBS = -lz -liconv #Path for SunOS ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS) diff --git a/lib_acl_cpp/samples/master_http_threads/main.cpp b/lib_acl_cpp/samples/master/master_http_threads2/main.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_threads/main.cpp rename to lib_acl_cpp/samples/master/master_http_threads2/main.cpp diff --git a/lib_acl_cpp/samples/master_http_threads2/master_http_threads2.cf b/lib_acl_cpp/samples/master/master_http_threads2/master_http_threads2.cf similarity index 100% rename from lib_acl_cpp/samples/master_http_threads2/master_http_threads2.cf rename to lib_acl_cpp/samples/master/master_http_threads2/master_http_threads2.cf diff --git a/lib_acl_cpp/samples/master_http_threads2/master_service.cpp b/lib_acl_cpp/samples/master/master_http_threads2/master_service.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_threads2/master_service.cpp rename to lib_acl_cpp/samples/master/master_http_threads2/master_service.cpp diff --git a/lib_acl_cpp/samples/master_http_threads2/master_service.h b/lib_acl_cpp/samples/master/master_http_threads2/master_service.h similarity index 100% rename from lib_acl_cpp/samples/master_http_threads2/master_service.h rename to lib_acl_cpp/samples/master/master_http_threads2/master_service.h diff --git a/lib_acl_cpp/samples/master_http_threads2/stdafx.cpp b/lib_acl_cpp/samples/master/master_http_threads2/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_threads2/stdafx.cpp rename to lib_acl_cpp/samples/master/master_http_threads2/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_http_aio/stdafx.h b/lib_acl_cpp/samples/master/master_http_threads2/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/stdafx.h rename to lib_acl_cpp/samples/master/master_http_threads2/stdafx.h diff --git a/lib_acl_cpp/samples/master/master_proc/Makefile b/lib_acl_cpp/samples/master/master_proc/Makefile new file mode 100644 index 000000000..8b84be3ab --- /dev/null +++ b/lib_acl_cpp/samples/master/master_proc/Makefile @@ -0,0 +1,3 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = master_proc diff --git a/lib_acl_cpp/samples/master_proc/ReadMe.txt b/lib_acl_cpp/samples/master/master_proc/ReadMe.txt similarity index 100% rename from lib_acl_cpp/samples/master_proc/ReadMe.txt rename to lib_acl_cpp/samples/master/master_proc/ReadMe.txt diff --git a/lib_acl_cpp/samples/master_proc/master_proc.cpp b/lib_acl_cpp/samples/master/master_proc/master_proc.cpp similarity index 100% rename from lib_acl_cpp/samples/master_proc/master_proc.cpp rename to lib_acl_cpp/samples/master/master_proc/master_proc.cpp diff --git a/lib_acl_cpp/samples/master_proc/master_proc.vcproj b/lib_acl_cpp/samples/master/master_proc/master_proc.vcproj similarity index 88% rename from lib_acl_cpp/samples/master_proc/master_proc.vcproj rename to lib_acl_cpp/samples/master/master_proc/master_proc.vcproj index 9d6f1513b..130efe944 100644 --- a/lib_acl_cpp/samples/master_proc/master_proc.vcproj +++ b/lib_acl_cpp/samples/master/master_proc/master_proc.vcproj @@ -19,7 +19,7 @@ Disabled - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks @@ -98,7 +98,7 @@ lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies) $(OutDir)master_udp.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)master_udp.pdb Console @@ -108,7 +108,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Use @@ -118,7 +118,7 @@ lib_acl_cpp_vc2012.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;%(AdditionalDependencies) $(OutDir)master_udp.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -128,7 +128,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_DLL;ACL_CPP_DLL;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -138,7 +138,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) $(OutDir)master_udp.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -146,15 +146,15 @@ 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 + 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 - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_DLL;ACL_CPP_DLL;%(PreprocessorDefinitions) true EnableFastChecks @@ -166,16 +166,16 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y lib_acl_cpp_d.lib;lib_acl_d.lib;lib_protocol_d.lib;%(AdditionalDependencies) $(OutDir)master_udp.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)master_udp.pdb Console MachineX86 - copy ..\..\..\dist\lib\win32\lib_acl_d.dll $(OutDir) /Y -copy ..\..\..\dist\lib\win32\lib_acl_cpp_d.dll $(OutDir) /Y -copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y + copy ..\..\..\..\dist\lib\win32\lib_acl_d.dll $(OutDir) /Y +copy ..\..\..\..\dist\lib\win32\lib_acl_cpp_d.dll $(OutDir) /Y +copy ..\..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y @@ -198,4 +198,4 @@ copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/master_udp/master_udp_vc2012.vcxproj.filters b/lib_acl_cpp/samples/master/master_udp/master_udp_vc2012.vcxproj.filters similarity index 100% rename from lib_acl_cpp/samples/master_udp/master_udp_vc2012.vcxproj.filters rename to lib_acl_cpp/samples/master/master_udp/master_udp_vc2012.vcxproj.filters diff --git a/lib_acl_cpp/samples/master_http_rpc/stdafx.cpp b/lib_acl_cpp/samples/master/master_udp/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_rpc/stdafx.cpp rename to lib_acl_cpp/samples/master/master_udp/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_udp_threads/stdafx.h b/lib_acl_cpp/samples/master/master_udp/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/stdafx.h rename to lib_acl_cpp/samples/master/master_udp/stdafx.h diff --git a/lib_acl_cpp/samples/master/master_udp_threads/Makefile b/lib_acl_cpp/samples/master/master_udp_threads/Makefile new file mode 100644 index 000000000..518deb058 --- /dev/null +++ b/lib_acl_cpp/samples/master/master_udp_threads/Makefile @@ -0,0 +1,3 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = master_udp_threads diff --git a/lib_acl_cpp/samples/master_udp_threads/main.cpp b/lib_acl_cpp/samples/master/master_udp_threads/main.cpp similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/main.cpp rename to lib_acl_cpp/samples/master/master_udp_threads/main.cpp diff --git a/lib_acl_cpp/samples/master_udp_threads/master_service.cpp b/lib_acl_cpp/samples/master/master_udp_threads/master_service.cpp similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/master_service.cpp rename to lib_acl_cpp/samples/master/master_udp_threads/master_service.cpp diff --git a/lib_acl_cpp/samples/master_udp/master_service.h b/lib_acl_cpp/samples/master/master_udp_threads/master_service.h similarity index 100% rename from lib_acl_cpp/samples/master_udp/master_service.h rename to lib_acl_cpp/samples/master/master_udp_threads/master_service.h diff --git a/lib_acl_cpp/samples/master_udp_threads/master_udp_threads.cf b/lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.cf similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/master_udp_threads.cf rename to lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.cf diff --git a/lib_acl_cpp/samples/master_udp_threads/master_udp_threads.sln b/lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.sln similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/master_udp_threads.sln rename to lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.sln diff --git a/lib_acl_cpp/samples/master_udp_threads/master_udp_threads.vcproj b/lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.vcproj similarity index 83% rename from lib_acl_cpp/samples/master_udp_threads/master_udp_threads.vcproj rename to lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.vcproj index 04b8c96a1..10d90a29d 100644 --- a/lib_acl_cpp/samples/master_udp_threads/master_udp_threads.vcproj +++ b/lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads.vcproj @@ -19,7 +19,7 @@ + CommandLine="copy ..\..\..\..\dist\lib\win32\lib_acl.dll $(OutDir)\ /Y +copy ..\..\..\..\dist\lib\win32\lib_acl_cpp_dll.dll $(OutDir)\ /Y +copy ..\..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir)\ /Y"/> AdditionalDependencies="lib_acl_cppd_dll.lib lib_acl_d.lib lib_protocol_d.lib" OutputFile="$(OutDir)/master_udp_threads.exe" LinkIncremental="2" - AdditionalLibraryDirectories="..\..\..\dist\lib\win32" + AdditionalLibraryDirectories="..\..\..\..\dist\lib\win32" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/master_udp_threads.pdb" SubSystem="1" @@ -198,9 +198,9 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir)\ /Y"/> Name="VCPostBuildEventTool"/> + CommandLine="copy ..\..\..\..\dist\lib\win32\lib_acl_d.dll $(OutDir)\ /Y +copy ..\..\..\..\dist\lib\win32\lib_acl_cppd_dll.dll $(OutDir)\ /Y +copy ..\..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir)\ /Y"/> Disabled - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks @@ -98,7 +98,7 @@ lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies) $(OutDir)master_udp_threads.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)master_udp_threads.pdb Console @@ -108,7 +108,7 @@ - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Use @@ -118,7 +118,7 @@ lib_acl_cpp_vc2012.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;%(AdditionalDependencies) $(OutDir)master_udp_threads.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -128,7 +128,7 @@ - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -138,7 +138,7 @@ lib_acl_cpp_dll.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) $(OutDir)master_udp_threads.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -146,15 +146,15 @@ MachineX86 - copy ..\..\..\dist\lib\win32\lib_acl.dll $(OutDir) /Y -copy ..\..\..\dist\lib\win32\lib_acl_cpp_dll.dll $(OutDir) /Y -copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y + copy ..\..\..\..\dist\lib\win32\lib_acl.dll $(OutDir) /Y +copy ..\..\..\..\dist\lib\win32\lib_acl_cpp_dll.dll $(OutDir) /Y +copy ..\..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y Disabled - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions) true EnableFastChecks @@ -166,16 +166,16 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y lib_acl_cppd_dll.lib;lib_acl_d.lib;lib_protocol_d.lib;%(AdditionalDependencies) $(OutDir)master_udp_threads.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)master_udp_threads.pdb Console MachineX86 - copy ..\..\..\dist\lib\win32\lib_acl_d.dll $(OutDir) /Y -copy ..\..\..\dist\lib\win32\lib_acl_cppd_dll.dll $(OutDir) /Y -copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y + copy ..\..\..\..\dist\lib\win32\lib_acl_d.dll $(OutDir) /Y +copy ..\..\..\..\dist\lib\win32\lib_acl_cppd_dll.dll $(OutDir) /Y +copy ..\..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y diff --git a/lib_acl_cpp/samples/master_udp_threads/master_udp_threads_vc2012.vcxproj.filters b/lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads_vc2012.vcxproj.filters similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/master_udp_threads_vc2012.vcxproj.filters rename to lib_acl_cpp/samples/master/master_udp_threads/master_udp_threads_vc2012.vcxproj.filters diff --git a/lib_acl_cpp/samples/master_http_aio/stdafx.cpp b/lib_acl_cpp/samples/master/master_udp_threads/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/master_http_aio/stdafx.cpp rename to lib_acl_cpp/samples/master/master_udp_threads/stdafx.cpp diff --git a/lib_acl_cpp/samples/master_udp/stdafx.h b/lib_acl_cpp/samples/master/master_udp_threads/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/master_udp/stdafx.h rename to lib_acl_cpp/samples/master/master_udp_threads/stdafx.h diff --git a/lib_acl_cpp/samples/master_udp_threads/valgrind.sh b/lib_acl_cpp/samples/master/master_udp_threads/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/master_udp_threads/valgrind.sh rename to lib_acl_cpp/samples/master/master_udp_threads/valgrind.sh diff --git a/lib_acl_cpp/samples/master_aio/Makefile b/lib_acl_cpp/samples/master_aio/Makefile deleted file mode 100644 index 84a000845..000000000 --- a/lib_acl_cpp/samples/master_aio/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = master_aio diff --git a/lib_acl_cpp/samples/master_http_aio/Makefile b/lib_acl_cpp/samples/master_http_aio/Makefile deleted file mode 100644 index e011fe444..000000000 --- a/lib_acl_cpp/samples/master_http_aio/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -include ../Makefile.in -EXTLIBS = -lz -PROG = master_http_aio diff --git a/lib_acl_cpp/samples/master_proc/Makefile b/lib_acl_cpp/samples/master_proc/Makefile deleted file mode 100644 index 892192830..000000000 --- a/lib_acl_cpp/samples/master_proc/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = master_proc diff --git a/lib_acl_cpp/samples/master_threads/Makefile b/lib_acl_cpp/samples/master_threads/Makefile deleted file mode 100644 index edee1db11..000000000 --- a/lib_acl_cpp/samples/master_threads/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = master_threads diff --git a/lib_acl_cpp/samples/master_trigger/Makefile b/lib_acl_cpp/samples/master_trigger/Makefile deleted file mode 100644 index 175ddb92e..000000000 --- a/lib_acl_cpp/samples/master_trigger/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = master_trigger diff --git a/lib_acl_cpp/samples/master_udp/Makefile b/lib_acl_cpp/samples/master_udp/Makefile deleted file mode 100644 index ec78063c0..000000000 --- a/lib_acl_cpp/samples/master_udp/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = master_udp diff --git a/lib_acl_cpp/samples/master_udp/Makefile.in b/lib_acl_cpp/samples/master_udp/Makefile.in deleted file mode 100644 index a212edb2f..000000000 --- a/lib_acl_cpp/samples/master_udp/Makefile.in +++ /dev/null @@ -1,104 +0,0 @@ -CC = g++ - -CFLAGS = -c -g -W -Wall -Wcast-qual -Wcast-align \ --Waggregate-return -Wno-long-long \ --Wpointer-arith -Werror -Wshadow -O3 \ --D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_USE_FAST_MACRO - -########################################################### -#Check system: -# Linux, SunOS, Solaris, BSD variants, AIX, HP-UX -SYSLIB = -lpthread -lcrypt -lz -CHECKSYSRES = @echo "Unknow system type!";exit 1 -UNIXNAME = $(shell uname -sm) -OSTYPE = $(shell uname -p) -RPATH = linux64 - -ifeq ($(CC),) - CC = gcc -endif - -# For FreeBSD -ifeq ($(findstring FreeBSD, $(UNIXNAME)), FreeBSD) - ifeq ($(findstring gcc, $(CC)), gcc) - CFLAGS += -Wstrict-prototypes - endif - CFLAGS += -DFREEBSD -D_REENTRANT - SYSLIB = -lcrypt -lpthread -endif - -#Path for Linux -ifeq ($(findstring Linux, $(UNIXNAME)), Linux) - ifeq ($CC, "gcc") - CFLAGS += -Wstrict-prototypes - endif - ifeq ($(findstring i686, $(OSTYPE)), i686) - RPATH = linux32 - endif - ifeq ($(findstring x86_64, $(OSTYPE)), x86_64) - RPATH = linux64 - endif - CFLAGS += -DLINUX2 -D_REENTRANT -endif - -#Path for SunOS -ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS) - ifeq ($(findstring 86, $(UNIXNAME)), 86) - SYSLIB += -lsocket -lnsl -lrt - endif - ifeq ($(findstring sun4u, $(UNIXNAME)), sun4u) - SYSLIB += -lsocket -lnsl -lrt - endif - ifeq ($CC, "gcc") - CFLAGS += -Wstrict-prototypes - endif - CFLAGS += -DSUNOS5 -D_REENTRANT -endif - -#Path for HP-UX -ifeq ($(findstring HP-UX, $(UNIXNAME)), HP-UX) - ifeq ($CC, "gcc") - CFLAGS += -Wstrict-prototypes - endif - CFLAGS += -DHP_UX -DHPUX11 - PLAT_NAME=hp-ux -endif - -#Find system type. -ifneq ($(SYSPATH),) - CHECKSYSRES = @echo "System is $(shell uname -sm)" -endif -########################################################### - -CFLAGS += -I../../../lib_acl/include -I../../../lib_protocol/include -I../../../lib_acl_cpp/include -EXTLIBS = -LDFLAGS = -L../../../lib_acl_cpp/lib -l_acl_cpp -L../../../lib_protocol/lib -l_protocol -L../../../lib_acl/lib -l_acl \ - $(EXTLIBS) $(SYSLIB) - -COMPILE = $(CC) $(CFLAGS) -LINK = $(CC) $(OBJ) $(LDFLAGS) -########################################################### -OBJ_PATH = . - -#Project's objs -SRC = $(wildcard *.cpp) -OBJ = $(patsubst %.cpp, $(OBJ_PATH)/%.o, $(notdir $(SRC))) - -$(OBJ_PATH)/%.o: %.cpp - $(COMPILE) $< -o $@ - -.PHONY = all clean -all: RM $(OBJ) - $(LINK) -o $(PROG) - @echo "" - @echo "All ok! Output:$(PROG)" - @echo "" -RM: - rm -f $(PROG) -clean: - rm -f $(PROG) - rm -f $(OBJ) -install: - cp $(PROG) ../../../dist/master/libexec/$(RPATH)/ - cp $(PROG).cf ../../../dist/master/conf/service/ -########################################################### diff --git a/lib_acl_cpp/samples/master_udp_threads/Makefile b/lib_acl_cpp/samples/master_udp_threads/Makefile deleted file mode 100644 index 0f74c2410..000000000 --- a/lib_acl_cpp/samples/master_udp_threads/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ./Makefile.in -PROG = master_udp_threads diff --git a/lib_acl_cpp/samples/mime/Makefile b/lib_acl_cpp/samples/mime/Makefile index f91ff0f8b..6e9c87290 100644 --- a/lib_acl_cpp/samples/mime/Makefile +++ b/lib_acl_cpp/samples/mime/Makefile @@ -1,9 +1,13 @@ -include ../Makefile.in -#Path for SunOS -ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS) - EXTLIBS = -liconv -endif -ifeq ($(findstring FreeBSD, $(UNIXNAME)), FreeBSD) - EXTLIBS = -L/usr/local/lib -liconv -endif -PROG = mime +.PHONY = all clean + +all: + @(cd mime; make) + @(cd mime_qp; make) + @(cd mime_base64; make) + @(cd mime_xxcode; make) + +clean: + @(cd mime; make clean) + @(cd mime_qp; make clean) + @(cd mime_base64; make clean) + @(cd mime_xxcode; make clean) diff --git a/lib_acl_cpp/samples/mime/mime/Makefile b/lib_acl_cpp/samples/mime/mime/Makefile new file mode 100644 index 000000000..e0f1c2182 --- /dev/null +++ b/lib_acl_cpp/samples/mime/mime/Makefile @@ -0,0 +1,10 @@ +base_path = ../../.. +include ../../Makefile.in +#Path for SunOS +ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS) + EXTLIBS = -liconv +endif +ifeq ($(findstring FreeBSD, $(UNIXNAME)), FreeBSD) + EXTLIBS = -L/usr/local/lib -liconv +endif +PROG = mime diff --git a/lib_acl_cpp/samples/mime/ReadMe.txt b/lib_acl_cpp/samples/mime/mime/ReadMe.txt similarity index 100% rename from lib_acl_cpp/samples/mime/ReadMe.txt rename to lib_acl_cpp/samples/mime/mime/ReadMe.txt diff --git a/lib_acl_cpp/samples/mime/email12.eml b/lib_acl_cpp/samples/mime/mime/email12.eml similarity index 100% rename from lib_acl_cpp/samples/mime/email12.eml rename to lib_acl_cpp/samples/mime/mime/email12.eml diff --git a/lib_acl_cpp/samples/mime/mime.cpp b/lib_acl_cpp/samples/mime/mime/mime.cpp similarity index 100% rename from lib_acl_cpp/samples/mime/mime.cpp rename to lib_acl_cpp/samples/mime/mime/mime.cpp diff --git a/lib_acl_cpp/samples/mime/mime.vcproj b/lib_acl_cpp/samples/mime/mime/mime.vcproj similarity index 87% rename from lib_acl_cpp/samples/mime/mime.vcproj rename to lib_acl_cpp/samples/mime/mime/mime.vcproj index a0f82b6da..211d1e108 100644 --- a/lib_acl_cpp/samples/mime/mime.vcproj +++ b/lib_acl_cpp/samples/mime/mime/mime.vcproj @@ -19,7 +19,7 @@ Disabled - ..\..\include;..\..\mime;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\mime;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -97,7 +97,7 @@ ws2_32.lib;lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Console @@ -112,7 +112,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded Use @@ -122,7 +122,7 @@ ws2_32.lib;wsock32.lib;lib_acl_vc2010.lib;lib_acl_cpp_vc2010.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -135,7 +135,7 @@ Disabled - ..\..\include;..\..\mime;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\mime;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -147,7 +147,7 @@ lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Console @@ -157,7 +157,7 @@ Disabled - ..\..\include;..\..\mime;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\mime;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -169,7 +169,7 @@ lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Console @@ -200,4 +200,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/mime/mime_nest.in b/lib_acl_cpp/samples/mime/mime/mime_nest.in similarity index 100% rename from lib_acl_cpp/samples/mime/mime_nest.in rename to lib_acl_cpp/samples/mime/mime/mime_nest.in diff --git a/lib_acl_cpp/samples/mime/mime_vc2008.vcproj b/lib_acl_cpp/samples/mime/mime/mime_vc2008.vcproj similarity index 88% rename from lib_acl_cpp/samples/mime/mime_vc2008.vcproj rename to lib_acl_cpp/samples/mime/mime/mime_vc2008.vcproj index cb6052700..90c9d4168 100644 --- a/lib_acl_cpp/samples/mime/mime_vc2008.vcproj +++ b/lib_acl_cpp/samples/mime/mime/mime_vc2008.vcproj @@ -41,7 +41,7 @@ Disabled - ..\..\include;..\..\mime;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\mime;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -102,7 +102,7 @@ ws2_32.lib;lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Console @@ -117,7 +117,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded Use @@ -127,7 +127,7 @@ ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -140,7 +140,7 @@ Disabled - ..\..\include;..\..\mime;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\mime;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -152,7 +152,7 @@ lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Console @@ -162,7 +162,7 @@ Disabled - ..\..\include;..\..\mime;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\mime;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -174,7 +174,7 @@ lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Console @@ -205,4 +205,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/mime/pipeline_string.cpp b/lib_acl_cpp/samples/mime/mime/pipeline_string.cpp similarity index 100% rename from lib_acl_cpp/samples/mime/pipeline_string.cpp rename to lib_acl_cpp/samples/mime/mime/pipeline_string.cpp diff --git a/lib_acl_cpp/samples/mime/pipeline_string.h b/lib_acl_cpp/samples/mime/mime/pipeline_string.h similarity index 100% rename from lib_acl_cpp/samples/mime/pipeline_string.h rename to lib_acl_cpp/samples/mime/mime/pipeline_string.h diff --git a/lib_acl_cpp/samples/mime/stdafx.cpp b/lib_acl_cpp/samples/mime/mime/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/mime/stdafx.cpp rename to lib_acl_cpp/samples/mime/mime/stdafx.cpp diff --git a/lib_acl_cpp/samples/mime/stdafx.h b/lib_acl_cpp/samples/mime/mime/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/mime/stdafx.h rename to lib_acl_cpp/samples/mime/mime/stdafx.h diff --git a/lib_acl_cpp/samples/mime/test1.eml b/lib_acl_cpp/samples/mime/mime/test1.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test1.eml rename to lib_acl_cpp/samples/mime/mime/test1.eml diff --git a/lib_acl_cpp/samples/mime/test10.eml b/lib_acl_cpp/samples/mime/mime/test10.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test10.eml rename to lib_acl_cpp/samples/mime/mime/test10.eml diff --git a/lib_acl_cpp/samples/mime/test11.eml b/lib_acl_cpp/samples/mime/mime/test11.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test11.eml rename to lib_acl_cpp/samples/mime/mime/test11.eml diff --git a/lib_acl_cpp/samples/mime/test12.eml b/lib_acl_cpp/samples/mime/mime/test12.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test12.eml rename to lib_acl_cpp/samples/mime/mime/test12.eml diff --git a/lib_acl_cpp/samples/mime/test13.eml b/lib_acl_cpp/samples/mime/mime/test13.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test13.eml rename to lib_acl_cpp/samples/mime/mime/test13.eml diff --git a/lib_acl_cpp/samples/mime/test14.eml b/lib_acl_cpp/samples/mime/mime/test14.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test14.eml rename to lib_acl_cpp/samples/mime/mime/test14.eml diff --git a/lib_acl_cpp/samples/mime/test15.eml b/lib_acl_cpp/samples/mime/mime/test15.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test15.eml rename to lib_acl_cpp/samples/mime/mime/test15.eml diff --git a/lib_acl_cpp/samples/mime/test16.eml b/lib_acl_cpp/samples/mime/mime/test16.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test16.eml rename to lib_acl_cpp/samples/mime/mime/test16.eml diff --git a/lib_acl_cpp/samples/mime/test17.eml b/lib_acl_cpp/samples/mime/mime/test17.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test17.eml rename to lib_acl_cpp/samples/mime/mime/test17.eml diff --git a/lib_acl_cpp/samples/mime/test18.eml b/lib_acl_cpp/samples/mime/mime/test18.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test18.eml rename to lib_acl_cpp/samples/mime/mime/test18.eml diff --git a/lib_acl_cpp/samples/mime/test19.eml b/lib_acl_cpp/samples/mime/mime/test19.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test19.eml rename to lib_acl_cpp/samples/mime/mime/test19.eml diff --git a/lib_acl_cpp/samples/mime/test2.eml b/lib_acl_cpp/samples/mime/mime/test2.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test2.eml rename to lib_acl_cpp/samples/mime/mime/test2.eml diff --git a/lib_acl_cpp/samples/mime/test21.eml b/lib_acl_cpp/samples/mime/mime/test21.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test21.eml rename to lib_acl_cpp/samples/mime/mime/test21.eml diff --git a/lib_acl_cpp/samples/mime/test3.eml b/lib_acl_cpp/samples/mime/mime/test3.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test3.eml rename to lib_acl_cpp/samples/mime/mime/test3.eml diff --git a/lib_acl_cpp/samples/mime/test4.eml b/lib_acl_cpp/samples/mime/mime/test4.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test4.eml rename to lib_acl_cpp/samples/mime/mime/test4.eml diff --git a/lib_acl_cpp/samples/mime/test5.eml b/lib_acl_cpp/samples/mime/mime/test5.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test5.eml rename to lib_acl_cpp/samples/mime/mime/test5.eml diff --git a/lib_acl_cpp/samples/mime/test6.eml b/lib_acl_cpp/samples/mime/mime/test6.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test6.eml rename to lib_acl_cpp/samples/mime/mime/test6.eml diff --git a/lib_acl_cpp/samples/mime/test7.eml b/lib_acl_cpp/samples/mime/mime/test7.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test7.eml rename to lib_acl_cpp/samples/mime/mime/test7.eml diff --git a/lib_acl_cpp/samples/mime/test8.eml b/lib_acl_cpp/samples/mime/mime/test8.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test8.eml rename to lib_acl_cpp/samples/mime/mime/test8.eml diff --git a/lib_acl_cpp/samples/mime/test9.eml b/lib_acl_cpp/samples/mime/mime/test9.eml similarity index 100% rename from lib_acl_cpp/samples/mime/test9.eml rename to lib_acl_cpp/samples/mime/mime/test9.eml diff --git a/lib_acl_cpp/samples/mime/utf.eml b/lib_acl_cpp/samples/mime/mime/utf.eml similarity index 100% rename from lib_acl_cpp/samples/mime/utf.eml rename to lib_acl_cpp/samples/mime/mime/utf.eml diff --git a/lib_acl_cpp/samples/mime/valgrind.sh b/lib_acl_cpp/samples/mime/mime/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/mime/valgrind.sh rename to lib_acl_cpp/samples/mime/mime/valgrind.sh diff --git a/lib_acl_cpp/samples/mime/vld.dll b/lib_acl_cpp/samples/mime/mime/vld.dll similarity index 100% rename from lib_acl_cpp/samples/mime/vld.dll rename to lib_acl_cpp/samples/mime/mime/vld.dll diff --git a/lib_acl_cpp/samples/mime/mime_base64/Makefile b/lib_acl_cpp/samples/mime/mime_base64/Makefile new file mode 100644 index 000000000..ccf94e765 --- /dev/null +++ b/lib_acl_cpp/samples/mime/mime_base64/Makefile @@ -0,0 +1,3 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = mime_base64 diff --git a/lib_acl_cpp/samples/mime_base64/base64_decode.txt b/lib_acl_cpp/samples/mime/mime_base64/base64_decode.txt similarity index 100% rename from lib_acl_cpp/samples/mime_base64/base64_decode.txt rename to lib_acl_cpp/samples/mime/mime_base64/base64_decode.txt diff --git a/lib_acl_cpp/samples/mime_base64/base64_encode.txt b/lib_acl_cpp/samples/mime/mime_base64/base64_encode.txt similarity index 100% rename from lib_acl_cpp/samples/mime_base64/base64_encode.txt rename to lib_acl_cpp/samples/mime/mime_base64/base64_encode.txt diff --git a/lib_acl_cpp/samples/mime_base64/main.cpp b/lib_acl_cpp/samples/mime/mime_base64/main.cpp similarity index 100% rename from lib_acl_cpp/samples/mime_base64/main.cpp rename to lib_acl_cpp/samples/mime/mime_base64/main.cpp diff --git a/lib_acl_cpp/samples/mime_base64/mime_base64.vcproj b/lib_acl_cpp/samples/mime/mime_base64/mime_base64.vcproj similarity index 89% rename from lib_acl_cpp/samples/mime_base64/mime_base64.vcproj rename to lib_acl_cpp/samples/mime/mime_base64/mime_base64.vcproj index 24bbe1d9f..53c337563 100644 --- a/lib_acl_cpp/samples/mime_base64/mime_base64.vcproj +++ b/lib_acl_cpp/samples/mime/mime_base64/mime_base64.vcproj @@ -19,7 +19,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -98,7 +98,7 @@ ws2_32.lib;lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_base64.pdb Console @@ -109,7 +109,7 @@ - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded @@ -120,7 +120,7 @@ ws2_32.lib;wsock32.lib;lib_acl_vc2010.lib;lib_acl_cpp_vc2010.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -133,7 +133,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -146,7 +146,7 @@ lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_base64.pdb Console @@ -156,7 +156,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -169,7 +169,7 @@ lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_base64.pdb Console @@ -186,4 +186,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/mime_base64/mime_base64_vc2008.vcproj b/lib_acl_cpp/samples/mime/mime_base64/mime_base64_vc2008.vcproj similarity index 89% rename from lib_acl_cpp/samples/mime_base64/mime_base64_vc2008.vcproj rename to lib_acl_cpp/samples/mime/mime_base64/mime_base64_vc2008.vcproj index d4eb32a70..a0ab9dce0 100644 --- a/lib_acl_cpp/samples/mime_base64/mime_base64_vc2008.vcproj +++ b/lib_acl_cpp/samples/mime/mime_base64/mime_base64_vc2008.vcproj @@ -41,7 +41,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -103,7 +103,7 @@ ws2_32.lib;lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_base64.pdb Console @@ -114,7 +114,7 @@ - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded @@ -125,7 +125,7 @@ ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -138,7 +138,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -151,7 +151,7 @@ lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_base64.pdb Console @@ -161,7 +161,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -174,7 +174,7 @@ lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_base64.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_base64.pdb Console @@ -191,4 +191,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/mime_base64/valgrind.sh b/lib_acl_cpp/samples/mime/mime_base64/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/mime_base64/valgrind.sh rename to lib_acl_cpp/samples/mime/mime_base64/valgrind.sh diff --git a/lib_acl_cpp/samples/mime/mime_qp/Makefile b/lib_acl_cpp/samples/mime/mime_qp/Makefile new file mode 100644 index 000000000..e93a59699 --- /dev/null +++ b/lib_acl_cpp/samples/mime/mime_qp/Makefile @@ -0,0 +1,3 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = mime_qp diff --git a/lib_acl_cpp/samples/mime_qp/main.cpp b/lib_acl_cpp/samples/mime/mime_qp/main.cpp similarity index 100% rename from lib_acl_cpp/samples/mime_qp/main.cpp rename to lib_acl_cpp/samples/mime/mime_qp/main.cpp diff --git a/lib_acl_cpp/samples/mime_qp/mime_qp.vcproj b/lib_acl_cpp/samples/mime/mime_qp/mime_qp.vcproj similarity index 89% rename from lib_acl_cpp/samples/mime_qp/mime_qp.vcproj rename to lib_acl_cpp/samples/mime/mime_qp/mime_qp.vcproj index 11d746ceb..ccc5e949f 100644 --- a/lib_acl_cpp/samples/mime_qp/mime_qp.vcproj +++ b/lib_acl_cpp/samples/mime/mime_qp/mime_qp.vcproj @@ -19,7 +19,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -98,7 +98,7 @@ ws2_32.lib;lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_qp.pdb Console @@ -109,7 +109,7 @@ - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded @@ -120,7 +120,7 @@ ws2_32.lib;wsock32.lib;lib_acl_vc2010.lib;lib_acl_cpp_vc2010.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -133,7 +133,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -146,7 +146,7 @@ lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_qp.pdb Console @@ -156,7 +156,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -169,7 +169,7 @@ lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_qp.pdb Console @@ -186,4 +186,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/mime_qp/mime_qp_vc2008.vcproj b/lib_acl_cpp/samples/mime/mime_qp/mime_qp_vc2008.vcproj similarity index 89% rename from lib_acl_cpp/samples/mime_qp/mime_qp_vc2008.vcproj rename to lib_acl_cpp/samples/mime/mime_qp/mime_qp_vc2008.vcproj index ee726f90a..62a6d604d 100644 --- a/lib_acl_cpp/samples/mime_qp/mime_qp_vc2008.vcproj +++ b/lib_acl_cpp/samples/mime/mime_qp/mime_qp_vc2008.vcproj @@ -41,7 +41,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -103,7 +103,7 @@ ws2_32.lib;lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_qp.pdb Console @@ -114,7 +114,7 @@ - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreaded @@ -125,7 +125,7 @@ ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -138,7 +138,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -151,7 +151,7 @@ lib_acl_d.lib;lib_acl_cpp_d.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_qp.pdb Console @@ -161,7 +161,7 @@ Disabled - ..\..\include;%(AdditionalIncludeDirectories) + ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;ACL_CPP_DLL;ACL_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -174,7 +174,7 @@ lib_acl.lib;lib_acl_cpp.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)mime_qp.exe - ..\..\lib;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) true $(OutDir)mime_qp.pdb Console @@ -191,4 +191,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/mime_qp/out.txt b/lib_acl_cpp/samples/mime/mime_qp/out.txt similarity index 100% rename from lib_acl_cpp/samples/mime_qp/out.txt rename to lib_acl_cpp/samples/mime/mime_qp/out.txt diff --git a/lib_acl_cpp/samples/mime_qp/valgrind.sh b/lib_acl_cpp/samples/mime/mime_qp/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/mime_qp/valgrind.sh rename to lib_acl_cpp/samples/mime/mime_qp/valgrind.sh diff --git a/lib_acl_cpp/samples/mime/mime_xxcode/Makefile b/lib_acl_cpp/samples/mime/mime_xxcode/Makefile new file mode 100644 index 000000000..1ba0ff123 --- /dev/null +++ b/lib_acl_cpp/samples/mime/mime_xxcode/Makefile @@ -0,0 +1,3 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = mime_xxcode diff --git a/lib_acl_cpp/samples/mime_xxcode/main.cpp b/lib_acl_cpp/samples/mime/mime_xxcode/main.cpp similarity index 100% rename from lib_acl_cpp/samples/mime_xxcode/main.cpp rename to lib_acl_cpp/samples/mime/mime_xxcode/main.cpp diff --git a/lib_acl_cpp/samples/mime_base64/Makefile b/lib_acl_cpp/samples/mime_base64/Makefile deleted file mode 100644 index 3944be749..000000000 --- a/lib_acl_cpp/samples/mime_base64/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = mime_base64 diff --git a/lib_acl_cpp/samples/mime_qp/Makefile b/lib_acl_cpp/samples/mime_qp/Makefile deleted file mode 100644 index b14706da8..000000000 --- a/lib_acl_cpp/samples/mime_qp/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = mime_qp diff --git a/lib_acl_cpp/samples/mime_xxcode/Makefile b/lib_acl_cpp/samples/mime_xxcode/Makefile deleted file mode 100644 index 67864cbf6..000000000 --- a/lib_acl_cpp/samples/mime_xxcode/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../Makefile.in -PROG = mime_xxcode diff --git a/lib_acl_cpp/samples/socket_stream/stdafx.h b/lib_acl_cpp/samples/socket_stream/stdafx.h index 265bf7847..6d11ed008 100644 --- a/lib_acl_cpp/samples/socket_stream/stdafx.h +++ b/lib_acl_cpp/samples/socket_stream/stdafx.h @@ -4,8 +4,8 @@ #pragma once - //#include //#include // TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÒªÇóµÄ¸½¼ÓÍ·Îļþ +#include "acl_cpp/lib_acl.hpp" diff --git a/lib_acl_cpp/samples/ssl/Makefile b/lib_acl_cpp/samples/ssl/Makefile new file mode 100644 index 000000000..766cb0c10 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/Makefile @@ -0,0 +1,13 @@ +.PHONY = all clean + +all: + @(cd ssl_client; make) + @(cd ssl_server; make) + @(cd https_client; make) + @(cd https_server; make) + +clean: + @(cd ssl_client; make clean) + @(cd ssl_server; make clean) + @(cd https_client; make clean) + @(cd https_server; make clean) diff --git a/lib_acl_cpp/samples/ssl/https_client/Makefile b/lib_acl_cpp/samples/ssl/https_client/Makefile new file mode 100644 index 000000000..d69661ce6 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/https_client/Makefile @@ -0,0 +1,6 @@ +PROG = https_client +util_path = ../.. +base_path = ../../.. +include ../../Makefile.in +CFLAGS += -I../.. +EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/https_client/https_client.cpp b/lib_acl_cpp/samples/ssl/https_client/https_client.cpp similarity index 100% rename from lib_acl_cpp/samples/https_client/https_client.cpp rename to lib_acl_cpp/samples/ssl/https_client/https_client.cpp diff --git a/lib_acl_cpp/samples/https_client/https_client.h b/lib_acl_cpp/samples/ssl/https_client/https_client.h similarity index 100% rename from lib_acl_cpp/samples/https_client/https_client.h rename to lib_acl_cpp/samples/ssl/https_client/https_client.h diff --git a/lib_acl_cpp/samples/https_client/main.cpp b/lib_acl_cpp/samples/ssl/https_client/main.cpp similarity index 100% rename from lib_acl_cpp/samples/https_client/main.cpp rename to lib_acl_cpp/samples/ssl/https_client/main.cpp diff --git a/lib_acl_cpp/samples/https_client/stdafx.cpp b/lib_acl_cpp/samples/ssl/https_client/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/https_client/stdafx.cpp rename to lib_acl_cpp/samples/ssl/https_client/stdafx.cpp diff --git a/lib_acl_cpp/samples/https_client/stdafx.h b/lib_acl_cpp/samples/ssl/https_client/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/https_client/stdafx.h rename to lib_acl_cpp/samples/ssl/https_client/stdafx.h diff --git a/lib_acl_cpp/samples/https_client/valgrind.sh b/lib_acl_cpp/samples/ssl/https_client/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/https_client/valgrind.sh rename to lib_acl_cpp/samples/ssl/https_client/valgrind.sh diff --git a/lib_acl_cpp/samples/ssl/https_server/Makefile b/lib_acl_cpp/samples/ssl/https_server/Makefile new file mode 100644 index 000000000..4dd6fedcd --- /dev/null +++ b/lib_acl_cpp/samples/ssl/https_server/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = https_server +EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/https_server/http_servlet.cpp b/lib_acl_cpp/samples/ssl/https_server/http_servlet.cpp similarity index 100% rename from lib_acl_cpp/samples/https_server/http_servlet.cpp rename to lib_acl_cpp/samples/ssl/https_server/http_servlet.cpp diff --git a/lib_acl_cpp/samples/https_server/http_servlet.h b/lib_acl_cpp/samples/ssl/https_server/http_servlet.h similarity index 100% rename from lib_acl_cpp/samples/https_server/http_servlet.h rename to lib_acl_cpp/samples/ssl/https_server/http_servlet.h diff --git a/lib_acl_cpp/samples/https_server/https_server.cf b/lib_acl_cpp/samples/ssl/https_server/https_server.cf similarity index 100% rename from lib_acl_cpp/samples/https_server/https_server.cf rename to lib_acl_cpp/samples/ssl/https_server/https_server.cf diff --git a/lib_acl_cpp/samples/https_server/main.cpp b/lib_acl_cpp/samples/ssl/https_server/main.cpp similarity index 100% rename from lib_acl_cpp/samples/https_server/main.cpp rename to lib_acl_cpp/samples/ssl/https_server/main.cpp diff --git a/lib_acl_cpp/samples/https_server/master_service.cpp b/lib_acl_cpp/samples/ssl/https_server/master_service.cpp similarity index 100% rename from lib_acl_cpp/samples/https_server/master_service.cpp rename to lib_acl_cpp/samples/ssl/https_server/master_service.cpp diff --git a/lib_acl_cpp/samples/https_server/master_service.h b/lib_acl_cpp/samples/ssl/https_server/master_service.h similarity index 100% rename from lib_acl_cpp/samples/https_server/master_service.h rename to lib_acl_cpp/samples/ssl/https_server/master_service.h diff --git a/lib_acl_cpp/samples/https_server/stdafx.cpp b/lib_acl_cpp/samples/ssl/https_server/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/https_server/stdafx.cpp rename to lib_acl_cpp/samples/ssl/https_server/stdafx.cpp diff --git a/lib_acl_cpp/samples/https_server/stdafx.h b/lib_acl_cpp/samples/ssl/https_server/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/https_server/stdafx.h rename to lib_acl_cpp/samples/ssl/https_server/stdafx.h diff --git a/lib_acl_cpp/samples/https_server/valgrind.sh b/lib_acl_cpp/samples/ssl/https_server/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/https_server/valgrind.sh rename to lib_acl_cpp/samples/ssl/https_server/valgrind.sh diff --git a/lib_acl_cpp/samples/ssl/ssl_client/Makefile b/lib_acl_cpp/samples/ssl/ssl_client/Makefile new file mode 100644 index 000000000..6a6eb8936 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_client/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = ssl_client +EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/ssl_client/ReadMe.txt b/lib_acl_cpp/samples/ssl/ssl_client/ReadMe.txt similarity index 100% rename from lib_acl_cpp/samples/ssl_client/ReadMe.txt rename to lib_acl_cpp/samples/ssl/ssl_client/ReadMe.txt diff --git a/lib_acl_cpp/samples/ssl_client/ssl_client.cpp b/lib_acl_cpp/samples/ssl/ssl_client/ssl_client.cpp similarity index 100% rename from lib_acl_cpp/samples/ssl_client/ssl_client.cpp rename to lib_acl_cpp/samples/ssl/ssl_client/ssl_client.cpp diff --git a/lib_acl_cpp/samples/ssl_client/ssl_client.vcproj b/lib_acl_cpp/samples/ssl/ssl_client/ssl_client.vcproj similarity index 88% rename from lib_acl_cpp/samples/ssl_client/ssl_client.vcproj rename to lib_acl_cpp/samples/ssl/ssl_client/ssl_client.vcproj index dbc8346d1..6cf38fc43 100644 --- a/lib_acl_cpp/samples/ssl_client/ssl_client.vcproj +++ b/lib_acl_cpp/samples/ssl/ssl_client/ssl_client.vcproj @@ -19,7 +19,7 @@ Disabled - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;HAS_POLARSSL;%(PreprocessorDefinitions) true EnableFastChecks @@ -102,7 +102,7 @@ ws2_32.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;lib_acl_cpp_vc2012d.lib;polarssl.lib;%(AdditionalDependencies) $(OutDir)ssl_client.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) libcmt;libc;%(IgnoreSpecificDefaultLibraries) true $(OutDir)ssl_client.pdb @@ -114,7 +114,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Use @@ -124,7 +124,7 @@ ws2_32.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;lib_acl_cpp_vc2012.lib;polarssl.lib;%(AdditionalDependencies) $(OutDir)ssl_client.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) libc;%(IgnoreSpecificDefaultLibraries) true Console @@ -138,7 +138,7 @@ Disabled - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;VC2003;ACL_DLL;ACL_CPP_DLL;%(PreprocessorDefinitions) true EnableFastChecks @@ -149,7 +149,7 @@ $(OutDir)ssl_client.exe - ..\..\..\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;%(AdditionalLibraryDirectories) libcmt;%(IgnoreSpecificDefaultLibraries) true $(OutDir)ssl_client.pdb @@ -161,7 +161,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;VC2003;ACL_DLL;ACL_CPP_DLL;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -170,7 +170,7 @@ $(OutDir)ssl_client.exe - ..\..\..\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -198,4 +198,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/ssl_client/ssl_client_vc2012.vcxproj.filters b/lib_acl_cpp/samples/ssl/ssl_client/ssl_client_vc2012.vcxproj.filters similarity index 100% rename from lib_acl_cpp/samples/ssl_client/ssl_client_vc2012.vcxproj.filters rename to lib_acl_cpp/samples/ssl/ssl_client/ssl_client_vc2012.vcxproj.filters diff --git a/lib_acl_cpp/samples/ssl_client/stdafx.cpp b/lib_acl_cpp/samples/ssl/ssl_client/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/ssl_client/stdafx.cpp rename to lib_acl_cpp/samples/ssl/ssl_client/stdafx.cpp diff --git a/lib_acl_cpp/samples/ssl_server/stdafx.h b/lib_acl_cpp/samples/ssl/ssl_client/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/ssl_server/stdafx.h rename to lib_acl_cpp/samples/ssl/ssl_client/stdafx.h diff --git a/lib_acl_cpp/samples/ssl_client/valgrind.sh b/lib_acl_cpp/samples/ssl/ssl_client/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/ssl_client/valgrind.sh rename to lib_acl_cpp/samples/ssl/ssl_client/valgrind.sh diff --git a/lib_acl_cpp/samples/ssl/ssl_client2/Makefile b/lib_acl_cpp/samples/ssl/ssl_client2/Makefile new file mode 100644 index 000000000..6a6eb8936 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_client2/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = ssl_client +EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/ssl/ssl_client2/ssl_client.cpp b/lib_acl_cpp/samples/ssl/ssl_client2/ssl_client.cpp new file mode 100644 index 000000000..496358457 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_client2/ssl_client.cpp @@ -0,0 +1,116 @@ +// ssl_client.cpp : ¶¨Òå¿ØÖÆ̨ӦÓóÌÐòµÄÈë¿Úµã¡£ +// + +#include "stdafx.h" +#include +#include "lib_acl.h" +#include "acl_cpp/acl_cpp_init.hpp" +#include "acl_cpp/http/http_header.hpp" +#include "acl_cpp/stdlib/string.hpp" +#include "acl_cpp/stream/socket_stream.hpp" +#include "acl_cpp/stream/polarssl_io.hpp" +#include "acl_cpp/stream/polarssl_conf.hpp" +#include "acl_cpp/http/http_client.hpp" + +static acl::polarssl_conf __ssl_conf; + +static bool test(const char* addr, int k, int nloop) +{ + acl::socket_stream client; + if (client.open(addr, 60, 60) == false) + { + std::cout << "connect " << addr << " error!" << std::endl; + return false; + } + + acl::polarssl_io* ssl = new acl::polarssl_io(__ssl_conf, false); + if (client.setup_hook(ssl) == ssl) + { + std::cout << "open ssl " << addr << " error!" << std::endl; + ssl->destroy(); + return false; + } + + std::cout << "ssl handshake ok, k: " << k << std::endl; + + for (int i = 0 ; i < nloop; i++) + { + char line[1024]; + memset(line, 'x', sizeof(line)); + line[1023] = 0; + line[1022] = '\n'; + if (client.write(line, strlen(line)) == -1) + { + std::cout << "write to " << addr << " error!" << std::endl; + return false; + } + + size_t n = sizeof(line); + if (client.gets(line, &n) == false) + { + std::cout << "gets from " << addr << " error!" + << acl_last_serror() << std::endl; + return false; + } + if (i < 1 && k < 10) + std::cout << ">>gets(" << n << "): " << line << std::endl; + if (i > 0 && i % 1000 == 0) + { + char buf[256]; + snprintf(buf, sizeof(buf), "write count: %d", i); + ACL_METER_TIME(buf); + } + } + + return true; +} + +static void usage(const char* procname) +{ + printf("usage: %s -h[help]\r\n" + "-s server_addr[default: 127.0.0.1:9001]\r\n" + "-c max_connections[default: 10]\r\n" + "-n max_loop_per_connection[default: 10]\r\n", procname); +} + +int main(int argc, char* argv[]) +{ + int ch, max_loop = 10, max_connections = 10; + acl::string addr("127.0.0.1:9001"); + + acl::acl_cpp_init(); + + while ((ch = getopt(argc, argv, "hs:n:c:")) > 0) + { + switch (ch) + { + case 'h': + usage(argv[0]); + return 0; + case 's': + addr = optarg; + break; + case 'n': + max_loop = atoi(optarg); + break; + case 'c': + max_connections = atoi(optarg); + break; + default: + break; + } + } + + if (max_connections <= 0) + max_connections = 100; + + for (int i = 0; i < max_connections; i++) + { + if (test(addr, i, max_loop) == false) + break; + } + + printf("Over, enter any key to exit!\n"); + getchar(); + return (0); +} diff --git a/lib_acl_cpp/samples/ssl/ssl_client2/stdafx.cpp b/lib_acl_cpp/samples/ssl/ssl_client2/stdafx.cpp new file mode 100644 index 000000000..4f72192c9 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_client2/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : Ö»°üÀ¨±ê×¼°üº¬ÎļþµÄÔ´Îļþ +// ssl_client.pch ½«³ÉΪԤ±àÒëÍ· +// stdafx.obj ½«°üº¬Ô¤±àÒëÀàÐÍÐÅÏ¢ + +#include "stdafx.h" + +// TODO: ÔÚ STDAFX.H ÖÐ +//ÒýÓÃÈκÎËùÐèµÄ¸½¼ÓÍ·Îļþ£¬¶ø²»ÊÇÔÚ´ËÎļþÖÐÒýÓà diff --git a/lib_acl_cpp/samples/ssl_client/stdafx.h b/lib_acl_cpp/samples/ssl/ssl_client2/stdafx.h similarity index 100% rename from lib_acl_cpp/samples/ssl_client/stdafx.h rename to lib_acl_cpp/samples/ssl/ssl_client2/stdafx.h diff --git a/lib_acl_cpp/samples/ssl/ssl_client2/valgrind.sh b/lib_acl_cpp/samples/ssl/ssl_client2/valgrind.sh new file mode 100644 index 000000000..9764d32c9 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_client2/valgrind.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./ssl_client diff --git a/lib_acl_cpp/samples/ssl/ssl_server/Makefile b/lib_acl_cpp/samples/ssl/ssl_server/Makefile new file mode 100644 index 000000000..379a37e35 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = ssl_server +EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/ssl_server/ReadMe.txt b/lib_acl_cpp/samples/ssl/ssl_server/ReadMe.txt similarity index 100% rename from lib_acl_cpp/samples/ssl_server/ReadMe.txt rename to lib_acl_cpp/samples/ssl/ssl_server/ReadMe.txt diff --git a/lib_acl_cpp/samples/ssl_server/ssl_server.cpp b/lib_acl_cpp/samples/ssl/ssl_server/ssl_server.cpp similarity index 100% rename from lib_acl_cpp/samples/ssl_server/ssl_server.cpp rename to lib_acl_cpp/samples/ssl/ssl_server/ssl_server.cpp diff --git a/lib_acl_cpp/samples/ssl_server/ssl_server.vcproj b/lib_acl_cpp/samples/ssl/ssl_server/ssl_server.vcproj similarity index 88% rename from lib_acl_cpp/samples/ssl_server/ssl_server.vcproj rename to lib_acl_cpp/samples/ssl/ssl_server/ssl_server.vcproj index e220c6b3b..522acfdba 100644 --- a/lib_acl_cpp/samples/ssl_server/ssl_server.vcproj +++ b/lib_acl_cpp/samples/ssl/ssl_server/ssl_server.vcproj @@ -19,7 +19,7 @@ @@ -41,7 +41,7 @@ - - diff --git a/lib_acl_cpp/samples/ssl_server/ssl_server_vc2012.vcxproj b/lib_acl_cpp/samples/ssl/ssl_server/ssl_server_vc2012.vcxproj similarity index 88% rename from lib_acl_cpp/samples/ssl_server/ssl_server_vc2012.vcxproj rename to lib_acl_cpp/samples/ssl/ssl_server/ssl_server_vc2012.vcxproj index b5b89430e..efa338001 100644 --- a/lib_acl_cpp/samples/ssl_server/ssl_server_vc2012.vcxproj +++ b/lib_acl_cpp/samples/ssl/ssl_server/ssl_server_vc2012.vcxproj @@ -90,7 +90,7 @@ Disabled - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;HAS_POLARSSL;%(PreprocessorDefinitions) true EnableFastChecks @@ -102,7 +102,7 @@ ws2_32.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;lib_acl_cpp_vc2012d.lib;polarssl.lib;%(AdditionalDependencies) $(OutDir)ssl_server.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) libcmt;libc;%(IgnoreSpecificDefaultLibraries) true $(OutDir)ssl_server.pdb @@ -114,7 +114,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded Use @@ -124,7 +124,7 @@ polarssl.lib;%(AdditionalDependencies) $(OutDir)ssl_server.exe - ..\..\..\lib\win32;..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories) libc;%(IgnoreSpecificDefaultLibraries) true Console @@ -138,7 +138,7 @@ Disabled - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;VC2003;ACL_DLL;ACL_CPP_DLL;%(PreprocessorDefinitions) true EnableFastChecks @@ -149,7 +149,7 @@ $(OutDir)ssl_server.exe - ..\..\..\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;%(AdditionalLibraryDirectories) libcmt;%(IgnoreSpecificDefaultLibraries) true $(OutDir)ssl_server.pdb @@ -161,7 +161,7 @@ - ..\..\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;VC2003;ACL_DLL;ACL_CPP_DLL;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -170,7 +170,7 @@ $(OutDir)ssl_server.exe - ..\..\..\lib\win32;%(AdditionalLibraryDirectories) + ..\..\..\..\lib\win32;%(AdditionalLibraryDirectories) true Console true @@ -198,4 +198,4 @@ - \ No newline at end of file + diff --git a/lib_acl_cpp/samples/ssl_server/ssl_server_vc2012.vcxproj.filters b/lib_acl_cpp/samples/ssl/ssl_server/ssl_server_vc2012.vcxproj.filters similarity index 100% rename from lib_acl_cpp/samples/ssl_server/ssl_server_vc2012.vcxproj.filters rename to lib_acl_cpp/samples/ssl/ssl_server/ssl_server_vc2012.vcxproj.filters diff --git a/lib_acl_cpp/samples/ssl_server/stdafx.cpp b/lib_acl_cpp/samples/ssl/ssl_server/stdafx.cpp similarity index 100% rename from lib_acl_cpp/samples/ssl_server/stdafx.cpp rename to lib_acl_cpp/samples/ssl/ssl_server/stdafx.cpp diff --git a/lib_acl_cpp/samples/ssl/ssl_server/stdafx.h b/lib_acl_cpp/samples/ssl/ssl_server/stdafx.h new file mode 100644 index 000000000..e8f69fba1 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server/stdafx.h @@ -0,0 +1,10 @@ +// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬ +// »òÊdz£Óõ«²»³£¸ü¸ÄµÄÏîÄ¿Ìض¨µÄ°üº¬Îļþ +// + +#pragma once + + +#include + +// TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÒªÇóµÄ¸½¼ÓÍ·Îļþ diff --git a/lib_acl_cpp/samples/ssl_server/valgrind.sh b/lib_acl_cpp/samples/ssl/ssl_server/valgrind.sh similarity index 100% rename from lib_acl_cpp/samples/ssl_server/valgrind.sh rename to lib_acl_cpp/samples/ssl/ssl_server/valgrind.sh diff --git a/lib_acl_cpp/samples/ssl/ssl_server2/Makefile b/lib_acl_cpp/samples/ssl/ssl_server2/Makefile new file mode 100644 index 000000000..379a37e35 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/Makefile @@ -0,0 +1,4 @@ +base_path = ../../.. +include ../../Makefile.in +PROG = ssl_server +EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/ssl/ssl_server2/main.cpp b/lib_acl_cpp/samples/ssl/ssl_server2/main.cpp new file mode 100644 index 000000000..41bd43f3e --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/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 = ":9001"; + printf("listen on: %s\r\n", addr); + if (argc >= 3) + ms.run_alone(addr, argv[2], 0, 1); // µ¥¶ÀÔËÐз½Ê½ + else + ms.run_alone(addr, NULL, 0, 1); // µ¥¶ÀÔËÐз½Ê½ + + 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/ssl/ssl_server2/master_service.cpp b/lib_acl_cpp/samples/ssl/ssl_server2/master_service.cpp new file mode 100644 index 000000000..d7bc5ba9a --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/master_service.cpp @@ -0,0 +1,196 @@ +#include "stdafx.h" +#include "master_service.h" + +//////////////////////////////////////////////////////////////////////////////// +// ÅäÖÃÄÚÈÝÏî + +char *var_cfg_crt_file; +char *var_cfg_key_file; +acl::master_str_tbl var_conf_str_tab[] = { + { "crt_file", "./mm263com1.crt", &var_cfg_crt_file }, + { "key_file", "./mm263com.key", &var_cfg_key_file }, + + { 0, 0, 0 } +}; + +int var_cfg_session_cache; +acl::master_bool_tbl var_conf_bool_tab[] = { + { "session_cache", 1, &var_cfg_session_cache }, + + { 0, 0, 0 } +}; + +int var_cfg_io_timeout; +acl::master_int_tbl var_conf_int_tab[] = { + { "io_timeout", 60, &var_cfg_io_timeout, 0, 0 }, + + { 0, 0 , 0 , 0, 0 } +}; + +acl::master_int64_tbl var_conf_int64_tab[] = { + + { 0, 0 , 0 , 0, 0 } +}; + +//////////////////////////////////////////////////////////////////////////////// + +master_service::master_service() +: conf_(NULL) +{ +} + +master_service::~master_service() +{ + if (conf_) + delete conf_; +} + +static acl::polarssl_io* setup_ssl(acl::socket_stream& conn, + acl::polarssl_conf& conf) +{ + acl::polarssl_io* hook = (acl::polarssl_io*) conn.get_hook(); + if (hook != NULL) + return hook; + + // ¶ÔÓÚʹÓà SSL ·½Ê½µÄÁ÷¶ÔÏó£¬ÐèÒª½« SSL IO Á÷¶ÔÏó×¢²áÖÁÍøÂç + // Á¬½ÓÁ÷¶ÔÏóÖУ¬¼´Óà ssl io Ìæ»» stream ÖÐĬÈϵĵײã IO ¹ý³Ì + + //logger("begin setup ssl hook..."); + + // ²ÉÓ÷Ç×èÈû SSL ÎÕÊÖ·½Ê½ + acl::polarssl_io* ssl = new acl::polarssl_io(conf, true, true); + if (conn.setup_hook(ssl) == ssl) + { + logger_error("setup_hook error!"); + ssl->destroy(); + return NULL; + } + + //logger("setup hook ok, tid: %lu", acl::thread::thread_self()); + return ssl; +} + +static bool do_run(acl::socket_stream& conn, acl::polarssl_io*) +{ + acl::string* buf =(acl::string*) conn.get_ctx(); + + // ·Ç×èÈûģʽ¶ÁÈ¡Ò»ÐУ¬¸Ã·Ç×èÈû¶Á·½Ê½ÊÇÓÉ polarssl_io ÀàµÄµ×²ã + // IO ¹ý³Ì±£Õ쵀 + if (conn.gets_peek(buf, false) == false) + { + if (conn.eof()) + return false; + else + return true; + } + + // ×èÈûģʽ»ØдÊý¾Ý£¬ÒòΪ¸ÃÌ×½Ó×Ö²¢Î´ÉèÖÃΪ·Ç×èÈûģʽ£¬ËùÒÔдµÄ¹ý³Ì + // »¹ÊÇ×èÈûµÄ + if (conn.write(*buf) == -1) + { + logger("write error!"); + return false; + } + + buf->clear(); + return true; +} + +bool master_service::thread_on_read(acl::socket_stream* conn) +{ + if (conf_ == NULL) + return do_run(*conn, NULL); + + acl::polarssl_io* ssl = setup_ssl(*conn, *conf_); + if (ssl == NULL) + return false; + + if (ssl->handshake() == false) + { + logger_error("ssl handshake failed"); + return false; + } + + if (ssl->handshake_ok() == false) + { + //logger("handshake trying again..."); + return true; + } + + //logger("handshake_ok"); + + return do_run(*conn, ssl); +} + +bool master_service::thread_on_accept(acl::socket_stream* conn) +{ + //logger("connect from %s, fd: %d, timeout: %d", conn->get_peer(true), + // conn->sock_handle(), conn->get_rw_timeout()); + + acl::string* buf = new acl::string(128); + conn->set_ctx(buf); + conn->set_rw_timeout(var_cfg_io_timeout); + + 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()); + acl::string* buf = (acl::string*) conn->get_ctx(); + delete buf; +} + +void master_service::thread_on_init() +{ +} + +void master_service::thread_on_exit() +{ +} + +void master_service::proc_on_init() +{ + if (var_cfg_crt_file == NULL || *var_cfg_crt_file == 0 + || var_cfg_key_file == NULL || *var_cfg_key_file == 0) + { + return; + } + + conf_ = new acl::polarssl_conf(); + + // ÔÊÐí·þÎñ¶ËµÄ SSL »á»°»º´æ¹¦ÄÜ + conf_->enable_cache(var_cfg_session_cache); + + // Ìí¼Ó±¾µØ·þÎñµÄÖ¤Êé + if (conf_->add_cert(var_cfg_crt_file) == false) + { + logger_error("add cert failed, crt: %s, key: %s", + var_cfg_crt_file, var_cfg_key_file); + delete conf_; + conf_ = NULL; + return; + } + logger("load cert ok, crt: %s, key: %s", + var_cfg_crt_file, var_cfg_key_file); + + // Ìí¼Ó±¾µØ·þÎñÃÜÔ¿ + if (conf_->set_key(var_cfg_key_file) == false) + { + logger_error("set private key error"); + delete conf_; + conf_ = NULL; + } +} + +void master_service::proc_on_exit() +{ +} diff --git a/lib_acl_cpp/samples/ssl/ssl_server2/master_service.h b/lib_acl_cpp/samples/ssl/ssl_server2/master_service.h new file mode 100644 index 000000000..e69fe1026 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/master_service.h @@ -0,0 +1,84 @@ +#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: + /** + * ´¿Ð麯Êý£ºµ±Ä³¸ö¿Í»§¶ËÁ¬½ÓÓÐÊý¾Ý¿É¶Á»ò¹Ø±Õ»ò³ö´íʱµ÷Óô˺¯Êý + * @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); + + /** + * µ±Ä³¸öÍøÂçÁ¬½ÓµÄ 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(); + +private: + acl::polarssl_conf* conf_; +}; diff --git a/lib_acl_cpp/samples/ssl/ssl_server2/ssl_server.cf b/lib_acl_cpp/samples/ssl/ssl_server2/ssl_server.cf new file mode 100644 index 000000000..1022632ad --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/ssl_server.cf @@ -0,0 +1,118 @@ + +service http_server { +# ½ø³ÌÊÇ·ñ½ûÖ¹ÔËÐÐ + 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 = 1443 + +# ·þÎñ¼àÌýΪÓòÌ×½Ó¿Ú +# 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Ôò±íʾ´ò¿ª´Ë¹¦ÄÜ +# ²¢ÇÒ´ËÖµ´ú±íÑÓ³Ù½ÓÊÜÁ¬½ÓµÄ³¬Ê±Öµ£¬³¬¹ý´ËֵʱÈç¹û¿Í»§¶ËÒÀȻûÓз¢À´Êý¾Ý£¬Ôò²Ù×÷ +# ϵͳ»áÔÚϵͳ²ãÖ±½Ó¹Ø±Õ¸ÃÁ¬½Ó +# 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 = 1 +# ½ø³Ì³ÌÐòÃû + master_command = ssl_server +# ½ø³ÌÈÕÖ¾¼Ç¼Îļþ + master_log = {install_path}/var/log/ssl_server +# µ÷ÊÔÈÕÖ¾·½Ê½£¬¸ñʽ£º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 +# ÔÚ²¢·¢·ÃÎÊÁ¿·Ç³£µÍµÄÇé¿öÏ£¬Èç·ÃÎÊÁ¿ÔÚ 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 = 1 +# Ï̳߳ØÖй¤×÷Ï̵߳ȴýÈÎÎñʱ¼ä¼ä¸ô(ºÁÃë) +# ioctl_schedule_wait = 50 +# Ïß³ÌÈÎÎñµ÷¶ÈµÄʱ¼ä¼ä¸ô´óÓÚ´ËÖµ(ºÁÃë)ºó¼Ç¾¯¸æÈÕÖ¾ +# ioctl_schedule_warn = 100 +# Ï̴߳¦ÀíÈÎÎñÓµ¶ÂÊý³¬¹ý´Ë·§Öµºó¼Ç¾¯¸æÈÕÖ¾£¬ÉèΪ 0 ÔòÄÚ²¿Ö»Óе±Óµ¶ÂÈÎÎñÊý³¬¹ý×ÜÏß³ÌÊýµÄ 10 ±¶Ê±²Å±¨¾¯ +# ioctl_qlen_warn = 0 +# Ï̵߳ĶÑÕ»¿Õ¼ä´óС£¬µ¥Î»Îª×Ö½Ú£¬0±íʾʹÓÃϵͳȱʡֵ + ioctl_stacksize = 0 +# ÔÊÐí·ÃÎÊ udserver µÄ¿Í»§¶ËIPµØÖ··¶Î§ + ioctl_access_allow = all + +# µ± acl_master Í˳öʱ£¬Èç¹û¸ÃÖµÖÃ1Ôò¸Ã³ÌÐò²»µÈËùÓÐÁ¬½Ó´¦ÀíÍê±Ï±ãÁ¢¼´Í˳ö + ioctl_quick_abort = 1 + +############################################################################ +# Ó¦ÓÃ×Ô¼ºµÄÅäÖÃÑ¡Ïî + +# crt_file = {install_path}/conf/ssl/imap.crt +# key_file = {install_path}/conf/ssl/imap.key + crt_file = imap.crt + key_file = imap.key +} + diff --git a/lib_acl_cpp/samples/ssl/ssl_server2/stdafx.cpp b/lib_acl_cpp/samples/ssl/ssl_server2/stdafx.cpp new file mode 100644 index 000000000..f01a2ff42 --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/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/ssl/ssl_server2/stdafx.h b/lib_acl_cpp/samples/ssl/ssl_server2/stdafx.h new file mode 100644 index 000000000..88376f8ad --- /dev/null +++ b/lib_acl_cpp/samples/ssl/ssl_server2/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/ssl_aio_client/Makefile b/lib_acl_cpp/samples/ssl_aio_client/Makefile deleted file mode 100644 index 11caecd2b..000000000 --- a/lib_acl_cpp/samples/ssl_aio_client/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -include ../Makefile.in -PROG = ssl_aio_client -EXTLIBS += -lpolarssl diff --git a/lib_acl_cpp/samples/ssl_client/Makefile b/lib_acl_cpp/samples/ssl_client/Makefile deleted file mode 100644 index 3e47c5ba6..000000000 --- a/lib_acl_cpp/samples/ssl_client/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -include ../Makefile.in -PROG = ssl_client -EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/samples/ssl_server/Makefile b/lib_acl_cpp/samples/ssl_server/Makefile deleted file mode 100644 index 150806aeb..000000000 --- a/lib_acl_cpp/samples/ssl_server/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -include ../Makefile.in -PROG = ssl_server -EXTLIBS += -lpolarssl -lz diff --git a/lib_acl_cpp/src/stream/istream.cpp b/lib_acl_cpp/src/stream/istream.cpp index a0c335757..26570f52a 100644 --- a/lib_acl_cpp/src/stream/istream.cpp +++ b/lib_acl_cpp/src/stream/istream.cpp @@ -224,7 +224,17 @@ bool istream::gets_peek(string& buf, bool nonl /* = true */, else ret = acl_vstream_gets_peek(stream_, vbf, &ready); if (ret == ACL_VSTREAM_EOF) - eof_ = true; + { +#if ACL_EWOULDBLOCK == ACL_EAGAIN + if (stream_->errnum != ACL_EWOULDBLOCK) +#else + if (stream_->errnum != ACL_EWOULDBLOCK + && stream_->errnum != ACL_EAGAIN) +#endif + { + eof_ = true; + } + } return ready ? true : false; } @@ -242,7 +252,15 @@ bool istream::read_peek(string& buf, bool clear /* = false */) if (acl_vstream_read_peek(stream_, buf.vstring()) == ACL_VSTREAM_EOF) { - eof_ = true; +#if ACL_EWOULDBLOCK == ACL_EAGAIN + if (stream_->errnum != ACL_EWOULDBLOCK) +#else + if (stream_->errnum != ACL_EWOULDBLOCK + && stream_->errnum != ACL_EAGAIN) +#endif + { + eof_ = true; + } return false; } else @@ -264,7 +282,15 @@ bool istream::readn_peek(string& buf, size_t cnt, bool clear /* = false */) if (acl_vstream_readn_peek(stream_, buf.vstring(), (int) cnt, &ready) == ACL_VSTREAM_EOF) { - eof_ = true; +#if ACL_EWOULDBLOCK == ACL_EAGAIN + if (stream_->errnum != ACL_EWOULDBLOCK) +#else + if (stream_->errnum != ACL_EWOULDBLOCK + && stream_->errnum != ACL_EAGAIN) +#endif + { + eof_ = true; + } } return ready ? true : false; } diff --git a/lib_acl_cpp/src/stream/polarssl_io.cpp b/lib_acl_cpp/src/stream/polarssl_io.cpp index 838cef149..2a6c4c3c3 100644 --- a/lib_acl_cpp/src/stream/polarssl_io.cpp +++ b/lib_acl_cpp/src/stream/polarssl_io.cpp @@ -76,6 +76,15 @@ static void my_debug( void *ctx, int level acl_unused, const char *str ) } #endif +polarssl_io& polarssl_io::set_non_blocking(bool yes) +{ + // ´Ë´¦½öÉèÖ÷Ç×èÈû IO ±ê־룬ÖÁÓÚÌ×½Ó×ÖÊÇ·ñ±»ÉèÖÃÁË·Ç×èÈûģʽ + // ÓÉÓ¦ÓÃ×Ô¼ºÀ´¾ö¶¨ + + non_block_ = yes; + return *this; +} + bool polarssl_io::open(ACL_VSTREAM* s) { if (s == NULL) @@ -331,11 +340,47 @@ int polarssl_io::sock_read(void *ctx, unsigned char *buf, size_t len) { #ifdef HAS_POLARSSL polarssl_io* io = (polarssl_io*) ctx; - int ret, timeout = 120; ACL_VSTREAM* vs = io->stream_; ACL_SOCKET fd = ACL_VSTREAM_SOCK(vs); - ret = acl_socket_read(fd, buf, len, timeout, vs, NULL); + //logger(">>>non_block: %s, sys_ready: %s", + // io->non_block_ ? "yes" : "no", + // vs->sys_read_ready ? "yes":"no"); + + // ·Ç×èÈûģʽÏ£¬Èç¹û sys_read_ready ±ê־λΪ 0£¬Ôò˵Ã÷ÓпÉÄÜ + // ±¾´Î IO ½«¶Á²»µ½Êý¾Ý£¬ÎªÁË·ÀÖ¹¸Ã¶Á¹ý³Ì±»×èÈû£¬ËùÒÔ´Ë´¦Ö±½Ó + // ·µ»Ø¸ø polarssl ²¢¸æÖ®µÈ´ýÏ´ζÁ£¬Ï´ζÁ²Ù×÷½«ÓÉʼþÒýÇæ´¥·¢£¬ + // ÕâÑù×öµÄÓŵãÊÇÔÚ·Ç×èÈûģʽϼ´Ê¹Ì×½Ó×ÖûÓÐÉèÖÃΪ·Ç×èÈû״̬ + // Ò²²»»á×èÈûỊ̈߳¬µ«È±µãÊÇÔö¼ÓÁËʼþÑ­»·´¥·¢µÄ´ÎÊý + if (io->non_block_ && vs->sys_read_ready == 0) + { + int ret = acl_readable(fd); + if (ret == -1) + return POLARSSL_ERR_NET_RECV_FAILED; + else if (ret == 0) + { + // ±ØÐëÔÚ´Ë´¦ÉèÖÃϵͳµÄ errno ºÅ£¬´Ë´¦ÊÇÄ£ÄâÁË + // ·Ç×èÈû¶Á¹ý³Ì + acl_set_error(ACL_EWOULDBLOCK); + return POLARSSL_ERR_NET_WANT_READ; + } + // else: ret == 1 + } + + // µ±Ê¼þÒýÇæÉèÖÃÁËÌ×½Ó×ֿɶÁµÄ״̬ʱ£¬³¬Ê±µÈ´ýΪ 0 Ãë + + int timeout; + if (vs->sys_read_ready) + timeout = 0; + else + timeout = vs->rw_timeout; + + int ret = acl_socket_read(fd, buf, len, timeout, vs, NULL); + + // Ð뽫¸Ã±ê־λÖà 0£¬ÕâÑùÔÚ·Ç×èÈûģʽÏ£¬Èç¹û polarssl ÔÚÖظ´ + // µ÷Óà sock_read º¯Êýʱ£¬¿ÉÒÔÔÚÇ°ÃæÌáÇ°·µ»ØÒÔÃâ×èÈûÔÚ IO ¶Á¹ý³Ì + vs->sys_read_ready = 0; + if (ret < 0) { int errnum = acl_last_error(); @@ -368,11 +413,11 @@ int polarssl_io::sock_send(void *ctx, const unsigned char *buf, size_t len) { #ifdef HAS_POLARSSL polarssl_io* io = (polarssl_io*) ctx; - int ret, timeout = 120; ACL_VSTREAM* vs = io->stream_; - ACL_SOCKET fd = ACL_VSTREAM_SOCK(vs); - ret = acl_socket_write(fd, buf, len, timeout, vs, NULL); + // µ±Îª·Ç×èÈûģʽʱ£¬³¬Ê±µÈ´ýΪ 0 Ãë + int ret = acl_socket_write(ACL_VSTREAM_SOCK(vs), buf, len, + io->non_block_ ? 0 : vs->rw_timeout, vs, NULL); if (ret < 0) { int errnum = acl_last_error();