commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giancarlo Barresi (JIRA)" <j...@apache.org>
Subject [jira] Created: (NET-150) Line terminator "/r/n" not properly traced in TelnetClient SpyStream
Date Fri, 26 Jan 2007 16:40:49 GMT
Line terminator "/r/n" not properly traced in TelnetClient SpyStream
--------------------------------------------------------------------

                 Key: NET-150
                 URL: https://issues.apache.org/jira/browse/NET-150
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 1.4 Final
         Environment: All
            Reporter: Giancarlo Barresi
            Priority: Minor


Line terminator "/r/n" isn't properly traced in TelnetClient SpyStream 
[ see TelnetClient.registerSpyStream(OutputStream  spystream) ].
Actually, it's traced as:
"\n\r"

Suggested PATCH:

Modify the method 
        _spyRead(int ch) 
in class 
        org.apache.commons.net.telnet.Telnet 
(from wich TelnetClient inherits):

    void _spyRead(int ch)
    {
        if (spyStream != null)
        {
            try
            {
                if (ch != (int) '\r')
                {
                	// ======Giancarlo Barresi PATCH START====
                    spyStream.write(ch);
                    // END =================================
                    
	if (ch == (int) '\n')
                    {
                        spyStream.write((int) '\r');
                    }
	// START PREVIOUS VERSION ******************************
	// spyStream.write(ch);
	// END *************************************************
                    
	spyStream.flush();
                }
            }
            catch (Exception e)
            {
                spyStream = null;
            }
        }
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message