You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by sn...@apache.org on 2002/09/11 19:26:12 UTC

cvs commit: xml-soap/java/src/org/apache/soap/util/net Relay.java TcpTunnel.java

snichol     2002/09/11 10:26:11

  Modified:    java/src/org/apache/soap/util/net Relay.java TcpTunnel.java
  Log:
  Have TcpTunnel dump to System.out, which means default character encoding
  will be used to translate bytes sent over the wire.  (TcpTunnelGui
  always uses iso-8859-1, which is not always appropriate, either.)
  
  Revision  Changes    Path
  1.5       +10 -0     xml-soap/java/src/org/apache/soap/util/net/Relay.java
  
  Index: Relay.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Relay.java	28 Jun 2001 20:12:09 -0000	1.4
  +++ Relay.java	11 Sep 2002 17:26:11 -0000	1.5
  @@ -67,6 +67,7 @@
    * <code>InputStream</code> to a <code>OutputStream</code>.
    *
    * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
  + * @author Scott Nichol (snichol@computer.org)
    */
   public class Relay extends Thread {
     final static int BUFSIZ = 1000;
  @@ -74,6 +75,7 @@
     OutputStream out;
     byte buf[] = new byte[BUFSIZ];
     TextArea ta;
  +  OutputStream os;
   
     Relay (InputStream in, OutputStream out, TextArea ta) {
       this.in = in;
  @@ -81,6 +83,12 @@
       this.ta = ta;
     }
   
  +  Relay (InputStream in, OutputStream out, OutputStream os) {
  +    this.in = in;
  +    this.out = out;
  +    this.os = os;
  +  }
  +
     public void run () {
       int n;
   
  @@ -91,6 +99,8 @@
           if (ta != null) {
             ta.append (new String (buf, 0, n, "8859_1"));
           }
  +        if (os != null)
  +          os.write(buf, 0, n);
         }
       } catch (IOException e) {
       } finally {
  
  
  
  1.4       +3 -3      xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java
  
  Index: TcpTunnel.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TcpTunnel.java	1 Sep 2000 03:53:06 -0000	1.3
  +++ TcpTunnel.java	11 Sep 2002 17:26:11 -0000	1.4
  @@ -94,9 +94,9 @@
                             tunnelhost);
   
         // relay the stuff thru
  -      new Relay (sc.getInputStream(), st.getOutputStream(), null).start ();
  -      new Relay (st.getInputStream(), sc.getOutputStream(), null).start ();
  -      
  +      new Relay (sc.getInputStream(), st.getOutputStream(), System.out).start ();
  +      new Relay (st.getInputStream(), sc.getOutputStream(), System.out).start ();
  +
         // that's it .. they're off; now I go back to my stuff.
       }
     }
  
  
  

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>