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

Function main

lib_acl_cpp/samples/aio/http_aclient_ssl/main.cpp:467–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467int main(int argc, char* argv[])
468{
469 acl::sslbase_conf* ssl_conf = NULL;
470 int ch, conn_timeout = 5, rw_timeout = 5;
471 std::vector<acl::string> name_servers;
472 acl::string addr("127.0.0.1:80");
473 acl::string host("www.baidu.com"), url("/"), ssl_path;
474 bool enable_gzip = false, keep_alive = false, debug = false;
475 bool ws_enable = false, enable_unzip = false;
476
477 while ((ch = getopt(argc, argv, "hs:S:N:H:L:t:i:ZUKDW")) > 0) {
478 switch (ch) {
479 case 'h':
480 usage(argv[0]);
481 return (0);
482 case 's':
483 addr = optarg;
484 break;
485 case 'S':
486 ssl_path = optarg;
487 break;
488 case 'L':
489 url = optarg;
490 break;
491 case 'N':
492 add_dns(name_servers, optarg);
493 break;
494 case 'H':
495 host = optarg;
496 break;
497 case 't':
498 conn_timeout = atoi(optarg);
499 break;
500 case 'i':
501 rw_timeout = atoi(optarg);
502 break;
503 case 'Z':
504 enable_gzip = true;
505 break;
506 case 'U':
507 enable_unzip = true;
508 break;
509 case 'K':
510 keep_alive = true;
511 break;
512 case 'D':
513 debug = true;
514 break;
515 case 'W':
516 ws_enable = true;
517 break;
518 default:
519 break;
520 }
521 }
522
523 if (name_servers.empty()) {
524 name_servers.push_back("8.8.8.8:53");

Callers

nothing calls this directly

Calls 15

acl_cpp_initFunction · 0.85
acl_sane_socketpairFunction · 0.85
beginMethod · 0.80
set_dnsMethod · 0.80
request_headerMethod · 0.80
set_keep_aliveMethod · 0.80
accept_gzipMethod · 0.80
usageFunction · 0.70
add_dnsFunction · 0.70
getoptFunction · 0.50
last_serrorFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…