| 116 | } |
| 117 | |
| 118 | int 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()) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…