Repository navigation
Commit 27f1f32
authored
[master378] Stop encoding a message when it is past its size limit (#5248)
Backport of the send-path part of master commit acac1e0 (#5066),
adapted for master378.
## Problem
A UA-TCP channel encoded a whole message into pooled send buffers and
checked the size limits afterwards. A 4 MB response against a 64 KB
limit rented about 515 buffers of 8 KB before it was rejected. When the
encoder rejected the message, those buffers were not returned.
## Fix
- The stream a message is encoded into takes at most one chunk more than
a message within the limits can fill, so encoding stops there. The same
response now rents at most 12 buffers.
- The buffers of a message that could not be encoded are returned.
## Checklist
_Put an `x` in the boxes that apply. You can complete these step by step
after opening the PR._
- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [x] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [ ] I have added all necessary documentation.
- [ ] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] If this PR changes C# source files, I ran **all** tests locally
using the **UA.slnx** solution against at least .NET **Framework** and
.NET **10**, and all passed. PRs changing only non-C# files do not
require these .NET test runs.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.1 parent c5b82ab commit 27f1f32
3 files changed
Lines changed: 512 additions & 21 deletions
File tree
- Stack/Opc.Ua.Core/Stack
- Bindings
- Tcp
- Tests/Opc.Ua.Core.Tests/Stack/Transport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
| |||
635 | 647 | | |
636 | 648 | | |
637 | 649 | | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
638 | 655 | | |
639 | 656 | | |
640 | 657 | | |
| |||
645 | 662 | | |
646 | 663 | | |
647 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
648 | 685 | | |
649 | 686 | | |
650 | 687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| 529 | + | |
529 | 530 | | |
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
535 | | - | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | | - | |
539 | | - | |
540 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
541 | 561 | | |
542 | | - | |
| 562 | + | |
543 | 563 | | |
544 | | - | |
545 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
546 | 590 | | |
547 | | - | |
548 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
549 | 595 | | |
550 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
551 | 599 | | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
557 | 605 | | |
558 | 606 | | |
559 | | - | |
560 | | - | |
561 | 607 | | |
562 | 608 | | |
563 | 609 | | |
| |||
589 | 635 | | |
590 | 636 | | |
591 | 637 | | |
592 | | - | |
593 | | - | |
594 | | - | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
595 | 642 | | |
596 | 643 | | |
597 | 644 | | |
| |||
742 | 789 | | |
743 | 790 | | |
744 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
745 | 813 | | |
746 | 814 | | |
747 | 815 | | |
| |||
0 commit comments