fix: avoid GPN on root path Device. which returns the full parameter tree
Two complementary fixes: - IdleState: skip root-level parent paths (Device., InternetGatewayDevice.) when building the GPN queue. Params like Device.RootDataModelVersion have Device. as parent but sending GPN on Device. with NextLevel=0 returns the entire TR-181 tree in one response (potentially several MB). These root-level params are classified via deeper subtree GPN or catalog. - task_queue: use NextLevel=1 for root paths (1 segment) as a safety net, NextLevel=0 for deeper paths to get all leaves of that subtree.
This commit is contained in:
1 parent
cce14d7039
commit
26ffcbea6b
2 files changed
+16
-4
No files matched your search
@@ -40,7 +40,12 @@ export enum TaskStatus {
|
||||
export class CWMPTaskQueue extends EventEmitter {
|
||||
static task_map: Record<string, (props: any) => string> = {
|
||||
get_parameter_names: (parameterPath: string) => {
|
||||
return CWMPMessageBuilder.getParameterNames(undefined, parameterPath, false)
|
||||
// Use NextLevel=1 for root paths (e.g. "Device." or "InternetGatewayDevice.")
|
||||
// to avoid fetching the entire parameter tree in a single response.
|
||||
// For deeper paths (e.g. "Device.DeviceInfo.") use NextLevel=0 to get all leaves.
|
||||
const segments = parameterPath.replace(/\.$/, '').split('.')
|
||||
const nextLevel = segments.length <= 1
|
||||
return CWMPMessageBuilder.getParameterNames(undefined, parameterPath, nextLevel)
|
||||
},
|
||||
get_parameter_attributes: (parameterNames: string[]) => {
|
||||
return CWMPMessageBuilder.getParameterAttributes(undefined, parameterNames)
|
||||
|
||||
Reference in new issue
Block a user