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

Function main

lib_acl_cpp/samples/ssl/https_request/main.cpp:22–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22int main(int argc, char* argv[])
23{
24 int ch, cocurrent = 1, count = 10;
25 bool use_ssl = false;
26 acl::string server_addr("127.0.0.1:1443"), host;
27 acl::string libpath;
28 acl::string url("/");
29
30 acl::acl_cpp_init();
31 acl::log::stdout_open(true);
32
33 while ((ch = getopt(argc, argv, "hf:s:c:n:SH:U:D")) > 0) {
34 switch (ch) {
35 case 'h':
36 usage(argv[0]);
37 return 0;
38 case 'f':
39 libpath = optarg;
40 break;
41 case 'c':
42 cocurrent = atoi(optarg);
43 break;
44 case 'n':
45 count = atoi(optarg);
46 break;
47 case 's':
48 server_addr = optarg;
49 break;
50 case 'S':
51 use_ssl = true;
52 break;
53 case 'H':
54 host = optarg;
55 break;
56 case 'U':
57 url = optarg;
58 break;
59 case 'D':
60 __debug = true;
61 break;
62 default:
63 break;
64 }
65 }
66
67 acl::sslbase_conf* ssl_conf = NULL;
68 if (libpath.find("mbedtls")) {
69 acl::mbedtls_conf::set_libpath(libpath.c_str());
70 ssl_conf = new acl::mbedtls_conf(false);
71 if (!acl::mbedtls_conf::load()) {
72 printf("load %s error\r\n", libpath.c_str());
73 return 1;
74 }
75 } else if (libpath.find("polarssl")) {
76 acl::polarssl_conf::set_libpath(libpath);
77 ssl_conf = new acl::polarssl_conf;
78 if (!acl::polarssl_conf::load()) {
79 printf("load %s error\r\n", libpath.c_str());

Callers

nothing calls this directly

Calls 15

acl_cpp_initFunction · 0.85
beginMethod · 0.80
thread_idMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
gettimeofdayFunction · 0.50
stamp_subFunction · 0.50
findMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…