summaryrefslogtreecommitdiff
path: root/ace/Token_Request_Reply.cpp
diff options
context:
space:
mode:
authoreea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-07 00:03:33 +0000
committereea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-07 00:03:33 +0000
commit3aaf850347c4cd5751e5c9fb9498787cdf392432 (patch)
treeb9cea7d77d05462b29bc551335150d9298f1e856 /ace/Token_Request_Reply.cpp
parentb865e170fd3c848d0331fff799f6ad390814b3ca (diff)
downloadATCD-3aaf850347c4cd5751e5c9fb9498787cdf392432.tar.gz
Files Token_Request_Reply.{h, cpp, i}
Added ACE_TOKEN_REQUEST_HEADER_SIZE to represent the size of the fixed-length portion of ACE_Token_Request's Transfer struct, and changed length calculations accordingly. Added two bytes to the buffer to accomodate '\0' values after the strings. File Remote_Tokens.cpp In ACE_Remote_Token_Proxy::request_reply, changed the check for failure when receiving the reply.
Diffstat (limited to 'ace/Token_Request_Reply.cpp')
-rw-r--r--ace/Token_Request_Reply.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/ace/Token_Request_Reply.cpp b/ace/Token_Request_Reply.cpp
index a74e0d61348..e88f40e6505 100644
--- a/ace/Token_Request_Reply.cpp
+++ b/ace/Token_Request_Reply.cpp
@@ -72,11 +72,15 @@ ACE_Token_Request::decode (void)
else // Skip this->tokenName_ + '\0' + ':'.
this->client_id_ = &this->token_name_[token_len + 2];
- size_t data_size = ((sizeof this->transfer_
- - sizeof this->transfer_.data_) // Fixed-size header.
- + ACE_OS::strlen (this->token_name_) + 1 // this->tokenName_ + '\0'
- + ACE_OS::strlen (this->client_id_) + 1 // this->clientId_ + '\0'
- + 1); // Space for ':'
+ // Fixed size header
+ // token_name_ plus '\0'
+ // ':'
+ // client_id_ plus '\0'
+ size_t data_size = ACE_TOKEN_REQUEST_HEADER_SIZE
+ + ACE_OS::strlen (this->token_name_) + 1
+ + ACE_OS::strlen (this->client_id_) + 1
+ + 1;
+
// Make sure the message was correctly received and framed.
return this->length () == data_size ? 0 : -1;
}