mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-08 02:58:53 +08:00
nghttpd: Fix multiple push configuration does not work
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user