| 1109 | } |
| 1110 | |
| 1111 | void acl_fiber_server_main(int argc, char *argv[], |
| 1112 | void (*service)(void*, ACL_VSTREAM*), void *ctx, int name, ...) |
| 1113 | { |
| 1114 | const char *myname = __FUNCTION__; |
| 1115 | const char *service_name = acl_safe_basename(argv[0]); |
| 1116 | const char *root_dir = NULL, *user = NULL, *addrs = NULL; |
| 1117 | int c, socket_count = 1, fdtype = ACL_VSTREAM_TYPE_LISTEN; |
| 1118 | #if !defined(_WIN32) && !defined(_WIN64) |
| 1119 | char *generation; |
| 1120 | #endif |
| 1121 | va_list ap; |
| 1122 | |
| 1123 | /* Set up call-back info. */ |
| 1124 | __service = service; |
| 1125 | __service_ctx = ctx; |
| 1126 | __first_name = name; |
| 1127 | |
| 1128 | va_start(ap, name); |
| 1129 | |
| 1130 | #if defined(_WIN32) || defined(_WIN64) |
| 1131 | # if _MSC_VER >= 1911 |
| 1132 | va_copy(__ap_dest, ap); |
| 1133 | # else |
| 1134 | __ap_dest = ap; |
| 1135 | # endif |
| 1136 | #else |
| 1137 | va_copy(__ap_dest, ap); |
| 1138 | master_log_open(argv[0]); |
| 1139 | #endif |
| 1140 | va_end(ap); |
| 1141 | |
| 1142 | __conf_file[0] = 0; |
| 1143 | |
| 1144 | #ifndef __APPLE__ |
| 1145 | # if !defined(_WIN32) && !defined(_WIN64) |
| 1146 | opterr = 0; |
| 1147 | # endif |
| 1148 | optind = 0; |
| 1149 | optarg = 0; |
| 1150 | #endif // __APPLE__ |
| 1151 | |
| 1152 | #if defined(_WIN32) || defined(_WIN64) |
| 1153 | if (winapi_hook()) { |
| 1154 | acl_msg_info("hook Win API ok"); |
| 1155 | } else { |
| 1156 | acl_msg_error("hook Win API error: %s", acl_last_serror()); |
| 1157 | } |
| 1158 | #endif |
| 1159 | |
| 1160 | while ((c = getopt(argc, argv, "Hc:n:s:t:uf:L:")) > 0) { |
| 1161 | switch (c) { |
| 1162 | case 'H': |
| 1163 | usage(argc, argv); |
| 1164 | exit (0); |
| 1165 | case 'f': |
| 1166 | acl_app_conf_load(optarg); |
| 1167 | #if defined(_WIN32) || defined(_WIN64) |
| 1168 | _snprintf(__conf_file, sizeof(__conf_file), "%s", optarg); |
no test coverage detected
searching dependent graphs…