| 1578 | } |
| 1579 | |
| 1580 | static void |
| 1581 | loadHandlerConf(const char *file_name, Utils::KeyValueMap &handler_conf) |
| 1582 | { |
| 1583 | std::list<string> conf_lines; |
| 1584 | TSFile conf_file = TSfopen(file_name, "r"); |
| 1585 | if (conf_file != nullptr) { |
| 1586 | char buf[1024]; |
| 1587 | while (TSfgets(conf_file, buf, sizeof(buf) - 1) != nullptr) { |
| 1588 | conf_lines.push_back(string(buf)); |
| 1589 | } |
| 1590 | TSfclose(conf_file); |
| 1591 | Utils::parseKeyValueConfig(conf_lines, handler_conf, gAllowlistCookies); |
| 1592 | Dbg(dbg_ctl_local, "[%s] Loaded handler conf file [%s]", __FUNCTION__, file_name); |
| 1593 | } else { |
| 1594 | TSError("[esi][%s] Failed to open handler config file [%s]", __FUNCTION__, file_name); |
| 1595 | } |
| 1596 | } |
| 1597 | |
| 1598 | static int |
| 1599 | esiPluginInit(int argc, const char *argv[], OptionInfo *pOptionInfo) |