Skip to content

Commit 2c37e69

Browse files
thscthsc
authored andcommitted
bug fix: message count ChunkFS works with at least one message.
1 parent 9c7bac0 commit 2c37e69

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

src/net/sharksystem/asp3/ASP3ChunkFS.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ private void initFiles(String trunkName) throws IOException {
7575
}
7676
}
7777

78+
private void saveStatus() throws IOException {
79+
this.writeMetaData(this.metaFile);
80+
}
81+
7882
@Override
7983
public List<CharSequence> getRecipients() {
8084
return this.recipients;
@@ -116,6 +120,8 @@ public void add(CharSequence message) throws IOException {
116120

117121
dos.writeUTF((String) message);
118122
this.numberMessage++;
123+
// keep message counter
124+
this.saveStatus();
119125
}
120126

121127
@Override

test/BasicTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class BasicTests {
2222
public static final String ALICE_BOB_CHAT_URL = "content://aliceAndBob.talk";
2323
public static final String ALICE_FOLDER = "alice";
2424
public static final String BOB_FOLDER = "bob";
25+
public static final String ALICE = "alice";
26+
public static final String BOB = "bob";
2527
public static final String ALICE2BOB_MESSAGE = "Hi Bob";
2628
public static final String BOB2ALICE_MESSAGE = "Hi Alice";
2729

-34 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)