Hi David,

I've ran Thierry's test case with Restlet internal connectors, looked at the
code and all is working as expected. I'm closing the issue. If you still
have trouble, could you provide us with a small test case?
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : Thierry Boileau [mailto:[email protected]] 
Envoyé : vendredi 27 février 2009 11:29
À : [email protected]
Objet : Re: VirtualHost can't match on port number

Hello David,

you may be in a special case. There is no obvious reason the port number is
not part of the request object.
You can get a working test case at this address and compare with your own
code =>
http://restlet.tigris.org/nonav/issues/showattachment.cgi/287/Test738.java

 best regards,
Thierry Boileau


> Hi Thierry-
>
> When I stepped through the VirtualHost/HostRoute code in the debugger, I
found that the problem seems to be that the incoming Request object did not
actually contain the Host port number.  This meant that any VirtualHost
which had a non-null host port pattern would fail the matching/scoring
process, and therefor would not be called.
>
> In particular, this code, from HostRoute.score():
>
>             int basePortValue = request.getHostRef().getHostPort();
>             if (basePortValue == -1) {
>                 basePortValue = request.getHostRef().getSchemeProtocol()
>                         .getDefaultPort();
>             }
>             hostPort = Integer.toString(basePortValue);
>
> Would result in the default port for the scheme getting assigned to the
hostPort value.  since my Servers (and virtual hosts) were set to
non-default port values, this seems like it must be a bug, perhaps in the
internal Connectors?
>
> Thanks very much for all your help- very much appreciated!
>
>   - Dave Fogel
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId
> =1234601
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=12379
68

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1282093

Reply via email to