labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ber...@apache.org
Subject svn commit: r653265 - in /labs/vysper/src/main/java/org/apache/vysper: mina/MinaBackedSessionContext.java mina/XmppIoHandlerAdapter.java xmpp/server/AbstractSessionContext.java
Date Sun, 04 May 2008 20:27:53 GMT
Author: berndf
Date: Sun May  4 13:27:50 2008
New Revision: 653265

URL: http://svn.apache.org/viewvc?rev=653265&view=rev
Log:
[vysper] properly close stream (on stream error) (LABS-95)

Modified:
    labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java
    labs/vysper/src/main/java/org/apache/vysper/mina/XmppIoHandlerAdapter.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/server/AbstractSessionContext.java

Modified: labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java?rev=653265&r1=653264&r2=653265&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java Sun May
 4 13:27:50 2008
@@ -73,6 +73,6 @@
     }
 
     public void close() {
-        minaSession.getCloseFuture().setClosed();
+        minaSession.close();
     }
 }

Modified: labs/vysper/src/main/java/org/apache/vysper/mina/XmppIoHandlerAdapter.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/mina/XmppIoHandlerAdapter.java?rev=653265&r1=653264&r2=653265&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/mina/XmppIoHandlerAdapter.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/mina/XmppIoHandlerAdapter.java Sun May  4
13:27:50 2008
@@ -47,8 +47,8 @@
         if (!(message instanceof Stanza)) {
             if (message instanceof XMLText) {
                 String text = ((XMLText) message).getText();
-                // tolerate newlines for stanza separation
-                if ("\n".equals(text)) return; 
+                // tolerate reasonable amount of whitespaces for stanza separation
+                if (text.length() < 40 && text.trim().length() == 0) return; 
             }
             
             messageReceivedNoStanza(ioSession, message);

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/server/AbstractSessionContext.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/server/AbstractSessionContext.java?rev=653265&r1=653264&r2=653265&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/server/AbstractSessionContext.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/server/AbstractSessionContext.java Sun
May  4 13:27:50 2008
@@ -95,6 +95,7 @@
         StanzaWriter stanzaWriter = getResponseWriter();
         stanzaWriter.close();
         sessionStateHolder.setState(SessionState.CLOSED);
+        // TODO do cleanup, e.g. registered resources etc.
         // TODO close underlying transport (TCP socket)
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message