Milt Epstein wrote:
>
> if getRemoteHost() doesn't return the host
> name, it should return the IP address.  (Maybe he didn't really means
> "returns nothing" though.)
>

 What you said, I think, maybe.


> Doesn't this just beg the question of the how the value of REMOTE_HOST
> is determined?
>

 We may be agreeing with one another.

 My interpretation is that getRemoteHost() corresponds exactly to
the REMOTE_HOST CGI variable, and if REMOTE_HOST normally would not
be set, then getRemoteHost() will return something other than the
host name, probably the IP address.

 I can see a couple of interpretations, ranked in order of least
to most likely:

 1) REMOTE_HOST not be set, but getRemoteHost() falls back
    to using java.net.InetAddress to (try to) actively look up
    the name. This is maybe allowed by the "name cannot be
    determined" wording. Determined by whom?

 2) REMOTE_HOST not set, but we're an HTTP servlet, so we return
    an empty string because "For HTTP servlets, same as the value
    of the CGI variable REMOTE_HOST." and REMOTE_HOST, according
    to the CGI spec[1] is unset.

 3) REMOTE_HOST not set, we're an HTTP servlet, but the first
    part of the clause applies and getRemoteHost() returns "the
    IP address of the client if the name cannot be determined"

 I suspect #3 is intended, but #1 and #2 look to be allowed
by the wording of the clause. This might be an angels on the
head of a pin kind of question, but such is spec.


-cks



[1] <URL:http://hoohoo.ncsa.uiuc.edu/cgi/interface.html> Is this
really the canonical spec? Looks like there is a little bit of
a conflict with the servlet spec, because this doc says if the
server doesn't know, REMOTE_HOST should not be set?







-

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to