Skip to content

Commit a8a1316

Browse files
committed
coded workaround. There comes an asap exception during certificate exchange. Certificates reache their peer fairly good but finally something comes over TCP which cannot be understood. That's a bug. Workaround: Kill connection. At least in Android, we have a recovery. I'm not proud of this. But works.
1 parent b8d3ea4 commit a8a1316

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/net/sharksystem/asap/protocol/ASAPPersistentConnection.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,14 @@ public void run() {
202202
Exception e = pduReader.getIoException() != null ?
203203
pduReader.getIoException() : pduReader.getAsapException();
204204

205-
this.terminate("exception when reading from stream (stop asap session): ", e);
205+
try {
206+
this.is.close();
207+
} catch (IOException exception) {
208+
System.out.println(this.getLogStart()
209+
+ "tried to close stream after exception caught: " + exception.getLocalizedMessage());
210+
}
211+
212+
this.terminate("exception when reading from stream (stop asap session, stream closed): ", e);
206213
break;
207214
}
208215

@@ -426,15 +433,10 @@ public void run() {
426433
} catch (IOException e) {
427434
this.ioException = e;
428435
System.out.println(ASAPPersistentConnection.this.getLogStart()
429-
+ "ioException when reading from stream, close stream");
430-
try {
431-
this.is.close();
432-
} catch (IOException exception) {
433-
System.out.println(ASAPPersistentConnection.this.getLogStart()
434-
+ "closing a stream we could not read from: "
435-
+ exception.getLocalizedMessage());
436-
}
436+
+ "IOException when reading from stream");
437437
} catch (ASAPException e) {
438+
System.out.println(ASAPPersistentConnection.this.getLogStart()
439+
+ "ASAPException when reading from stream");
438440
this.asapException = e;
439441
}
440442
finally {

0 commit comments

Comments
 (0)