mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 10:38:53 +08:00
nghttpd: Fix multiple push configuration does not work
This commit is contained in:
@@ -49,15 +49,15 @@ namespace nghttp2 {
|
||||
|
||||
namespace {
|
||||
int parse_push_config(Config &config, const char *optarg) {
|
||||
const char *eq = strchr(optarg, '=');
|
||||
const auto eq = strchr(optarg, '=');
|
||||
if (eq == NULL) {
|
||||
return -1;
|
||||
}
|
||||
auto paths = std::vector<std::string>();
|
||||
auto &paths = config.push[std::string(optarg, eq)];
|
||||
auto optarg_end = optarg + strlen(optarg);
|
||||
const char *i = eq + 1;
|
||||
auto i = eq + 1;
|
||||
for (;;) {
|
||||
const char *j = strchr(i, ',');
|
||||
auto j = strchr(i, ',');
|
||||
if (j == NULL) {
|
||||
j = optarg_end;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ int parse_push_config(Config &config, const char *optarg) {
|
||||
i = j;
|
||||
++i;
|
||||
}
|
||||
config.push[std::string(optarg, eq)] = std::move(paths);
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user