Commit 5cdcebd
committed
refactor(framework): extract parseMaxMessageSize helper
Dedupe three near-identical maxMessageSize parsing blocks in
applyConfigParams() (rpc, http, jsonrpc) into a single private static
helper. Helper returns long to match the wider-typed http/jsonrpc fields;
the rpc assignment retains an explicit (int) cast at the call site to
make the gRPC int32 hard constraint visible.
Net effect: ~16 lines removed, error messages guaranteed consistent
across the three protocols, and adding a future protocol limit becomes
a one-liner instead of a copy-paste block.
Also add a brief comment on CommonParameter.maxMessageSize clarifying
that the legacy field name refers to the gRPC limit, alongside the
explicit httpMaxMessageSize / jsonRpcMaxMessageSize siblings.1 parent bb14edd commit 5cdcebd
2 files changed
Lines changed: 19 additions & 27 deletions
File tree
- common/src/main/java/org/tron/common/parameter
- framework/src/main/java/org/tron/core/config/args
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
Lines changed: 17 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | 526 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
554 | 533 | | |
555 | 534 | | |
556 | 535 | | |
| |||
1258 | 1237 | | |
1259 | 1238 | | |
1260 | 1239 | | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
1261 | 1251 | | |
1262 | 1252 | | |
1263 | 1253 | | |
| |||
0 commit comments