Skip to content

Honor negotiated MMS server limits before merge - #67

Merged
masarray merged 1 commit into
agent/complete-server-consolidationfrom
main-mms-server-final-review
Aug 11, 2026
Merged

masarray merged 1 commit into
agent/complete-server-consolidationfrom
main-mms-server-final-review

Conversation

@masarray

Copy link
Copy Markdown
Owner

Fixes final PR #51 review findings

  • preflights worst-case Write response against negotiated MMS/COTP limits before invoking callbacks;
  • explicitly rejects Read.specificationWithResult before object reads because this bounded profile does not encode the requested specification;
  • dynamically encodes InitiateResponse and caps outstanding-call/nesting values to the client proposals;
  • applies negotiation behavior to strict and IED-simulator runtimes;
  • retains byte-identical default AARE behavior.

Evidence

  • embedded hard profile: 19/19 passed;
  • MMS live-client profile: 5/5 passed;
  • new regression proves an oversized multi-variable Write causes no side effect;
  • new regressions verify negotiated Initiate values and explicit Read-mode rejection.

@masarray
masarray merged commit 05b64e6 into agent/complete-server-consolidation Aug 11, 2026
18 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2dbb7d083f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +386 to +388
const auto selected_nesting_level = std::min(
initiate.data_structure_nesting_level,
kServerMaximumNestingLevel);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce the advertised nesting-level limit

When a client proposes a nesting level below 5, this advertises the smaller value in the InitiateResponse, but the selected limit is never stored or enforced afterward. In particular, static_dispatcher.cpp accepts constructed read values without traversing their depth and passes write values directly to callbacks, so an association negotiated at level 1 can still exchange deeper arrays or structures, violating the newly advertised limit and potentially breaking clients that rely on it.

Useful? React with 👍 / 👎.

Comment on lines +516 to +517
std::array<std::uint8_t, 128U> aare{};
const auto aare_result = encode_accept_aare_into(mms_initiate_response, aare);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the fixed 128-byte AARE staging cap

When the new overload is given a valid but larger MMS InitiateResponse, accept_aare_size() and the surrounding session/CPA checks can accept an AARE larger than 128 bytes, yet encoding always uses this fixed staging buffer. For example, valid initiate detail bit strings can make the AARE exceed 128 bytes while the final CPA still fits its 255-byte session field; the method then returns value_out_of_range even when destination has the reported required capacity.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant