[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/transport/tcp TCPSession.java,1.10,
Status: Beta
Brought to you by:
huston
|
From: Huston F. <hu...@us...> - 2001-07-29 03:53:00
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp
In directory usw-pr-cvs1:/tmp/cvs-serv31128/src/org/beepcore/beep/transport/tcp
Modified Files:
TCPSession.java
Log Message:
Fixed erroneous message for aborted session
Index: TCPSession.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp/TCPSession.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** TCPSession.java 2001/06/28 15:42:49 1.10
--- TCPSession.java 2001/07/29 03:52:57 1.11
***************
*** 391,395 ****
* @throws BEEPException
*/
! private void processNextFrame() throws BEEPException, IOException
{
if (Log.isLogged(Log.SEV_DEBUG_VERBOSE)) {
--- 391,396 ----
* @throws BEEPException
*/
! private void processNextFrame()
! throws BEEPException, IOException, SessionAbortedException
{
if (Log.isLogged(Log.SEV_DEBUG_VERBOSE)) {
***************
*** 407,411 ****
if (b == -1) {
! throw new BEEPException("Malformed BEEP header, EOS");
}
--- 408,412 ----
if (b == -1) {
! throw new SessionAbortedException();
}
***************
*** 440,444 ****
for (int count = 0; count < payload.length; ) {
! count += is.read(payload, count, payload.length - count);
}
--- 441,449 ----
for (int count = 0; count < payload.length; ) {
! int n = is.read(payload, count, payload.length - count);
! if (n == -1) {
! throw new SessionAbortedException();
! }
! count += n;
}
***************
*** 452,457 ****
if (b == -1) {
! throw new BEEPException("Malformed BEEP frame, "
! + "trailer not found");
}
--- 457,461 ----
if (b == -1) {
! throw new SessionAbortedException();
}
***************
*** 520,523 ****
--- 524,529 ----
terminate(e.getMessage());
+ } catch (SessionAbortedException e) {
+ terminate("Session aborted by remote peer.");
} catch (Throwable e) {
Log.logEntry(Log.SEV_ERROR, TCP_MAPPING, e);
***************
*** 529,532 ****
--- 535,541 ----
+ TCPSession.this.getState());
}
+ }
+
+ private static class SessionAbortedException extends Exception {
}
}
|