nghttpd: Fix multiple push configuration does not work
This commit is contained in:
parent
1216d7d912
commit
d4f87ce29f
|
@ -49,15 +49,15 @@ namespace nghttp2 {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
int parse_push_config(Config &config, const char *optarg) {
|
int parse_push_config(Config &config, const char *optarg) {
|
||||||
const char *eq = strchr(optarg, '=');
|
const auto eq = strchr(optarg, '=');
|
||||||
if (eq == NULL) {
|
if (eq == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
auto paths = std::vector<std::string>();
|
auto &paths = config.push[std::string(optarg, eq)];
|
||||||
auto optarg_end = optarg + strlen(optarg);
|
auto optarg_end = optarg + strlen(optarg);
|
||||||
const char *i = eq + 1;
|
auto i = eq + 1;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
const char *j = strchr(i, ',');
|
auto j = strchr(i, ',');
|
||||||
if (j == NULL) {
|
if (j == NULL) {
|
||||||
j = optarg_end;
|
j = optarg_end;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ int parse_push_config(Config &config, const char *optarg) {
|
||||||
i = j;
|
i = j;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
config.push[std::string(optarg, eq)] = std::move(paths);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue