Server is not responding in nonblocking mode

Hi,

If client send <?xml version="1.0"?> tag before stream tag, server is not responding. Looks like bug in XMLLightweightParser.

Thx,

Tim

There is one more error, with empty tags. They are not handled properly. Here is a diff of my changes. After that server is working better…

@@ -200,7 +220,6 @@

return;

}

byteBuffer.flip();

  • byte[] bhs = byteBuffer.array();

byteBuffer.rewind();

CharBuffer charBuffer = encoder.decode( byteBuffer );

charBuffer.flip();

@@ -322,6 +341,16 @@

}

else if ( ch == ‘’>’’ )

{

  • if ( insideRootTag && “?xml>”.equals( head.toString() ) )

  • {

  • // head <?xml version=“1.0”?>

  • startLastMsg = buffer.length() - readByte + ( i + 1 );

  • status = INIT;

  • tailCount = 0;

  • cdataOffset = 0;

  • head.setLength( 0 );

  • insideRootTag = false;

  • }

if ( insideRootTag && “stream:stream>”.equals( head.toString() ) )

{

// Found closing stream:stream

@@ -349,6 +378,8 @@

head.append( “>” );

status = INSIDE;

insideRootTag = true;

  • if (ch == ‘’>’’)

  • i–;

continue;

}

head.append( (char)ch );

I need to find a right way to close client sessions. When there is exception in NonBlockingReadingMode.run() session is not closed properly.