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

Function acl_fiber_server_main

lib_fiber/cpp/src/fiber_server.cpp:1111–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1109}
1110
1111void 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);

Callers 1

runMethod · 0.70

Calls 15

acl_safe_basenameFunction · 0.85
master_log_openFunction · 0.85
winapi_hookFunction · 0.85
acl_msg_infoFunction · 0.85
acl_msg_errorFunction · 0.85
acl_last_serrorFunction · 0.85
acl_app_conf_loadFunction · 0.85
acl_alldigFunction · 0.85
acl_msg_fatalFunction · 0.85
acl_chroot_uidFunction · 0.85
acl_set_core_limitFunction · 0.85
hook_fiber_logFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…