Skip to content

Wrong advancement of offset #6

@ozomer

Description

@ozomer

In lines https://github.com/ericnorris/node-cdb/blob/master/src/readable-cdb.js#L122-L128
The offset should be reduced only if the payload is the same, i.e.

if (buffer.toString() == key) {
    if (offset === 0) {
        fs.read(self.fd, new Buffer(dataLength), 0, dataLength, recordPosition + 8 + keyLength, returnData);
    } else {
        offset--;
        readSlot(++slot);
    }
} else {
    readSlot(++slot);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions