{"record":{"id":"0e765de63f5a4e38","repo":"XTLS/Xray-core","slug":"cwndmultiplier-must-be-at-least-1","errorCode":null,"errorMessage":"CwndMultiplier must be at least 1","messagePattern":"CwndMultiplier must be at least 1","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_method.go","lineNumber":569,"sourceCode":"\t}\n\tif c.DownCap != nil {\n\t\tconfig.DownlinkCapacity = *c.DownCap\n\t}\n\tif c.CwndMultiplier != nil {\n\t\tconfig.CwndMultiplier = *c.CwndMultiplier\n\t}\n\tif c.MaxSendingWindow != nil {\n\t\tconfig.MaxSendingWindow = *c.MaxSendingWindow\n\t}\n\n\tif config.Mtu < 21 {\n\t\treturn nil, errors.New(\"Mtu must be at least 21\").AtError()\n\t}\n\tif config.Tti < 10 || config.Tti > 1000 {\n\t\treturn nil, errors.New(\"invalid mKCP TTI: \", c.Tti).AtError()\n\t}\n\tif config.CwndMultiplier < 1 {\n\t\treturn nil, errors.New(\"CwndMultiplier must be at least 1\").AtError()\n\t}\n\tif config.GetSendingBufferSize() == 0 {\n\t\treturn nil, errors.New(\"MaxSendingWindow must be >= Mtu\").AtError()\n\t}\n\n\treturn config, nil\n}\n\ntype GRPCConfig struct {\n\tAuthority           string `json:\"authority\"`\n\tServiceName         string `json:\"serviceName\"`\n\tMultiMode           bool   `json:\"multiMode\"`\n\tIdleTimeout         int32  `json:\"idle_timeout\"`\n\tHealthCheckTimeout  int32  `json:\"health_check_timeout\"`\n\tPermitWithoutStream bool   `json:\"permit_without_stream\"`\n\tInitialWindowsSize  int32  `json:\"initial_windows_size\"`\n\tUserAgent           string `json:\"user_agent\"`\n}","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_method.go#L551-L587","documentation":"Thrown by KCPConfig.Build() when CwndMultiplier is less than 1. The multiplier scales the congestion window relative to the receive window; a value of 0 or negative makes the send window empty and no data can ever be transmitted. Defaults to 2 when unset.","triggerScenarios":"Explicitly setting kcpSettings.cwndMultiplier to 0 or a negative number in the JSON config.","commonSituations":"Attempting to disable congestion control by setting the multiplier to 0, or misreading the field as a boolean/percentage.","solutions":["Set cwndMultiplier to 1 or higher (default 2 is recommended).","Remove the field entirely to accept the default."],"exampleFix":"// before\n\"kcpSettings\": { \"cwndMultiplier\": 0 }\n// after\n\"kcpSettings\": { \"cwndMultiplier\": 2 }","handlingStrategy":"validation","validationCode":"if kcp.CwndMultiplier != nil && *kcp.CwndMultiplier < 1 {\n    return errors.New(\"cwndMultiplier must be >= 1\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := kcpCfg.Build(); err != nil && strings.Contains(err.Error(), \"CwndMultiplier\") {\n    cfg.CwndMultiplier = nil // fall back to default\n    _, err = cfg.Build()\n}","preventionTips":["Document cwndMultiplier as '>=1, default 2' in any config UI.","Reject 0/negative values at input time rather than at build time."],"tags":["config","mkcp","transport","congestion","validation","go"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}