You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2003/12/01 03:34:13 UTC

cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy Proxy.java

sebb        2003/11/30 18:34:13

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/proxy
                        Proxy.java
  Log:
  Proxy needs to return the headers as well
  
  Revision  Changes    Path
  1.16      +6 -7      jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
  
  Index: Proxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Proxy.java	30 Nov 2003 23:21:06 -0000	1.15
  +++ Proxy.java	1 Dec 2003 02:34:13 -0000	1.16
  @@ -140,9 +140,7 @@
           HTTPSampler sampler = new HTTPSampler();
           try
           {
  -            byte[] clientRequest = //TODO: var not used, but call may be needed for side effects?
  -                request.parse(
  -                    new BufferedInputStream(clientSocket.getInputStream()));
  +           request.parse(new BufferedInputStream(clientSocket.getInputStream()));
   
               sampler = request.getSampler();
               
  @@ -155,7 +153,7 @@
   
               result = sampler.sample();
               writeToClient(
  -                result.getResponseData(),
  +                result,
                   new BufferedOutputStream(clientSocket.getOutputStream()));
               /*
                * We don't want to store any cookies in the generated test plan
  @@ -199,13 +197,14 @@
        * @throws IOException  if an IOException occurs while writing
        */
       private void writeToClient(
  -        byte[] inBytes,
  +        SampleResult res,
           OutputStream out)
           throws IOException
       {
           try
           {
  -            out.write(inBytes);
  +        	out.write((res.getResponseHeaders()+"\n").getBytes());
  +            out.write(res.getResponseData());
               out.flush();
               log.debug("Done writing to client");
           }
  
  
  

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