You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ryo Neyama <ne...@trl.ibm.co.jp> on 2001/10/31 14:39:03 UTC

Different behavior in debug option

Hello,

Here is a citation from
xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java.

---- Line 363
if (category.isDebugEnabled()) {
    String contentLength = (String) headers.get("content-length");
    if ( contentLength != null ) {
        contentLength = contentLength.trim();
        byte[] data = new byte[Integer.parseInt(contentLength)];
        for (len=0; len<data.length; )
            len+= inp.read(data,len,data.length-len);
        String xml = new String(data);

        outMsg = new Message( data );

        category.debug( "\nXML received:" );
        category.debug( "-----------------------------------------------");
        category.debug( xml );
    }
    else {
        outMsg = new Message( inp );
        category.debug( "\nNo Content-Length" );
        category.debug( "\nXML received:" );
        category.debug( "-----------------------------------------------");
        category.debug( (String) outMsg.getAsString() );
    }
} else {
    outMsg = new Message( inp );
}

---- Line 387

This code behaves differently when the debug option is enabled and the
behavior is more reasonable than the behavior of debug-disabled. In calse of
debug-enabled, Content-Length header is handled correctly, while the
Content-Length header is just ignored in case of debug-disabled. The latter
behavior actually causes a deadlock when the server communicating with this
code assumes Keep-Alive.

Isn't this a bug?
If so, I will fix it.

Best regards,
    Ryo Neyama @ IBM Research, Tokyo Research Laboratory
    Internet Technology
    neyama@trl.ibm.co.jp