Browse Source

CIPropertyDelegate: Fix issue where status field was omitted from successful PE response headers

develop
reuk 1 year ago
parent
commit
b4aa74b3be
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      modules/juce_midi_ci/ci/juce_CIPropertyDelegate.cpp

+ 7
- 6
modules/juce_midi_ci/ci/juce_CIPropertyDelegate.cpp View File

@@ -172,15 +172,19 @@ struct PropertyDelegateDetail
static auto getSubscribeId (const PropertyRequestHeader&) { return String{}; }
static auto getSubscribeId (const PropertyReplyHeader&) { return String{}; }
static auto getStatus (const PropertySubscriptionHeader&) { return 0; }
static auto getStatus (const PropertyRequestHeader&) { return 0; }
static auto getStatus (const PropertyReplyHeader& h) { return h.status; }
static std::optional<int> getStatus (const PropertySubscriptionHeader&) { return {}; }
static std::optional<int> getStatus (const PropertyRequestHeader&) { return {}; }
static std::optional<int> getStatus (const PropertyReplyHeader& h) { return h.status; }
template <typename T>
static auto toFieldsFromHeader (const T& t)
{
auto fields = t.extended;
// Status shall always be included if it is present in the header
if (const auto status = getStatus (t))
fields["status"] = *status;
if (getResource (t) != getResource (T()))
fields["resource"] = getResource (t);
@@ -199,9 +203,6 @@ struct PropertyDelegateDetail
if (t.mediaType != T().mediaType)
fields["mediaType"] = t.mediaType;
if (getStatus (t) != getStatus (T()))
fields["status"] = getStatus (t);
if (getSetPartial (t))
fields["setPartial"] = true;


Loading…
Cancel
Save