diff options
| author | Alan Conway <aconway@apache.org> | 2010-04-22 17:25:37 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-04-22 17:25:37 +0000 |
| commit | 2c313d7aa4007a3af7555d249518dfa617954646 (patch) | |
| tree | 11a96a6e7460e71b120a18b744bc41e622fb7499 /cpp/src | |
| parent | c38f43e3ff69f7509f0b8c0328769e63730a0c5f (diff) | |
| download | qpid-python-2c313d7aa4007a3af7555d249518dfa617954646.tar.gz | |
Fix bug in disabling sequence number and timestamp.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@936974 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
| -rw-r--r-- | cpp/src/tests/qpid_send.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cpp/src/tests/qpid_send.cpp b/cpp/src/tests/qpid_send.cpp index b3ca99799b..57282f7399 100644 --- a/cpp/src/tests/qpid_send.cpp +++ b/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); } |
