axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryo Neyama" <ney...@trl.ibm.co.jp>
Subject Different behavior in debug option
Date Wed, 31 Oct 2001 13:39:03 GMT
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



Mime
View raw message