MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/aio/aio_server_ssl/main.cpp:329–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329int main(int argc, char* argv[])
330{
331 // �¼������Ƿ�����ں��еĸ�Чģʽ
332 bool use_kernel = false;
333 acl::string key_file, cert_file;
334 acl::string addr("127.0.0.1:9001"), libssl_path;
335 int ch;
336
337 while ((ch = getopt(argc, argv, "l:hkL:t:K:C:n:S:")) > 0) {
338 switch (ch) {
339 case 'h':
340 usage(argv[0]);
341 return 0;
342 case 'l':
343 addr = optarg;
344 break;
345 case 'k':
346 use_kernel = true;
347 break;
348 case 'L':
349 __max = atoi(optarg);
350 break;
351 case 't':
352 __timeout = atoi(optarg);
353 break;
354 case 'K':
355 key_file = optarg;
356 break;
357 case 'C':
358 cert_file = optarg;
359 break;
360 case 'n':
361 __max_used = atoi(optarg);
362 break;
363 case 'S':
364 libssl_path = optarg;
365 break;
366 default:
367 break;
368 }
369 }
370
371 // ��ʼ��ACL��(��������WIN32��һ��Ҫ���ô˺�������UNIXƽ̨�¿ɲ�����)
372 acl::acl_cpp_init();
373
374 acl::log::stdout_open(true);
375
376 // ��˽Կ��֤�鶼����ʱ�Ų��� SSL ͨ�ŷ�ʽ
377 if (key_file.empty() || cert_file.empty()) {
378 /* do nothing */
379 } else if (libssl_path.find("mbedtls") != NULL) {
380 const std::vector<acl::string>& libs = libssl_path.split2("; \t\r\n");
381 if (libs.size() == 3) {
382 acl::mbedtls_conf::set_libpath(libs[0], libs[1], libs[2]);
383 if (acl::mbedtls_conf::load()) {
384 __ssl_conf = new acl::mbedtls_conf(true);
385 } else {
386 printf("load %s error\r\n", libssl_path.c_str());

Callers

nothing calls this directly

Calls 14

acl_cpp_initFunction · 0.85
add_accept_callbackMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
emptyMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45
enable_cacheMethod · 0.45
add_certMethod · 0.45
set_keyMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…