Skip to content

Commit 4e7f6f0

Browse files
committed
bug fix: remove channel: now, chunks from all eras are removed, not only current era.
1 parent a61f1a5 commit 4e7f6f0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/net/sharksystem/asap/ASAPEngine.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,14 @@ public boolean channelExists(CharSequence uri) throws IOException {
222222
}
223223

224224
public void removeChannel(CharSequence uri) throws IOException {
225-
ASAPChunk chunk = this.chunkStorage.getChunk(uri, this.getEra());
226-
chunk.drop();
225+
int currentEra;
226+
int nextEra = this.getOldestEra();
227+
do {
228+
currentEra = nextEra;
229+
ASAPChunk chunk = this.chunkStorage.getChunk(uri, currentEra);
230+
chunk.drop();
231+
nextEra = ASAP.nextEra(currentEra);
232+
} while(currentEra != this.getEra());
227233
}
228234

229235
public ASAPMessages getChunkChain(int position) throws IOException, ASAPException {

src/net/sharksystem/asap/ASAPStorage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public interface ASAPStorage {
9595
/**
9696
*
9797
* @param uri
98-
* @return channel
98+
* @return channel containing all message issued by owner of this storage. Received messages are <b>not</b> part
99+
* of this channel. (See makan implementation)
99100
* @throws ASAPException if no channel with that uri exists in this storage
100101
*/
101102
ASAPChannel getChannel(CharSequence uri) throws ASAPException, IOException;

0 commit comments

Comments
 (0)