snichol     2002/09/05 23:07:03

  Modified:    java/src/org/apache/soap/util/net HTTPUtils.java
  Log:
  Remove tabs.  Add TODO comment about checking HTTP status code before
  creating TransportMessage for response.
  
  Revision  Changes    Path
  1.30      +18 -13    xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java
  
  Index: HTTPUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- HTTPUtils.java    5 Sep 2002 16:50:52 -0000       1.29
  +++ HTTPUtils.java    6 Sep 2002 06:07:03 -0000       1.30
  @@ -97,7 +97,7 @@
      */
     private static Socket buildSocket(URL url, int targetPort,
                                       String httpProxyHost, int httpProxyPort,
  -                                 Boolean tcpNoDelay)
  +                                    Boolean tcpNoDelay)
        throws Exception {
         Socket s = null;
         String host = null;
  @@ -124,8 +124,8 @@
         
         if (tcpNoDelay != null)
         {
  -     if (s != null) 
  -       s.setTcpNoDelay(tcpNoDelay.booleanValue());
  +        if (s != null) 
  +          s.setTcpNoDelay(tcpNoDelay.booleanValue());
         }
   
         return s;
  @@ -187,7 +187,7 @@
                   httpProxyHost,
                   httpProxyPort,
                   DEFAULT_OUTPUT_BUFFER_SIZE,
  -             null);
  +                null);
     }
   
     /**
  @@ -214,7 +214,7 @@
                   httpProxyHost,
                   httpProxyPort,
                   outputBufferSize,
  -             null);
  +                null);
     }
   
     /**
  @@ -235,7 +235,7 @@
                                         int timeout,
                                         String httpProxyHost, int httpProxyPort,
                                         int outputBufferSize,
  -                                   Boolean tcpNoDelay)
  +                                      Boolean tcpNoDelay)
         throws IllegalArgumentException, IOException, SOAPException {
             
       return post(url, request, timeout, httpProxyHost, httpProxyPort,
  @@ -271,7 +271,7 @@
                                         int timeout,
                                         String httpProxyHost, int httpProxyPort,
                                         int outputBufferSize,
  -                                   Boolean tcpNoDelay,
  +                                      Boolean tcpNoDelay,
                                         StringBuffer requestCopy,
                                         StringBuffer responseCopy)
         throws IllegalArgumentException, IOException, SOAPException {
  @@ -311,7 +311,7 @@
         if (URI.length() == 0) URI = "/";
   
         /* Construct the HTTP header. */
  -      StringBuffer headerbuf = new StringBuffer();
  +      StringBuffer headerbuf = new StringBuffer(512);
         headerbuf.append(Constants.HEADER_POST).append(' ').append(URI)
             .append(" HTTP/").append(HTTP_VERSION).append("\r\n")
             .append(Constants.HEADER_HOST).append(": ").append(url.getHost())
  @@ -413,11 +413,11 @@
                     if (previousValue != null) {
                         // Some servers send multiple Set-Cookie[2] headers.
                         // Concatenate them into a single header according to RFC 
2109 and 2965
  -                       if (name.equalsIgnoreCase("Set-Cookie") ||
  -                           name.equalsIgnoreCase("Set-Cookie2")) {
  -                           respHeaders.put(name, ((String) previousValue) + "," + 
value);
  -                       }
  -                   }
  +                      if (name.equalsIgnoreCase("Set-Cookie") ||
  +                          name.equalsIgnoreCase("Set-Cookie2")) {
  +                          respHeaders.put(name, ((String) previousValue) + "," + 
value);
  +                      }
  +                  }
                 }
                 namebuf = new StringBuffer();
                 valuebuf = new StringBuffer();
  @@ -448,6 +448,11 @@
           responseCopy.append(line).append("\r\n").append(new String(bytes));  /* May 
get junk due to actual encoding */
         }
         
  +      // TODO: process differently depending on statusCode and respContentLength
  +      //       (TransportMessage does not even get statusCode)
  +      // e.g. statusCode 401 is Unauthorized
  +      // e.g. text/xml and multipart/* are only valid content types
  +
         /* Construct the response object. */
         SOAPContext ctx;
         TransportMessage response;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to