From e288ff90aa151eab4088d109c00aaa348840e215 Mon Sep 17 00:00:00 2001 From: cdfrey Date: Wed, 6 Jun 2007 21:10:25 +0000 Subject: [PATCH] - did some testing and found that PINMessage's MessageRecordId is the same as the RecordId given through the SetIds() API... but these Id's are duplicated in the protocol... RecordId is stored in the protocol header, while MessageRecordId is stored in the record it self as a common field... added RecType and RecordId to PIN Message so that we store both of these --- ChangeLog | 7 +++++++ src/r_pin_message.cc | 17 ----------------- src/r_pin_message.h | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0edb56d7..be4f2c6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,13 @@ Release: version 0.8 - 2007/05/?? - changed MessageRecordId in PINMessage to load from a new uint32_t field in CommonField, instead of piggy backing on a field for other use + - did some testing and found that PINMessage's MessageRecordId + is the same as the RecordId given through the SetIds() + API... but these Id's are duplicated in the protocol... + RecordId is stored in the protocol header, while + MessageRecordId is stored in the record it self as + a common field... added RecType and RecordId to + PIN Message so that we store both of these 2007/05/27 - added item to gui/TODO - applied Brian Edginton's s11n-boost.h patch diff --git a/src/r_pin_message.cc b/src/r_pin_message.cc index b57e62f8..e9364669 100644 --- a/src/r_pin_message.cc +++ b/src/r_pin_message.cc @@ -137,23 +137,6 @@ const unsigned char* PINMessage::ParseField(const unsigned char *begin, return begin; } -uint8_t PINMessage::GetRecType() const -{ - throw std::logic_error("PINMessage::GetRecType() called, and not supported by the USB protocol. Should never get called."); -} - -// empty API, not required by protocol -uint32_t PINMessage::GetUniqueId() const -{ - throw std::logic_error("PINMessage::GetUniqueId() called, and not supported by the USB protocol. Should never get called."); -} - -// empty API, not required by protocol -void PINMessage::SetIds(uint8_t Type, uint32_t Id) -{ - // accept it without complaining, just do nothing -} - void PINMessage::ParseHeader(const Data &data, size_t &offset) { // we skip the "header" since we don't know what to do with it yet diff --git a/src/r_pin_message.h b/src/r_pin_message.h index 2d53c872..c3b859fe 100644 --- a/src/r_pin_message.h +++ b/src/r_pin_message.h @@ -43,13 +43,22 @@ namespace Barry { class PINMessage { public: + uint8_t RecType; + uint32_t RecordId; + Address From; Address To; Address Cc; Address Bcc; std::string Subject; std::string Body; - uint32_t MessageRecordId; + uint32_t MessageRecordId; // this happens to be the same as + // RecordId in my (CDF) testing, + // but interestingly, it is stored + // as a field *inside* the record, + // and not as part of the header... + // in effect, this record ID occurs + // twice in the protocol std::vector Unknowns; public: @@ -61,9 +70,9 @@ public: ~PINMessage(); // Parser / Builder API (see parser.h / builder.h) - uint8_t GetRecType() const; - uint32_t GetUniqueId() const; // empty API, not required by protocol - void SetIds(uint8_t Type, uint32_t Id); // empty API, not required by protocol + uint8_t GetRecType() const { return RecType; } + uint32_t GetUniqueId() const { return RecordId; } + void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset); void BuildHeader(Data &data, size_t &offset) const; -- 2.11.4.GIT