Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-173

XmlRpcCommonsTransport logs one byte at a time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.2
    • 3.1.4
    • None
    • None

    Description

      In XmlRpcCommonsTransport, when the isUsingByteArrayOutput(config) = true branch is taken, the resulting logging is nearly impossible to understand, because each character (byte actually) is logged in a separate log entry. This occurs because the FilterOutputStream's implementation of write( byte[], int, int ) and write( byte[] ), just iteratively invoke write( byte ) – and the underlying output stream logs each byte.

      To fix, just add the following overrides to the anonymous FilterOutputStream subclass:

      public void write( byte[] b, int off, int len ) throws IOException

      { // Override to delegate directly -- improves performance and helps make log readable. out.write( b, off, len ); }

      public void write( byte[] b ) throws IOException

      { // Override to delegate directly -- improves performance and helps make log readable. out.write( b ); }

      Attachments

        Activity

          People

            jochen@apache.org Jochen Wiedmann
            brandond Brandon DuRette
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: