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

Function main

lib_fiber/samples-c++/https_client/main.cpp:118–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118int main(int argc, char *argv[])
119{
120 int ch;
121 char addr[256];
122#ifdef __APPLE__
123 //acl::string libpath("../libmbedcrypto.dylib;../libmbedx509.dylib;../libmbedtls.dylib");
124 acl::string libpath("/usr/local/lib/libcrypto.dylib; /usr/local/lib/libssl.dylib");
125#else
126 //acl::string libpath("../libmbedcrypto.so;../libmbedx509.so;../libmbedtls.so");
127 acl::string libpath("/usr/local/lib64/libcrypto.so; /usr/local/lib/libssl.so");
128#endif
129
130 acl_msg_stdout_enable(1);
131
132 snprintf(addr, sizeof(addr), "%s", "0.0.0.0:9001");
133
134 while ((ch = getopt(argc, argv, "hc:n:s:t:r:l:H:")) > 0) {
135 switch (ch) {
136 case 'h':
137 usage(argv[0]);
138 return 0;
139 case 'c':
140 __max_fibers = atoi(optarg);
141 __left_fibers = __max_fibers;
142 break;
143 case 't':
144 __conn_timeout = atoi(optarg);
145 break;
146 case 'r':
147 __rw_timeout = atoi(optarg);
148 break;
149 case 'n':
150 __max_loop = atoi(optarg);
151 break;
152 case 's':
153 snprintf(addr, sizeof(addr), "%s", optarg);
154 break;
155 case 'l':
156 libpath = optarg;
157 break;
158 case 'H':
159 __host = optarg;
160 break;
161 default:
162 break;
163 }
164 }
165
166 gettimeofday(&__begin, NULL);
167
168 if (libpath.find("mbedtls") != NULL) {
169 const std::vector<acl::string>& libs = libpath.split2("; \t");
170 if (libs.size() != 3) {
171 printf("invalid libpath=%s\r\n", libpath.c_str());
172 return 1;
173 }
174 acl::mbedtls_conf::set_libpath(libs[0], libs[1], libs[2]);
175 if (!acl::mbedtls_conf::load()) {

Callers

nothing calls this directly

Calls 9

acl_msg_stdout_enableFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50
gettimeofdayFunction · 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…