Skip to content

Commit

Permalink
[FIXED] potential message duplication from sources when downgrading b…
Browse files Browse the repository at this point in the history
…ack from 2.10 (#4454)

- [X] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
 - [ ] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

2.10 adds a couple space separated fields to the sourcing message header
from 2 to 4 but the current 2.9 code is too strict of checking the
number of fields is exactly 2 rather than at least 2
  • Loading branch information
derekcollison committed Aug 30, 2023
2 parents 415bbb2 + 003daf3 commit 2e1392a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/stream.go
Expand Up @@ -2983,7 +2983,7 @@ func streamAndSeq(shdr string) (string, uint64) {
}
// New version which is stream index name <SPC> sequence
fields := strings.Fields(shdr)
if len(fields) != 2 {
if len(fields) < 2 {
return _EMPTY_, 0
}
return fields[0], uint64(parseAckReplyNum(fields[1]))
Expand Down

0 comments on commit 2e1392a

Please sign in to comment.