diff options
| author | Pavel Moravec <pmoravec@apache.org> | 2014-02-02 14:01:16 +0000 |
|---|---|---|
| committer | Pavel Moravec <pmoravec@apache.org> | 2014-02-02 14:01:16 +0000 |
| commit | b9518191c67ea6ef625649f869d517a1b9be293a (patch) | |
| tree | 17a4acc326ce2a4dfe839d9eac36460b37db5da8 /cpp/src | |
| parent | 155c8a3187883f35a3b6d02d507bccb0b213d38d (diff) | |
| download | qpid-python-b9518191c67ea6ef625649f869d517a1b9be293a.tar.gz | |
QPID-5121: Store module does not raise exception when attempting to enqueue a message bigger than the journal size
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1563613 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
| -rw-r--r-- | cpp/src/qpid/legacystore/jrnl/wrfc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/qpid/legacystore/jrnl/wrfc.cpp b/cpp/src/qpid/legacystore/jrnl/wrfc.cpp index 43461b66a3..64ee65f1ac 100644 --- a/cpp/src/qpid/legacystore/jrnl/wrfc.cpp +++ b/cpp/src/qpid/legacystore/jrnl/wrfc.cpp @@ -125,7 +125,8 @@ wrfc::enq_threshold(const u_int32_t enq_dsize_dblks) const u_int32_t fwd_dblks = subm_dblks + enq_dsize_dblks + _enq_cap_offs_dblks; u_int16_t findex = _fc_index; fcntl* fcp = _curr_fc; - bool in_use = false; + bool in_use = false; // at least one file contains an enqueued record + bool overwrite = false; // reached the original journal file we started with while (fwd_dblks && !(findex != _fc_index && fcp->enqcnt())) { fwd_dblks -= fwd_dblks > _fsize_dblks ? _fsize_dblks : fwd_dblks; @@ -133,12 +134,13 @@ wrfc::enq_threshold(const u_int32_t enq_dsize_dblks) const { if (++findex == _lpmp->num_jfiles()) findex = 0; + overwrite |= findex == _fc_index; fcp = _lpmp->get_fcntlp(findex); } in_use |= fcp->enqcnt() > 0; } // Return true if threshold exceeded - return findex != _fc_index && in_use; + return (findex != _fc_index && in_use) || overwrite; } bool wrfc::wr_reset() |
