Skip to content

Commit

Permalink
keep prev data only when delta negotiated
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Oct 9, 2024
1 parent 9ad97af commit bda868e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,13 @@ void handlePublication(Protocol.Publication pub) throws Exception {
ClientInfo info = ClientInfo.fromProtocolClientInfo(pub.getInfo());
PublicationEvent event = new PublicationEvent();
byte[] pubData = pub.getData().toByteArray();
byte[] prevData = this.getPrevData();
if (prevData != null && pub.getDelta()) {
pubData = Fossil.applyDelta(prevData, pubData);
if (this.deltaNegotiated) {
byte[] prevData = this.getPrevData();
if (prevData != null && pub.getDelta()) {
pubData = Fossil.applyDelta(prevData, pubData);
}
this.setPrevData(pubData);
}
this.setPrevData(pubData);
event.setData(pubData);
event.setInfo(info);
event.setOffset(pub.getOffset());
Expand Down

0 comments on commit bda868e

Please sign in to comment.