You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Giancarlo Barresi (JIRA)" <ji...@apache.org> on 2007/01/26 17:40:49 UTC

[jira] Created: (NET-150) Line terminator "/r/n" not properly traced in TelnetClient SpyStream

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


[jira] Resolved: (NET-150) Line terminator "/r/n" not properly traced in TelnetClient SpyStream

Posted by "Giancarlo Barresi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/NET-150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Giancarlo Barresi resolved NET-150.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4 Final

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; 
            } 
        } 
    }


> 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
>             Fix For: 1.4 Final
>
>
> 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