summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-04-22 17:25:37 +0000
committerAlan Conway <aconway@apache.org>2010-04-22 17:25:37 +0000
commit9c475fa9fa2edb4f3f22d1a0ab6e23ab24ed89f7 (patch)
treece5c1e3e4415faa87985d46065693a428d12adc3 /qpid/cpp/src
parent7bdeb4a889a92b89a2f5f910a71d938d273ae2e6 (diff)
downloadqpid-python-9c475fa9fa2edb4f3f22d1a0ab6e23ab24ed89f7.tar.gz
Fix bug in disabling sequence number and timestamp.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@936974 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/tests/qpid_send.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/qpid_send.cpp b/qpid/cpp/src/tests/qpid_send.cpp
index b3ca99799b..57282f7399 100644
--- a/qpid/cpp/src/tests/qpid_send.cpp
+++ b/qpid/cpp/src/tests/qpid_send.cpp
@@ -123,7 +123,7 @@ struct Options : public qpid::Options
("report-header", qpid::optValue(reportHeader, "yes|no"), "Headers on report.")
("send-rate", qpid::optValue(sendRate,"N"), "Send at rate of N messages/second. 0 means send as fast as possible.")
("sequence", qpid::optValue(sequence, "yes|no"), "Add a sequence number messages property (required for duplicate/lost message detection)")
- ("timestamp", qpid::optValue(sequence, "yes|no"), "Add a time stamp messages property (required for latency measurement)")
+ ("timestamp", qpid::optValue(timestamp, "yes|no"), "Add a time stamp messages property (required for latency measurement)")
("help", qpid::optValue(help), "print this usage statement");
add(log);
}
@@ -286,9 +286,12 @@ int main(int argc, char ** argv)
if (opts.sendRate) interval = qpid::sys::TIME_SEC/opts.sendRate;
while (contentGen->setContent(msg)) {
- if (opts.sequence) msg.getProperties()[SN] = ++sent;
- if (opts.timestamp) msg.getProperties()[TS] = int64_t(
- qpid::sys::Duration(qpid::sys::EPOCH, qpid::sys::now()));
+ ++sent;
+ if (opts.sequence)
+ msg.getProperties()[SN] = sent;
+ if (opts.timestamp)
+ msg.getProperties()[TS] = int64_t(
+ qpid::sys::Duration(qpid::sys::EPOCH, qpid::sys::now()));
sender.send(msg);
reporter.message(msg);
if (opts.tx && (sent % opts.tx == 0)) {
@@ -308,7 +311,8 @@ int main(int argc, char ** argv)
}
if (opts.reportTotal) reporter.report();
for (uint i = opts.sendEos; i > 0; --i) {
- msg.getProperties()[SN] = ++sent;
+ if (opts.sequence)
+ msg.getProperties()[SN] = ++sent;
msg.setContent(EOS);//TODO: add in ability to send digest or similar
sender.send(msg);
}