diff options
author | Alan Conway <aconway@apache.org> | 2007-03-15 19:22:02 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-03-15 19:22:02 +0000 |
commit | 6bc8ab8e4b209b841969544fc735361335040906 (patch) | |
tree | 90b8a4b3f0ec4fdf2c3a0ac02b27768b953a3be1 /cpp/lib/broker/BrokerMessage.cpp | |
parent | f92c42ffe7662d1d0e2863c6e143567b25ae2024 (diff) | |
download | qpid-python-6bc8ab8e4b209b841969544fc735361335040906.tar.gz |
Changed u_int<n>_t to uint<n>_t for posix compliance.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@518733 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/BrokerMessage.cpp')
-rw-r--r-- | cpp/lib/broker/BrokerMessage.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/cpp/lib/broker/BrokerMessage.cpp b/cpp/lib/broker/BrokerMessage.cpp index bff4492a49..91ba3dfec0 100644 --- a/cpp/lib/broker/BrokerMessage.cpp +++ b/cpp/lib/broker/BrokerMessage.cpp @@ -50,7 +50,7 @@ BasicMessage::BasicMessage( {} // FIXME aconway 2007-02-01: remove. -// BasicMessage::BasicMessage(Buffer& buffer, bool headersOnly, u_int32_t contentChunkSize) : +// BasicMessage::BasicMessage(Buffer& buffer, bool headersOnly, uint32_t contentChunkSize) : // publisher(0), size(0) // { @@ -80,8 +80,8 @@ bool BasicMessage::isComplete(){ } void BasicMessage::deliver(ChannelAdapter& channel, - const string& consumerTag, u_int64_t deliveryTag, - u_int32_t framesize) + const string& consumerTag, uint64_t deliveryTag, + uint32_t framesize) { // CCT -- TODO - Update code generator to take pointer/ not // instance to avoid extra contruction @@ -94,9 +94,9 @@ void BasicMessage::deliver(ChannelAdapter& channel, void BasicMessage::sendGetOk(const MethodContext& context, const std::string& /*destination*/, - u_int32_t messageCount, - u_int64_t deliveryTag, - u_int32_t framesize) + uint32_t messageCount, + uint64_t deliveryTag, + uint32_t framesize) { // CCT -- TODO - Update code generator to take pointer/ not // instance to avoid extra contruction @@ -110,7 +110,7 @@ void BasicMessage::sendGetOk(const MethodContext& context, } void BasicMessage::sendContent( - ChannelAdapter& channel, u_int32_t framesize) + ChannelAdapter& channel, uint32_t framesize) { channel.send(header); Mutex::ScopedLock locker(contentLock); @@ -134,7 +134,7 @@ bool BasicMessage::isPersistent() return props && props->getDeliveryMode() == PERSISTENT; } -void BasicMessage::decode(Buffer& buffer, bool headersOnly, u_int32_t contentChunkSize) +void BasicMessage::decode(Buffer& buffer, bool headersOnly, uint32_t contentChunkSize) { decodeHeader(buffer); if (!headersOnly) decodeContent(buffer, contentChunkSize); @@ -149,15 +149,15 @@ void BasicMessage::decodeHeader(Buffer& buffer) buffer.getShortString(routingKey); setRouting(exchange, routingKey); - u_int32_t headerSize = buffer.getLong(); + uint32_t headerSize = buffer.getLong(); AMQHeaderBody::shared_ptr headerBody(new AMQHeaderBody()); headerBody->decode(buffer, headerSize); setHeader(headerBody); } -void BasicMessage::decodeContent(Buffer& buffer, u_int32_t chunkSize) +void BasicMessage::decodeContent(Buffer& buffer, uint32_t chunkSize) { - u_int64_t expected = expectedContentSize(); + uint64_t expected = expectedContentSize(); if (expected != buffer.available()) { std::cout << "WARN: Expected " << expectedContentSize() << " bytes, got " << buffer.available() << std::endl; throw Exception("Cannot decode content, buffer not large enough."); @@ -167,9 +167,9 @@ void BasicMessage::decodeContent(Buffer& buffer, u_int32_t chunkSize) chunkSize = expected; } - u_int64_t total = 0; + uint64_t total = 0; while (total < expectedContentSize()) { - u_int64_t remaining = expected - total; + uint64_t remaining = expected - total; AMQContentBody::shared_ptr contentBody(new AMQContentBody()); contentBody->decode(buffer, remaining < chunkSize ? remaining : chunkSize); addContent(contentBody); @@ -197,25 +197,25 @@ void BasicMessage::encodeContent(Buffer& buffer) if (content.get()) content->encode(buffer); } -u_int32_t BasicMessage::encodedSize() +uint32_t BasicMessage::encodedSize() { return encodedHeaderSize() + encodedContentSize(); } -u_int32_t BasicMessage::encodedContentSize() +uint32_t BasicMessage::encodedContentSize() { Mutex::ScopedLock locker(contentLock); return content.get() ? content->size() : 0; } -u_int32_t BasicMessage::encodedHeaderSize() +uint32_t BasicMessage::encodedHeaderSize() { return getExchange().size() + 1 + getRoutingKey().size() + 1 + header->size() + 4;//4 extra bytes for size } -u_int64_t BasicMessage::expectedContentSize() +uint64_t BasicMessage::expectedContentSize() { return header.get() ? header->getContentSize() : 0; } |