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

Function main

lib_fiber/samples-c++/https_server/main.cpp:132–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132int main(int argc, char *argv[])
133{
134 acl::string addr(":9001");
135#ifdef __APPLE__
136 acl::string libpath("/usr/local/lib/libcrypto.dylib; /usr/local/lib/libssl.dylib");
137#else
138 acl::string libpath("/usr/local/lib64/libcrypto.so; /usr/local/lib/libssl.so");
139#endif
140 int ch;
141
142 acl::acl_cpp_init();
143 acl::log::stdout_open(true);
144
145 while ((ch = getopt(argc, argv, "hs:r:c:k:l:S")) > 0) {
146 switch (ch) {
147 case 'h':
148 usage(argv[0]);
149 return 0;
150 case 's':
151 addr = optarg;
152 break;
153 case 'r':
154 __rw_timeout = atoi(optarg);
155 break;
156 case 'c':
157 __ssl_crt = optarg;
158 break;
159 case 'k':
160 __ssl_key = optarg;
161 break;
162 case 'l':
163 libpath = optarg;
164 break;
165 case 'S':
166 __shared_stack =true;
167 break;
168 default:
169 break;
170 }
171 }
172
173 if (libpath.find("mbedtls") != NULL) {
174 const std::vector<acl::string>& libs = libpath.split2("; \t");
175 if (libs.size() != 3) {
176 printf("invalid libpath=%s\r\n", libpath.c_str());
177 return 1;
178 }
179
180 acl::mbedtls_conf::set_libpath(libs[0], libs[1], libs[2]);
181 if (acl::mbedtls_conf::load()) {
182 __ssl_conf = new acl::mbedtls_conf(true);
183 } else {
184 printf("load %s error\r\n", libpath.c_str());
185 return 1;
186 }
187 } else if (libpath.find("polarlssl") != NULL) {
188 acl::polarssl_conf::set_libpath(libpath);
189 if (acl::polarssl_conf::load()) {

Callers

nothing calls this directly

Calls 8

acl_cpp_initFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50
acl_fiber_createFunction · 0.50
acl_fiber_scheduleFunction · 0.50
findMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…