axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toshiyuki Kimura <to...@apache.org>
Subject Re: cvs commit: ws-axis/java/src/org/apache/axis/transport/http HTTPSender.java
Date Thu, 16 Oct 2003 21:47:58 GMT
Hi Toshiro,

> Now, I perfectly understand what you say :) thanks!

  Yah, I'm also happy ... :)

> As you mentioned, all HTTP header "field names" are
> case-insensitive[1]. However, I prefer "Transfer-Encoding"
> to "transfer-encoding" in request header.
> This is just my feeling. How do you think?

  Basically, I have the same feeling - but, in fact, it seems
the code has a few difficulties by the preference. Umm ...
I think there're three options here;

a) Stick to the current logics
.........*.........*.........*.........*.........*.........*.........*
675 String transferEncoding =
676        (String) headers
677        .get(HTTPConstants.HEADER_TRANSFER_ENCODING.toLowerCase());
678 if (null != transferEncoding
679 && transferEncoding.trim()
680 .equalsIgnoreCase(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED)){
.........*.........*.........*.........*.........*.........*.........*

b) Change the definition of HEADER_TRANSFER_ENCODING
.........*.........*.........*.........*.........*.........*.........*
101 public static final String HEADER_TRANSFER_ENCODING
                                       = "transfer-encoding".intern();
.........*.........*.........*.........*.........*.........*.........*

c) Define two fields HEADER_TRANSFER_ENCODING as the sending data and,
   HEADER_TRANSFER_ENCODING_FOR_HASHKEY as the case-insensitive key
.........*.........*.........*.........*.........*.........*.........*
101 public static final String HEADER_TRANSFER_ENCODING
                                       = "Transfer-Encoding".intern();
102 public static final String HEADER_TRANSFER_ENCODING_FOR_HASHKEY
                                       = "transfer-encoding".intern();
.........*.........*.........*.........*.........*.........*.........*

  I think the c) reduces a very slight cost of const.toLowerCase() and
it might give a legibility to us and/or future committers. However, it
also condemn us to maintain the data consistency of line 101 and 102.
If it's acceptable to us, c) is better than the others.

  Do you have any other ideas, or comments ?

--
Toshi <toshi@apache.org>

-----Original Message-----
From:	 Toshiro Takase [SMTP:E30809@jp.ibm.com]
Sent:	 Thursday, October 16, 2003 8:18 PM
To:	 axis-dev@ws.apache.org
Subject: Re: cvs commit: ws-axis/java/src/org/apache/axis/transport/
         http HTTPSender.java

Hi Toshi,

Now, I perfectly understand what you say :) thanks!

Your question:
"Do you know why the original contributor doesn't define the keys in
HTTPConstants ?"

My guess is,,,
HTTPConstants.HEADER_TRANSFER_ENCODING is used in other parts.

HTTPSender.java: in writeToSocket method
-----
      //Do http chunking.
      header.append(HTTPConstants.HEADER_TRANSFER_ENCODING)
              .append(": ")
              .append(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED)
              .append("\r\n");
-----

As you mentioned, all HTTP header "field names" are case-insensitive[1].
However, I prefer "Transfer-Encoding" to "transfer-encoding" in request
header.
This is just my feeling. How do you think?

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

Thanks in advance,
Toshiro TAKASE
IBM Research, Tokyo Research Laboratory, Internet Technology
notes ID: Toshiro Takase/Japan/IBM@IBMJP, e-mail: E30809@jp.ibm.com


Mime
View raw message